The content of this page is no longer maintained and could be outdated soon or already is. The reasons could be various, like this information became obsolete or there is by now a better way to handle the information on this page. This page will be retained here for archiving reasons.
Virtualbox is a really great virtualization environment for especially desktop use. Well, actually the server where this site resides was running in Virtualbox :)
There is an Open Source Edition (OSE) and an edition with a proprietary license. The OSE doesn't have all features, like a VRDP server or USB pass-through. Because for desktop virtualization I need neither I prefer to run the Open Source Edition.
As mentioned, I used Virtualbox to run a server in it. And that virtual server runs on my home-server. Of course there's no X installed on that server, there's no need for it. But if you just add the official Debian repositories for VirtualBox and run apt-get install virtualbox-X.X
… you can guess it. Tons of dependencies pull in almost a full installation of X. But I don't want that!
So, how can you install VirtualBox without X? Actually it's quite easy.
Just download and install the generic package for all distributions! No need for X with that one.
But how do you manage the Virtual Machines on a system without X? How do you autostart your Virtual Machines? How do you automatically stop VM's when the host halts?
Of course you can write your own scripts and use VBoxManage
to control your VM's. But why re-invent the wheel? There is a great utility called VBoxTool that does all that for you!
Make sure to check their documentation, especially the installation guidelines and how to autostart on boot.
One thing to keep in your mind: the virtual machines run as user, not as root! So vboxtool
only operates the VM's you run as the designated user.
To install the guest additions just attach the appropriate ISO image to your VM and in the VM mount your CD-ROM drive.
Attach (assuming VirtualBox is installed in the default directory /opt/VirtualBox
):
VBoxManage controlvm <VM Name> dvdattach /opt/VirtualBox/additions/VBoxGuestAdditions.iso
This however only works up until VirtualBox 3.0, since version 3.1 there's a different mechanism for your storage management. It gives more possibilities and flexibility, but is also more complicated.
Personally I just loop-mount the ISO on the host and scp the Guest Additions installer to the guest.