Author Topic: VirtualBox in unRAID  (Read 97858 times)

Offline dabl

  • Full Member
  • ***
  • Posts: 193
Re: VirtualBox in unRAID
« Reply #30 on: February 20, 2011, 11:56:17 AM »
Thanks to gfjardim help I now have this running very happily on my live box  ;D

I only have a Semperon 140 in my server atm so didn't want to go crazy.
That said, the one VM I am running (Windows XP Torrent/Download Box) is running perfectly and is extremely responsive for a VM.

I'd have to say this kicks the pants out of VMWare Server hands down.

How much ram do you have? 

I'm curious about any user experiences with 4 GB (or less) ram.

Offline bubbaQ

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3214
Re: VirtualBox in unRAID
« Reply #31 on: February 20, 2011, 12:08:29 PM »
My production unRAID system only has 2GB and runs WinXP in VBox fine.

Offline bubbaQ

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3214
Re: VirtualBox in unRAID
« Reply #32 on: February 20, 2011, 12:10:43 PM »
Quote
Using VBox and Ubuntu I discovered how problematic is NFS, and how easy and stable is SMB.

You can give VBox direct access to local drives, and obviate all the network issues.

Offline jpimlott

  • Member
  • **
  • Posts: 78
  • since when is 20 tb not enough
Re: VirtualBox in unRAID
« Reply #33 on: February 22, 2011, 10:05:44 AM »
I installed Virtual box over the weekend and ran into server problems. Some of them I could sort out with some help. Now the phpvbox web server is stating it cant connect to the vbox server service account.

What user name and passwords should be set ?

What other changes need to be made in the system to admin it ?

I am running unraid 4.7, virtualbox 4.0.4, unraidweb for php, and phpvbox web site.
The web server starts and loads phpvbox web site after installing and using firefox.

Thanks
John
unraid 5.0 final
msi 775 mb
11 seagate data drives
full nzxt tower case
antec 750 earthwatt power supply
supermicro 8 port sas card

Offline halvardu

  • Member
  • **
  • Posts: 4
Re: VirtualBox in unRAID
« Reply #34 on: February 23, 2011, 02:47:07 AM »
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
 

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


I hope it helps.

Hi, is it the same where I run this scripts? Should I just put the in /boot/ and run them??

Thanks for any help
Halvard

Offline gfjardim

  • Hero Member
  • *****
  • Posts: 821
Re: VirtualBox in unRAID
« Reply #35 on: February 23, 2011, 07:00:43 AM »
I don't like to run anything from the flash disk (/boot/) because file permissions get all messed up. You can run the scripts from anywhere into your system, because the script use it's directory as reverence to all operations.

Offline Venares

  • Member
  • **
  • Posts: 63
Re: VirtualBox in unRAID
« Reply #36 on: February 23, 2011, 11:02:35 AM »
I installed Virtual box over the weekend and ran into server problems. Some of them I could sort out with some help. Now the phpvbox web server is stating it cant connect to the vbox server service account.

What user name and passwords should be set ?

What other changes need to be made in the system to admin it ?

I am running unraid 4.7, virtualbox 4.0.4, unraidweb for php, and phpvbox web site.
The web server starts and loads phpvbox web site after installing and using firefox.

Thanks
John


Make sure you have the following in your go file to start the web service.

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


Also MUST run the following at the command line atleast once.

VBoxManage setproperty websrvauthlibrary null

Offline halvardu

  • Member
  • **
  • Posts: 4
Re: VirtualBox in unRAID
« Reply #37 on: February 23, 2011, 12:06:52 PM »
I don't like to run anything from the flash disk (/boot/) because file permissions get all messed up. You can run the scripts from anywhere into your system, because the script use it's directory as reverence to all operations.

Thank you  ;D
Regards, halvard

Offline halvardu

  • Member
  • **
  • Posts: 4
Re: VirtualBox in unRAID
« Reply #38 on: February 23, 2011, 01:15:08 PM »
Hi..

I have now runned both the scripts without problems. but what do i do now??
It did create a file called "VirtualBox-4.0.2-unRAID.tgz"

Thanks for any help :)
Halvard
---------------------------------------

Is it nobody that can help??? PLEASE!
« Last Edit: February 24, 2011, 03:30:52 AM by halvardu »

Offline Velkitor

  • Member
  • **
  • Posts: 29
Re: VirtualBox in unRAID
« Reply #39 on: February 27, 2011, 01:51:27 AM »
HALP!

Today I noticed that my vm was being unexpectedly stopped.
Now I can't start (via VBoxManage startvm <VM Name> -type headless>

