Support > User Customizations

VirtualBox in unRAID

(1/84) > >>

gfjardim:
Use these instructions with discretion. ;D

This guide intention is to allow unRAID users to be able to compile their own kernel headers, and with that be able to compile and run VirtualBox into unRAID server. Note that a huge amount of RAM is necessary for compile and run VBox, and I recommend over 4GB or RAM.

Wiki: http://lime-technology.com/wiki/index.php?title=Installing_VirtualBox_in_unRAID

meep:
This looks great and your presentation is very clear.

As someone who can follow directions well but sometimes lacks the Linux savvy to understand what's going on, a couple of questions;

1. Will this survive updates?
Say there a 4.7.1 or 4.8. Will the whole things need to be done again? I had VMWare Server running under 4.5.3 but was locked out of upgrades as I'd need to go through the whole involved process each time.

2. Vanilla Kernel?
Is this replacing something customised in unraid and if so, what features might be affected?

3. Implemented in unRAID?
This is all implemented in unRAID, right? No need for a developer system?

4. v5 equivalents?
What should I be looking for to do this on 5 (when stable)? What versions of what have been updated?

Appreciate patience with Linux newbie

Peter

gfjardim:

--- Quote from: meep on February 12, 2011, 04:25:36 PM ---[..]
As someone who can follow directions well but sometimes lacks the Linux savvy to understand what's going on, a couple of questions;
[..]

--- End quote ---

1) It may survive some unRAID updates, but it's the same problem that afflicts VMware, if the kernel is changed in the update, you may have to recompile the modules.

2) "Vanilla" is the source of the kernel from kernel.org. It has stock configurations, so it's supposed to be used by system builders, like Lime-Technology. In the guide, after replace the "original source" (stripped from the released version) with the "vanilla" one, we copy the md driver, the System.map and the build ".config" used by Tom to built unRAID, and apply it to the source before compile it. It's used only to make the headers necessary to compile the VBox modules, and is erased after a simple reboot, so it makes no permanent changes into the system.

3) Yes, in the guide we install all development packages needed to make the headers and compile the VBox modules, so there's no need to use a developer system. Most of the dependencies can be satisfied with unMENU gcc, perl and cpio packages, requiring only ncurses, patch and pkgtools.

4) You have to download the right vanilla source from kernel.org . In the shell, type "uname -r", and the kernel version needed is that before "-unRAID" prefix. You also have to download the equivalent packages for Slackware 13.1, that can be found here.

meep:
Excellent

I'm looking forward to getting my unRaid server doing more than just unRaid again and have taken a liking to VirtualBox recently.

Many thanks.

Peter

gfjardim:
If it helps, I made some very simple scripts to automate these jobs.

I use the first one to install and compile the headers. Note that all package versions are suitable for version 4.x of unRAID, but not for 5.x.

--- Quote ---#!/bin/bash
P="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"

[ ! -d "$P/packages" ] && mkdir $P/packages

cd $P/packages

[ ! -e "linux-2.6.32.9.tar.gz" ] && wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.9.tar.gz
[ ! -e "gcc-4.2.4-i486-1.tgz" ] && wget http://slackware.oregonstate.edu/slackware-12.2/slackware/d/gcc-4.2.4-i486-1.tgz
[ ! -e "glibc-2.7-i486-17.tgz" ] && wget http://slackware.oregonstate.edu/slackware-12.2/slackware/l/glibc-2.7-i486-17.tgz
[ ! -e "binutils-2.18.50.0.9-i486-1.tgz" ] && wget http://slackware.oregonstate.edu/slackware-12.2/slackware/d/binutils-2.18.50.0.9-i486-1.tgz
[ ! -e "make-3.81-i486-1.tgz" ] && wget http://slackware.oregonstate.edu/slackware-12.2/slackware/d/make-3.81-i486-1.tgz
[ ! -e "cxxlibs-6.0.9-i486-1.tgz" ] && wget http://slackware.oregonstate.edu/slackware-12.2/slackware/a/cxxlibs-6.0.9-i486-1.tgz
[ ! -e "pkgtools-12.1.0-noarch-7.tgz" ] && wget http://slackware.osuosl.org/slackware-12.2/slackware/a/pkgtools-12.1.0-noarch-7.tgz
[ ! -e "perl-5.10.0-i486-1.tgz" ] && wget http://slackware.osuosl.org/slackware-12.2/slackware/d/perl-5.10.0-i486-1.tgz
[ ! -e "cpio-2.5-i486-3.tgz" ] && wget http://slackware.osuosl.org/slackware-12.2/slackware/a/cpio-2.5-i486-3.tgz
[ ! -e "patch-2.5.4-i486-1.tgz" ] && wget http://slackware.osuosl.org/slackware-12.2/slackware/a/patch-2.5.4-i486-1.tgz
[ ! -e "ncurses-5.6-i486-3.tgz" ] && wget http://slackware.osuosl.org/slackware-12.2/slackware/l/ncurses-5.6-i486-3.tgz

