edit: I have updated this post to correct a few errors, since it is a pain to keep two documents up to date, please refer to the guide on the wiki.
http://wiki.contribs.org/VirtualBoxNot sure if this is much use to anyone else, but I have installed Sun VirtualBox 2.2.2 onto my server.
(Note, this will probably only work with Sun VirtualBox 2.2.2)
My reasoning for this is I needed a (virtual) windows machine running on at a remote location to perform various administrative tasks. I can control the virtual machine using an RDP client (ie windows Remote Desktop Connection). This way I can run network applications as if I were in the office and am not tying up a physical machine.
1. Download the following files to your server (it is a good idea to keep these file around if you ever need to rebuild a server)
wget http://download.virtualbox.org/virtualbox/2.2.2/VirtualBox-2.2.2_46594_rhel4-1.i386.rpm
For kernel 2.6.9-78.0.13.EL get:
wget http://kevinps2003.tripod.com/vboxdrv-2.2.2.tar.gz
For kernel 2.6.9-78.0.13.ELsmp get:
wget http://kevinps2003.tripod.com/vboxdrv-2.2.2smp.tar.gz
(Note: vboxdrv-2.2.2*.tar.gz contains vboxdrv.ko and vboxnetflt.ko, which was copied from a VirtualBox 2.2.2 installation on a Cent OS 4.7 machine)
2. Install the dependencies for VirtualBox (this will install alsa-lib and SDL)
yum install SDL
You may need to run the following commands to complete the installation.
signal-event post-upgrade
signal-event reboot
3. Create a new group ‘vboxusers’ in the server manager and assign the appropriate users.
4. Create a new ibay for the VirtualBox settings and hard drive files. Set the Group to ‘vboxusers’ and User Access to ‘read=group, write=group’.
5. Install VirtualBox using the following command
rpm -Uvh VirtualBox-2.2.2_46594_rhel4-1.i386.rpm
Note - You will get the following error message, which you can ignore, we will manually copy and install the precompiled modules
Creating group 'vboxusers'. VM users must be member of that group!
No precompiled module for this kernel found -- trying to build one. Messages
emitted during module compilation will be logged to /var/log/vbox-install.log.
Compilation of the kernel module FAILED! VirtualBox will not start until this
problem is fixed. Please consult /var/log/vbox-install.log to find out why the
kernel module does not compile. Most probably the kernel sources are not found.
Install them and execute
/etc/init.d/vboxdrv setup
as root.
6. Extract files from vboxdrv-2.2.2*.tar.gz
tar -zxvf vboxdrv-2.2.2*.tar.gz
7. Copy precompiled virtualbox drivers to the appropriate lib/modules/… folder
(use ‘uname –r’ to determine your current kernel, in my case it was 2.6.9-78.0.13.EL)
cp vboxdrv.ko /lib/modules/2.6.9-78.0.13.EL/
cp vboxnetflt.ko /lib/modules/2.6.9-78.0.13.EL/
8. Change module permissions and owner using the following commands (this step might not be required)
chown root:root /lib/modules/2.6.9-78.0.13.EL/vboxdrv.ko
chown root:root /lib/modules/2.6.9-78.0.13.EL/vboxnetflt.ko
chmod 644 /lib/modules/2.6.9-78.0.13.EL/vboxdrv.ko
chmod 644 /lib/modules/2.6.9-78.0.13.EL/vboxnetflt.ko
9. Test the kernel module, if there are no error messages, you can keep going, if not, you may have to compile the modules for yourself.
insmod /lib/modules/2.6.9-78.0.13.EL/vboxdrv.ko
insmod /lib/modules/2.6.9-78.0.13.EL/vboxnetflt.ko
10. Verify the kernel modules are loaded
lsmod | grep vbox
Should result in
vboxnetflt 78504 0
vboxdrv 100008 1 vboxnetflt
11. Unload the kernel
rmmod vboxnetflt
rmmod vboxdrv
12. Run depmod to determine module dependancies
depmod -a /lib/modules/2.6.9-78.0.13.EL/vboxnetflt.ko
13. Test that the kernel modules load properly with the following command
modprobe vboxnetflt
14. Verify the kernel modules are loaded
lsmod | grep vbox
Should result in
vboxnetflt 78504 0
vboxdrv 100008 1 vboxnetflt
15. Create/edit the /etc/rc.modules file to load vboxdrv and vboxnetflt at boot time
pico /etc/rc.modules
Add the following line and save
modprobe vboxnetflt
16. Remove the file that flags vboxdrv and vboxnetflt module as not being installed properly
rm /etc/vbox/module_not_compiled
17. Set Environment Variable (replace 'vbox_files' with the ibay you created)
export VBOX_USER_HOME=/home/e-smith/files/ibays/vbox_files/files/.VirtualBox
18. Permanently set Environment Variable
pico /etc/profile.d/vboxpath.sh
Add the two lines below (replace 'vbox_files' with the ibay you created)
# /etc/profile.d/vboxpath.sh - Set Virtual Box Settings Location
export VBOX_USER_HOME=/home/e-smith/files/ibays/vbox_files/files/.VirtualBox
Change the permissions on the script to make it executable
chmod 755 /etc/profile.d/vboxpath.sh
19. Verify the environment variable is set
echo $VBOX_USER_HOME
Should result in (replace 'vbox_files' with the ibay you created)
/home/e-smith/files/ibays/vbox_files/files/.VirtualBox
20. You can now create your own virtual machines using VboxManage (located in /usr/bin/).
The link below should help you create your first virtual machine.
http://vmetc.com/wp-content/uploads/2008/07/headless-vm-creation-in-virtualbox-creating-an-ubuntu-804-server-vm.pdf
Tips/Hints
A) To create a virtual machine, use the following command:
/usr/bin/VBoxManage createvm -name "WinXP" –register
It should result in something similar to: (where 'vbox_files' will be the ibay you created)
Virtual machine 'WinXP' is created and registered.
UUID: 3d07762d-acb9-4a0a-9df0-dd8a1d8ce0e8
Settings file: '/home/e-smith/files/ibays/vbox_files/files/.VirtualBox/Machines/WinXP/WinXP.xml'
B) After configuring, start the virtual machine by using the following command: (replace 'WinXP' with the name you provided in the 'createvm' command above)
VBoxHeadless -startvm "WinXP"
C) To access the virtual machine, start your RDP Client (ie ‘Remote Desktop Connection’ on Windows) and enter the IP Address or Name of your SME Server (include the port, if necessary).

D) To give your virtual machine an IP Address from your local network (ie DHCP provided by another machine), use the following commands to change the Virtual NIC to use your LAN connection. If you server as configured as a gateway, make sure that 'eth0' is the LAN port not the WAN port.
VBoxManage modifyvm "WinXP" -nic1 bridged
VBoxManage modifyvm "WinXP" -bridgeadapter1 eth0
E) When modifying your virtual machine, you will need to pay close attention to the amount of physical ram in your server. Use the following command to check the amount of free memory in your server
free -m
In my case I only have 256MB of RAM installed in this server, my virtual machine can only be run with 128MB of RAM. The server will essentially grind to a halt if you attempt to run a virtual machine when you do not have enough free physical memory.
VBoxManage modifyvm "WinXP" -memory "128MB"