Technology Musings
Not long ago, I took upon the task of setting up a dedicated virtualization server. I knew I wanted to maximize hardware by keeping the OS slim, so I decided to go with my Linux distro of choice: Ubuntu. This works out very well, because the current version is a Long Term Support release, which means I’ll have access to security patches for a full 5 years. As for the actual virtualization software? There are multiple choices for Linux, but I really liked several aspects of VirtualBox: cross-platform support, the VRDP feature, and I had already been running it in a headless configuration on Windows. For your enjoyment, I documented the entire procedure. So here goes:
UPDATE: Please note that a newer version of both Ubuntu and VirtualBox have superseded those used in this HOWTO. Specifically, VirtualBox 2.1 includes substantive changes to host networking.
UPDATE 2: I having (finally) posted a new guide, utilizing Ubuntu 9.10 Karmic Koala and VirtualBox 3.1.2. As this HOWTO is sorely out-of-date, please follow Ubuntu VirtualBox Server Redux
sudo apt-get update sudo apt-get upgrade
sudo apt-get install linux-source elinks sudo apt-get install make gcc build-essential sudo apt-get install linux-headers-$(uname -r)
elinks virtualbox.org
sudo dpkg -i virtualbox_*.deb
sudo apt-get -f install
sudo usermod -a -G vboxusers vboxuser
sudo chown root:vboxusers /dev/net/tun
sudo VBoxAddIF vbox0 vboxuser sudo VBoxAddIF vbox1 vboxuser sudo VBoxAddIF vbox2 vboxuser sudo VBoxAddIF vbox3 vboxuser
sudo nano /etc/network/interfaces.conf
auto lo iface lo inet loopback auto eth0 iface eth0 inet manual up ifconfig $IFACE 0.0.0.0 up up ip link set $IFACE promisc on down ip link set $IFACE promisc off down ifconfig $IFACE down auto vbox0 iface vbox0 inet manual auto vbox1 iface vbox1 inet manual auto vbox2 iface vbox2 inet manual auto vbox3 iface vbox3 inet manual auto br0 iface br0 inet static address 192.168.1.40 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.1 bridge_ports eth0 vbox0 vbox1 vbox2 vbox3 bridge_fd 9 bridge_hello 2 bridge_maxage 12 bridge_stp off
sudo nano /etc/resolv.conf
search domainname nameserver 192.168.1.41 nameserver 208.67.222.222 nameserver 208.67.220.220
sudo /etc/init.d/networking restart
mkdir ~/.VirtualBox/VDI
mv ~/Windows XP.vdi ~/.VirtualBox/VDI/Windows XP.vdi
VBoxManage createvm -name "Windows XP" -register
What does it do?
Memory: 256MB
ACPI: ON
Hardware Virtualization: ON
Physical Address Extension: ON
Hard Drive Image: Windows XP.vdi
VRDP: ON
VRPD Port: 3390
Networking: Host Interface
Host Networking Device: vbox0
VBoxManage modifyvm "Windows XP" -memory 256MB -acpi on -hwvirtex on -pae on -hda "Windows XP.vdi" -vrdp on -vrdpport 3390 -nic1 hostif -hostifdev1 vbox0
VBoxManage showvminfo "Windows XP"VBoxHeadless -s "Windows XP" &
So, I hope that helps. I know the use case is very specific, but I couldn’t find any other guides that spelled out everything that needed to be done. The VirtualBox forums are a great resource, just be sure to search before posting.
1 Response to HOWTO: Ubuntu VirtualBox Server
Ubuntu VirtualBox Server Redux | Idea Excursion
March 16th, 2010 at 11:12 am
[...] VirtualBox and Ubuntu have drastically changed since I wrote HOWTO: Ubuntu VirtualBox Server. In fact, they’ve change to such a degree that the previous article isn’t [...]