VirtualBox in unRAID


Recommended Posts

Any news on this coming to the package manager? Or is it fairly simple to setup using the scripts?

 

It is on my list to look at, but it probably won't happen for a little while yet.  I am working on updating the Airvideo package so that it works properly with the new stuff it needs.

Link to comment
  • Replies 528
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

You can either start up you Virtual Machine using:

 

VBoxManage startvm - http://www.virtualbox.org/manual/ch08.html#vboxmanage-startvm

or

VBoxHeadless - http://www.virtualbox.org/manual/ch07.html#vboxheadless (if you are just going to connect to it via remote desktop)

or

vboxtool - http://vboxtool.sourceforge.net/

 

but the more important issue is how to get the Virtual Machine turned off "properly"/"safely" once you shut down or restart your unRAID array?

 

There are at least 2 options that need to be looked at:

 

VBoxManage controlvm - http://www.virtualbox.org/manual/ch08.html#vboxmanage-controlvm

or (again)

vboxtool - http://vboxtool.sourceforge.net/ (which states that it does it automatically).

 

 

 

I had time to test this and have chosen:

nohup VBoxHeadless --startvm "Windows 7 Enterprise" --vrde=off >/dev/null 2>&1 &

for starting the VM in headless mode (will be controlling it via Remote Desktop or Logmein).

 

and

nohup VBoxManage controlvm "Windows 7 Enterprise" savestate >/dev/null 2>&1 &

for stopping the VM in save mode (something like suspend in windows - the machine state is saved to a file - snapshot).

 

When resuming the VM with VBoxHeadless the saved state is resumed.

 

Remaining issue - How can I add the save command to the server powerdown script? ???

Will unRAID v5 have the option (GUI) to add additional functionality (commands) to the powerdown script? ???

 

Note:

I just realised that by installing Logmein on the VM I can actually access and control the unRAID server the VM is running on... :o

Which removes the need for Dynamic DNS package I was contemplating on using.

 

Link to comment

Remaining issue - How can I add the save command to the server powerdown script? ???

Will unRAID v5 have the option (GUI) to add additional functionality (commands) to the powerdown script? ???

anyone know how I can do this in current unRAID system?

 

Link to comment

In v5.x you can try edit the script "/usr/local/sbin/emhttp_event" with something like this :

 

echo -e "case \"\$1\" in\n\

    'disks_mounted')\n\

        nohup VBoxHeadless --startvm "Windows 7 Enterprise" --vrde=off >/dev/null 2>&1 &\n\

    ;;\n\

    'unmounting_disks')\n\

        nohup VBoxManage controlvm "Windows 7 Enterprise" savestate >/dev/null 2>&1 &\n\

    ;;\n\

esac">>/usr/local/sbin/emhttp_event

 

Link to comment

Does anyone know what would happen to the virtualbox machines if the process is just terminated by the unmenu shutdown command? I seem to remember somebody saying that shutdown script first tries to terminate things nicely, then kills them. I have multiple vbox machines I'm playing with (not simultaneously) and it would be kind of a pain to remember to update the shutdown script to kill each instance. Is there a command that would ask all possible vbox machines to suspend instead of calling them all out one by one? I'm currently managing them via phpvirtualbox, so it would be nice to know an unattended shutdown won't mess up a vbox machine I've currently got open.

 

I suppose I could install apcupsd on each vbox machine and set the shutdown to occur a couple minutes sooner than the unraid box.

Link to comment

I gave a try to virtualbox.

 

I wasn't able to run it under unRAID 4.5.1

So I upgrade to 4.7.

it did work. Installation was OK and I was able to configure phpvbox.

Thanx for the guide, by the way.

 

BUT it is extremely slow. In fact, it is 100 X slower than vmware.

I can't figure why.

 

I'm back to vmware for now but i'll try again when i'll have  some spare time.

 

:)

 

 

Link to comment

The easiest way to run phpvirtualbox is to install unRAID-Web package from unMENU and then, in the "Personal Webserver Setup" menu, choose the path of the extracted phpvirtualbox files, pick a non-used port, save the configuration and restart the webserver.

 

