VirtualBox in unRAID


Recommended Posts

I'd like to say thanks to everybody contributing to this thread.  I had my old server die on me (very old hardware) and built a new one powerful enough to run VirtualBox.  The scripts on the first page worked like a charm and I now have VirtualBox 4.0.6 running a few VMs and am able to retire 2 other PCs.  This is excellent. 

The server is running faster then ever, and the VMs are also very fast, thanks to being migrated to modern hardware.  I used CloneVDI to migrate old windows machines into VirtualBox and had no problems anywhere (that were not addressed in this thread).

 

The only thing that might be pointed out is after running the first script, you should run VirtualBox-xxxx.run to install VirtualBox.  Then run the second script to create the package that will be reinstalled on startup.  Then just put vboxmanage startvm command in the go script for each VM that need to autostart.

 

Now the only thing left to do is get unraid to run a script when I press stop so I can execute 'vboxmanage controlvm savestate' for my vm's so they release their hold on the disks.  Any ideas here?

 

kg

Link to comment
  • Replies 528
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • 2 weeks later...

I ran both script and when I run "installpkg VirtualBox-4.0.2-unRAID.tgz"

I get the following:

Verifying package VirtualBox-4.0.2-unRAID.tgz.
Installing package VirtualBox-4.0.2-unRAID.tgz:
PACKAGE DESCRIPTION:
Executing install script for VirtualBox-4.0.2-unRAID.tgz.
insmod: can't read '/lib/modules/2.6.32.9-unRAID/misc/vboxdrv.ko': No such file or directory
insmod: can't read '/lib/modules/2.6.32.9-unRAID/misc/vboxnetadp.ko': No such file or directory
insmod: can't read '/lib/modules/2.6.32.9-unRAID/misc/vboxnetflt.ko': No such file or directory
ln: creating symbolic link `/root/.VirtualBox/vbox': Operation not permitted
Package VirtualBox-4.0.2-unRAID.tgz installed.

 

and when I run:

VBoxManage setproperty websrvauthlibrary null

vboxwebsrv -b -H 127.0.0.1 --logfile /dev/null >/dev/null

I get "command not found" for both.

 

What is wrong?

Link to comment

I ran both script and when I run "installpkg VirtualBox-4.0.2-unRAID.tgz"

I get the following:

Verifying package VirtualBox-4.0.2-unRAID.tgz.
Installing package VirtualBox-4.0.2-unRAID.tgz:
PACKAGE DESCRIPTION:
Executing install script for VirtualBox-4.0.2-unRAID.tgz.
insmod: can't read '/lib/modules/2.6.32.9-unRAID/misc/vboxdrv.ko': No such file or directory
insmod: can't read '/lib/modules/2.6.32.9-unRAID/misc/vboxnetadp.ko': No such file or directory
insmod: can't read '/lib/modules/2.6.32.9-unRAID/misc/vboxnetflt.ko': No such file or directory
ln: creating symbolic link `/root/.VirtualBox/vbox': Operation not permitted
Package VirtualBox-4.0.2-unRAID.tgz installed.

 

and when I run:

VBoxManage setproperty websrvauthlibrary null

vboxwebsrv -b -H 127.0.0.1 --logfile /dev/null >/dev/null

I get "command not found" for both.

 

What is wrong?

Easy, the version of VirtualBox you are attempting to install was compiled for an older version of Linux.

unRAID 5.0b6 uses 2.6.36.2-unRAID, not 2.6.32.9-unRAID as in the unRAID 4.7 version.

 

Try this on your system.

ls /lib/modules

 

 

Link to comment

Joe, assuming he is using v4.7 as in his signature, I would suggest that he reboot the system and try all over again.

 

For those searching for v5.x scripts, I attached them.

 

Thank you both Joe and gfjardim.

 

I am testing the virtualbox on a test server 5.0beta6a.

 

I will try the new scripts.

 

Link to comment

Hey guys,

 

I just wanted to share some experience with a problem I had with regards to VirtualBox and Transmission playing in the same sandbox.

 

Sometime after installing VBox, I could no longer start transmission-daemon, and kept getting this error message on my syslog:

mmm dd hh:mm tower transmission-daemon: transmission-daemon Failed to daemonize: No such device (daemon.c:474)

 

Eventually I determined that this line in my go script was causing it:

vboxwebsrv -b -H 127.0.0.1 --logfile /dev/null >/dev/null

 

I changed it to this and both daemons seem to be playing nice:

vboxwebsrv -b -H 127.0.0.1 >/dev/null

 

My question would be:  Are there any repercussions with not stating the logfile?  Would it be better if I let it create a logfile in a non-array disk?

 

Some background on my setup, if it makes any difference.  I'm running unRAID 4.5.6 and Transmission 2.11 installed on top of the 2.0.1 package from unMENU.  Transmission seems to run okay if it's started before vboxweb but I wanted to be able to restart it without rebooting the server.

 

-fb

Link to comment