I see the following in the syslog:
Feb 27 01:39:03 Tower kernel: VBoxHeadless invoked oom-killer: gfp_mask=0x304d2, order=0, oom_adj=0 (Minor Issues)
Feb 27 01:39:03 Tower kernel: Pid: 13004, comm: VBoxHeadless Not tainted 2.6.32.9-unRAID #8 (Errors)
Feb 27 01:39:03 Tower kernel: Call Trace: (Errors)
Feb 27 01:39:03 Tower kernel:  [<c104ab61>] oom_kill_process+0x59/0x1cd (Errors)
Feb 27 01:39:03 Tower kernel:  [<c104afb9>] __out_of_memory+0xef/0x102 (Errors)
Feb 27 01:39:03 Tower kernel:  [<c104b02a>] out_of_memory+0x5e/0x83 (Errors)
Feb 27 01:39:03 Tower kernel:  [<c104cfe9>] __alloc_pages_nodemask+0x375/0x42f (Errors)
Feb 27 01:39:03 Tower kernel:  [<f85d3e4b>] rtR0MemObjLinuxAllocPages+0xad/0x163 [vboxdrv] (Errors)
Feb 27 01:39:03 Tower kernel:  [<f85d3f28>] rtR0MemObjLinuxAllocPhysSub2+0x27/0xd1 [vboxdrv] (Errors)
Feb 27 01:39:03 Tower kernel:  [<f85d4079>] rtR0MemObjLinuxAllocPhysSub+0xa7/0xb2 [vboxdrv] (Errors)
Feb 27 01:39:03 Tower kernel:  [<f85d409e>] rtR0MemObjNativeAllocPhysNC+0x1a/0x1c [vboxdrv] (Errors)
Feb 27 01:39:03 Tower kernel:  [<f85d2812>] RTR0MemObjAllocPhysNCTag+0x55/0x6a [vboxdrv] (Errors)
Feb 27 01:39:03 Tower kernel:  [<f85d04b2>] ? supdrvIOCtl+0x1165/0x245a [vboxdrv] (Errors)
Feb 27 01:39:03 Tower kernel:  [<f85d3712>] ? rtR0MemAllocEx+0x60/0x90 [vboxdrv] (Errors)
Feb 27 01:39:03 Tower kernel:  [<f85d3712>] ? rtR0MemAllocEx+0x60/0x90 [vboxdrv] (Errors)
Feb 27 01:39:03 Tower kernel:  [<f85cc287>] ? VBoxDrvLinuxIOCtl+0xfd/0x171 [vboxdrv] (Errors)
Feb 27 01:39:03 Tower kernel:  [<f85cc18a>] ? VBoxDrvLinuxIOCtl+0x0/0x171 [vboxdrv] (Errors)
Feb 27 01:39:03 Tower kernel:  [<c10769d5>] ? vfs_ioctl+0x22/0x67 (Errors)
Feb 27 01:39:03 Tower kernel:  [<c1076f33>] ? do_vfs_ioctl+0x478/0x4ac (Errors)
Feb 27 01:39:03 Tower kernel:  [<c129eedf>] ? schedule+0x44c/0x72f (Errors)
Feb 27 01:39:03 Tower kernel:  [<c1076f93>] ? sys_ioctl+0x2c/0x45 (Errors)
Feb 27 01:39:03 Tower kernel:  [<c1002935>] ? syscall_call+0x7/0xb (Errors)
Feb 27 01:39:03 Tower kernel: Out of memory: kill process 12989 (VBoxHeadless) score 19543 or a child (Errors)
Feb 27 01:39:03 Tower kernel: Killed process 12989 (VBoxHeadless) (Errors)
Feb 27 01:39:03 Tower kernel: device eth0 left promiscuous mode (Network)
Feb 27 01:46:07 Tower kernel: device eth0 entered promiscuous mode (Network)

Any ideas?  It says out of memory, but my box has 8gb of memory, and I only have 1.5gb assigned to this vm.  The only other thing that would be taking resources is SAB and sickbeard...

free -m shows:
             total       used       free     shared    buffers     cached
Mem:          8041       7802        239          0         27       7427
-/+ buffers/cache:        347       7694
Swap:            0          0          0


Any ideas?

Offline jpimlott

  • Member
  • **
  • Posts: 78
  • since when is 20 tb not enough
Re: VirtualBox in unRAID
« Reply #40 on: February 28, 2011, 11:40:52 AM »
Venares
Thanks for the reply even though I had run those before running them again fixes the issue.
I then rebooted the server and it does not rerun afterwards even though it is in my go script.
the doinst.sh does not seem to run at the end of boot.
When and  how should that be run ?
If I do these manully the system runs great.
Now I just need more memory and cores. :)

John 
unraid 5.0 final
msi 775 mb
11 seagate data drives
full nzxt tower case
antec 750 earthwatt power supply
supermicro 8 port sas card

Offline halvardu

  • Member
  • **
  • Posts: 4
