VirtualBox Tips
From KaminskiWiki
[edit] Importing Ubuntu Appliances
The udev system in modern Ubuntus maintains persistent information about the network adapter(s). When importing an Ubuntu appliance, it will end up with a different MAC address. /etc/udev/rules.d/70-persistent-net.rules* i Check the /etc/udev/rules.d/70-persistent-net.rules and remove any references to old MAC addresses.
Symptoms of problems stemming from old persistent-net rules:
- ifconfig -a shows the device existing, but ethernet doesn't work and ifup doesn't work
- in /var/log/dmesg: udev: "renamed network interface eth1 to eth1"
[edit] Networking Configuration
http://www.virtualbox.org/manual/UserManual.html#networkingmodes
On a friendly network, I use bridged mode. Guest OSes get their own IP address from the router, and act like any other peer on the network.
On a locked down campus network, peers may not be able to see each other. To make it easy for the host to see the guest easily, you can use NAT mode.
NAT mode needs port forwarding. You need to set up port forwarding with VBoxManage. The guest appliance must be turned off.
Example:
# set up ssh (the "ssh" string is just a name for this port forward instance) VBoxManage setextradata "intrepid-server" "VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/Protocol" TCP VBoxManage setextradata "intrepid-server" "VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/GuestPort" 22 VBoxManage setextradata "intrepid-server" "VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/HostPort" 8822 # set up http VBoxManage setextradata "intrepid-server" "VBoxInternal/Devices/e1000/0/LUN#0/Config/http/Protocol" TCP VBoxManage setextradata "intrepid-server" "VBoxInternal/Devices/e1000/0/LUN#0/Config/http/GuestPort" 80 VBoxManage setextradata "intrepid-server" "VBoxInternal/Devices/e1000/0/LUN#0/Config/http/HostPort" 8880
Use "pcnet" for PCNet virtual network card and "e1000" for Intel PRO/1000 virtual network card.

