As I was poking around the VirtualBox support forums the other day I noticed there seems to be a ton of confusion surrounding linux guests. A lot of that seems like it stems from the way virtualbox has to approach additional kernel modules in guest additions. So here is the “Debian way” that both Ubuntu and Debian users can use.
Grab a stable net install (i386 or amd64 image) from Debian’s image download. You can try testing if you want, it should be closer to the base build of debian you are going to want but half the time the installer is severely broken until close to freeze periods in the debian freeze phase.
Setup a new VirtualBox Guest to install. Here is the basic gist:
Make sure to select Linux and Debian.
Selected the netinst ISO that you’ve just downloaded.
Make sure you enable 3D and give the GPU some memory to work with.
Configuring a Debian Guest:
Go through the normal install process and when you get to the end where you select the task. Just select “Standard Linux System” for now. Once you are done with the install reboot and replace all instances of lenny with sid in /etc/apt/sources.list and upgrade:
sed 's/lenny/sid/g' /etc/apt/sources.list apt-get update apt-get -f dist-upgrade
Once you have upgraded to sid and rebooted, log back in as root and install the desktop environment by running tasksel and selecting “Desktop Environment”:
That will install a boatload of packages so when it completes you’ll want to setup X and install the virtualbox utilities.
apt-get install virtualbox-ose-guest-dkms virtualbox-ose-guest-utils virtualbox-ose-guest-x11 Xorg -configure mv /root/xorg.conf.root /etc/x11/xorg.conf
DKMS should build the virtualbox guest modules for your kernel on unstable or testing. For lenny or “virtualbox-ose-guest-source” you’d need to install modules-assistant and run “module-assistant” by hand to build a kernel module if it isn’t already under stable as it should be. Which is easy enough, DKMS just made that process easier/automagic.
Now you’ll want to edit /etc/X11/xorg.conf and update your mouse driver to be “vboxmouse” and your video driver to be “vboxvideo”. Then start up GDM and you should have access to direct rendering to run everything from compiz to avant.
nano /etc/X11/xorg.conf /etc/init.d/gdm restart
Lets hope you made it to something like this:
Your Debian guest should now inegrate with your host computer. (clipboard, mouse, screen resizing, ability to mount shared folders) You’ll also be able to use direct rendering and opengl if you enabled it in virtualbox. There are still an annoying bug with direct rendering under linux guests where the screen does not refresh with something like compiz running. A way to make it less noticeable is to keep the screen ticking along with something changing. That is why I add the seconds to my clock on the guest. Also, if you are getting superblock in the future errors when restarting you will want to edit /etc/default/rcS to utc=no. Of course, that is only applicable to anybody west of prime meridian I guess.