Difference between revisions of "VirtualBox"

From SME Server
Jump to navigationJump to search
m (Removed redundant header)
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
{{Level|Advanced}}
 
{{Level|Advanced}}
 
+
{{warning box|This how to is *out of date* and refers to SME7. You probably need to install smeserver-phpvirtualbox and smeserver-virtualbox contribs for Koozali SME10 : [[Phpvirtualbox]]}}
 
=== Maintainer ===
 
=== Maintainer ===
 
Kevin Schneider
 
Kevin Schneider
  
 
=== Description ===
 
=== Description ===
This contribution for smeserver adds Sun VirtualBox 2.2.2 for Headless operation (ie creates a virtual machine on your server that can be access via an RDP client such as 'Remote Desktop Connection' on Windows.  This allows you to have a virtual Windows machine running on at a remote location to perform various administrative tasks.  You can run network applications as if I were in the remote office and will not tying up a physical machine.
+
This contribution for smeserver adds Sun VirtualBox 3.0.10 for Headless operation (ie creates a virtual machine on your server that can be access via an RDP client such as 'Remote Desktop Connection' on Windows.  This allows you to have a virtual Windows machine running at a remote location to perform various administrative tasks.  You can run network applications as if you were in the remote office and will not tying up a physical machine.
 +
 
 +
For instruction on how to install [[VirtualBox 4.0 on SME Server v8 beta 6]], check this [http://wiki.contribs.org/index.php?title=VirtualBox_4.0_on_SME_Server_v8_beta_6 wiki] page.
  
 
=== Requirements ===
 
=== Requirements ===
You will need SME Server 7.4, kernel 2.6.9-78.0.13.EL or 2.6.9-78.0.13.ELsmp  
+
You will need SME Server 7.4, kernel 2.6.9-78.0.22.EL or 2.6.9-78.0.22.ELsmp  
 
check your current kernel using  
 
check your current kernel using  
 
  uname -r
 
  uname -r
  
You will also need to download the following rpm files
+
You will also need to download the VirtualBox rpm file
wget ftp://ftp.pbone.net/mirror/www.whiteboxlinux.org/whitebox/4/en/updates/i386/alsa-lib-1.0.6-5.RHEL4.i386.rpm
+
  wget http://download.virtualbox.org/virtualbox/3.0.10/VirtualBox-3.0.10_54097_rhel4-1.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
 
  wget http://download.virtualbox.org/virtualbox/2.2.2/VirtualBox-2.2.2_46594_rhel4-1.i386.rpm
 
  
 
You will also need the precompiled kernel modules
 
You will also need the precompiled kernel modules
'''For 2.6.9-78.0.13.EL'''
+
 
  wget http://kevinps2003.tripod.com/vboxdrv-2.2.2.tar.gz
+
'''For 2.6.9-78.0.22.EL'''
'''For 2.6.9-78.0.13.ELsmp'''
+
  wget http://kevinps2003.tripod.com/VirtualBox3.0.10_Modules_2.6.9-78.EL.tar.gz
  wget http://kevinps2003.tripod.com/vboxdrv-2.2.2smp.tar.gz
+
'''For 2.6.9-78.0.22.ELsmp'''
 +
  wget http://kevinps2003.tripod.com/VirtualBox3.0.10_Modules_2.6.9-78.ELsmp.tar.gz
  
 
=== Installation ===
 
=== Installation ===
Line 29: Line 30:
 
----
 
----
  
2. Install the dependencies for VirtualBox
+
2. Install the dependencies for VirtualBox (this will install the alsa-lib and SDL)
rpm -Uvh alsa-lib-1.0.6-5.RHEL4.i386.rpm
+
yum install SDL
  rpm -Uvh SDL-1.2.7-8.i386.rpm
+
You may need to run the following commands to complete the installation
 +
signal-event post-upgrade
 +
  signal-event reboot
  
 
----
 
----
Line 44: Line 47:
  
 
5. Install VirtualBox using the following command
 
5. Install VirtualBox using the following command
  rpm -Uvh VirtualBox-2.2.2_46594_rhel4-1.i386.rpm
+
  rpm -Uvh VirtualBox-3.0.10_54097_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
 
Note - You will get the following error message, which you can ignore, we will manually copy and install the precompiled modules
Line 63: Line 66:
 
----
 
----
  
6. Extract files from vboxdrv-2.2.2*.tar.gz
+
6. Extract files from VirtualBox3.0.10_Modules_2.6.9-78.EL*.tar.gz
  tar -zxvf vboxdrv-2.2.2*.tar.gz
+
  tar -zxvf VirtualBox3.0.10_Modules_2.6.9-78.EL*.tar.gz
  
 
----
 
----
Line 70: Line 73:
 
7. Copy precompiled VirtualBox drivers to the appropriate lib/modules/… folder
 
7. Copy precompiled VirtualBox drivers to the appropriate lib/modules/… folder
  
'''For 2.6.9-78.0.13.EL'''
+
'''For 2.6.9-78.0.22.EL'''
  cp vboxdrv.ko /lib/modules/2.6.9-78.0.13.EL/
+
  cp vboxdrv.ko /lib/modules/2.6.9-78.0.22.EL/
  cp vboxnetflt.ko /lib/modules/2.6.9-78.0.13.EL/
+
  cp vboxnetflt.ko /lib/modules/2.6.9-78.0.22.EL/
'''For 2.6.9-78.0.13.ELsmp'''
+
cp vboxnetadp.ko /lib/modules/2.6.9-78.0.22.EL/
  cp vboxdrv.ko /lib/modules/2.6.9-78.0.13.ELsmp/
+
'''For 2.6.9-78.0.22.ELsmp'''
  cp vboxnetflt.ko /lib/modules/2.6.9-78.0.13.ELsmp/
+
  cp vboxdrv.ko /lib/modules/2.6.9-78.0.22.ELsmp/
 
+
  cp vboxnetflt.ko /lib/modules/2.6.9-78.0.22.ELsmp/
 +
cp vboxnetadp.ko /lib/modules/2.6.9-78.0.22.ELsmp/
 
----
 
----
  
 
8. Change module permissions and owner using the following commands (this step might not be required)
 
8. Change module permissions and owner using the following commands (this step might not be required)
  
'''For 2.6.9-78.0.13.EL'''
+
'''For 2.6.9-78.0.22.EL'''
  chown root:root /lib/modules/2.6.9-78.0.13.EL/vboxdrv.ko
+
  chown root:root /lib/modules/2.6.9-78.0.22.EL/vboxdrv.ko
  chown root:root /lib/modules/2.6.9-78.0.13.EL/vboxnetflt.ko
+
  chown root:root /lib/modules/2.6.9-78.0.22.EL/vboxnetflt.ko
  chmod 644 /lib/modules/2.6.9-78.0.13.EL/vboxdrv.ko
+
chown root:root /lib/modules/2.6.9-78.0.22.EL/vboxnetadp.ko
  chmod 644 /lib/modules/2.6.9-78.0.13.EL/vboxnetflt.ko
+
  chmod 644 /lib/modules/2.6.9-78.0.22.EL/vboxdrv.ko
'''For 2.6.9-78.0.13.ELsmp'''
+
  chmod 644 /lib/modules/2.6.9-78.0.22.EL/vboxnetflt.ko
  chown root:root /lib/modules/2.6.9-78.0.13.ELsmp/vboxdrv.ko
+
chmod 644 /lib/modules/2.6.9-78.0.22.EL/vboxnetadp.ko
  chown root:root /lib/modules/2.6.9-78.0.13.ELsmp/vboxnetflt.ko
+
'''For 2.6.9-78.0.22.ELsmp'''
  chmod 644 /lib/modules/2.6.9-78.0.13.ELsmp/vboxdrv.ko
+
  chown root:root /lib/modules/2.6.9-78.0.22.ELsmp/vboxdrv.ko
  chmod 644 /lib/modules/2.6.9-78.0.13.ELsmp/vboxnetflt.ko
+
  chown root:root /lib/modules/2.6.9-78.0.22.ELsmp/vboxnetflt.ko
 +
chown root:root /lib/modules/2.6.9-78.0.22.ELsmp/vboxnetadp.ko
 +
  chmod 644 /lib/modules/2.6.9-78.0.22.ELsmp/vboxdrv.ko
 +
  chmod 644 /lib/modules/2.6.9-78.0.22.ELsmp/vboxnetflt.ko
 +
chmod 644 /lib/modules/2.6.9-78.0.22.ELsmp/vboxnetadp.ko
  
 
----
 
----
Line 96: Line 104:
 
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.
 
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.
  
'''For 2.6.9-78.0.13.EL'''
+
'''For 2.6.9-78.0.22.EL'''
  insmod /lib/modules/2.6.9-78.0.13.EL/vboxdrv.ko
+
  insmod /lib/modules/2.6.9-78.0.22.EL/vboxdrv.ko
  insmod /lib/modules/2.6.9-78.0.13.EL/vboxnetflt.ko
+
  insmod /lib/modules/2.6.9-78.0.22.EL/vboxnetflt.ko
'''For 2.6.9-78.0.13.ELsmp'''
+
insmod /lib/modules/2.6.9-78.0.22.EL/vboxnetadp.ko
  insmod /lib/modules/2.6.9-78.0.13.ELsmp/vboxdrv.ko
+
'''For 2.6.9-78.0.22.ELsmp'''
  insmod /lib/modules/2.6.9-78.0.13.ELsmp/vboxnetflt.ko
+
  insmod /lib/modules/2.6.9-78.0.22.ELsmp/vboxdrv.ko
 +
  insmod /lib/modules/2.6.9-78.0.22.ELsmp/vboxnetflt.ko
 +
insmod /lib/modules/2.6.9-78.0.22.ELsmp/vboxnetadp.ko
  
 
----
 
----
Line 108: Line 118:
 
  lsmod | grep vbox
 
  lsmod | grep vbox
 
Should result in
 
Should result in
  vboxnetflt            78504 0
+
vboxnetadp            73576  0
  vboxdrv              100008 1 vboxnetflt
+
  vboxnetflt            80776 0
 +
  vboxdrv              106920 1 vboxnetflt
  
 
----
 
----
Line 115: Line 126:
 
11. Unload the kernel modules
 
11. Unload the kernel modules
 
  rmmod vboxnetflt
 
  rmmod vboxnetflt
 +
rmmod vboxnetadp
 
  rmmod vboxdrv
 
  rmmod vboxdrv
  
 
----
 
----
  
12. Edit the modules.dep file
+
12. Run depmod to determine module dependancies
 +
'''For 2.6.9-78.0.22.EL'''
 +
depmod -a /lib/modules/2.6.9-78.0.22.EL/vboxnetflt.ko
 +
depmod -a /lib/modules/2.6.9-78.0.22.EL/vboxnetadp.ko
 +
'''For 2.6.9-78.0.22.ELsmp'''
 +
depmod -a /lib/modules/2.6.9-78.0.22.ELsmp/vboxnetflt.ko
 +
depmod -a /lib/modules/2.6.9-78.0.22.ELsmp/vboxnetadp.ko
  
'''For 2.6.9-78.0.13.EL'''
+
Note - if you have get a few lines containing the following
  pico /lib/modules/2.6.9-78.0.13.EL/modules.dep
+
WARNING: Can't read module /lib/modules/2.6.9-78.0.22.EL
Add the following two lines to the end and save
+
You will need to update your server (See comment #6, [http://bugs.contribs.org/show_bug.cgi?id=5334 Bug #5334], not recommended for a production server), or manually edit the modules.dep file.
  /lib/modules/2.6.9-78.0.13.EL/vboxdrv.ko:
+
 
  /lib/modules/2.6.9-78.0.13.EL/vboxnetflt.ko: /lib/modules/2.6.9-78.0.13.EL/vboxdrv.ko
+
'''For 2.6.9-78.0.22.EL'''
'''For 2.6.9-78.0.13.ELsmp'''
+
  pico /lib/modules/2.6.9-78.0.22.EL/modules.dep
  pico /lib/modules/2.6.9-78.0.13.ELsmp/modules.dep
+
Add the following lines
Add the following two lines to the end and save
+
  /lib/modules/2.6.9-78.0.22.EL/vboxdrv.ko:
  /lib/modules/2.6.9-78.0.13.ELsmp/vboxdrv.ko:
+
  /lib/modules/2.6.9-78.0.22.EL/vboxnetadp.ko:
  /lib/modules/2.6.9-78.0.13.ELsmp/vboxnetflt.ko: /lib/modules/2.6.9-78.0.13.ELsmp/vboxdrv.ko
+
/lib/modules/2.6.9-78.0.22.EL/vboxnetflt.ko: /lib/modules/2.6.9-78.0.22.EL/vboxdrv.ko
 +
 
 +
'''For 2.6.9-78.0.22.ELsmp'''
 +
  pico /lib/modules/2.6.9-78.0.22.ELsmp/modules.dep
 +
Add the following lines
 +
  /lib/modules/2.6.9-78.0.22.ELsmp/vboxdrv.ko:
 +
  /lib/modules/2.6.9-78.0.22.ELsmp/vboxnetadp.ko:
 +
/lib/modules/2.6.9-78.0.22.ELsmp/vboxnetflt.ko: /lib/modules/2.6.9-78.0.22.ELsmp/vboxdrv.ko
  
 
----
 
----
Line 136: Line 161:
 
13. Test that the kernel modules load properly with the following command
 
13. Test that the kernel modules load properly with the following command
 
  modprobe vboxnetflt
 
  modprobe vboxnetflt
 +
modprobe vboxnetadp
  
 
----
 
----
Line 142: Line 168:
 
  lsmod | grep vbox
 
  lsmod | grep vbox
 
Should result in
 
Should result in
  vboxnetflt            78504 0
+
vboxnetadp            73576  0
  vboxdrv              100008 1 vboxnetflt
+
  vboxnetflt            80776 0
 +
  vboxdrv              106920 1 vboxnetflt
  
 
----
 
----
  
15. Remove the file that flags vboxdrv and vboxnetflt module as not being installed properly
+
15. Create/edit the /etc/rc.modules file to load vboxdrv and vboxnetflt at boot time
 +
pico /etc/rc.modules
 +
Add the following lines and save
 +
modprobe vboxnetflt
 +
modprobe vboxnetadp
 +
 
 +
Run the following command to make the script executable.
 +
chmod +x /etc/rc.modules
 +
 
 +
----
 +
 
 +
16. Remove the file that flags vboxdrv and vboxnetflt module as not being installed properly
 
  rm /etc/vbox/module_not_compiled
 
  rm /etc/vbox/module_not_compiled
  
 
----
 
----
  
16. Set Environment Variable (replace 'vbox_files' with the ibay you created)
+
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
 
  export VBOX_USER_HOME=/home/e-smith/files/ibays/vbox_files/files/.VirtualBox
  
 
----
 
----
  
17. Permanently set Environment Variable
+
18. Permanently set Environment Variable
 
  pico /etc/profile.d/vboxpath.sh
 
  pico /etc/profile.d/vboxpath.sh
 
Add the two lines below (replace 'vbox_files' with the ibay you created)
 
Add the two lines below (replace 'vbox_files' with the ibay you created)
Line 168: Line 206:
 
----
 
----
  
18. Verify the environment variable is set
+
19. Verify the environment variable is set
 
  echo $VBOX_USER_HOME
 
  echo $VBOX_USER_HOME
 
Should result in (where 'vbox_files' is the ibay you created)
 
Should result in (where 'vbox_files' is the ibay you created)
Line 175: Line 213:
 
----
 
----
  
19. You can now create and run your own virtual machines using VBoxManage and VBoxHeadless (located in /usr/bin/).  
+
20. You can now create and run your own virtual machines using VBoxManage and VBoxHeadless (located in /usr/bin/).  
  
 
=== Usage - VBoxManage ===
 
=== Usage - VBoxManage ===
Line 231: Line 269:
 
----
 
----
  
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 otherwise your virtual machine will be exposed to the internet without a firewall.
+
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 your server is configured as a gateway, make sure that 'eth0' is the LAN port not the WAN otherwise your virtual machine will be exposed to the internet without a firewall.
 
  VBoxManage modifyvm "WinXP" -nic1 bridged
 
  VBoxManage modifyvm "WinXP" -nic1 bridged
 
  VBoxManage modifyvm "WinXP" -bridgeadapter1 eth0
 
  VBoxManage modifyvm "WinXP" -bridgeadapter1 eth0
Line 260: Line 298:
 
=== Uninstall ===
 
=== Uninstall ===
 
  rpm -e VirtualBox
 
  rpm -e VirtualBox
rpm -e SDL
 
rpm -e alsa-lib
 
  
 
Remove the kernel modules from the /lib/modules/... folder
 
Remove the kernel modules from the /lib/modules/... folder
  
'''For 2.6.9-78.0.13.EL'''
+
'''For 2.6.9-78.0.22.EL'''
  rm /lib/modules/2.6.9-78.0.13.EL/vbox*.ko
+
  rm /lib/modules/2.6.9-78.0.22.EL/vbox*.ko
'''For 2.6.9-78.0.13.ELsmp'''
+
'''For 2.6.9-78.0.22.ELsmp'''
  rm /lib/modules/2.6.9-78.0.13.ELsmp/vbox*.ko
+
  rm /lib/modules/2.6.9-78.0.22.ELsmp/vbox*.ko
 
 
Remove the lines added to the modules.dep file in step 12.
 
  
 
Remove the Environment Variable Script
 
Remove the Environment Variable Script
 
  rm /etc/profile.d/vboxpath.sh
 
  rm /etc/profile.d/vboxpath.sh
  
=== Bugs ===
+
----
Please raise bugs under the SME-Contribs section in [http://bugs.contribs.org/enter_bug.cgi].
+
<noinclude>[[Category: Howto]]
 
+
[[Category:Virtualisation]]</noinclude>
<noinclude>[[Category: Contrib]]</noinclude>
 

Latest revision as of 15:31, 12 July 2023

PythonIcon.png Skill level: Advanced
The instructions on this page may require deviations from standard procedures. A good understanding of linux and Koozali SME Server is recommended.


Warning.png Warning:
This how to is *out of date* and refers to SME7. You probably need to install smeserver-phpvirtualbox and smeserver-virtualbox contribs for Koozali SME10 : Phpvirtualbox


Maintainer

Kevin Schneider

Description

This contribution for smeserver adds Sun VirtualBox 3.0.10 for Headless operation (ie creates a virtual machine on your server that can be access via an RDP client such as 'Remote Desktop Connection' on Windows. This allows you to have a virtual Windows machine running at a remote location to perform various administrative tasks. You can run network applications as if you were in the remote office and will not tying up a physical machine.

For instruction on how to install VirtualBox 4.0 on SME Server v8 beta 6, check this wiki page.

Requirements

You will need SME Server 7.4, kernel 2.6.9-78.0.22.EL or 2.6.9-78.0.22.ELsmp check your current kernel using

uname -r

You will also need to download the VirtualBox rpm file

wget http://download.virtualbox.org/virtualbox/3.0.10/VirtualBox-3.0.10_54097_rhel4-1.i386.rpm

You will also need the precompiled kernel modules

For 2.6.9-78.0.22.EL

wget http://kevinps2003.tripod.com/VirtualBox3.0.10_Modules_2.6.9-78.EL.tar.gz

For 2.6.9-78.0.22.ELsmp

wget http://kevinps2003.tripod.com/VirtualBox3.0.10_Modules_2.6.9-78.ELsmp.tar.gz

Installation

1. Download the files to your folder on your server (it is a good idea to keep these file around if you ever need to rebuild a server)


2. Install the dependencies for VirtualBox (this will install the 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-3.0.10_54097_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 VirtualBox3.0.10_Modules_2.6.9-78.EL*.tar.gz

tar -zxvf VirtualBox3.0.10_Modules_2.6.9-78.EL*.tar.gz

7. Copy precompiled VirtualBox drivers to the appropriate lib/modules/… folder

For 2.6.9-78.0.22.EL

cp vboxdrv.ko /lib/modules/2.6.9-78.0.22.EL/
cp vboxnetflt.ko /lib/modules/2.6.9-78.0.22.EL/
cp vboxnetadp.ko /lib/modules/2.6.9-78.0.22.EL/

For 2.6.9-78.0.22.ELsmp

cp vboxdrv.ko /lib/modules/2.6.9-78.0.22.ELsmp/
cp vboxnetflt.ko /lib/modules/2.6.9-78.0.22.ELsmp/
cp vboxnetadp.ko /lib/modules/2.6.9-78.0.22.ELsmp/

8. Change module permissions and owner using the following commands (this step might not be required)

For 2.6.9-78.0.22.EL

chown root:root /lib/modules/2.6.9-78.0.22.EL/vboxdrv.ko
chown root:root /lib/modules/2.6.9-78.0.22.EL/vboxnetflt.ko
chown root:root /lib/modules/2.6.9-78.0.22.EL/vboxnetadp.ko
chmod 644 /lib/modules/2.6.9-78.0.22.EL/vboxdrv.ko
chmod 644 /lib/modules/2.6.9-78.0.22.EL/vboxnetflt.ko
chmod 644 /lib/modules/2.6.9-78.0.22.EL/vboxnetadp.ko

For 2.6.9-78.0.22.ELsmp

chown root:root /lib/modules/2.6.9-78.0.22.ELsmp/vboxdrv.ko
chown root:root /lib/modules/2.6.9-78.0.22.ELsmp/vboxnetflt.ko
chown root:root /lib/modules/2.6.9-78.0.22.ELsmp/vboxnetadp.ko
chmod 644 /lib/modules/2.6.9-78.0.22.ELsmp/vboxdrv.ko
chmod 644 /lib/modules/2.6.9-78.0.22.ELsmp/vboxnetflt.ko
chmod 644 /lib/modules/2.6.9-78.0.22.ELsmp/vboxnetadp.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.

For 2.6.9-78.0.22.EL

insmod /lib/modules/2.6.9-78.0.22.EL/vboxdrv.ko
insmod /lib/modules/2.6.9-78.0.22.EL/vboxnetflt.ko
insmod /lib/modules/2.6.9-78.0.22.EL/vboxnetadp.ko

For 2.6.9-78.0.22.ELsmp

insmod /lib/modules/2.6.9-78.0.22.ELsmp/vboxdrv.ko
insmod /lib/modules/2.6.9-78.0.22.ELsmp/vboxnetflt.ko
insmod /lib/modules/2.6.9-78.0.22.ELsmp/vboxnetadp.ko

10. Verify the kernel modules are loaded

lsmod | grep vbox

Should result in

vboxnetadp             73576  0
vboxnetflt             80776  0
vboxdrv               106920  1 vboxnetflt

11. Unload the kernel modules

rmmod vboxnetflt
rmmod vboxnetadp
rmmod vboxdrv

12. Run depmod to determine module dependancies For 2.6.9-78.0.22.EL

depmod -a /lib/modules/2.6.9-78.0.22.EL/vboxnetflt.ko
depmod -a /lib/modules/2.6.9-78.0.22.EL/vboxnetadp.ko

For 2.6.9-78.0.22.ELsmp

depmod -a /lib/modules/2.6.9-78.0.22.ELsmp/vboxnetflt.ko
depmod -a /lib/modules/2.6.9-78.0.22.ELsmp/vboxnetadp.ko

Note - if you have get a few lines containing the following

WARNING: Can't read module /lib/modules/2.6.9-78.0.22.EL

You will need to update your server (See comment #6, Bug #5334, not recommended for a production server), or manually edit the modules.dep file.

For 2.6.9-78.0.22.EL

pico /lib/modules/2.6.9-78.0.22.EL/modules.dep  

Add the following lines

/lib/modules/2.6.9-78.0.22.EL/vboxdrv.ko:
/lib/modules/2.6.9-78.0.22.EL/vboxnetadp.ko:
/lib/modules/2.6.9-78.0.22.EL/vboxnetflt.ko: /lib/modules/2.6.9-78.0.22.EL/vboxdrv.ko

For 2.6.9-78.0.22.ELsmp

pico /lib/modules/2.6.9-78.0.22.ELsmp/modules.dep  

Add the following lines

/lib/modules/2.6.9-78.0.22.ELsmp/vboxdrv.ko:
/lib/modules/2.6.9-78.0.22.ELsmp/vboxnetadp.ko:
/lib/modules/2.6.9-78.0.22.ELsmp/vboxnetflt.ko: /lib/modules/2.6.9-78.0.22.ELsmp/vboxdrv.ko

13. Test that the kernel modules load properly with the following command

modprobe vboxnetflt
modprobe vboxnetadp

14. Verify the kernel modules are loaded

lsmod | grep vbox

Should result in

vboxnetadp             73576  0
vboxnetflt             80776  0
vboxdrv               106920  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 lines and save

modprobe vboxnetflt 
modprobe vboxnetadp 

Run the following command to make the script executable.

chmod +x /etc/rc.modules

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 (where 'vbox_files' is the ibay you created)

/home/e-smith/files/ibays/vbox_files/files/.VirtualBox

20. You can now create and run your own virtual machines using VBoxManage and VBoxHeadless (located in /usr/bin/).

Usage - VBoxManage

To create a virtual machine, use the following command, replace "WinXP" with the name of your new virtual machine.

VBoxManage createvm -name "WinXP" –register

Set the amount of RAM for your virtual machine

VBoxManage modifyvm "WinXP" -memory "128MB"

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

Enables 'ACPI' for your virtual machine in VirtualBox

VBoxManage modifyvm "WinXP" -acpi on 

Creates a new virtual hard disk file (VDI). Note, size is in MB. The file will be saved to /home/e-smith/files/ibays/vbox_files/files/.VirtualBox/HardDisks/WinXP.vdi

VBoxManage createvdi -filename "WinXP.vdi" -size 20000 -register

Assign the hard disk file to your new virtual machine

VBoxManage modifyvm "WinXP" -hda "WinXP.vdi"

Sets the first boot device for your virtual machine to dvd (ie installing OS)

VBoxManage modifyvm "WinXP" -boot1 dvd 

Adds a CD/DVD image (located on your server) to VirtualBox media manager (note, replace the path below with the path to your installation media)

VBoxManage registerimage dvd /home/e-smith/files/ibays/iso_images/files/WinXP.iso

Assigns the CD/DVD image to your virtual machine

VBoxManage modifyvm "WinXP" -dvd /home/e-smith/files/ibays/iso_images/files/WinXP.iso

Remove the CD/DVD image from your virtual machine

VBoxManage modifyvm "WinXP" -dvd none

Sets the Virtual NIC to the VirtualBox 'nat' (can't communicate with other computers on lan, but has internet access via your server)

VBoxManage modifyvm "WinXP" -nic1 nat

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 your server is configured as a gateway, make sure that 'eth0' is the LAN port not the WAN otherwise your virtual machine will be exposed to the internet without a firewall.

VBoxManage modifyvm "WinXP" -nic1 bridged
VBoxManage modifyvm "WinXP" -bridgeadapter1 eth0

The commands above were based on this guide. [1]

Usage - VBoxHeadless

To start your virtual machine use the following command

VBoxHeadless -s "WinXP"

To access your virtual machine, you will need to connect via an RDP client. On Windows you can use the built in 'Remote Desktop Connection' to access your virtual machine. Open your RDP client and input the IP address/Name of your SME Server into the box and press Connect.

RDP Connection.jpg

Note there is no authentication when connecting by default, consult the VirtualBox documentation for instructions on implementing authentication.


To start your virtual machine on a different port (ie 12345), use the following command

VBoxHeadless -s "WinXP" -p 12345

Then enter 'IPaddress:port' into your RDP client. For Windows Remote Desktop Connection use

192.168.1.1:12345 

Uninstall

rpm -e VirtualBox

Remove the kernel modules from the /lib/modules/... folder

For 2.6.9-78.0.22.EL

rm /lib/modules/2.6.9-78.0.22.EL/vbox*.ko

For 2.6.9-78.0.22.ELsmp

rm /lib/modules/2.6.9-78.0.22.ELsmp/vbox*.ko

Remove the Environment Variable Script

rm /etc/profile.d/vboxpath.sh