You need to set the authentication mode of Vbox webserver to null:

VBoxManage setproperty websrvauthlibrary null

 

And you will need to launch the vboxwebserver:

vboxwebsrv -b -H <ip of unRAID> --logfile /dev/null >/dev/null

 

I could use a little help with the phpvirtualbox part....

 

I have phpvirtualadmin @ "/boot/packages/phpvirtualbox/" and have setup the webserver on port 82.

 

I ran these commands:

VBoxManage setproperty websrvauthlibrary null
vboxwebsrv -b -H 10.10.1.122 --logfile /dev/null >/dev/null

 

When I go to http://tower:82 I get a popup that says

An unknown PHP error occurred. This is most likely a syntax error in config.php in phpVirtualBox's folder.
The most common errors are an unclosed quote or a missing semicolon in a configuration item that has been entered 
(e.g. location, username, or password). Depending on your PHP configuration, navigating directly to config.php 
in your web browser may display the PHP error message. If find that this is not the case, or have no idea 
what this error message means, please raise the issue at http://code.google.com/p/phpvirtualbox/issues/list

 

So I go to http://tower:82/config.php and get a "500 - Internal Server Error"

 

In config.php there is this:

/* Username / Password for system user that runs VirutalBox */
var $username = 'ian';
var $password = 'password';
var $location = 'http://10.10.1.122:18083/';

 

I changed the IP address to match my server, but the username and password? What's up with those? Do they matter since we set authentication to null?

 

Link to comment

VirtualBox Web Server "vboxwebsrv" continuously writes a log file to the "/boot/custom/vbox" folder on the flash drive whenever the WEBUI is open in your browser.

 

