Virtualbox is a very good software and always uses default network settings (NAT), which is really convenient. But this time the host and the virtual machine need to communicate, so I found the network settings such as host-only, which can set an independent IP address to communicate with the host, other virtual machines and networks.
Virtualbox is a very good software and always uses default network settings (NAT), which is really convenient. But this time the host and the virtual machine need to communicate, so I found the network settings such as host-only, which can set an independent IP address to communicate with the host, other virtual machines and networks. The configuration process is as follows: (host and virtual machines are all ubuntu)
1. virtualbox global settings, ctrl + G
Add an adapter in the Network, vboxnet0, set ipv4: 192.168.56.1, and cancel DHCP server (we need to set static IP ).
2. virtualbox local settings, ctrl + S
In Network, select Host-only Adapter for attached to and vboxnet0.
3. Configure the Virtual Machine network,/etc/network/interfaces
auto eth0iface eth0 inet staticaddress 192.168.56.99netmask 255.255.255.0gateway 192.168.56.1nameserver 8.8.8.8
Here, the last eight digits of the address can be retrieved (2-254), and The nameserver can retrieve the host's dns. Modify the dns address in/etc/resolv. conf if necessary.
At this point, you will find that the host and virtual machine can ping each other, but the virtual machine cannot ping the Internet, the Internet is a big problem, and then the next step:
4. Set the host to allow shared networks
Install a firestarter firewall software in ubuntu, and check Enable Network connection sharing in settings. OK! You can use putty 'remote' to log on, just like a real server ......