First, pre-installation preparation
1. What is a virtual machine
Virtual machine is a complete computer system that runs in a fully-functional environment through software simulations with complete hardware systems. The same as the actual server (computer)
2. Installation system & virtual machine software
1) Installation system: CentOS system. (ISO image)
2) Virtual machine software: VMware Workstation Pro (download and install, no demo here)
Second, create a virtual machine
Installation steps:
1. Create a new virtual machine
2, select the CentOS image (installation path and image need to choose their own)
3, the account set here is not root, the virtual machine set user account and password (root root account will also be this password)
4. Select the virtual machine installation location
5, the rest of the steps follow the default next, complete, the rest is to wait for the installation to complete
6, because I download the CentOS version by default is the use of graphical interface, so you need to press CTRL+ALT+F2 to switch to a graphical interface. Enter your account password to
7. Using bridge mode to link network
8. Set the gateway under Linux
1. Modify the IP address:
View: Ifconfig
Temporary: ifconfig eth0 (NIC interface) IP address netmask subnet mask (255.255.255.0)
Permanent: Vim/etc/sysconfig/network-scripts/ifcfg-eth0
Device=eth0 NIC Name
Onboot=yes boot automatically enabled
Bootproto=static/dhcp How to get IP address manually configured/auto-assigned
ipaddr=192.168.1.1 configured IP Address
Subnet mask configured by netmask=255.255.255.0
Need to restart service or network card to take effect
Service Network Restart Restart the network card (restart all network cards)
Ifconfig eth0 Down
Ifconfig eth0 up reboot eth0 NIC (restart the specified eth0 NIC)
2. Modify the Gateway:
View: Route-n
Temp: Route Add default GW IP address route add default GW 192.168.103.1
Permanent: Vim/etc/sysconfig/network-scripts/ifcfg-eth0
gateway=192.168.103.1
Need to restart service or network card to take effect
Service Network Restart Restart the network card (restart all network cards)
Ifconfig eth0 Down
Ifconfig eth0 up reboot eth0 NIC (restart the specified eth0 NIC)
3. Configure DNS
Configuration: Vim/etc/sysconfig/network-scripts/ifcfg-eth0
dns1=202.106.0.20
dns2=8.8.8.8
Or
Vim/etc/resolv.conf
NameServer 202.106.0.20
NameServer 8.8.8.8
Test: nslookup can resolve a domain name to an IP address
9. Check if you can connect to the network
Ping Www.baidu.com has data returned that means the network link was successful.
The network cannot connect to the workaround:
Check the gateway DNS and so on. Need to view VMware edit-"Virtual network editor Change settings
The external connection in bridge mode is automatically connected by default, but this auto is not always available, so you need to manually change the external connection to the one corresponding to the local network.
Build a Linux virtual machine under window