This can shorten the life of the flash drive.  :(

 

This is less serious than "transmission" flash write because it occurs only during WEBUI usage (configuration stage of virtual machine).

 

can the location of the vbox folder be modified easily? or does it need a .conf file solution like the equivalent transmission flash writing problem?

 

Link to comment

I'm using this syntax to launch the webserver:

 

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

 

It's working really well without any log.

 

Theone, try this sintax to launch wboxwebsrv, it won't write to the flash drive.

 

don't you also need the -b option for running in background ?

 

Link to comment

I'm using this syntax to launch the webserver:

 

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

 

It's working really well without any log.

 

Theone, try this sintax to launch wboxwebsrv, it won't write to the flash drive.

 

don't you also need the -b option for running in background ?

 

 

The -b option is the one that write logs into the flash drive, the "&" in the end "demonizes" the service.

Link to comment

Can anyone assist with phpvirtualbox????

 

Have you done this part?

The easiest way to run phpvirtualbox is to install unRAID-Web package from unMENU and then, in the "Personal Webserver Setup" menu, choose the path of the extracted phpvirtualbox files, pick a non-used port, save the configuration and restart the webserver.

 

IIRC, after I did that and launched phpvbox for the first time, it asked me to create the config.php.  I think I just copied config.php-example to config.php.  After that it seems to start.

 

Sorry man, my recall superpowers suck.  But I hope it puts you in the right track.  I can get more information once I get home.

Link to comment

My box is an old p4 - probably not capable...

 

I have the same problem with phpvirtualbox my AMD 4050e/2GB system. Not a powerful machine but I wonder if memory is the issue. In the end I configured a VM using terminal. That worked but I would still like to get the web configuration method working.

Link to comment

Will Virtualbox work with the new Beta7 kernel or will it need to be recompiled with a new script?

 

 

You will need to recompile with a new script:

 

#!/bin/bash
P="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
KVERSION=`uname -r | cut -d"-" -f1`
KDIR="/usr/src/$(uname -r)"

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

cd $P/packages

[ ! -e "linux-$KVERSION.tar.gz" ] && wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-$KVERSION.tar.gz
[ ! -e "gcc-4.4.4-i486-1.txz" ] && wget http://slackware.osuosl.org/slackware-13.1/slackware/d/gcc-4.4.4-i486-1.txz
[ ! -e "glibc-2.11.1-i486-3.txz" ] && wget http://slackware.osuosl.org/slackware-13.1/slackware/l/glibc-2.11.1-i486-3.txz
[ ! -e "binutils-2.20.51.0.8-i486-1.txz" ] && wget http://slackware.osuosl.org/slackware-13.1/slackware/d/binutils-2.20.51.0.8-i486-1.txz
[ ! -e "make-3.81-i486-1.txz" ] && wget http://slackware.osuosl.org/slackware-13.1/slackware/d/make-3.81-i486-1.txz
[ ! -e "cxxlibs-6.0.13-i486-2.txz" ] && wget http://slackware.osuosl.org/slackware-13.1/slackware/a/cxxlibs-6.0.13-i486-2.txz
[ ! -e "perl-5.10.1-i486-1.txz" ] && wget http://slackware.osuosl.org/slackware-13.1/slackware/d/perl-5.10.1-i486-1.txz
[ ! -e "patch-2.5.4-i486-1.txz" ] && wget http://slackware.osuosl.org/slackware-13.1/slackware/a/patch-2.5.4-i486-1.txz
[ ! -e "ncurses-5.7-i486-1.txz" ] && wget http://slackware.osuosl.org/slackware-13.1/slackware/l/ncurses-5.7-i486-1.txz
[ ! -e "mpfr-2.4.2p03-i486-1.txz" ] && wget http://slackware.osuosl.org/slackware-13.1/slackware/l/mpfr-2.4.2p03-i486-1.txz
[ ! -e "gcc-g++-4.4.4-i486-1.txz" ] && wget http://slackware.osuosl.org/slackware-13.1/slackware/d/gcc-g++-4.4.4-i486-1.txz

installpkg *.t*z

rm /usr/src/linux
ln -sf $P/headers/linux-$KVERSION /usr/src/linux

if [ ! -d "$P/headers" ]; then
        mkdir -p $P/headers
        tar -C $P/headers -zxvf $P/packages/linux-$KVERSION.tar.gz
        find $KDIR -type f -exec cp --parents '{}' /usr/src/linux/ \;
fi

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

Link to comment

Does anyone want to work on a legit wiki page with instructions for this? and keep that updated instead of a thread that we have to dig through to find information? - like that script looks awesome, but I have to still go back and search for where to find the packages... etc etc.

Link to comment

Does anyone want to work on a legit wiki page with instructions for this? and keep that updated instead of a thread that we have to dig through to find information? - like that script looks awesome, but I have to still go back and search for where to find the packages... etc etc.

 

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

 

8)

 

WOW. I'll give it a shot when I get home (next week)

 

 

Link to comment

Just upgraded to 5.0b7 and thought it was time to give vbox a try after the great wiki article made the info more accessible. After a few bumbs i managed to create the package, but when trying to run it (even after reboot) i get the following errors. Not sure if they are critical or not, or even if virtual box will work despite the errors. Anyone got any ideas?

 

root@Tower:/boot/packages# installpkg VirtualBox-4.0.8-unRAID.tgz

Verifying package VirtualBox-4.0.8-unRAID.tgz.

Installing package VirtualBox-4.0.8-unRAID.tgz:

PACKAGE DESCRIPTION:

Executing install script for VirtualBox-4.0.8-unRAID.tgz.

insmod: error inserting '/lib/modules/2.6.37.6-unRAID/misc/vboxdrv.ko': -1 Invalid module format

insmod: error inserting '/lib/modules/2.6.37.6-unRAID/misc/vboxnetadp.ko': -1 Invalid module format

insmod: error inserting '/lib/modules/2.6.37.6-unRAID/misc/vboxnetflt.ko': -1 Invalid module format

Package VirtualBox-4.0.8-unRAID.tgz installed.

 

When trying to run a VBoxManage command i get the following error:

WARNING: The vboxdrv kernel module is not loaded. Either there is no module

        available for the current kernel (2.6.37.6-unRAID) or it failed to

        load. Please recompile the kernel module and install it by

 

          sudo /etc/init.d/vboxdrv setup

 

        You will not be able to start VMs until this problem is fixed.

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.