VirtualBox in unRAID


Recommended Posts

  • Replies 528
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • 2 weeks later...

VBoxManage list usbhost

returns "none" as in no devices so maybe there is a permissions issue somewhere.

 

The root account needs to be part of the vboxusers group.  After a bunch of messing around I was able to get it to work after taking the following steps

 

Rather than permanently altering the groups on my boot device (as I manage a few unRAID installs, and use a common flash configuration) I added the following to /boot/config/go :

 

#Add vboxusers for USB support under virtualbox

groupadd vboxusers

usermod -aG vboxusers root

usermod -aG vboxusers nobody

 

I think this probably limited to my system, but even if I add those commands I cannot access my USB devices until I insert an additional USB device into my unRAID server (and for whatever reason my unRAID box will fail to boot if any other bootable device is connected to it, it always seems to default to anything but my unRAID drive).  Once I insert a new USB device after a successful boot, I get the ability to attach USB devices to my virtual guests (even though I have a USB device already attached) but I have to restart the virtualbox services (at least as far as I can tell).  I won't need USB access frequently, so this approach will work for me.

 

I created a script to allow me to access my usb devices after I attach a new device.  Here's how it goes

 

#Kill running virtualbox hosts:

nohup VBoxManage controlvm "XPProper" savestate >/dev/null 2>&1 &

nohup VBoxManage controlvm "Win7test" savestate >/dev/null 2>&1 &

 

#Kill virtualbox services

kill $(pidof vboxwebsrv)

kill $(pidof VBoxXPCOMIPCD)

kill $(pidof VBoxSVC)

kill $(pidof vboxwebsrv)

kill $(pidof php-cgi)

 

#Wait for things to die

sleep 10

 

#restart web services allowing USB access - Running this should start all the previously killed services/commands with the exception of starting the running VMs

vboxwebsrv -H 0.0.0.0 >/dev/null 2>&1 &

 

In attempting to resolve the problem I upgraded to the latest version, which works well following Dase's instructions (with modifications to build the latest packagest etc).  found here http://lime-technology.com/forum/index.php?topic=10978.msg158011#msg158011

Link to comment
  • 1 month later...

Hi all - I'm running a Win7 VM with iTunes which is integrated into my home automation system.

 

My motherboard has AC887 audio which is enabled - yet the VM (set to output audio to the windows client only) does not output via the unraid motherboard's  built in audio.

 

Is there a driver included for realtek AC887 audio in unraid 5 rc3 and if not is there a way to add one other than compiling my own kernel?

 

Alternatively, is a USB soundblaster the best approach? I have the extension pack so assume the vm can access it?

 

Thanks,

 

Alex

Link to comment
  • 3 weeks later...

Ran into a problem getting things working with v5.0-rc4 and wanted to share how I got things working with VirtualBox-4.1.18-78361-Linux_x86.run

 

I used the scripts on the wiki with the only changes being pointing the kernel source to the v3.0 url as others have noted and bumping the version number in the package making script.

 

The problem is that the kernel modules used by VirtualBox were not being built, so nothing worked. To fix this, I did the following:

 

rm /lib/modules/3.0.33-unRAID/build
rm /lib/modules/3.0.33-unRAID/source
ln -s /usr/src/linux /lib/modules/3.0.33-unRAID/build
ln -s /usr/src/linux /lib/modules/3.0.33-unRAID/source

 

Once these changes are made, the kernel modules get built and installed. Haven't setup anything beyond building the package yet, but the modules do show up in lsmod so hopefully I'm set.

 

Confirmed working well, first vm up and running!

Link to comment

5.0 scripts. Made one change to the first script to grab the correct kernel:

 

[ ! -e "linux-$KVERSION.tar.gz" ] && wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-$KVERSION.tar.gz

 

Then before installing VirtualBox, I ran the lines above to correct the lib/modules links.

 

The only other change from the wiki was in the second script, since I used the latest VirtualBox:

 

VBOXVERSION="4.1.18"

Link to comment

