VirtualBox compiled for unRAID


Recommended Posts

Latest release compiled for you is VirtualBox version 5.0.12.

Includes packages for unRAID versions with the following kernels:

  • kernel 4.1.13 (version 6.1.6)

 


 

Website http://vbox.a1aina.com (link also in signature) setup. Hosts direct access links with checksums.

 

Let me know what you think. Please check for any typos & voice any changes you would like to see. I will provide help here along with other unRAID users.

 

I think most people have upgraded off other unRAID versions... however, if other kernel versions are needed, post your requested version to this thread.

 


There is a plugin for VirtualBox on unRAID from theone available at https://raw.github.com/theone11/virtualbox_plugin/master/virtualbox.plg

The plugin installs the VirtualBox package (discussed in this thread) & the VirtualBox Extension package (the plugin does not install phpVirtualBox).

Visit the unRAID forums topic VirtualBox Plugin for unRAID v5 for more information on the plugin.

Any issues with the plugin can be reported to https://github.com/theone11/virtualbox_plugin/issues

Link to comment
  • Replies 256
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Moved history (previously listed above) to here. Using top post for updates / notifications.

 

gfjardim created the thread VirtualBox in unRAID to provide instructions on how to install VirtualBox on unRAID.

 

A wiki page, http://lime-technology.com/wiki/index.php?title=Installing_VirtualBox_in_unRAID, was also created explaining how to compile kernel headers.

 

Many people requested someone to compile the headers for them; it requires extra programs to be installed & is RAM intensive. I volunteered, hosted a few compiled files on my SkyDrive & my involvement grew from there.

 

People have requested direct access to files (for wget or curl access), md5 checksums for the compiled files & other features that SkyDrive does not offer... These requests are also not directly related to the original thread which is nearly 30 pages long... So I have made some changes, including starting a new thread.

Link to comment

Great work lainie!

Did you already included the USB fixes to doinst.sh?

 

I included them in the instructions page at the bottom (potential traps section). Have not changed anything about the way it is compiled yet.

 

Also considering adding a line for "makedir -p /boot/custom/vbox -m 0777".

 

Anyone see any reason not to add the proposed changes?

Link to comment

I included them in the instructions page at the bottom (potential traps section). Have not changed anything about the way it is compiled yet.

Ah, ok, just a little correction:

The fix is not for getting the USB devices showing up in running VMs, but to get USB devices working at all (without using the trick of plugging another USB device). I still need to restart the VM to recognize an USB device assigned to it while it was running.

 

Also considering adding a line for "makedir -p /boot/custom/vbox -m 0777".

 

Anyone see any reason not to add the proposed changes?

 

Not sure about this one. This will end up in an error message if the dir is already created. Not that this cause any harm though...

Link to comment

I recreated the latest version 4.2.6 for unRAID kernel 3.4.11 with the updates in doinst.sh file. Have listed it as mod_vbox-4.2.6-unRAID-3.4.11.tgz. If you try it, let me know if there are any issues with it.

 

Ah, ok, just a little correction:

The fix is not for getting the USB devices showing up in running VMs, but to get USB devices working at all (without using the trick of plugging another USB device). I still need to restart the VM to recognize an USB device assigned to it while it was running.

 

Ah, I will correct the instructions then. If the modded doinst.sh version works I should be able to eliminate the Potential traps section.  :)

Link to comment

I keep getting errors..

 

It says "An error occurred communicating with your vboxwebsrv. No more requests will be sent by phpVirtualBox until the error is corrected and this page is refreshed. The details of this connection error should be displayed in a subsequent dialog box."

 

Then it tells me

 

"Error logging in to vboxwebsrv."

 

I have vboxwebsrv running as root and have the correct root / password entered in config.php for phpVirtualBox..

 

anyone having this problem?

Link to comment

jangjong, I used your instructions in the spotweb forums to get newznab, spotweb, phpmyadmin & phpvirtualbox all running happily. Just want to doublecheck that you are running phpvirtualbox on a different port than newznab & spotweb (I have phpmyadmin & phpvirtualbox on the same port with no rewrite rules affecting them).

 

Suspect you will have checked the above, so next:

What do you have in config.php for the $location setting? Should be

var $location = 'http://127.0.0.1:18083/';

 

Are there any errors regarding vbox in /var/log/syslog?

cat /var/log/syslog |grep vbox

 

 

Link to comment

jangjong, I used your instructions in the spotweb forums to get newznab, spotweb, phpmyadmin & phpvirtualbox all running happily. Just want to doublecheck that you are running phpvirtualbox on a different port than newznab & spotweb (I have phpmyadmin & phpvirtualbox on the same port with no rewrite rules affecting them).

 

