VirtualBox in unRAID


Recommended Posts

When I had VBox on my unRAID server I used:

 

echo "\013" | vboxheadless --startvm hdserver > /dev/null 2>&1 &

 

where "hdserver" is the name of the vm.  This is suppose to start it in the background.  It is possible that you could use the echo "\013" command with the -b option on the vboxwebsrv command to achieve background execution.  It turned out that vboxheadless was waiting for a return even though it is suppose to be in the "background" - go figure.

Doubt the above will work - so I found what I had to install vox when I had 4.0.6 on unRAID 4.6.

go script:

cd /boot/VBox/
./InstallVBox.sh
./InstallVBoxExtensions.sh
./StartHomeSrv.sh
./StartQAMSrv.sh

InstallVBox.sh script:

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.6-71344-Linux_x86.run

InstallVBoxExtensions.sh script:

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.6-71344.vbox-extpack

StartHomeSrv.sh script:

echo "\013" | vboxheadless --startvm homesrv > /dev/null 2>&1 &

StartQAMSrv.sh script:

echo "\013" | vboxheadless --startvm qamsrv > /dev/null 2>&1 &

Probably won't help either but I thought I would post it anyway for better completion on my original post

Link to comment
  • Replies 528
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

I managed to get it to work.

 

because the vbox 3.4.4 ....

....  I created the folder custom/vbox (which is where the .VirtualBox links to) on my flash drive and set the authentication to off "var $noAuth = true;" in the config.php file (under phpvirtualbox folder).

Almost same issue here, so just in case :

I tried the install with the packages provided in this post (Page18 I think...) on V5-R5.

I installed VirtualBox-4.1.18-unRAID.3.0.35 & Oracle_VM_VirtualBox_Extension_Pack-4.1.18 & phpvirtualBox

Ended up with the "Could not connect to host (http://127.0.0.1:18083/)" error.

I had to  fix a link to get it work :

I changed /root/.VirtualBox  -> /boot/custom/vbox  to .VirtualBox -> /opt/VirtualBox ;

Don't know if this issue is related to the installation package or to my config,

Anyway everything is ok now, thank U all.

Link to comment

Hi again,

 

Just a few words to say that's fully working (in background mode).

 

I only changed "Go" script" by adding "-b" switch for web service invocation then reboot and that did the trick.

 

I really don't understand because I tried this several times and it didn't work.

 

The only thing I changed recently was adding a password for the "root" account...

Link to comment

All the problems I was having was down to not having this folder:

 

/boot/custom/vbox

 

Now all running!!! :)

 

My install script is now:

 

  cd /boot/custom/vbox

  installpkg *.t*z

  VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.1.20-80170.vbox-extpack

  VBoxManage setproperty websrvauthlibrary null

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

 

 

 

Next problem:

 

Does anyone know how to get VB to close down at host shutdown/restart?

 

Getting it to start again is easy!!

 

 

Edit 3: Ok, performance is atrocious.  PS3 Media Server can't render quick enough even with 4 cores and 3.5GB of ram. Back to square one :/

Link to comment

Edit 3: Ok, performance is atrocious.  PS3 Media Server can't render quick enough even with 4 cores and 3.5GB of ram. Back to square one :/

Did you enable AMD-V, nested paging, install the guest-addons, guest ISO thingy, connect with Remote Desktop Connection etc. etc.?

 

Out of the box, virtualbox is slow, but after tweaking, it's pretty fast. Also, did you install the Guest OS with all those cores? I gave my Guest XP one core. It's fast enough with that for what I'm using it for.

Link to comment

Did you enable AMD-V, nested paging, install the guest-addons, guest ISO thingy, connect with Remote Desktop Connection etc. etc.?

 

Out of the box, virtualbox is slow, but after tweaking, it's pretty fast. Also, did you install the Guest OS with all those cores? I gave my Guest XP one core. It's fast enough with that for what I'm using it for.

 

Is there something like that for Intel ATOM?

 

Link to comment

Did you enable AMD-V, nested paging, install the guest-addons, guest ISO thingy, connect with Remote Desktop Connection etc. etc.?

 

Out of the box, virtualbox is slow, but after tweaking, it's pretty fast. Also, did you install the Guest OS with all those cores? I gave my Guest XP one core. It's fast enough with that for what I'm using it for.

 

Is there something like that for Intel ATOM?

 

After you install virtualbox, it will tell you most of the optimizations that the CPU supports:

 

