Article directory
1 Introduction
In this article, we will describe how to install CentOS Stream under VMware. The host machine is windows10 home edition, the version selected for installing VMware is VMware17 , and the linux version is CentOS stream 9 .
2. Environment preparation
2.1 Install VMware
Log in to VMware's official website to download version 17.
2.2 download centos stream
Log in to Ali's system mirror station to download, select CentOS-Stream-9-latest-x86_64-dvd1.iso , the file size is about 9.1G .
Or use the address I copied directly
https://mirrors.aliyun.com/centos-stream/9-stream/BaseOS/x86_64/iso/CentOS-Stream-9-latest-x86_64-dvd1.iso?spm=a2c6h.25603864.0.0.446e408cqM7mTv
3. Configure the virtual machine
3.1 Create a new virtual machine
In the upper left corner of WMware , click on the file in the upper left corner, and then click Create a new virtual machine
. Select Custom
. There is no operation here. Just go to the next step and choose to install the operating system later. For the guest operating system, select the linux version and select Red Hat Enterprise Linux 9 64-bit. Fill in the name of the virtual machine that you like. The location is the directory where the virtual machine is saved after it is created. You can choose a directory you like. The processor configuration is optional . The memory is recommended to be 2G network type by default. The default I /O controller type is fine. The disk type is also fine. New virtual disk The disk size is recommended to be 20G . Only check Split the virtual disk into multiple files . The file name of the virtual machine is the default. Configure the preview. This step does not need to be operated. Click Finish . After completion, click Edit virtual machine settings to find CD/DVD (SATA) , find the iso file we downloaded earlier, and click OK. Finally, check the network configuration. We choose the bridge mode. It belongs to the VMware part and the configuration is complete. The next step is the installation process of steam9
3.2 Install steam9
Find the button to open this virtual machine , and the following installation interface will appear. At this time, use the arrow keys on the keyboard to select Install CentOS Stream 9 , and the selected option will turn white. The mouse on this page is invalid, and you can only use the keyboard.
Language selection Simplified Chinese
When you arrive at this interface, you only need to configure three operations.
First, click on the installation destination . If you don’t make a choice, it will be automatically configured. If
you want to configure the size of the specific directory yourself, you can choose to customize and click **+** on the left , configure according to the instructions below:
- /boot: Used to store programs related to the startup of the Linux system, such as the boot loader, etc. The recommended size is 100MB.
- swap: Realize virtual memory, the recommended size is 1~2 times of physical memory.
- / : The root directory of the Linux system, all directories are hung under this directory, the recommended size is more than 5GB.
- /usr : Used to store applications in the Linux system, which has a lot of related data, and it is recommended to be larger than 3GB.
- /var : Used to store frequently changing data and log files in the Linux system, it is recommended to be larger than 1GB.
- /home : stores the data of ordinary users. It is the home directory of ordinary users. The recommended size is the remaining space.
- /tmp : Put the temporary disk in a separate partition to avoid affecting the stability of the system when the file system is full. The recommended size is 500MB or more.
You can only configure /swap /boot and the rest is a simple solution for / , as shown in the figure below
, it is recommended to assign it automatically, then click Finish in the upper left corner, return to the main page, click the root password set by the user
and set the password to 123456 , because it is a simple password type, so you need to click 2 times to complete
the button . Back to the main page, if you need to modify the time, select the time and date to enter the time configuration
Finally, there is one software option left . After opening,
the first one is a system with a desktop. My requirement is to use stream9 as a server, so I choose Minimal Install , and then click Finish to return to the main page of configuration, click Home Start the installation in the lower right corner of the face.
The installation will take some time. If there is no problem, you will finally see the following page. Click the restart system in the lower right corner to start the server
4. General arrangement
4.1 Login to the server
Through the previous operations, we have completed the installation of centos stream 9, and we have set the password of the root account to 123456. When starting the server again ,
we need to press Enter and enter the account number and password to log in.
After logging in, execute the command to view the versioncat /etc/redhat-release
[root@localhost ~]# cat /etc/redhat-release
CentOS Stream release 9
4.2 Configure the static ip of the network card
Execute the command to view network card informationip a
[root@localhost ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:0c:29:30:c6:90 brd ff:ff:ff:ff:ff:ff
altname enp3s0
inet 192.168.3.200/24 brd 192.168.3.255 scope global noprefixroute ens160
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fe30:c690/64 scope link noprefixroute
valid_lft forever preferred_lft forever
[root@localhost ~]#
By printing the network card information, I know that my network card name is ens160 , execute to view the network card configuration path, executegrep -rn /etc -e ens160
[root@localhost ~]# grep -rn /etc -e ens160
/etc/NetworkManager/system-connections/ens160.nmconnection:2:id=ens160
/etc/NetworkManager/system-connections/ens160.nmconnection:6:interface-name=ens160
Execute the command to modify the network card vi /etc/NetworkManager/system-connections/ens160.nmconnection
and save the contents of the file
[ipv4]
method=auto
changed to
[ipv4]
method=manual
address1=192.168.3.10/24,192.168.3.1
dns=114.114.114.114;8.8.8.8
manual : manual
192.168.3.10/24 : static intranet ip
192.168.3.1 : gateway
dns is optional, just fill in 114.114.114.114 is also
ok, save the file after modification, execute refresh network card configuration, nmcli c reload
or restart the network card directlynmcli c up ens160
4.3 Enable remote login
If you use xshell directly, if you use the root account to log in, you will be rejected. You need to modify the sshd configuration, execute it vi /etc/ssh/sshd_config
, and then add the configuration that allows remote login to the file.
PermitRootLogin yes
After saving, execute and restart sshd to check the running status of the service systemctl restart sshd
by executingsystemctl status sshd
4.4 configure ssh
Check the **/etc/ssh/sshd_config** file, there is the following configuration item:
AuthorizedKeysFile .ssh/authorized_keys
So as long as we add our local public key to this file, we can open the ssh configuration login
Note : Generally, the newly installed system does not have this file, and it ssh-keygen
will be generated just by executing it.
5. Summary
The above is a very clear process from downloading VMware to installing and activating VMware, and then downloading and installing CentOS Stream in VMware. It is so detailed that there are graphic explanations for each step. Finally, experiments were also conducted on how to set static ip and configure sshd. Hope this information helps you get started with both tools easily.