Networking with VirtualBox
Linux has virtual network adapters in the form of TAP interfaces, and VirtualBox relies on this approach, too. The only requirements is free access to the /dev/net/tun device file for the user account used by VirtualBox.
Also, you need a bridge software, such as the bridge-utils package, and the tunctl command-line tool, which is part of the uml-utilities package on openSUSE.
Bridging with VirtualBox can be approached two possible ways on start up:
- If you will always have a fixed number of guests, the correct approach would be to set up a permanent interface to which the virtual machine connects.
- For a more flexible approach, you can let the virtual machine autonomously create a dynamic interface.
However, you need to type the administrative password in either case.
Permanent or Dynamic Interface
The list of commands for setting up a permanent interface is quite intimidating.
The first thing is to set up the bridge and connect it to eth0:
brctl addbr br0 ifconfig eth0 0.0.0.0 brctl addif br0 eth0
Updating the IP addresses comes next. If you use a DHCP server to assign addresses, dhclient br0 will handle this; if not, you need to assign addresses manually with ifconfig br0 IP address.
For each simulated network card in the guest system, you need a virtual interface host side; VBoxAddIF vbox0 User br0 connects it to the bridge.
The VBoxAddIF script creates a TAP interface, called vbox0, and grants the user User account to it. VBoxAddIF is included with the VirtualBox package, but hidden away in the depths of the source code directory tree in src/VBox/Installer/linux.
The final step, working as root, is to connect the simulated card in the guest system with the TAP interface. To do so, you need to enter the card name as the Interface name in the configuration dialog. In this case, leave the two lines for scripts blank.
To release the interface again after use, type VBoxDeleteIF vbox0 at the command line. Incidentally, this tool is missing in the open source variant.
The second method involves running two scripts: one to create the TAP interface and connect it to the bridge and the other to disable the interface again.
Enabling a TAP Interface
01 #!/bin/bash 02 # Create TAP interface for the user klaus: 03 interface=`VBoxTunctl -b -u klaus` 04 # Create the interface: 05 ifconfig $interface up 06 # Connect with the bridge: 07 brctl addif br0 $interface
Version 16 of the popular Linux desktop reveals new tools, edge-snapping, and performance improvements.
Symantec says Linux-Darlioz burrows in through PHP.
Dell renews its quest for the ultimate developer machine.
Innovative back door looks like normal SSH traffic.
One of CeBITs most successful forums opens the new year with a new name. The popular Open Source Forum continues in 2014 under the name Special Conference: Open Source. This year, the forum will be bigger and offer a wider range of possibilities for sponsors.
New release offers better graphics drivers and expands filesystem support.
New mail protocol will shut out the NSA and prevent snooping on metadata.
A new web application helps users visualize distributed denial-of-service attacks.
Ubuntu 13.10 takes a step toward convergence, with lots of mobility, but Mir only partly here.
Galileo board is targeted to embedded developers and educational institutions.