Configure the host-only network in virtualbox in Ubuntu

Source: Internet
Author: User
Tags nameserver

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 staticaddress192.168.56.99Netmask255.255.255.0Gateway192.168.56.1Nameserver8.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.