FEr2S.png

Link to comment

Edit 3: Ok, performance is atrocious.  PS3 Media Server can't render quick enough even with 4 cores and 3.5GB of ram. Back to square one :/

Did you enable AMD-V, nested paging, install the guest-addons, guest ISO thingy, connect with Remote Desktop Connection etc. etc.?

 

Out of the box, virtualbox is slow, but after tweaking, it's pretty fast. Also, did you install the Guest OS with all those cores? I gave my Guest XP one core. It's fast enough with that for what I'm using it for.

 

Everything was turned on using windows 7 x32.

 

Network performance is abysmal too, with 30MB/sec the most I can get out of it.

 

VMWare Fusion on my Mac Pro runs at 95% performance, this is barely 50%!!!

 

The chip is a 3.2Ghz quad, with 3.6ghz turbo, so it aint the best but it copes ok when running PS3MS natively.

Link to comment

I think if you want close to bare metal performance, you should go with VMware esxi.

 

I'm probably going to do that when/if unRAID 5.0 is final.

 

For me, the speed is fine for noodling and a-boodling with the occasional Windows app.

I tried to get iTunes running on the Guest XP instance to stream to Airplay speakers, but the streaming kept dropping out, which I think is a network issue -- the CPU was not taxed.

I don't know if I need to dedicate a separate network card to XP and/or run VMWare to have that work.

Link to comment

Why is VMWare esxi so much better? :confused:

Because you are running on a host that is optimized for virtual machines only, not a host that's a media server (unraid) with virtualbox added as an afterthought. esxi is the host os that runs unraid as a guest, and any other vm's you want. Much cleaner if you have the hardware to properly support it.
Link to comment
  • 2 weeks later...

Here are a couple add on files that I use to manage my Virtualbox. I don't start things in my go file, because I prefer to check basic functionality on boot before firing off all my extra programs. I rarely restart my server (months) so I'm not interested in everything coming up immediately. Here are 2 unmenu buttons, and a small script to link to the stop button that pauses all running vms. I would really like that script to be called in the event of an unattended shutdown (power outage or power button press) but I haven't figured that part out yet.

vboxscripts.zip

Link to comment

Here are a couple add on files that I use to manage my Virtualbox. I don't start things in my go file, because I prefer to check basic functionality on boot before firing off all my extra programs. I rarely restart my server (months) so I'm not interested in everything coming up immediately. Here are 2 unmenu buttons, and a small script to link to the stop button that pauses all running vms. I would really like that script to be called in the event of an unattended shutdown (power outage or power button press) but I haven't figured that part out yet.

 

I have used Joe L.'s "unraid_addon_control.sh" script (you can look it up in the forum - thank you Joe L.) and created the below "rc.virtualbox" script for automatically starting virtualbox on server start and automatically stopping VMs and virtualbox on server stopping or shutdown (also works during power outage if you have a UPS and it is configured in unRAID):

 

rc.virtualbox (my virtual machine is called "My_VM"):

case $1 in
start)
  nohup VBoxHeadless --startvm "My_VM" >/dev/null 2>&1 &
  echo "rc.virtualbox: Windows 7 Enterprise Virtual Machine started"
;;
stop)
  VBoxManage controlvm "My_VM" savestate
  echo "rc.virtualbox: Windows 7 Enterprise Virtual Machine state saved and terminated"
;;
esac

 

and my go script (parts related to virtualbox):

VBoxManage extpack install /boot/extra_my/Oracle_VM_VirtualBox_Extension_Pack-4.1.20-80170.vbox-extpack
VBoxManage setproperty websrvauthlibrary null
vboxwebsrv -b -H 127.0.0.1 --logfile /dev/null >/dev/null
echo "Virtualbox: vboxwebsrv service started"

# Create unraid.d directory if needed
# Copy *.rc scripts to unRAID /etc/rc.d/unraid.d and make executable
mkdir -p /etc/rc.d/unraid.d
cp /boot/extra_my/rc.virtualbox /etc/rc.d/unraid.d/rc.virtualbox
chmod +x  /etc/rc.d/unraid.d/rc.virtualbox

# Activate the addon control script
/boot/extra_my/unraid_addon_control.sh -u

 

Link to comment

Cool, I'll look into the addon script. What I like about my pause script is that it doesn't need to know the names of the vms, it just issues the savestate command to each running vm until none are running. I have 10 or so vms, and could have 2 or 3 running at any given time, but not consistently the same ones all the time.

