VirtualBox virtual Ubuntu system and host ping
The premise of mutual ping is that the IP address of the host and virtual machine is in the same band [eg: Host: 192.168.1.10 virtual Linux: 192.168.1.11]
1. Set the Host ip Address:
Open Network Sharing Center-> change adapter settings-> Ethernet, modify its ip address
Run CMD on the host and enter ipconfig as follows:
2. Set the Virtual Machine ip Address:
Open the terminal and run it as root
Run sudo gedit/etc/hosts to modify the settings as follows:
Run sudo gedit/etc/network/interfaces to modify the settings as follows:
Run sudo gedit/etc/resolv. conf to modify it as follows:
The DNS of the host is followed by the nameserver. Different machines correspond to different
Restart NETWORK SERVICE
Sudo/etc/init. d/networking restart
Disable Firewall
Sudo ufw disable
3. Virtual Machine network connection settings:
In this test, if the Virtual Machine network format is set incorrectly, it will not be pinged, so pay special attention to it.
If the host is connected to WiFi, choose Virtual Machine Settings> network> enable network connection (bridging network card, Realtek... Wireless Lan .......)
If the host is connected to a wired network, choose Virtual Machine Settings> network> enable network connection (bridging network card, Realtek PCIe GBE Family ........)
So far, all settings have been set successfully, and the host and the virtual machine can ping each other.