infra:virtualbox

Virtualbox & VDE networking

# echo 'deb http://download.virtualbox.org/virtualbox/debian wily contrib' > /etc/apt/sources.list.d/virtualbox.list
# wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
# apt-get update
# apt-get install virtualbox-5.0

Install virtual distributed ethernet switching:

# apt-get install screen vde2 uml-utilities
# cd /usr/lib; ln -s libvdeplug.so.2 libvdeplug.so

Edit /etc/rc.local add following lines so a switch will be started at host OS boot.

/usr/sbin/tunctl -u hakr -t tap0
/usr/bin/screen -d -m -S vde_switch /usr/bin/vde_switch --tap tap0 --mode 0666
/usr/bin/screen -d -m -S vde_slirp  /usr/bin/slirpvde -D
/sbin/ip addr add 10.0.2.1/24 broadcast 10.0.2.255 dev tap0
/sbin/ip link set tap0 up

Update networking settings via the GUI:

Attached to: 'Generic Driver'
Name: 'VDE'
Generic Properties: 'network=/var/run/vde.ctl'

Or via cmdline:

VBoxManage modifyvm "VM name" --nic<x> generic
VBoxManage modifyvm "VM name" --nicgenericdrv<x> VDE
VBoxManage modifyvm "VM name" --nicproperty<x> network=/var/run/vde.ctl

Use network=/var/run/vde.ctl<n> to connect the VM to a specific switchport.

  • infra/virtualbox.txt
  • Last modified: 20/11/2021 00:38
  • by harm