VirtualBox in unRAID


Recommended Posts

Please try the new script posted above.

 

Are there any differences between the script above, and the 5.x script in the wiki article? Couldn't see any by glancing them.

 

No, the script on the Wiki is the last one I've posted, and it works with v5beta6 and v5beta7.

Link to comment
  • Replies 528
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

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)

 

Many thanks for this. This is a real nice piece of work and achievement for the community.

That's why I really like unRAID.

 

When I first followed your step-by-step instructions, I came across a difference when comparing them to

the helper scripts. It is, that the step-by-step instructions suggest to save the VBox package in /boot/custom/vbox,

where the package script will put it in /boot/config/vbox.

So, the questions goes out to the inventor: What's it going to be ;D

Link to comment

When I first followed your step-by-step instructions, I came across a difference when comparing them to

the helper scripts. It is, that the step-by-step instructions suggest to save the VBox package in /boot/custom/vbox,

where the package script will put it in /boot/config/vbox.

So, the questions goes out to the inventor: What's it going to be ;D

Which directory is prefered? Unmenu uses /boot/custom and SNAP uses /boot/config. Maybe it is wise leave the /boot/config only to unRAID core and /boot/custom to packages.

Link to comment

Which directory is prefered? Unmenu uses /boot/custom and SNAP uses /boot/config. Maybe it is wise leave the /boot/config only to unRAID core and /boot/custom to packages.

Yes, it is my opinion that ONLY unRAID should be using /boot/config.  SNAP's dev choose to use /boot/config

Link to comment

Which directory is prefered? Unmenu uses /boot/custom and SNAP uses /boot/config. Maybe it is wise leave the /boot/config only to unRAID core and /boot/custom to packages.

Yes, it is my opinion that ONLY unRAID should be using /boot/config.  SNAP's dev choose to use /boot/config

 

Thanks prostuff1, I've fixed the Wiki entry.

Link to comment

I have my virtualbox server in unRaid up and running thanks to you all, but I'm having some network issues with the guest OS that I was hoping someone had an answer. At random times a large network write operation will fail saying that the "delayed write failed". I googled, and found plenty of people with that issue on older versions of virtualbox, but nothing ongoing. I've tried a bunch of different combinations, with varying degrees of success, but nothing that works all the time. I've even managed to crash unRaid when I changed the network type to bridged instead of NAT. I've not tested to a machine external to unRaid, these failures are all occurring when writing to an unRaid user share from a guest XP virtualbox install.