Re: VirtualBox in unRAID
« Reply #41 on: March 03, 2011, 07:11:36 AM »
Hi, I'm still trying to get the virtualbox to work, but this is what I get when I run the script:


linux-2.6.32.9/virt/
linux-2.6.32.9/virt/kvm/
linux-2.6.32.9/virt/kvm/Kconfig
linux-2.6.32.9/virt/kvm/coalesced_mmio.c
linux-2.6.32.9/virt/kvm/coalesced_mmio.h
linux-2.6.32.9/virt/kvm/eventfd.c
linux-2.6.32.9/virt/kvm/ioapic.c
linux-2.6.32.9/virt/kvm/ioapic.h
linux-2.6.32.9/virt/kvm/iodev.h
linux-2.6.32.9/virt/kvm/iommu.c
linux-2.6.32.9/virt/kvm/irq_comm.c
linux-2.6.32.9/virt/kvm/kvm_main.c
tar: linux-2.6.32.9/arch/microblaze/boot/dts/system.dts: Cannot create symlink t                     o `../../platform/generic/system.dts': Operation not permitted
tar: Error exit delayed from previous errors
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  HOSTCC  scripts/basic/hash
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/lex.zconf.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf -o arch/x86/Kconfig
#
# configuration written to .config
#
scripts/kconfig/conf -s arch/x86/Kconfig
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  CHK     include/linux/utsrelease.h
  UPD     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-x86
ln: creating symbolic link `include/asm': Operation not permitted
make: *** [include/asm] Error 1


I have also tried to install it manual but with out any luck..
can anybody help?

Thanks in advance
Halvard

Offline ftp222

  • Full Member
  • ***
  • Posts: 150
Re: VirtualBox in unRAID
« Reply #42 on: March 03, 2011, 10:40:06 AM »
I am not too familiar with licensing and Linux/GPL/etc. but can't someone just post a compiled package?  I know with VMware there were restrictions due to serial number and agreements for downloading the software.  There is no serial number for VirtualBox, but is there another agreement/restriction?

I was able to create the package without any issues, but I'm sure this would be more widely adopted if it were a simple unmenu add-on.

Offline Scottathon

  • Member
  • **
  • Posts: 44
Re: VirtualBox in unRAID
« Reply #43 on: March 03, 2011, 11:44:52 AM »
I am not too familiar with licensing and Linux/GPL/etc. but can't someone just post a compiled package?  I know with VMware there were restrictions due to serial number and agreements for downloading the software.  There is no serial number for VirtualBox, but is there another agreement/restriction?

I was able to create the package without any issues, but I'm sure this would be more widely adopted if it were a simple unmenu add-on.


It would be quite awesome if someone would do this. I couldn't get past the first of gfjardim's scripts without errors.

Offline perfessor101

  • Member
  • **
  • Posts: 97
Re: VirtualBox in unRAID
« Reply #44 on: March 03, 2011, 12:23:43 PM »
I was getting errors too ... tar needed an 'f' was one ... and it seemed that only hard coded directories would work on my unRAID 4.7 system ... I would get funny names/directories running the given scripts ... and the created package was named vbox - unraid with no kernel numbers ...

my files are located in the /boot/vbox directory with the packages located in /boot/vbox/packages

here are the commands I used for the first two stages ...

Compile Headers:
Code: [Select]

cd /boot/vbox/packages
installpkg *.tgz

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

tar -C /usr/src -zxvf /boot/vbox/packages/linux-2.6.32.9.tar.gz
   
ln -sf /usr/src/linux-2.6.32.9 /usr/src/linux

cp -rf /usr/src/linux_original/* /usr/src/linux/
cp -f /usr/src/linux_original/.config /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


Install Vbox:
Code: [Select]

mkdir -p /boot/custom/vbox && ln -sf /boot/custom/vbox /root/.VirtualBox

mkdir /mnt/cache/tmp

export TMPDIR=/mnt/cache/tmp && sh /boot/vbox/VirtualBox-4.0.2-69518-Linux_x86.run



Install WebServer and Extension Pack:
Code: [Select]

rmdir /mnt/cache/tmp

VBoxManage setproperty websrvauthlibrary null

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

VBoxManage extpack install /boot/vbox/Oracle_VM_VirtualBox_Extension_Pack-4.0.2-69518.vbox-extpack



I'm not sure why I was getting funny directory/filename manglings ... I formatted the flash to be sure and reinstalled unraid from scratch with only the bare minimum on the usb key and it was still giving me troubles with the directory/filenames being weird.

the only way I could get the package to work that was created was to install it once ... and then run doinst.sh manually and install the package again.

So currently each time I reboot I rebuild vbox from the start


I do really want to thank gfjardim for this as I wouldn't have any VirtualBox on my system without his great work on this ...

Bobby