Can we all use a single pre-compiled package that someone can host (torrent, etc...) or is it hardware dependent (during compilation) or in violation of some license?

 

I don't see why everyone that wants to use Virtualbox needs to recompile his own package...

 

Link to comment

Can we all use a single pre-compiled package that someone can host (torrent, etc...) or is it hardware dependent (during compilation) or in violation of some license?

 

I don't see why everyone that wants to use Virtualbox needs to recompile his own package...

There is a license issue if you package up the extension pack together with the base. See https://www.virtualbox.org/wiki/Licensing_FAQ bullet point 7. I personally install the extension pack before packaging so it is ready to go, however I suppose you could theoretically package the base only and script the extension pack install every boot. Beyond that, I think the only requirement would be a different base package for each kernel revision, so 4.7 would need a package, 5.xx would need several different packages, I haven't kept up with what's been changed with each point upgrade through the betas and rcs.

Link to comment
  • 2 weeks later...

I am having some issues...  I am following the steps on the wikki about getting this VirtualBox installed on my unRAID 4.7 box.  After all the attempts and errors I am getting, I think it is the way I am copying the code and pasting it in, to make up the scripts.  I tried the individual steps, typing it all out, but even the doinst.sh file I make (by copying the text and pasting in) gives errors.  I have tried this on a clean, basic, new 4.7 raid install on another pc, and have the exact same outcome.

 

Could someone give me the steps to making these script files, so I know if I am doing them wrong.  I have to be......

 

Also when I create the script files, i give them the extension .sh as I am assuming that is what it is supose to be.

 

It has issues with the script right from the getgo, as it has issues with the first part..

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

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

cd $P/packages

 

basically says it can't create the directory/doesn't exsist....  where is it trying to create the packages directory exaclty???

 