I have run the v5 scripts but get errors - more accurately:

 

tar: linux-2.6.36.2/arch/microblaze/boot/dts/system.dts: Cannot create symlink to `../../platform/generic/system.dts': Operation not permitted
tar: Exiting with failure status due to previous errors
cp: cannot create symbolic link `/boot/scripts/headers/linux-2.6.36.2/linux': Operation not permitted
mv: cannot create symbolic link `/usr/include/linux_original/linux': Operation not permitted
mv: cannot create symbolic link `/usr/include/asm-generic_original/asm-generic': Operation not permitted
mv: cannot create symbolic link `/usr/include/asm_original/asm': Operation not permitted
ln: creating symbolic link `/usr/include/asm-generic/asm-generic': Operation not permitted
ln: creating symbolic link `/usr/include/linux/linux': Operation not permitted
ln: creating symbolic link `/usr/include/asm/asm': Operation not permitted
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
In file included from /usr/include/asm/sigcontext.h:5,
                 from /usr/include/bits/sigcontext.h:28,
                 from /usr/include/signal.h:339,
                 from /usr/include/sys/wait.h:31,
                 from scripts/basic/docproc.c:46:
/usr/include/linux/types.h:13:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"

 

I am testing it on a virtualbox running under windows.

attached are the scripts' log files.

Virtualbox_v5_scripts_logs.zip

Link to comment

I have run the v5 scripts but get errors - more accurately:

 

tar: linux-2.6.36.2/arch/microblaze/boot/dts/system.dts: Cannot create symlink to `../../platform/generic/system.dts': Operation not permitted
tar: Exiting with failure status due to previous errors
cp: cannot create symbolic link `/boot/scripts/headers/linux-2.6.36.2/linux': Operation not permitted
mv: cannot create symbolic link `/usr/include/linux_original/linux': Operation not permitted
mv: cannot create symbolic link `/usr/include/asm-generic_original/asm-generic': Operation not permitted
mv: cannot create symbolic link `/usr/include/asm_original/asm': Operation not permitted
ln: creating symbolic link `/usr/include/asm-generic/asm-generic': Operation not permitted
ln: creating symbolic link `/usr/include/linux/linux': Operation not permitted
ln: creating symbolic link `/usr/include/asm/asm': Operation not permitted
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
In file included from /usr/include/asm/sigcontext.h:5,
                 from /usr/include/bits/sigcontext.h:28,
                 from /usr/include/signal.h:339,
                 from /usr/include/sys/wait.h:31,
                 from scripts/basic/docproc.c:46:
/usr/include/linux/types.h:13:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"

 

I am testing it on a virtualbox running under windows.

attached are the scripts' log files.

That is easier.  The /boot file system is a "fat" file system ans symbolic links are not supported, just like it says.
Link to comment

OK, so I tried running the v4 scripts on my production server  :'( and got the following on the 2nd script:

cp: failed to get attributes of `/opt': No such file or directory
cp: failed to get attributes of `/lib/modules/2.6.32.9-unRAID/misc': No such file or directory
cp: failed to get attributes of `/lib/modules/2.6.32.9-unRAID/misc': No such file or directory
cp: failed to get attributes of `/lib/modules/2.6.32.9-unRAID/misc': No such file or directory
cp: cannot stat `/etc/vbox': No such file or directory
cp: cannot stat `/etc/udev/rules.d/10-vboxdrv.rules': No such file or directory

Slackware package maker, version 2.1.

Searching for symbolic links:

No symbolic links were found, so we won't make an installation script.
You can make your own later in ./install/doinst.sh and rebuild the
package if you like.

This next step is optional - you can set the directories in your package
to some sane permissions. If any of the directories in your package have
special permissions, then DO NOT reset them here!

Would you like to reset all directory permissions to 755 (drwxr-xr-x) and
directory ownerships to root.root ([y]es, [n]o)? y

mode of `.' retained as 0755 (rwxr-xr-x)
mode of `./etc' retained as 0755 (rwxr-xr-x)
mode of `./etc/udev' retained as 0755 (rwxr-xr-x)
mode of `./etc/udev/rules.d' retained as 0755 (rwxr-xr-x)
mode of `./lib' retained as 0755 (rwxr-xr-x)
mode of `./lib/modules' retained as 0755 (rwxr-xr-x)
mode of `./lib/modules/2.6.32.9-unRAID' retained as 0755 (rwxr-xr-x)
mode of `./install' retained as 0755 (rwxr-xr-x)
ownership of `.' retained as root:root
ownership of `./etc' retained as root:root
ownership of `./etc/udev' retained as root:root
ownership of `./etc/udev/rules.d' retained as root:root
ownership of `./lib' retained as root:root
ownership of `./lib/modules' retained as root:root
ownership of `./lib/modules/2.6.32.9-unRAID' retained as root:root
ownership of `./install' retained as root:root

Creating tar file VirtualBox-4.0.2-unRAID.tar...