Suspect you will have checked the above, so next:

What do you have in config.php for the $location setting? Should be

var $location = 'http://127.0.0.1:18083/';

 

Are there any errors regarding vbox in /var/log/syslog?

cat /var/log/syslog |grep vbox

I have $location set to 'http://127.0.0.1:18083/'

 

Jan  6 14:12:09 Tower kernel: vboxdrv: Found 2 processor cores.
Jan  6 14:12:09 Tower kernel: vboxdrv: fAsync=0 offMin=0x22c offMax=0x1b78
Jan  6 14:12:09 Tower kernel: vboxdrv: TSC mode is 'synchronous', kernel timer mode is 'normal'.
Jan  6 14:12:09 Tower kernel: vboxdrv: Successfully loaded version 4.2.6 (interface 0x001a0004).

 

 

This is what I have in syslog for vbox.

 

and this is the 'details' from the error message:

 

Exception Object
(
    [message:protected] => Error logging in to vboxwebsrv.
    [string:Exception:private] => 
    [code:protected] => 64
    [file:protected] => /mnt/cache/web/main/phpvirtualbox-4.2-4/lib/vboxconnector.php
    [line:protected] => 213
    [trace:Exception:private] => Array
        (
            [0] => Array
                (
                    [file] => /mnt/cache/web/main/phpvirtualbox-4.2-4/lib/vboxconnector.php
                    [line] => 4875
                    [function] => connect
                    [class] => vboxconnector
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [1] => Array
                (
                    [file] => /mnt/cache/web/main/phpvirtualbox-4.2-4/lib/vboxconnector.php
                    [line] => 918
                    [function] => remote_vboxRecentMediaGet
                    [class] => vboxconnector
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                    [fn] => vboxRecentMediaGet
                                )

                        )

                )

            [2] => Array
                (
                    [file] => /mnt/cache/web/main/phpvirtualbox-4.2-4/lib/ajax.php
                    [line] => 306
                    [function] => __call
                    [class] => vboxconnector
                    [type] => ->
                    [args] => Array
                        (
                            [0] => vboxRecentMediaGet
                            [1] => Array
                                (
                                    [0] => Array
                                        (
                                            [fn] => vboxRecentMediaGet
                                        )

                                    [1] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [data] => Array
                                                        (
                                                            [responseData] => Array
                                                                (
                                                                )

                                                        )

                                                    [errors] => Array
                                                        (
                                                        )

                                                    [persist] => Array
                                                        (
                                                        )

                                                    [messages] => Array
                                                        (
                                                        )

                                                )

                                        )

                                )

                        )

                )

            [3] => Array
                (
                    [file] => /mnt/cache/web/main/phpvirtualbox-4.2-4/lib/ajax.php
                    [line] => 306
                    [function] => vboxRecentMediaGet
                    [class] => vboxconnector
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                    [fn] => vboxRecentMediaGet
                                )

                            [1] => Array
                                (
                                    [0] => Array
                                        (
                                            [data] => Array
                                                (
                                                    [responseData] => Array
                                                        (
                                                        )

                                                )

                                            [errors] => Array
                                                (
                                                )

                                            [persist] => Array
                                                (
                                                )

                                            [messages] => Array
                                                (
                                                )

                                        )

                                )

                        )

                )

        )

    [previous:Exception:private] => 
)


Location:http://127.0.0.1:18083/

Link to comment

What do you get when you run this:

netstat -an | grep 18083

If you get a response that it is listening...

 

as root, run these commands:

VBoxManage setproperty websrvauthlibrary default
VBoxManage setproperty vrdeauthlibrary default

 

If this does not work, we can bypass the login.

 


 

According to phpvirtualbox wiki, these are the things that will cause this error in order of easiest to fix:

 

1) Username / password not correct in config.php

-- Make sure they are correct.

You have said you have root & the correct root password in your initial post

 

2) vboxwebsrv is not running as the user configured in config.php

-- Run vboxwebsrv as user specified in config.php.

You have listed that vboxwebsrv is running as root in your initial post

 

3) vboxwebsrv not running

-- Make sure it is running via 'ps aux | grep vboxweb'

Also confirmed running in your initial post

 

4) vboxwebsrv running on a different IP / port

-- Check via 'netstat -an | grep PORTNUMBER' where PORTNUMBER is the port you have configured vboxwebsrv to run on via /etc/vbox/vbox.cfg. If you do not have a port specified, the default is 18083. You should see something listed for the IP / port you have configured. If you are using non-defaults, update the $location setting in config.php.

Checking this now, but from output of location in config, it should be ok

 

5) VirtualBox does not have a valid authentication library configured

