VirtualBox Virtual machine configuration Ubuntu Network

Source: Internet
Author: User
Tags nameserver vm virtualbox

First, the operating environment:

Host: IA-64 i5 CPU, Windows 7 SP1 flagship operating system, a wired network card, a wireless network card

Virtual machine: orical VM VirtualBox 4.3.26

Virtual Host: Ubuntu 12.04.5 LTS x64

Second, the Virtual machine settings:

The connection method used in this article is "Bridging the network card". That is, the virtual host through the virtual machine and host a network card bridge, you can and host in the same network segment. However, to allow the virtual host to open the network card

Promiscuous mode.


Set up the network card you want to bridge, and select Allow promiscuous mode. After that, the virtual machine configuration is complete, and then our Ubuntu64 virtual host is configured.

To view the network interface of a host using ifconfig:
My host has two: Eth2, Lo; one of them is our wired network card, the other is local loopback. And what we're going to configure is eth2 this interface.

(1) You can use the Ifconfig command:

Ifconfig eth2 <ip> Netmark <mark>

This command reloads the network adapter configuration that you just modified.

(2) can also be modified in the configuration file:

To modify IP and mask:

Its configuration file is/etc/network/interfaces,

The first part is the loopback network, the following is the eth2, to be modified is this part (this Part I have commented out).

Auto Eth2

Iface eth2 inet Static

Address <ip>

Netmask <mask>

Gateway <gateway-ip>

Note that the Imask, gateway-ip to be consistent with the host host, IP to be in the same network segment.


To modify DNS:

Here I created a new DNS instance directly. On the Internet to check the information, many people say directly modify/etc/resolv.conf, but I found this file, found that he is a symbolic link:

You can also find the final configuration location. But I did not look, but in another way, a new file was created in the/etc/resolvconf/resolv.conf.d/directory to store the DNS I configured.

DNS can be specified in this file:

nameserver:8.8.8.8

nameserver:114.114.114.114

Note: This method modification may make it less than DHCP and, if necessary, can find a priority configuration for the DHCP configuration file.

Reload configuration after:

IP:/etc/init.d/networking Start

DNS:/etc/init.d/resolvconf Restart

Note: The following problems may occur with the restart of the network:

Running/etc/init.d/networking Restart is deprecated because it could not enable again some interfaces

The use of restart is not favoured because some interfaces are no longer supported. You can add sudo to try.

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.