./
etc/
etc/udev/
etc/udev/rules.d/
lib/
lib/modules/
lib/modules/2.6.32.9-unRAID/
tar-1.13: VirtualBox-4.0.2-unRAID.tar is the archive; not dumped
install/
install/doinst.sh

Gzipping VirtualBox-4.0.2-unRAID.tar...
Renaming VirtualBox-4.0.2-unRAID.tar.gz to VirtualBox-4.0.2-unRAID.tgz...
Moving VirtualBox-4.0.2-unRAID.tgz to .....
Package creation complete.

 

the listed directories indeed don't exist - where should they have come from?

 

Link to comment

In the first case, these scripts are intended to be run from a disk in the array, commonly the cache drive  (e.g. /mnt/cache or /mnt/disk1), because the flash drive is formated in FAT.

 

In the second problem, are you sure that Vbox installed successfully? Because neither scripts install Vbox, the first one only set the compilation environment and the second one only creates the package, you have to install Vbox yourself between the scripts.

Link to comment

In the first case, these scripts are intended to be run from a disk in the array, commonly the cache drive  (e.g. /mnt/cache or /mnt/disk1), because the flash drive is formated in FAT.

 

In the second problem, are you sure that Vbox installed successfully? Because neither scripts install Vbox, the first one only set the compilation environment and the second one only creates the package, you have to install Vbox yourself between the scripts.

 

I am running them from the Cache drive.

 

I indeed missed out installation of Vbox. Does it matter which version? can I install the latest one 4.0.8?

 

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.

 

Cool cool.  I'll keep mine the way it is until I break something else then.

 

I indeed missed out installation of Vbox. Does it matter which version? can I install the latest one 4.0.8?

 

I installed 4.0.8 just fine.  There was no deviation from the procedure other than correctly naming the package the second script makes.

 

Link to comment

OK, got it running under unRAID v4.7  including the phpVirtualBox web interface.

 

I don't have a CD/DVD on my unRAID server.

I have an image (ISO) of the Windows 7 installation DVD.

 

Now... How do I install Windows 7?

 

edited:

OK I figured It out - point the CD/DVD storage device to the ISO file... SO OBVIOUS !?

now installing...

 

 

Another question:

 

How can I use the keyboard and mouse to do the setup ..?

I installed the "Oracle_VM_VirtualBox_Extension_Pack-4.0.8-71778.vbox-extpack" using:

vboxmanage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.0.0-69151.vbox-extpack

which should have enabled the console (currently grayed out) - but didn't.

 

Has anyone gotten the console to work?

Link to comment

To access the Virtual Machine it's easiest to use the Remote Desktop function of windows ... (on my iPhone I have Mocha RDP - also a lite version available)

 

I'll reinstall VirtualBox and check the options for adding the USB filter driver to a VM (under the USB section for the Virtual Machine I think)

 

on the to do list last time I looked they were working at adding VNC for ways to access the Virtual Machine's console.

 

Bobby

 

Here are the USB settings with a USB trackball keyboard attached

USBSettings.jpg.068ccc6ae9fca01d5d242be0cc02c701.jpg

Link to comment

Another question:

 

How can I use the keyboard and mouse to do the setup ..?

I installed the "Oracle_VM_VirtualBox_Extension_Pack-4.0.8-71778.vbox-extpack" using:

vboxmanage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.0.0-69151.vbox-extpack

which should have enabled the console (currently grayed out) - but didn't.

 

Has anyone gotten the console to work?

 

OK solved this:

1. stopped the VM

2. ran

VBoxManage modifyvm "VM name" --vrde on

 

3. restarted the VM

 

now console button is enabled and running.

 

Link to comment

Got this working in 5.0b6 thanks to all the tips here & now have SqueezeServer running in TinyXp VM (yeah!).

 

However.....

 

On reboot, neither unraid-web or virtualbox appear to be installed.

 

It's necessary for me to installpkg both (and VB pkg takes some time to install!).

 

Here's my go script:

 

#!/bin/bash
# Start the Management Utility
logger -t "$0[$$]"  "##### STARTING GO script. #####"
/usr/local/sbin/emhttp &
logger -t "$0[$$]"  "##### SETTING SYM LINKS. #####"
ln -s /mnt/cache/.Plex/Library /Library

ln -s /mnt/cache/.Plex/Library /root/Library

logger -t "$0[$$]"  "##### LOADING TO CONF. #####"
echo "/mnt/cache/.Plex" >> /etc/ld.so.conf
ldconfig
logger -t "$0[$$]"  "##### STARTING PLEX. #####"
cd /mnt/cache/.Plex/PlexMediaServer-v0.9.2.8-34480ac
#./start.sh >> /Library/Logs/Plex\ Media\ Server.log 2>&1 &
./start.sh

cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c 

vboxwebsrv -b -H 127.0.0.1 --logfile /dev/null >/dev/null

 

(please excuse the logger lines, I'm trying to debug)

 

Any advice?

 

Peter

 

Link to comment

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).

 

 

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.