Koozali.org: home of the SME Server

HOWTO: Installing VirtualBox 2.2.2 on SME Server 7.4

Offline kevinps

  • *
  • 5
  • +0/-0
HOWTO: Installing VirtualBox 2.2.2 on SME Server 7.4
« on: May 18, 2009, 11:39:08 PM »
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/VirtualBox

Not 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)
Code: [Select]
wget http://download.virtualbox.org/virtualbox/2.2.2/VirtualBox-2.2.2_46594_rhel4-1.i386.rpmFor kernel 2.6.9-78.0.13.EL get:
Code: [Select]
wget http://kevinps2003.tripod.com/vboxdrv-2.2.2.tar.gzFor kernel 2.6.9-78.0.13.ELsmp get:
Code: [Select]
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)
Code: [Select]
yum install SDLYou may need to run the following commands to complete the installation.
Code: [Select]
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
Code: [Select]
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
Code: [Select]
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
Code: [Select]
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)
Code: [Select]
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)
Code: [Select]
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.
Code: [Select]
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
Code: [Select]
lsmod | grep vbox

Should result in
Code: [Select]
vboxnetflt             78504  0
vboxdrv               100008  1 vboxnetflt

11.   Unload the kernel
Code: [Select]
rmmod vboxnetflt
rmmod vboxdrv

12.   Run depmod to determine module dependancies
Code: [Select]
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
Code: [Select]
modprobe vboxnetflt

14.   Verify the kernel modules are loaded
Code: [Select]
lsmod | grep vbox

Should result in
Code: [Select]
vboxnetflt             78504  0
vboxdrv               100008  1 vboxnetflt

15.   Create/edit the /etc/rc.modules file to load vboxdrv and vboxnetflt at boot time
Code: [Select]
pico /etc/rc.modules
Add the following line and save
Code: [Select]
modprobe vboxnetflt
16.   Remove the file that flags vboxdrv and vboxnetflt module as not being installed properly
Code: [Select]
rm /etc/vbox/module_not_compiled

17.   Set Environment Variable (replace 'vbox_files' with the ibay you created)
Code: [Select]
export VBOX_USER_HOME=/home/e-smith/files/ibays/vbox_files/files/.VirtualBox

