Configure the host-only network in virtualbox in ubuntu

Source: Internet
Author: User
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 ......

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.