Recently, VMWare was unable to install it, so it chose virtualbox. Unexpectedly, virtualbox is quite good, free, and small (less than 100 MB of the latest version ).
It took some time to re-install the RedHat Virtual Machine and found that the Network was a problem. It is always greedy and convenient to use bridging. But now the laptop uses wireless Internet access, which is too troublesome to bridge. The biggest problem with bridging is that virtual machines and hosts are isolated when there is no network.
After searching the Internet, the solution is Nat + host only to solve two problems: communication between virtual machines and hosts and connection to the Internet.
Nat accesses the Internet through the host, and host only communicates with the virtual machine.
1. Virtual Machine Software sets two NICs, one being Nat and the other being host.
2. Add two NICs in the virtual machine environment. My environment is RedHat monitoring ice 6.4. Add ifcfg-th0 and ifcfg-th1 under/etc/sysconfig/network-srcept.
Here, the virtual machine and the host can ping each other, but the virtual machine still cannot ping the internet. For a long time, I wonder if it is a routing problem. If you have two NICs, You have to select one as the egress. I checked the knowledge of the route table online.
[[Email protected] ~] # Route
Kernel IP routing table
Destination gateway genmask flags metric ref use iface
10.0.2.0*255.255.255.0 u 0 0 0 eth0
192.168.56.0*255.255.255.0 u 0 0 0 eth1
Link-local * 255.255.0.0 U 1002 0 0 eth0
Link-local * 255.255.0.0 U 1003 0 0 eth1
Default bogon 0.0.0.0 ug 0 0 0 eth0
The preceding figure shows the kernel route table. The default route table is eth0. Eth0 is the NAT Nic, and the problem of connecting to the Internet is solved. (Here is the configuration I changed. The default route table exit is eth1, so it cannot be connected.