[ ! -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

 

with downloading the files... it seems it connects/finds the file, but then doesn't download and gives a 404 error...  The files are there online, as I can download them on my PC using the links.

 

There is more errors I get from the rest of the code, but if I can't get past the first part, then no sense worrying about the rest.

 

Is anyone able to help?  It must be something I'm doing, as it seems to work for several other people.  Or is there steps that should be done before doing the steps in the wiki (http://lime-technology.com/wiki/index.php/Installing_VirtualBox_in_unRAID) on this...?

 

it's unRAID 4.7

uname -r gives..  2.6.32.9-unRAID

 

Thanks in advance,

 

Pete

(a frustrated individual, with little hair left....  :-[ )

Link to comment

I'm not an expert but for the sake of your hair I'll give it a shot. I think the script is trying to create the "packages" directory in whatever directory you're running the script (preferably a folder on the cache drive). I don't think the scripts need a .sh extension (mine don't have it). They do need to be executable (use chmod). Also take a look at the post by Dace on this page http://lime-technology.com/forum/index.php?topic=10978.135. It helped me out quite a bit. I've attached a zip file with the two scripts. If these work there is probably an issue with how you're creating the scripts. Cutting and pasting can be problematic if you're doing it on a windows machine. Good luck.

vboxscripts.zip

Link to comment

THanks,

 

Those sacripts are for UnRAID 5 but I modified it.  When I install the VirtualBox file (from the section Installing VirtualBox) , I get some errors (like "ln: creating symbolic link '/usr/share/pixmaps/virtualbox.png' : no such file or directory ) I get a few of these that are similar just different files/locations in this share directory.  Is this normal or is this a bad thing?

 

Thanks again,

 

Pete

Link to comment

Several people have asked in the forums for anyone to post a compiled package for VirtualBox. I don't have a test machine to setup various versions of UnRAID, but here is what I have for my version (5 beta 11). I did NOT compile with the extension pack, so I *think* this is OK to post.

 

[glow=red,2,300]*** Use at your own risk. I will try to keep an eye on this forum to help, but offer no guarantee. If this does not work for you, you may have to compile your own. ***[/glow]

 

Here is what I have to hopefully shorten the process (including phpvirtualbox):

 

I used SimpleFeature web server & plugin from http://code.google.com/p/unraid-simplefeatures/downloads/list

I set this to use /mnt/cache/.custom/www  (my cache drive) as my data directory & picked 8084 for the listening port (http://tower:8084 to test).

 

The extension pack for VirtualBox can be found on the page  https://www.virtualbox.org/wiki/Downloads

Or direct link: http://download.virtualbox.org/virtualbox/4.1.18/Oracle_VM_VirtualBox_Extension_Pack-4.1.18-78361.vbox-extpack

I downloaded this to my /boot/packages/ directory.

 

This is a link to my Public folder for VirtualBox compiled for unRAID on my SkyDrive. The files I compiled (no extension pack installed at this point). I am using the  file vbox-4.1.18-unRAID-2.6.37.6.tgz for VirtualBox 4.1.18 on unRAID 5 beta 11 successfully. I placed this tgz file under /boot/packages/

 

From http://code.google.com/p/phpvirtualbox/downloads/list I downloaded phpvirtualbox-4.1-7.zip to my Windows computer & extracted it to /mnt/cache/.custom/www (the data directory for my SimpleFeatures web plugin).

 

Last I added these lines to my /boot/config/go file:

# Start VirtualBox
installpkg /boot/packages/VirtualBox-4.1.8-unRAID.tgz
vboxwebsrv -b -H 127.0.0.1 --logfile /dev/null >/dev/null
VBoxManage extpack install /boot/packages/Oracle_VM_VirtualBox_Extension_Pack-4.1.18-78361.vbox-extpack

 

Each reboot installs the VirtualBox tgz package, starts the webserver & then adds the extension pack.

 

Instead of rebooting, you can run these lines from the go file produce this output:

root@tower:~# installpkg /boot/packages/VirtualBox-4.1.8-unRAID.tgz
Verifying package VirtualBox-4.1.8-unRAID.tgz.
Installing package VirtualBox-4.1.8-unRAID.tgz:
PACKAGE DESCRIPTION:
Executing install script for VirtualBox-4.1.8-unRAID.tgz.
Package VirtualBox-4.1.8-unRAID.tgz installed.

root@tower:~# vboxwebsrv -b -H 127.0.0.1 --logfile /dev/null >/dev/null
Oracle VM VirtualBox web service version 4.1.18
(C) 2005-2012 Oracle Corporation
All rights reserved.
root@tower:~# VBoxManage extpack install /boot/packages/Oracle_VM_VirtualBox_Extension_Pack-4.1.18-78361.vbox-extpack
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Successfully installed "Oracle VM VirtualBox Extension Pack".
root@tower:~# 

 

Pointing my Windows machine's Firefox web browser to http://tower:8084 takes me to the web interface for phpVirtualBox & allows me to login with username / password of admin / admin

 

*Edit on Aug. 3, 2012 to change link from single file to my Public folder. This will allow me to store & share multiple versions.

Link to comment

Several people have asked in the forums for anyone to post a compiled package for VirtualBox. I don't have a test machine to setup various versions of UnRAID, but here is what I have for my version (5 beta 11). I did NOT compile with the extension pack, so I *think* this is OK to post.

This is great! I'm glad someone stepped up to the plate with this.

 

Could you please post the results of

uname -r

on your system?

 

I suspect that anyone running an unraid version with the same uname -r results should be able to use this package without issue. I don't know which versions of unraid use which kernel, so if we have the kernel version for your build it would be simple for someone to check their version to see if it matches.

Link to comment

Could you please post the results of

uname -r

on your system?

 

I suspect that anyone running an unraid version with the same uname -r results should be able to use this package without issue. I don't know which versions of unraid use which kernel, so if we have the kernel version for your build it would be simple for someone to check their version to see if it matches.

 

It got lost in the huge post:

This is the file I compiled (no extension pack installed at this point) & am using successfully:

SkyDrive link to VirtualBox 4.1.8.tgz compiled on UnRAID 5 beta 11 with kernel 2.6.37.6-unRAID. I placed this tgz file under /boot/packages/

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.