VMware workstation download and installation
- The application market can be downloaded, and the key can also be found in the comment area of the application market.
- Set static IP.
Search "virtual network editor" in the lower left corner of windows 10 interface
"Change settings" → "VMnet8" → "use local DHCP..." uncheck → "subnet IP" is changed to 192.168.127.0 (seems to correspond to moxa) → "NAT settings" → "gateway IP" 192.168.127.2 → "OK". (the subnet IP and gateway IP need to be recorded and used later) (the port seems to be 24 by default)
(after creating a new virtual machine, you need to modify the network configuration file to correspond to it, so that you can connect to the network.)
CentOS image download and installation
2.1 CentOS image download
Download the image iso file of CentOS7 and aliyun.
2.2 new virtual machine (CentOS installation)
reference resources https://www.jb51.net/article/172165.htm
There are two differences:
(1) Because the static IP is set in front, the Internet is not connected temporarily;
(2) The software selection interface of CentOS7 is different. Select "GNOME desktop".
2.3 installing VMware Tools
VMware Tools is installed to realize file sharing between host and virtual machine, and the code can also be copied and pasted.
During the process of starting the virtual machine, the "reinstall VMware Tools" in the "virtual machine" will light up. Click "reinstall VMware Tools" and the VMware Tools CD will appear after the virtual machine is started. Copy the files in the CD (maybe only the ".tar.gz" folder) and put them in the Downloads/VMware Tools folder. Then extract the ".tar.gz" folder. After extracting, double-click "extract", Get the VMware Tools District folder, open it, then open the terminal in this folder and enter the command
./vmware-install.pl
Just press enter for the options that come out during the installation process.
After installation, create a new folder in the host as a shared folder, then return to the virtual machine, click "virtual machine" → "Settings" → "options" → "shared folder", click "always enable", and add the path of the shared folder, as shown in the figure below. After setting, you can restart the virtual machine. After restarting, you can drag the files in the host directly to the virtual machine interface.
In addition, when you open the virtual machine after installing VMware Tools, you should keep the small disc in the lower right corner lit. If it is gray, right-click "connect" directly.
2.4 setting static IP
Modify the network configuration file in the new virtual machine. The file is in the / etc / sysconfig / network scripts folder. Open the folder and then open the terminal (or open the terminal first and then enter the command)
cd /etc/sysconfig/network-scripts
Modify the file ifcfg-ens33 and use the command vim ifcfg-ens33. (my is eno16777736. You can enter ifconfig on the terminal to view your network configuration.)
(1) If you are prompted that you need root permission, enter the command su, and then enter the password of the root user. The password is not displayed in the process of entering. Just enter after entering.
(2) vim is used to modify: ① input "i" first to change to insert mode; ② Modify documents; ③ After modification, click "Esc" to exit the mode, and then enter ": wq" to save and exit. Then remember to enter the command source ifcfg-ens33 to make the modification take effect.
(3) The modified file is:
TYPE=Ethernet BOOTPROTO=static DEFROUTE=yes PEERDNS=yes PEERROUTES=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_PEERDNS=yes IPV6_PEERROUTES=yes IPV6_FAILURE_FATAL=no NAME=eno16777736 UUID=9bd6d6e9-517a-49be-b17f-8c6aee936959 DEVICE=eno16777736 ONBOOT=yes IPADDR0=192.168.127.120 PREFIX0=24 GATEWAY0=192.168.127.2 NETMASK=255.255.255.0 DNS1=114.114.114.114 DNS2=223.5.5.5
If it is an ens gateway, use the following command
TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no #BOOTPROTO=dhcp # Remember to comment out this sentence because static IP is used DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=ens33 UUID=91c597a1-6070-4463-a47b-0234510fe5f3 DEVICE=ens33 ONBOOT=yes # After setting yes and restarting, use the command ifconfig to view the IP address IPADDR0=192.168.127.120 # The IP address is in the same network segment as 1.2, and 120 corresponds to the equipment in the laboratory? PREFIX0=24 # The port appears to be the default GATEWAY0=192.168.127.2 # Gateway IP, same as in 1.2 NETMASK=255.255.255.0 # Subnet mask, same as in 1.2 DNS1=114.114.114.114 DNS2=223.5.5.5) After setting the restart, you can see the set static state IP Well, inet It's a virtual machine IP,netmask Is the subnet mask, broadcast This is the broadcast address. It's online by this time.
Re input
Click "virtual machine" → "setting" → "network adapter", and the device status "connected" in the upper right corner should be checked.