Jun 18 02:04:48 AVFILES kernel: ------------[ cut here ]------------
Jun 18 02:04:48 AVFILES kernel: kernel BUG at drivers/md/unraid.c:435!
Jun 18 02:04:48 AVFILES kernel: invalid opcode: 0000 [#1] SMP 
Jun 18 02:04:48 AVFILES kernel: last sysfs file: /sys/devices/pci0000:00/0000:00:1c.3/0000:03:00.1/ide0/0.0/block/hda/stat
Jun 18 02:04:48 AVFILES kernel: Modules linked in: vboxnetflt vboxnetadp vboxdrv md_mod xor ide_gd_mod i2c_i801 i2c_core r8169 pata_jmicron jmicron ahci sata_mv
Jun 18 02:04:48 AVFILES kernel: 
Jun 18 02:04:48 AVFILES kernel: Pid: 9139, comm: VBoxHeadless Not tainted (2.6.32.9-unRAID # EP35-DS3R
Jun 18 02:04:48 AVFILES kernel: EIP: 0060:[<f83e0c1f>] EFLAGS: 00010286 CPU: 0
Jun 18 02:04:48 AVFILES kernel: EIP is at unraid_make_request+0x1d4/0x342 [md_mod]
Jun 18 02:04:48 AVFILES kernel: EAX: f65e9360 EBX: 00000001 ECX: 0000000b EDX: 00005555
Jun 18 02:04:48 AVFILES kernel: ESI: 00000000 EDI: f65e92c0 EBP: f2875cf8 ESP: f2875cb4
Jun 18 02:04:48 AVFILES kernel:  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Jun 18 02:04:48 AVFILES kernel: Process VBoxHeadless (pid: 9139, ti=f2874000 task=f59ff020 task.ti=f2874000)
Jun 18 02:04:48 AVFILES kernel: Stack:
Jun 18 02:04:48 AVFILES kernel:  f5903a80 00000001 f6e767e0 00000000 02f03ac0 00000000 02f03acc 00000000
Jun 18 02:04:48 AVFILES kernel: <0> f65e9360 f6e767e0 f5903f00 00000246 f5903a80 c13cdf8c f6c96660 00000008
Jun 18 02:04:48 AVFILES kernel: <0> f7562000 f2875d18 f83ddef7 f5903a80 00000001 00000000 f6c96660 00000008
Jun 18 02:04:48 AVFILES kernel: Call Trace:
Jun 18 02:04:48 AVFILES kernel:  [<f83ddef7>] ? md_make_request+0x83/0x8b [md_mod]
Jun 18 02:04:48 AVFILES kernel:  [<c1125b0f>] ? generic_make_request+0x1d6/0x211
Jun 18 02:04:48 AVFILES kernel:  [<c1089412>] ? bio_alloc_bioset+0x37/0x96
Jun 18 02:04:48 AVFILES kernel:  [<c1126d10>] ? submit_bio+0x96/0x9b
Jun 18 02:04:48 AVFILES kernel:  [<c104d931>] ? set_page_dirty_lock+0x2e/0x34
Jun 18 02:04:48 AVFILES kernel:  [<c108956b>] ? bio_set_pages_dirty+0x25/0x33
Jun 18 02:04:48 AVFILES kernel:  [<c108bb67>] ? dio_bio_submit+0x49/0x5b
Jun 18 02:04:48 AVFILES kernel:  [<c108bbae>] ? dio_send_cur_page+0x35/0x96
Jun 18 02:04:48 AVFILES kernel:  [<c108c823>] ? __blockdev_direct_IO+0x965/0xbb2
Jun 18 02:04:48 AVFILES kernel:  [<c104ee99>] ? pagevec_lookup_tag+0x1c/0x25
Jun 18 02:04:48 AVFILES kernel:  [<c10abd90>] ? reiserfs_direct_IO+0x32/0x37
Jun 18 02:04:48 AVFILES kernel:  [<c10af2cd>] ? reiserfs_get_blocks_direct_io+0x0/0x96
Jun 18 02:04:48 AVFILES kernel:  [<c1049c8f>] ? generic_file_aio_read+0xe8/0x51a
Jun 18 02:04:48 AVFILES kernel:  [<c106836f>] ? __slab_alloc+0x91/0x425
Jun 18 02:04:48 AVFILES kernel:  [<c109287a>] ? aio_rw_vect_retry+0x6a/0x12e
Jun 18 02:04:48 AVFILES kernel:  [<c1049ba7>] ? generic_file_aio_read+0x0/0x51a
Jun 18 02:04:48 AVFILES kernel:  [<c10932ae>] ? aio_run_iocb+0x55/0xc8
Jun 18 02:04:48 AVFILES kernel:  [<c1093a4b>] ? sys_io_submit+0x2ad/0x37d
Jun 18 02:04:48 AVFILES kernel:  [<c1002935>] ? syscall_call+0x7/0xb
Jun 18 02:04:48 AVFILES kernel: Code: 8d 44 07 30 89 45 dc 39 18 74 05 42 39 ca 7c ea 83 7d dc 00 75 04 0f 0b eb fe 8d 47 28 e8 88 f9 eb c8 8b 45 dc 83 78 0c 00 74 04 <0f> 0b eb fe 8b 55 dc 83 7a 10 00 74 04 0f 0b eb fe 83 7d c8 00 
Jun 18 02:04:48 AVFILES kernel: EIP: [<f83e0c1f>] unraid_make_request+0x1d4/0x342 [md_mod] SS:ESP 0068:f2875cb4
Jun 18 02:04:48 AVFILES kernel: ---[ end trace cff48deac87f8c18 ]---

That crash was generated when I tried to bridge the network adapter, or change the disk cache, I can't remember which.

 

I just generated the exact same crash by disabling the disk i/o cache in the phpvirtualbox settings and starting the vm.

 

It appears that the problem only occurs when using user shares, not disk shares. I can work around the problem to some extent, but it would be nice to solve it.

 

Scratch that. It just did the "delayed write failed" again writing directly to the disk share. It just seemed to take longer, and it wrote about 1GB before it failed.

Link to comment
  • 2 weeks later...

Well, since no one else seemed to have the same issues, I thought maybe it might be something unique to my setup. Turns out, it may have been. I installed 4.0.8, thinking I may as well use the latest version instead of the version shown in the tutorials. Now that 4.0.10 is out, I decided to try that, and what do you know, all my problems are gone.

 

So, for future reference, 4.0.8 may have issues with unraid, and 4.0.10 seems to be working well so far.

Link to comment
  • 4 weeks later...

Has anybody tried Virtualbox 4.1?  I made a package for it and have it running on my system without problems, but it seems to have broken phpVirtualbox.  So after updating that from the google site it's still not working (just displays "loading ..." for me).  Anybody else have problems or success with this version?

Link to comment

Has anybody tried Virtualbox 4.1?  I made a package for it and have it running on my system without problems, but it seems to have broken phpVirtualbox.  So after updating that from the google site it's still not working (just displays "loading ..." for me).  Anybody else have problems or success with this version?

How long ago did you get the phpVirtualbox update? Apparently 4.1-1b is very fresh, within the last 6 hours. I suspect there will be more updates as issues like this appear with the new build. I would appreciate it if you would keep us updated on your progress, as I am still having occasional network write failures.

Link to comment

The problem partly solved itself.  I did get the newest version of phpVirtualBox (4.1-1b currently) and now it works fine, but only in FireFox.  Doesn't work (for me) in IE.  So for me to get it working I needed to get the newest phpVirtualBox, remove the old version (dont indstall on top of it) and edit config.php to reflect my system.

To create the package of VirtualBox I used the scripts provided on the top of this thread.  Just replaced the version of VirtualBox.

 

Link to comment

I'll admit I have not read through this entire thread, but I just started setting up my first unRAID server (waiting for my first preclear to finish) and I had a few questions on using VirtualBox in an unRAID environment.

 

1. I have used VirtualBox in a windows environment, so is there an interface to change settings and setup your Virtual Machine once VirtualBox is installed?

 

2. Currently, I do remote connect to my windows box, and then I am able to run any of my VMs.  Is this possible in an unRAID environment?

 

Thanks!

Link to comment

After I install VirtualBox I get warnings that my vboxdrv module isn't loaded.  If I reboot and install my package I see errors like:

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

 

If I run dmesg I see the following in the log:

vboxdrv: version magic '2.6.39.3 SMP mod_unload 686 ' should be '2.6.39.3-unRAID SMP mod_unload CORE2 '

 

Any idea what I'm doing wrong?  When I do a make oldconfig I get asked a bunch of "new" questions.  Is that normal?  I just choose the defaults should I not?

 

Mike

Link to comment

It appears also that in the unraid 5 script the .config file doesn't get copied.  I think the pertenent line of the script is:

 

find $KDIR -type f -exec cp --parents '{}' /usr/src/linux/ \

 

My shell scripting isn't very good so I don't know exactly what the line above is doing.  I do know, however, that it isn't copying over the .config file.  Perhaps the following needs to be added to the script?

 

cp -f $KDIR/.config /usr/src/linux/

 

Doing another build now.  I've got my fingers crossed.

 

Mike

Link to comment

I am officially fixed and up and running with virtualbox on 5 beta 10.  Unless someone objects I'm going to update the wiki headers script with the changes I discussed above:

 

#!/bin/bash
P="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
KVERSION=`uname -r | cut -d"-" -f1`
KDIR="/usr/src/linux-$(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/ \;
       cp -f $KDIR/.config /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 && yes "" | make oldconfig && make

 

There is probably a way to fix the "find" command to include the .config file but I don't know find that well.  So perhaps this will work until someone finds a better fix.  I also updated the make oldconfig script to auto answer the questions that come up.  There aren't many of them but it may help eliminate confusion.

 

Mike

Link to comment

Sorry for the seemly basic question, but would VirtualBox in unRaid be a better(?) solution that what I'm currently doing, which is run ESXi, then have a VM for unRAID, one for Win7 & one for MythBuntu?

 

Reason I ask is, ESXi is kind of a hack w/ unRaid.  There is no real easy way to backup the VMs, so I used to run a WHS VM for local backups, and something got corrupted and the whole VM was lost.  If I spun my setup around and put unRaid down as the base (instead of ESXi), then put a W7 VM & WHS or MythBuntu VM on top, I could back up my VMs and hopefully the whole thing would be more stable.

 

What do you think?  Thanks in advance!

 

- Cha

Link to comment

Sorry for the seemly basic question, but would VirtualBox in unRaid be a better(?) solution that what I'm currently doing, which is run ESXi, then have a VM for unRAID, one for Win7 & one for MythBuntu?

 

Reason I ask is, ESXi is kind of a hack w/ unRaid.  There is no real easy way to backup the VMs, so I used to run a WHS VM for local backups, and something got corrupted and the whole VM was lost.  If I spun my setup around and put unRaid down as the base (instead of ESXi), then put a W7 VM & WHS or MythBuntu VM on top, I could back up my VMs and hopefully the whole thing would be more stable.

 

What do you think?  Thanks in advance!

 

- Cha

I run virtualbox on unraid, and I am very happy with the result. Since there is no swap partition and the unraid kernel is not built to use a swap partition I would recommend having ample ram. I run two vms right now without issue on my unraid. All my vmdk files are on a partition that sit outside the protected array. Furthermore, I looked into the whole esxi situation and you need very specific hardware which makes the results with esxi very unpredictable.

Link to comment

I run virtualbox on unraid, and I am very happy with the result. Since there is no swap partition and the unraid kernel is not built to use a swap partition I would recommend having ample ram. I run two vms right now without issue on my unraid. All my vmdk files are on a partition that sit outside the protected array. Furthermore, I looked into the whole esxi situation and you need very specific hardware which makes the results with esxi very unpredictable.

 

I wholeheartedly disagree.  Running Virtualbox on unRaid is a hack at best, while ESXi is designed precisely for the task at hand.  Given reasonable hardware, the results are VERY predictable.  Backing up the VM couldn't be simpler.  Turn the "power" off to the VM, browse to the VM in the datastor browser and export the VM as a file to wherever you'd like to keep it!  :o

Link to comment

I have 16 gigs of RAM, that should be fine for unRaid and one VM, correct? I am really betwixt and between on this one. ESXi still seems like a hack. VirtualBox may be a hack as well, but which is better:

- long term stability

- ability to recover after failure

- flexibility in configuration

 

Appreciate any inputs you have!

 

Sent from my DROIDX using Tapatalk

Link to comment

I have 16 gigs of RAM, that should be fine for unRaid and one VM, correct? I am really betwixt and between on this one. ESXi still seems like a hack. VirtualBox may be a hack as well, but which is better:

- long term stability

- ability to recover after failure

- flexibility in configuration

 

Appreciate any inputs you have!

 

Sent from my DROIDX using Tapatalk

 

16GB of RAM should be considered more than plenty in a home-server scenario.

Smaller VMs, like DNS/DHCP/FW or a simple DLNA server take less than 512MB

 

My top level criteria would be the "safety" of the unraid setup.

 

ESXi is a professional solution with a bare metal hypervisor.

With vmdirectpath and direct access to the drives from unraid, recovery of unraid should not be an issue.

You need a windoze box/VM to administer it.  :(

For vmdirectpath you need a mobo and CPU that support vt-d.

 

If you can provide all that, a setup is more 1,2,3 finished and less of a hack as with vbox on unraid.

 

For a low-end solution "bare-metal unraid" with vbox on top can be achieved with a small Atom build and

will satisfy the safety criteria as well.

Link to comment

Hello,

First of all, thanks for this great guide. I’m going to install VirtualBox on my unRAID server but I’m waiting for an additional RAM to be delivered. In the meantime I would be very thankful if you could answer some of my questions (sorry, linux newbie here).

 

1. Does VirtualBox write on flash drive very often? I know it was a problem for the Transmission package and I’ve read the whole thread and found that the web server causes a great number of writes , but if I’m not going to use it I won’t have to worry about my flash drive, right?

 

2. I have a spare HDD outside of the array that I want to use for non-unRAID purposes like VirtualBox. How should I modify the installation scripts so they use that drive for temporary installation files storage, etc.?

 

3. Do I need to mount that drive every time I reboot my server (after I create some virtual machines on it)? Because I know that every drive has its own name assigned (sda, sdb, etc.) but sometimes when I add additional drives those names change. unRAID seems to work with that just fine, but what will happen when I create virtual machine on my non-array drive, then I add a HDD to unRAID and it gets the non-array disk’s name? Will VirtualBox be able to recognize that and look for the virtual machine file on the proper drive?

 

4. Is there any “clean-up” procedure necessary after the installation? Will the kernel source, gcc, etc. be  removed automatically after the installation/reboot?

 

5. Do you think that 4GB RAM and 2.7GHz single core Sempron should be enough for unRAID, unmenu, cache_dirs and one VM – striped down Ubuntu with lxde working 24/7 (Transmission, jDownloader, maybe a lighttpd/php5/mysql server)? I can try to unlock a second core in my Sepron if that would make a noticeable difference.

 

6. How long does this whole procedure take time (without downloading)? Are we talking minutes or hours?

 

7. What about upgrading and uninstalling VirtualBox? Is it also that complicated?

 

8. And the most important one – is my data/unRAID configuration going to be safe during the installation. Should I be extra careful at any particular step?

 

Link to comment

Right I'll try to answer some of your questions.

 

1. Does VirtualBox write on flash drive very often? I know it was a problem for the Transmission package and I’ve read the whole thread and found that the web server causes a great number of writes , but if I’m not going to use it I won’t have to worry about my flash drive, right?

Vbox writes nothing to the flash drive, all VM's and therefor any reads / writes would be on a cache/snap drive.

 

2. I have a spare HDD outside of the array that I want to use for non-unRAID purposes like VirtualBox. How should I modify the installation scripts so they use that drive for temporary installation files storage, etc.?

Just point any paths that use cache drive to the location of your drive.

 

3. Do I need to mount that drive every time I reboot my server (after I create some virtual machines on it)? Because I know that every drive has its own name assigned (sda, sdb, etc.) but sometimes when I add additional drives those names change. unRAID seems to work with that just fine, but what will happen when I create virtual machine on my non-array drive, then I add a HDD to unRAID and it gets the non-array disk’s name? Will VirtualBox be able to recognize that and look for the virtual machine file on the proper drive?

The drive WILL need to be mounted every time as this is where the VM's will run from.

I personaly use the S.N.A.P. script to do this which opperates on a drive GUI or SN to mount the drive.

 

4. Is there any “clean-up” procedure necessary after the installation? Will the kernel source, gcc, etc. be  removed automatically after the installation/reboot?

I would recommend you use a dev or VM test system to do the actual compile.

No need to clean any mess up then and you wont potentialy screw up your live system

 

5. Do you think that 4GB RAM and 2.7GHz single core Sempron should be enough for unRAID, unmenu, cache_dirs and one VM – striped down Ubuntu with lxde working 24/7 (Transmission, jDownloader, maybe a lighttpd/php5/mysql server)? I can try to unlock a second core in my Sepron if that would make a noticeable difference.

My box runs 4GB RAM with a Sempron.

This runs unmenu, cache_dirs and vbox with a windows xp machine running uTorrent with no problems.

Please DO NOT attempt to unlock the second core on your CPU as its probbly locked for a very good reason and could cause instability in your system.

 

6. How long does this whole procedure take time (without downloading)? Are we talking minutes or hours?

The whole process probbly takes about an hour.

20-30 minutes if you have done it a few times and know what your doing.

 

7. What about upgrading and uninstalling VirtualBox? Is it also that complicated?

Upgrading is as simple as re-compiling vbox and droping it on your flash drive.

None of the config stuff shold change generaly.

 

8. And the most important one – is my data/unRAID configuration going to be safe during the installation. Should I be extra careful at any particular step?

Again, I would recommend using a dev box or a VM to do the compile.

 

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.