Link to comment

1. A HUGE thank you to everyone who has helped us n00bs to get this running. Makes me all warm and fuzzy inside by how awesome the community for unraid is.

 

2. I think a rewrite of the instructions for this is in order. Too many useful tidbits are strung out through too many posts. I would gladly do this myself, but I must admit, I do not really know what I am doing here and the extent of my linux knowledge was mostly gained through setting up and working with unraid.

 

3. HUGE THANK YOU!

 

-b

Link to comment

VirtualBox 4.2.0 is out. It was released before I had a chance to compile 4.1.22 for unRAID (@ 1 week in between the versions).

 

I compiled 4.2 for the following versions:

vbox-4.2.0-unRAID-2.6.32.9.tgz compiled on unRAID 4.7 w/ kernel 2.6.32.9

vbox-4.2.0-unRAID-3.4.4.tgz compiled on unRAID 5 RC6 test 2 w/ kernel 3.4.4

vbox-4.2.0-unRAID-3.4.11.tgz compiled on unRAID 5 RC8a w/ kernel 3.4.11

 

[glow=red,2,300]WARNING[/glow]!!! Before you upgrade to 4.2, be aware that phpvirtualbox does not have a version compatible with 4.2.x.

 

A direct link to the extension pack for 4.2.0 can be found here: http://download.virtualbox.org/virtualbox/4.2.0/Oracle_VM_VirtualBox_Extension_Pack-4.2.0-80737.vbox-extpack

 

I upgraded my VirtualBox to the compiled 4.2 version & when I launched phpvirtualbox, received this message

This version of phpVirtualBox (4.1-x) is incompatible with VirtualBox 4.2.0. You probably need to download the latest phpVirtualBox 4.2-x.

See the Versioning section here for more information

I clicked the link to download a 4.2 version, but as of this posting there is not one.

 

I decided to compile version 4.1.20 for unRAID 5 RC8a. You can find it under my SkyDrive's archive folder with the other 4.1.20 files. If you follow the link in my signature for instructions, I have a direct link to the expac for 4.1.20 if needed (it can also be found on VirtualBox's site, but may require digging through past version links).

 

I have my VirtualBox running my VM headless & the VM is accessible via remote desktop. I suspect that phpvirtualbox will have a version for 4.2 in the near future.

 

billotronic, I will probably rewrite the instructions again sometime after phpvirtualbox releases a version compatible with 4.2.x. My current instructions (link found in signature) work for most & were created fairly recently. Start there & if you have issues, continue on down the thread & if it is not covered, post here.

 

* EDIT - to add direct link to extension pack 4.2.

Link to comment

did you noticed that there is log file being frequently written at /boot/custom/vbox/vboxwebsrv.log (symlinked from /root/.VirtualBox/) mainly when having phpVirtualBox page open, also there is another log file but a lot less writes on it apparently, I'm afraid this may wear my pen? I did already tried to remove that symlink, create a dir and just symlink the important files (excl. the logs) to the /boot/... but not ok as it apparently renames the xml when doing changes on the vm to a -prev as backup and creates a new file, then the symlink doesn't work...

 

I did tried to run vboxwebsrv with --logfile /dev/null, or without --logfile param at all but the log file always get's created... any idea to get rid of it?

 

for now my workaround to stop it was to change my go file to this:

 

#VirtualBox

installpkg /boot/packages/vbox-4.1.20-unRAID-3.4.11.tgz

rm /root/.VirtualBox

mkdir /root/.VirtualBox

cp -r /boot/custom/vbox/* /root/.VirtualBox/

mkdir /root/VirtualBox\ VMs

cp -r /boot/custom/vbox_vms/* /root/VirtualBox\ VMs/

VBoxManage setproperty websrvauthlibrary null

VBoxManage extpack install /boot/packages/Oracle_VM_VirtualBox_Extension_Pack-4.1.20-80170.vbox-extpack

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

 

and did created a vboxsave.sh script with:

cp -r /root/.VirtualBox/* /boot/custom/vbox/

cp -r /root/VirtualBox\ VMs/* /boot/custom/vbox_vms/

 

then I need to use my vboxsave.sh script after doing changes on virtualbox settings, adding vm's, etc... to make them permanent, not a perfect solution but at least my pen doesn't constantly blink anymore :)

 

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.