Virtualbox installation and network bridging in Ubuntu 7.10

Source: Internet
Author: User

I. Installation

1. Download the installation package. We recommend that you download the Deb package.

2. Prepare dependencies. For normal use of virtualbox, libxalan110 and libxerces27 are required. Therefore, to install them first, you can use the following command:

Sudo apt-Get install libxalan110 libxerces27

3. Install the compilation tool and related packages. During the installation process, compile the kernel module used by virtualbox. To do this, you need to prepare basic compilation tools and packages. You can use the following commands to install them:

Sudo apt-Get install build-essential Linux-headers-'uname-R'

4. Now, go to the directory where the virtualbox installation package is saved and install it using the following command:

Sudo dpkg-I virtualbox_1.x.x_ubuntu_feisty_i386.deb

During installation, virtualbox requires you to accept the license agreement. In addition, the installer creates a vboxusers user group and compiles the required kernel modules.

5. Now, you cannot start virtualbox because your current user does not belong to the vboxusers user group. You can use the following command to add the current user (use your user name instead of "youruser" in the Command) to the vboxusers user group:

Sudo adduser youruser vboxusers

Virtualbox screen moving down:

If the resolution of the virtual machine is close to the resolution of X, and some interfaces are on the edge of X, the title of the original window manager changes to a black bar area after the full screen, and the screen moves down, the Windows Start Menu is displayed on the next desktop.

Solution: reduce the resolution before full screen, right-click the screen and adjust the resolution of the display to the same as that of X, so that no screen offset exists.

Ii. Bridging Network Configuration

Generally, the default Nat mode is selected after virtualbox is installed to set the network, and guest can be connected smoothly. However, this method is rigid and requires more elastic changes, the bridge mode should be adopted. Here, the bridge mode is like the bridged mode in VMware, and the host and guest are equal in the LAN.

Refer to the usermanual.pdf file in the virtualbox directory after virtualbox is installed. The configuration is as follows:

1. On Debian and Ubuntu-based systems, first install the UML-utilities tool and bridge-utils tool, which contain the virtual network device (TAP interfaces:

Sudo apt-Get install UML-utilities

Sudo apt-Get install bridge-utils

To enable your VM to access network interfaces, you must set the user name (usually your Ubuntu Login User name) of the user running the VM) add to the UML-Net user group (replace "vboxuser" with your user name "):

Sudo gpasswd-A vboxuser UML-Net

Note: to make the change take effect, restart your computer.

2. Describe the virtual network device you want to add to your Debian or Ubuntu operating system, and edit/etc/Network/interfaces:

Sudo Vim/etc/Network/interfaces

Add the following content after the opened file, name the virtual network interface "tap0", and specify the interface IP configuration method as manual, and specify the user using this interface (replace "vboxuser" with your user name "):

Auto tap0

Iface tap0 Inet Manual

Up ifconfig $ iface 0.0.0.0 up

Down ifconfig $ iface down

Tunctl_user vboxuser

3. Activate the created virtual network interface and Network Bridge for the first time:

Sudo/sbin/IFUP tap0

Sudo/sbin/IFUP br0

This step only needs to be performed once. The interface and bridge will be automatically activated the next time the host restarts.

4. in addition, add the following content to/etc/Network/interfaces to create a bridge named "br0". the IP address of the bridge is configured through DHCP, all network interfaces in the host, including the Virtual Network Interface tap0, will be built on this bridge:

Auto br0

Iface br0 Inet DHCP

Bridge_ports all tap0

Here, you can make changes based on your network conditions. You can make the Network Bridge use static IP:

Iface br0 Inet static

Address 192.168.1.2

Netmask 255.255.255.0

Network 192.168.1.0

Broadcast 192.168.1.255

Gateway 192.168.1.1

5. let virtualbox use this virtual network interface to start virtualbox. On the main interface, select the virtual machine to use the created virtual network interface tap0, and click "set ", in the displayed window, select "network", select one network adapter (usually "network adapter 0"), select "enable network adapter", and select "host interface" after "Connect ", select "access network cable", enter the name of the created virtual network interface "tap0" in "host network interface name", and click OK. You can also use the vboxmanage command line tool (replace "my VM" with your VM name ):

Vboxmanage modifyvm "my VM"-hostifdev1 tap0/

Finally, configure the network of the host and the virtual machine so that the host and the virtual machine are in the same network segment, so that the host and the virtual machine become two machines with the same position in the LAN and can access each other.

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.