installpkg *.tgz

cd /

mv /usr/src/linux /usr/src/linux_original

if [ ! -d "$P/headers" ]; then
   mkdir -p $P/headers
   tar -C $P/headers -zxvf $P/packages/linux-2.6.32.9.tar.gz
   cp -rf /usr/src/linux_original/* $P/headers/linux-2.6.32.9/
   cp -f /usr/src/linux_original/.config $P/headers/linux-2.6.32.9/
fi

ln -sf $P/headers/linux-2.6.32.9 /usr/src/linux
[ -e "/usr/include/linux" ] && mv /usr/include/linux /usr/include/linux_original
[ -e "/usr/include/asm-generic" ] && mv /usr/include/asm-generic /usr/include/asm-generic_original
[ -e "/usr/include/asm" ] && mv /usr/include/asm /usr/include/asm_original
ln -sf /usr/src/linux/include/asm-generic /usr/include/asm-generic
ln -sf /usr/src/linux/include/linux /usr/include/linux
ln -sf /usr/src/linux/arch/x86/include/asm /usr/include/asm
 
cd /usr/src/linux && make oldconfig && make
 

--- End quote ---

The second one I used to automate the package-making process:

--- Quote ---#!/bin/bash
P="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"

TMPDIR="$P/vbox_temp"

[ -d "$TMPDIR" ] && rm -rf $TMPDIR

mkdir $TMPDIR

cd $TMPDIR
cp --parents -rf /opt/VirtualBox $TMPDIR/
cp --parents -f /lib/modules/2.6.32.9-unRAID/misc/vboxdrv.ko $TMPDIR/
cp --parents -f /lib/modules/2.6.32.9-unRAID/misc/vboxnetadp.ko $TMPDIR/
cp --parents -f /lib/modules/2.6.32.9-unRAID/misc/vboxnetflt.ko $TMPDIR/
cp --parents -rf /etc/vbox $TMPDIR/
cp --parents -f /etc/udev/rules.d/10-vboxdrv.rules $TMPDIR/


mkdir $TMPDIR/install

cat >>$TMPDIR/install/doinst.sh << 'THE_END_OF_SCRIPT'
# Insert VBox modules on the kernel
insmod /lib/modules/2.6.32.9-unRAID/misc/vboxdrv.ko
insmod /lib/modules/2.6.32.9-unRAID/misc/vboxnetadp.ko
insmod /lib/modules/2.6.32.9-unRAID/misc/vboxnetflt.ko

# Create some necessary links
ln -sf /opt/VirtualBox/VBox.sh /usr/bin/VBoxHeadless
ln -sf /opt/VirtualBox/VBox.sh /usr/bin/VBoxManage
ln -sf /opt/VirtualBox/VBox.sh /usr/bin/VBoxSDL
ln -sf /opt/VirtualBox/VBox.sh /usr/bin/VBoxVRDP
ln -sf /opt/VirtualBox/VBox.sh /usr/bin/VirtualBox
ln -sf /usr/bin/VBoxHeadless /usr/bin/vboxheadless
ln -sf /usr/bin/VBoxManage /usr/bin/vboxmanage
ln -sf /usr/bin/VBoxSDL /usr/bin/vboxsdl
ln -sf /opt/VirtualBox/VBox.sh /usr/bin/vboxwebsrv

# Reload udev rules
udevadm control --reload-rules

# Link the configuration dir
[ ! -d "/boot/custom/vbox" ] && mkdir -p /boot/custom/vbox
ln -sf /boot/custom/vbox /root/.VirtualBox

# Auto-created rules
THE_END_OF_SCRIPT

cd $TMPDIR/ && makepkg ../VirtualBox-4.0.2-unRAID.tgz
rm -rf $TMPDIR


--- End quote ---

I hope it helps.

Navigation

[0] Message Index

[#] Next page

Go to full version