On Ubuntu, vbox uses bridge to connect to the network

Source: Internet
Author: User

In general, the NAT method can be connected to the Internet, but the VM cannot be accessed from the Internet. If you want to allow Internet access, you must use the bridge method,

The procedure is as follows:

1. InstallBridge-utils

2. ModifyAdd the following content to the/etc/Network/interfaces file:

Auto br0
Iface br0 Inet static
Address 192.168.1.122
Netmask 255.255.255.0
Gateway 192.168.1.1
Bridge_ports eth0
Bridge_fd 2.5

To dynamically obtain the website:

 
Auto br0
Iface br0 Inet DHCP
Bridge_ports eth0
Bridge_fd 2.5
 
3. Restart the network
/Etc/init. d/networking restart
Use brctl showCheck whether br0 is started.
Ifconfig shows that the IP address is configured on br0.

4. Run the following command to obtain the permission for this device.
Chown <username>/dev/NET/TUN

5. Configure the VM and use br0.

Vboxaddif vbox0 <username> br0

6. Select the network as hostinterface before starting the VM.
Enter the name vbox0.

7. After the VM is started, set the IP address in the VM system.

OK

References:

Http://wiki.debian.org/VirtualBox

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.