-- Run the follwing commands AS THE SAME USER THAT VBOXWEBSRV RUNS AS:

 

VBoxManage setproperty websrvauthlibrary default

VBoxManage setproperty vrdeauthlibrary default

Also checking this one now.

 

6) VirtualBox cannot authenticate with the host system.

-- This is usually something in your pam configuration that is not allowing authentication. I am not a pam expert, nor am I familiar with the myriad of pam configurations specific to each linux distro. In this case, the only fix I can suggest is to turn off vboxwebsrv authentication by running the following command as the same user that runs vboxwebsrv:

 

VBoxManage setproperty websrvauthlibrary null

If the above does not fix it... this is next to bypass the login

Link to comment

Were you using admin/admin at the prompt by phpvirtualbox or root/rootpassword?

 

The vboxwebsrv needs to be set to the same user that is configured in config.php (in your case & mine this is root)... but the actual login to phpvirtualbox is by default admin/admin.

 

Initially I had mine prompting me for a login, but later changed it to no longer prompt with "VBoxManage setproperty websrvauthlibrary null" & uncommenting the line "var $noAuth = true;" in config.php.

Link to comment

I recreated the latest version 4.2.6 for unRAID kernel 3.4.11 with the updates in doinst.sh file. Have listed it as mod_vbox-4.2.6-unRAID-3.4.11.tgz. If you try it, let me know if there are any issues with it.

 

If the modded doinst.sh version works I should be able to eliminate the Potential traps section.  :)

 

Works for me! THANK YOU!

Link to comment

Original post updated with latest info.

 

Added more packages for VirtualBox version 4.2.6 to now include unRAID (5rc6) kernel 3.4.4 & (4.7) kernel 2.6.32.9. These include the changes listed in previous posts to create /boot/custom/vbox/ directory & fix USB devices not working in VMs.

Link to comment

so.. few things that i wanted to say about this..

 

  • You say to run 'vboxwebsrv -b -H 127.0.0.1 --logfile /dev/null >/dev/null' to run vbox webservice. However, I think this changed the permission for /dev/null and caused some problems for my other plugin.. so maybe we should try to either run it as nobody or point the log file path to actual path?
  • I have no knowledge about building a linux package what-so-ever, but isn't there a way to set a build number? I am mentioning this because I wasn't able to use 'Upgradepkg' to upgrade from your old build of 4.2.6 for 3.4.11 kernel

Link to comment

You say to run 'vboxwebsrv -b -H 127.0.0.1 --logfile /dev/null >/dev/null' to run vbox webservice. However, I think this changed the permission for /dev/null and caused some problems for my other plugin.. so maybe we should try to either run it as nobody or point the log file path to actual path?

 

I knew something was changing permissions on /dev/null, but had not checked to see what was doing it. You can run "chmod 666 /dev/null" to change it back temporarily, but it does get changed back to 600 permissions (I now suspect the change back to 600 is when you do something in phpvirtualbox & it writes to the log; which is why it seemed random to me).

 

I have tracked part of why it changes the permissions to this file "/etc/udev/rules.d/10-vboxdrv.rules". Tried changing the 0600 to 0666, but that did not work.

 

If you run vboxwebsrv with a path to a log, like "vboxwebsrv -b -H 127.0.0.1 --logfile /var/log/vbox.log" then /dev/null is not affected. If not specified, I suspect it writes to the flash, but have not checked. Also not sure how quickly the log grows. I have started my vboxwebsrv with a log file specified & will check its size periodically.

 

I do not think you can run vboxwebsrv as nobody since it requires the user that runs it to have a valid home directory. It creates a link ~/.VirtualBox -> /boot/custom/vbox/.

 

On the phpvirtualbox wiki, they mention running it as a user other than root & some have created a user "vbox" or "vboxuser" just for running VirtualBox.

Link to comment

I've just added the vbox package for unRAID kernel 3.4.24.  I'm still on a previous version so have not tested, but saw no errors when creating it.

 

I have no knowledge about building a linux package what-so-ever, but isn't there a way to set a build number? I am mentioning this because I wasn't able to use 'Upgradepkg' to upgrade from your old build of 4.2.6 for 3.4.11 kernel

 

Typically there will only be one package for each version of VirtualBox for each kernel of unRAID.

 

I am able to find information about how to use upgradepkg when reinstalling/upgrading a package... but little to no information on how to make a created package upgradeable.

 

Link to comment

Thanks a lot for this.

 

Thanks to you, I decided to upgrade to v5

 

Prior, I was holding out until stable v5 was released to prevent having to recompile every time the kernel was updated. And I was getting really mad at Tom for the lack of activity until recently. Now I can happily upgrade to a release candidate and not worry about a kernel change.

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.