Wiki Page
Install VirtualBox Guest Additions
A quick note on Virtualization
For people who do not want to or are unable run Cyn.in on a physically dedicated server machine, virtualization is the way to go. Virtualization platforms are also very useful for debugging and problem solving where repeated testing of operating system altering use-cases is to be done - you can snapshot a particular state of the virtual machine and restore it at will for quickly reverting to the target case.
For simple and easy virtualization, and especially for Cyn.in developers, I recommend usage of Oracle's VirtualBox. VirtualBox provides the maximum simplicity and feature to cost ratio, especially for common development tasks. We use it quite effectively for the actual installer CD building and testing process as well.
Guest Additions
In VirtualBox, on-guest improvements are provided by installing VirtualBox guest additions through the Devices menu in the running virtual machine's window. Usually this is only installed by users in an X Windows environment like Gnome / KDE for getting basic amenities like Clipboard Copy Paste and pass-through mouse handling. We've seen substantial performance improvements when the VirtualBox Guest Additions are installed on non-GUI VMs as well. The installation of guest additions on Cyn.in from the installer CD (which is essentially meant to be a headless debian 5.0 lenny setup at the base linux distro level) can get a bit tricky. Let's walk through the finer points:
Enable and Mount the Guest Additions CD
Switch to the console window of the running Cyn.in virtual machine and select Install Guest Additions from the Devices menu, as shown. Note: Nothing will appear to happen, when you do this.
Next, we verify that VirtualBox has actually loaded the CD into the drive, by looking at Devices -> CD/DVD devices -> VBoxGuestAdditions.iso. The entry should have a check-mark next to it, indicating that it is succefully loaded, as shown in the screenshot. Note that this can sometimes fail if you have a badly configured drive or something similar wrong, in your setup. Usually VirtualBox will prompt you with an alert when such a failure happens.
Install the build dependencies
Right, now for the tricky parts. :)
First, we need to install the development dependencies of the VirtualBox guest additions kernel modules. To do that, you have to first determine what kernel version you're using. We usually combine all of this into a single apt-get command, like so. First, become root with the su command and type your root password. Then run:apt-get install build-essential linux-headers-`uname -r`
Mounting the Virtualbox guest additions CD, manually
If you were running in X Windows, the Virtualbox guest additions CD would typically get auto-mounted and you would proceed to directly run the shell script. Not so, when you're running headless (at least with the default setup). So you have to manually mount the cdrom device, at /media/cdrom, with the following command:
mount /dev/cdrom /media/cdrom
and then cd to the mounted directory and see the files, you should see something like this in your console:
dkgLennyi386:/home/dhiraj/svn/odn/cynintrunk# cd /media/cdrom dkgLennyi386:/media/cdrom# ls -lh total 30M dr-xr-xr-x 3 root root 2.0K 2009-12-17 19:07 32Bit dr-xr-xr-x 2 root root 2.0K 2009-12-17 19:07 64Bit -r-xr-xr-x 1 root root 217 2009-12-04 15:36 AUTORUN.INF -r-xr-xr-x 1 root root 4.4K 2009-12-17 19:03 autorun.sh -r-xr-xr-x 1 root root 2.8M 2009-12-17 18:59 VBoxLinuxAdditions-amd64.run -r-xr-xr-x 1 root root 2.4M 2009-12-17 19:06 VBoxLinuxAdditions-x86.run -r-xr-xr-x 1 root root 13M 2009-12-17 17:54 VBoxSolarisAdditions.pkg -r-xr-xr-x 1 root root 5.9M 2009-12-17 18:54 VBoxWindowsAdditions-amd64.exe -r-xr-xr-x 1 root root 467K 2009-12-17 18:51 VBoxWindowsAdditions.exe -r-xr-xr-x 1 root root 5.3M 2009-12-17 18:52 VBoxWindowsAdditions-x86.exe
Run the installation shell script from CD
All that's remaining now is the running of the installer script. You will typically want to run VBoxLinuxAdditions.x86.run, like this:
./VBoxLinuxAdditions-x86.run
The shell script should now proceed to build the guest additions and will usually complain that there's no X Server found, or about no OpenGL support and so on, all this is normal in our case. When it completes, you can see if you get a noticeable performance boost by restarting your virtual machine using the reboot command or whatever other restart mechanism you're happy with. Restarting is required. Also, every time you install a kernel upgrade, you'll have to repeat the above procedure, because the VirtualBox guest additions kernel modules will no longer be in sync with the current kernel and thus, not load.

Blog
Status Log


"Package linux-headers is not installed, so not removed"
"E Couldn't find package 2.6.26-2-686"
When I run the VBox utility, I got:
"(Your system does not seam to be set up to build kernel modules."
"Look at /var/log/vboxadd-install.log to find out what went wrong)"
"Installing the Window System drivers ...fail!"
"(Could not find the X.Org or XFree86 Window System.)"
That made linux think that you wanted to install 2 things, whereas the command actually installs only 1. Please copy paste the command from the instructions instead of typing it and it will work.
To *be able* to copy paste, you will probably have to SSH into the appliance in the first place (using a client like putty if you're on windows).
Because of the text in italic, I thought a space was inserted between the dash and the back-quote. I'm going to repeat it soon.
Thanks, Dom
What the benefits of installing the VBox extensions?
ps: default admin credentials are
siteadmin/secret
Happy Evaluating !!
The evaluation is going well. Currently playing with the WebDAV feature ;)
Any response about why we need to install the VBox extensions? The Cynin setup works fine just from the command line, so no Graphical Interface is required on the server box (real server or just the VM). Do the VBox kernel patches make a difference?
A+, Dom
This is true for any virtualization tech that you're using, actually. VMWare have their own "tools" that you can install as well.
So while you're probably used to installing guest additions only for the obvious UI benefits (auto resizing guest screen resolutions, copy paste), there are performance merits as well. The problem is that you have to (manually, using above instructions) keep the guest additions updated to match your linux kernel version as well.
cynin:/# apt-get install build-essential linux-headers-`uname -r`
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package build-essential is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package build-essential has no installation candidate
I was able to install the vbox additions, but it fails to load on boot "(modprobe vboxguest failed)...."
Any ideas on what might be going on?