18.   Permanently set Environment Variable
Code: [Select]
pico /etc/profile.d/vboxpath.sh
Add the two lines below (replace 'vbox_files' with the ibay you created)
Code: [Select]
# /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
Code: [Select]
chmod 755 /etc/profile.d/vboxpath.sh
19.   Verify the environment variable is set
Code: [Select]
echo $VBOX_USER_HOME
Should result in (replace 'vbox_files' with the ibay you created)
Code: [Select]
/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:
Code: [Select]
/usr/bin/VBoxManage createvm -name "WinXP" –register
It should result in something similar to: (where 'vbox_files' will be the ibay you created)
Code: [Select]
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)
Code: [Select]
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.
Code: [Select]
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
Code: [Select]
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.
Code: [Select]
VBoxManage modifyvm "WinXP" -memory "128MB"
« Last Edit: May 20, 2009, 04:36:51 AM by kevinps »

Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
Re: HOWTO: Installing VirtualBox 2.2.2 on SME Server 7.4
« Reply #1 on: May 19, 2009, 02:55:40 AM »
Code: [Select]
[root@servidor virtualbox]# wget http://kevinps2003.tripod.com/vboxdrv-2.2.2.tar.gz
--21:13:45--  http://kevinps2003.tripod.com/vboxdrv-2.2.2.tar.gz
           => `vboxdrv-2.2.2.tar.gz'
Resolving kevinps2003.tripod.com... 209.202.252.50
Connecting to kevinps2003.tripod.com|209.202.252.50|:80... failed: Connection timed out.
Retrying.
:sad:

Edit: I was able to download the file using a different provider!
Thanks,
« Last Edit: May 19, 2009, 04:14:30 AM by Franco (a.k.a. stuntshell) »

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: HOWTO: Installing VirtualBox 2.2.2 on SME Server 7.4
« Reply #2 on: May 19, 2009, 04:02:53 PM »
Code: [Select]
wget ftp://ftp.pbone.net/mirror/www.whiteboxlinux.org/whitebox/4/en/updates/i386/alsa-lib-1.0.6-5.RHEL4.i386.rpm
wget ftp://ftp.pbone.net/mirror/ftp.centos.org/4.7/os/x86_64/CentOS/RPMS/SDL-1.2.7-8.i386.rpm
Please try and adhere to more normal installation commands as SME Server makes use of yum and repositories, alsa and SDL can be installed from the base repository AFAIK.

Besides that SME Server is build for i386 architecture so it is very bad advice to install x86_64 packages as they are meant for 64 bit machines.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline christian

  • *
  • 369
  • +0/-0
    • http://www.szpilfogel.com
Re: HOWTO: Installing VirtualBox 2.2.2 on SME Server 7.4
« Reply #3 on: May 19, 2009, 05:16:46 PM »
Kevinps,
I currently use VMWare server 2. Did you find an advantage in going to Virtual Box?

I use an older version (1 year old) on my XP machine but found it had less features than VMWare.

Always looking for a better solution...

C
SME since 2003

Offline kevinps

  • *
  • 5
  • +0/-0
Re: HOWTO: Installing VirtualBox 2.2.2 on SME Server 7.4
« Reply #4 on: May 20, 2009, 03:24:31 AM »
cactus, thanks for the info, I will update the post to show the proper way of doing it.

christian, the only advantage I found was the built-in RDP support, I can use the windows remote desktop connection on any machine and don't have to install/configure another client.  The main reason I use VirtualBox is I have a fairly large collection of VDI's and I don't want to start over with something new.

Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
Re: HOWTO: Installing VirtualBox 2.2.2 on SME Server 7.4
« Reply #5 on: May 20, 2009, 03:56:04 AM »
I exchanged emails with Kevin and he applied for an account on the wiki, so soon his How-To should be there, and should be easy to edit and do it properly.
Kevin has compiled the modules for the SMP kernel as well, I'm testing them right now

About Cristian's question, I'm finding VBox way better than VMWare, especially when it comes to speed. So this alone will make me switch.


Offline soprom

  • *
  • 589
  • +0/-0
    • www.logiciel-libre.org
Re: HOWTO: Installing VirtualBox 2.2.2 on SME Server 7.4
« Reply #6 on: October 08, 2009, 09:06:12 PM »
I followed the Wiki procedure but vbox didn't start because it didn't find the modules.

I had it working like this:

Code: [Select]
yum install kernel-devel-`uname -r` gcc
/etc/init.d/vboxdrv setup
yum remove kernel-devel-`uname -r` gcc

Did someone did it with VirtualBox-3.0.8_53138_rhel4-1.i386.rpm ?
Sophie from Montréal

Offline kevinps

  • *
  • 5
  • +0/-0
Re: HOWTO: Installing VirtualBox 2.2.2 on SME Server 7.4
« Reply #7 on: October 15, 2009, 04:22:03 AM »
Sorry I haven't updated the wiki/modules to reflect the newest version of virtual box, I've had hardware issues on my server and I haven't had time to fix it or get virtual box updated.  I'll try to have the wiki and downloads updated in the next week or two. 

FYI, I also plan on writing a howto for compiling modules for virtual box and other programs, but haven't had time for that either.

Offline soprom

  • *
  • 589
  • +0/-0
    • www.logiciel-libre.org
Re: HOWTO: Installing VirtualBox 2.2.2 on SME Server 7.4
« Reply #8 on: October 15, 2009, 05:44:40 AM »
I use VirtualBox on my desktop but when I tried on the server, I found it to be far from what I have with vmWare on the same server.  So I switched back to vmWare.

But thanks for your notes, they helped me do my own tests!
Sophie from Montréal

Offline sekt

  • 4
  • +0/-0
Re: HOWTO: Installing VirtualBox 2.2.2 on SME Server 7.4
« Reply #9 on: October 17, 2009, 05:32:23 PM »
I get a error after punct 12.

do anyone know how to get on

[root@p5ql-cm 2.6.9-78.0.13.ELsmp]# depmod -a /lib/modules/2.6.9-78.0.13.ELsmp/vboxnetflt.ko
WARNING: Can't read module /lib/modules/2.6.9-78.0.22.ELsmp/weak-updates/lib/modules/2.6.9-78.0.8.ELsmp/updates/slip/slip.ko: No such file or directory
WARNING: Can't read module /lib/modules/2.6.9-78.0.22.ELsmp/weak-updates/lib/modules/2.6.9-78.0.8.ELsmp/updates/appletalk/appletalk.ko: No such file or directory
WARNING: Can't read module /lib/modules/2.6.9-78.0.22.ELsmp/weak-updates/lib/modules/2.6.9-78.0.8.ELsmp/updates/ppp/ppp_generic.ko: No such file or directory
WARNING: Can't read module /lib/modules/2.6.9-78.0.22.ELsmp/weak-updates/lib/modules/2.6.9-78.0.8.ELsmp/updates/ppp/ppp_mppe.ko: No such file or directory
I use skype, contact me at 'svenn-erik'

Offline kevinps

  • *
  • 5
  • +0/-0
Re: HOWTO: Installing VirtualBox 2.2.2 on SME Server 7.4
« Reply #10 on: November 02, 2009, 05:01:36 AM »
FYI the wiki has been updated for VirtualBox 3.0.10.  Sorry for the delay in getting this out.  I have tested it using 2.6.9-78.0.22.EL and 2.6.9-78.0.22.ELsmp and they are both working for me.

I will try to get a wiki page up on how to compile the modules on your own so that no one has to wait for me to update things.

sekt, the issue you ran into is due to bug #5334, I have added two options for getting around this issue in the wiki.

Offline pauljclarke

  • ***
  • 61
  • +0/-0
Re: HOWTO: Installing VirtualBox 2.2.2 on SME Server 7.4
« Reply #11 on: November 23, 2009, 03:03:58 PM »
Hi,

'Yum install SDL' returns nothing - please can you state which repo is required.

Thanks
Paul

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: HOWTO: Installing VirtualBox 2.2.2 on SME Server 7.4
« Reply #12 on: November 23, 2009, 09:10:07 PM »
I will try to get a wiki page up on how to compile the modules on your own so that no one has to wait for me to update things.
Perhaps you can have it added to the SME Contribs CVS which makes it possible for others to administrate and update it... apart from the possibility off code review, the contribs org repositories and the build system that are all there to improve quality and maintainability.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline pauljclarke

  • ***
  • 61
  • +0/-0
Re: HOWTO: Installing VirtualBox 2.2.2 on SME Server 7.4
« Reply #13 on: November 25, 2009, 08:38:52 AM »
Perhaps you can have it added to the SME Contribs CVS which makes it possible for others to administrate and update it... apart from the possibility off code review, the contribs org repositories and the build system that are all there to improve quality and maintainability.

Guess this means it's not avalible as yet? please can we be informed as I've list to test this asap.

Thanks
Paul

Offline kevinps

  • *
  • 5
  • +0/-0
Re: HOWTO: Installing VirtualBox 2.2.2 on SME Server 7.4
« Reply #14 on: November 28, 2009, 07:39:17 PM »
I'm not sure what all would be required to submit this to the CVS.  I am not a coder, so I am open to any suggestions/help on how to do this.

As for 'yum install SDL', it appears to come from the base repository, I didn't have to specify any other repositories on my system.

=====================================================================
 Package                 Arch       Version          Repository        Size
=====================================================================
Installing:
 SDL                     i386       1.2.7-8          base              202 k
Installing for dependencies:
 alsa-lib                i386       1.0.6-5.RHEL4    base              302 k