VirtualBox compiled for unRAID


Recommended Posts

Oh.. and another thing i want to mention..

if you've read my post before in this thread, i found a problem where

 

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

 

This line of the command causes the permission for "/dev/null" to be changed.. and this cause some other plug-ins to function incorrectly.

 

so instead of setting the logfile to /dev/null, I recommend creating a folder somewhere.. make a folder like /mnt/cache/vbox/log or something.

 

Then run it like this..

 

vboxwebsrv -b -H 192.168.0.199 --logfile /mnt/cache/vbox/log >/dev/null 

 

I need to try this when I get home. Thanks Jang!!


Jangjong, I have updated the install instructions now to use

vboxwebsrv -b -H 127.0.0.1 --logfile /var/log/vbox.log

instead of /dev/null. That way the log will be in the same directory as syslog & other logs.

 

Your post on how to setup multiple web ports for lighttpd helped me & when I see someone wanting to run multiple web apps, I point them to your thread. Lots are using the information found in that thread successfully (including me). Thank you for sharing it.

 


Jtech007, You need to edit the lighttpd.cfg file for your setup. This includes editing the IP addresses for your server, providing the path to phpvirtualbox & making sure there are no rewrite rules applied to phpvirtualbox.

 

The above log file fix is not the issue for you. It would not hurt to change it, but it has nothing to do with changing how your web server displays pages.

 

Link to comment
  • Replies 256
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

 

Jtech007, You need to edit the lighttpd.cfg file for your setup. This includes editing the IP addresses for your server, providing the path to phpvirtualbox & making sure there are no rewrite rules applied to phpvirtualbox.

 

The above log file fix is not the issue for you. It would not hurt to change it, but it has nothing to do with changing how your web server displays pages.

 

Any idea what I need to change? I have my original file but have no clue what is attributed to Newznab and VB or what code to add (not my strong suit)... I attached the original lightpd file.

lighttpd.txt

Link to comment

Any idea what I need to change? I have my original file but have no clue what is attributed to Newznab and VB or what code to add (not my strong suit)... I attached the original lightpd file.

 

Okay, to help you out i will need these from you:

 

[*]Path of where Newznab is located

[*]Path of where phpvirtualbox is located

[*]Your local IP address of your unraid machine

[*]Your "Web root directory:" path under the web sever setting in WebGUI

[*]Your "Listening port:" setting under the web sever setting in WebGUI

 

I can help you write lighttpd.cfg if you need.

 

You weren't supposed to copy exactly what i have. You were supposed to use my lighttd.cfg as a guide line.

 

 

Link to comment

Any idea what I need to change? I have my original file but have no clue what is attributed to Newznab and VB or what code to add (not my strong suit)... I attached the original lightpd file.

 

Okay, to help you out i will need these from you:

 

 

  • Path of where Newznab is located

/mnt/cache/appdata/webroot/newznab

  • Path of where phpvirtualbox is located

/config/plugins/phpvirtualbox-4.2-4

  • Your local IP address of your unraid machine

192.168.1.3

  • Your "Web root directory:" path under the web sever setting in WebGUI

/mnt/cache/appdata/webroot/newznab/www

  • Your "Listening port:" setting under the web sever setting in WebGUI

81

 

I can help you write lighttpd.cfg if you need.

 

That would be great, but I would also like to "learn" what it does and what needs to be added to make each one work. I am not sure at this point what that file does for newznab and why it interferes with other processes.

 

You weren't supposed to copy exactly what i have. You were supposed to use my lighttd.cfg as a guide line.

 

I found that out after it didn't work.  8) I made a backup of the original file and can work from there. Thanks again!

Link to comment

Okay.. try to follow this step:

 

[*]Move /config/plugins/phpvirtualbox-4.2-4 to /mnt/cache/appdata/webroot/ so it will be /mnt/cache/appdata/webroot/phpvirtualbox-4.2-4

[*]Create a folder called 'main' in webroot so it will be /mnt/cache/appdata/webroot/main

[*]Open up the setting page for Simplefeature Webserver

[*]Change Web root directory to /mnt/cache/appdata/webroot/main

[*]Change Listening port to 85

[*]

Use this for your lighttpd.cfg



# User customizations
# Add your own settings here. These won't get overwritten upon reboot
## Abdd your own settings here. These won't get overwritten upon reboot
#

$SERVER["socket"] == "192.168.1.3:81" {
        server.document-root = "/mnt/cache/appdata/webroot/newznab/www/"

        url.rewrite-once = (
                "^/.*\.(css|jpg|jpeg|gif|png|js|ico)" => "$0",
                "^/(admin|install).*$" => "$0",
                "^/([^/\.]+)/?(?:\?(.*))$" => "index.php?page=$1&$2",
                "^/([^/\.]+)/?$" => "index.php?page=$1",
                "^/([^/\.]+)/([^/]+)/?(?:\?(.*))$" => "index.php?page=$1&id=$2&$3",
                "^/([^/\.]+)/([^/]+)/?$" => "index.php?page=$1&id=$2",
                "^/([^/\.]+)/([^/]+)/([^/]+)/?$" => "index.php?page=$1&id=$2&subpage=$3"
        )
}

$SERVER["socket"] == "192.168.1.3:8333" {
        server.document-root = "/mnt/cache/appdata/webroot/phpvirtualbox-4.2-4/"
}

 

This should enable you to have your newznab at http://192.168.1.3:81 and phpvirtualbox at http://192.168.1.3:8333

If you want to use a different port other than 8333, just change it in the lighttpd.cfg file. It's simple as that.

 

but we are NOT DONE yet.

 

It is VERY IMPORTANT that you follow these steps to install and set up VirtualBox. It won't work correctly if you don't run these commands in this order:

[*]installpkg vbox-4.2.6-unRAID-3.4.24.tgz

[*]VBoxManage setproperty websrvauthlibrary null

[*]vboxwebsrv -b -H 192.168.1.3 --logfile /var/log/vbox.log

[*]VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.2.6-82870.vbox-extpack

 

After you have done above, navigate to /mnt/cache/appdata/webroot/phpvirtualbox-4.2-4

 

If you  haven't already, change config.php-example to config.php..

 

Open up config.php

 

Find this line:

 

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

 

Change it to this

 

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

 

 

 

NOW, you should be all done.

 

open up http://192.168.1.3:8333

 

The default username is admin, and the password is admin

 

If you want to skip this authentication, find this line in config.php

#var $noAuth = true;

remove # (uncomment it), it will look like this:

var $noAuth = true;

 

This will skip the authentication process

 

Let me know how this works out for you

Link to comment

Okay.. try to follow this step:

 

[*]Move /config/plugins/phpvirtualbox-4.2-4 to /mnt/cache/appdata/webroot/ so it will be /mnt/cache/appdata/webroot/phpvirtualbox-4.2-4

[*]Create a folder called 'main' in webroot so it will be /mnt/cache/appdata/webroot/main

[*]Open up the setting page for Simplefeature Webserver

[*]Change Web root directory to /mnt/cache/appdata/webroot/main

[*]Change Listening port to 85

[*]

Use this for your lighttpd.cfg



# User customizations
# Add your own settings here. These won't get overwritten upon reboot
## Abdd your own settings here. These won't get overwritten upon reboot
#

$SERVER["socket"] == "192.168.1.3:81" {
        server.document-root = "/mnt/cache/appdata/webroot/newznab/www/"

        url.rewrite-once = (
                "^/.*\.(css|jpg|jpeg|gif|png|js|ico)" => "$0",
                "^/(admin|install).*$" => "$0",
                "^/([^/\.]+)/?(?:\?(.*))$" => "index.php?page=$1&$2",
                "^/([^/\.]+)/?$" => "index.php?page=$1",
                "^/([^/\.]+)/([^/]+)/?(?:\?(.*))$" => "index.php?page=$1&id=$2&$3",
                "^/([^/\.]+)/([^/]+)/?$" => "index.php?page=$1&id=$2",
                "^/([^/\.]+)/([^/]+)/([^/]+)/?$" => "index.php?page=$1&id=$2&subpage=$3"
        )
}

$SERVER["socket"] == "192.168.1.3:8333" {
        server.document-root = "/mnt/cache/appdata/webroot/phpvirtualbox-4.2-4/"
}

 

This should enable you to have your newznab at http://192.168.1.3:81 and phpvirtualbox at http://192.168.1.3:8333

If you want to use a different port other than 8333, just change it in the lighttpd.cfg file. It's simple as that.

 

but we are NOT DONE yet.

 

It is VERY IMPORTANT that you follow these steps to install and set up VirtualBox. It won't work correctly if you don't run these commands in this order:

[*]installpkg vbox-4.2.6-unRAID-3.4.24.tgz

[*]VBoxManage setproperty websrvauthlibrary null

[*]vboxwebsrv -b -H 192.168.1.3 --logfile /var/log/vbox.log

[*]VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.2.6-82870.vbox-extpack

 

After you have done above, navigate to /mnt/cache/appdata/webroot/phpvirtualbox-4.2-4

 

If you  haven't already, change config.php-example to config.php..

 

Open up config.php

 

Find this line:

 

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

 

Change it to this

 

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

 

 

 

NOW, you should be all done.

 

open up http://192.168.1.3:8333

 

The default username is admin, and the password is admin

 

If you want to skip this authentication, find this line in config.php

#var $noAuth = true;

remove # (uncomment it), it will look like this:

var $noAuth = true;

 

This will skip the authentication process

 

Let me know how this works out for you

 

Cool! Thanks for spelling it out for me. I did everything and of course it did not work. :) Cannot see newznab either.

 

But here is something weird that I found in the lightpd error log:

 

[25-Jan-2013 05:08:49 UTC] PHP Notice: Undefined variable: string in /usr/local/emhttp/plugins/mysql/mysqlctl.php on line 148

[25-Jan-2013 05:08:49 UTC] PHP Notice: Undefined variable: results in /usr/local/emhttp/plugins/mysql/mysqlctl.php on line 100

[25-Jan-2013 05:18:01 UTC] PHP Notice: Undefined variable: string in /usr/local/emhttp/plugins/mysql/mysqlctl.php on line 148

[25-Jan-2013 05:18:01 UTC] PHP Notice: Undefined variable: results in /usr/local/emhttp/plugins/mysql/mysqlctl.php on line 100

 

The Web Server will not start no matter what I do or try.

 

While in putty I did get this that I had not seen before:

 

VirtualBox web service 4.2.6 r82870 linux.x86 (Dec 19 2012 15:42:02) release log

00:00:00.000106 main    Log opened 2013-01-25T05:23:35.427945000Z

00:00:00.000108 main    OS Product: Linux

00:00:00.000109 main    OS Release: 3.4.11-unRAID

00:00:00.000111 main    OS Version: #1 SMP Mon Sep 17 17:36:21 PDT 2012

00:00:00.000128 main    Host RAM: 3764MB total, 2498MB available

00:00:00.000131 main    Executable: /opt/VirtualBox/vboxwebsrv

00:00:00.000132 main    Process ID: 11852

00:00:00.000133 main    Package type: LINUX_32BITS_GENERIC

 

Which I believe is a good thing. Am I correct in thinking that the last hurdle I getting the WebGUI running to see the VB interface?

Link to comment

Did you follow every steps I listed?

Creating a main folder, changing the web root directory and changing the port on webserver config?

 

Is the port number 85 getting used by anything ?

or is the port number 8333 getting used by anything?

 

We don't need to worry about that log. That log is not relevant

 

the webserver won't start if there is a conflicting port number.

the webserver also won't start if the web root directory you have set is invalid.

 

before we do anything with virtualbox, we need to figure out what the problem is with the webserver..

 

So. First of all, delete all settings in lighttpd.cfg (Located at /boot/config/plugins/simpleFeatures). DO NOT DELETE THE FILE. just make it an empty file.

then start the server. Does the server start?

 

If it doesn't, then you have some wrong setting in the web server setting.

a listening port number that is getting used by some other web app, or incorrect web root directory

in this case, make sure you don't have any typo for for the web root directory setting, and make sure that path exist.

if the path looks correct, try changing ports to see if you can start the server. DO NOT USE 81 OR 8333. These will get used by newznab and phpvirtualbox.

 

 

if it does start, there must be something wrong with lighttpd.cfg

in this case..take a screen shot of the web server setting in web gui so i know exact setting you have.

 

now. try use this for your lighttpd.cfg:

# User customizations
# Add your own settings here. These won't get overwritten upon reboot
#
$SERVER["socket"] == "192.168.1.3:8333" {
        server.document-root = "/mnt/cache/www/phpvirtualbox-4.2-4/"
}

 

if this starts, then it must mean that you didnt change the port number in the webserver setting and still have it as 81

 

If this doesn't start..make sure this path (/mnt/cache/www/phpvirtualbox-4.2-4/) is valid.  phpvirtualbox-4.2-4 must be a folder, not the zip file. it has to be the content of what you extracted from phpvirtualbox-4.2-4.zip

also look at lighttpd.cfg. You will see this line

$SERVER["socket"] == "192.168.1.3:8333" {

change that 8333 to some other number (random number like 28437)

 

Also, please make sure you can access unraid with http://192.168.1.3..

 

 

When we got everything working and find out what was wrong, then I can try to explain what lighttpd.cfg is doing

you will learn better that way

Link to comment

So after several attempts here are the steps I go through to get this to work....

 

I am running RC10 with SAB, SickBeard, mySQL (xbmc), AirVideo, SimpleFeatures. My server IP is 192.168.0.43 (so if following these steps change this as necessary). My phpVirtualBox is installed at /mnt/cache/appdata/www/phpvirtualbox-4.2-4/

 

Download files and save them as per the link in the first post (thanks Iainie)

Connect to server via telnet and run...

    /boot/packages/installpkg vbox-4.2.6-unRAID-3.4.24.tgz

    VBoxManage setproperty websrvauthlibrary null

    VBoxManage setproperty vrdeauthlibrary default

    vboxwebsrv -b -H 192.168.0.43 --logfile /var/log/vbox.log

    VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.2.6-82870.vbox-extpack

 

Open Web Browser and go to 192.168.0.43/settings

        Select Webserver icon and ensure

              Web Root Directory = /mnt/cache/appdata/www

              Listening Port = 8804

 

If this is a first install then edit /mnt/cache/appdata/www/phpvirtualbox-4.2-4/config.php and change

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

to

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

 

Start Webserver

 

Open Browser and go to 192.168.0.43:8404

        Login with admin (u) and admin (p)

 

Once you have created your VM (XP in my case) install the Guest additions via the Settings-->Guest Additions... menu. It will greatly improve the remote mouse control and display responsiveness.

 

Hope this helps.

 

Tolax

 

Link to comment

Did you follow every steps I listed?

Creating a main folder, changing the web root directory and changing the port on webserver config? Yes. Yes & Yes but I found something wrong that kinda fixed the web server startup issue. I created the /mnt/cache/appdata/webroot/main folder but forgot to move the phpVB and newznab folders into it. The webserver starts now. Port is 85 (as you requested). I also copied the lightpd file for just phpVB as I don't care about newznab running, just VB.

 

So the webserver is running, port is 85, /mnt/cache/appdata/webroot/main is the web root dir and ran all three files in the console and now I get a 404 - not found error when I try to access it via 192.168.1.3:8333.

 

 

SO I looked back at a few of your prior posts and actually learned (somewhat) what this does. Since I just copied this:

 

# User customizations

# Add your own settings here. These won't get overwritten upon reboot

#

$SERVER["socket"] == "192.168.1.3:8333" {

        server.document-root = "/mnt/cache/www/phpvirtualbox-4.2-4/"}

 

To my lightpd file and saved it I noticed that since my web root dir is currently /mnt/cache/appdata/webroot/main that it why I got the 404 error as the lightpd file is looking for it at /mnt/cache/www/phpvirtualbox-4.2-4/.

 

So I changed the lightpd file to match the web root dir that you had me change it to earlier and now I am looking at the login prompt for the phpVB.

 

Finally got it working! Thank you very much for all your help on this one, and to lainie as well for putting it all together and hosting the site.

 

Hopefully other nOOB's like me will benefit from my issues and get it working.

 

 

 

 

Link to comment

Did you follow every steps I listed?

Creating a main folder, changing the web root directory and changing the port on webserver config? Yes. Yes & Yes but I found something wrong that kinda fixed the web server startup issue. I created the /mnt/cache/appdata/webroot/main folder but forgot to move the phpVB and newznab folders into it. The webserver starts now. Port is 85 (as you requested). I also copied the lightpd file for just phpVB as I don't care about newznab running, just VB.

 

So the webserver is running, port is 85, /mnt/cache/appdata/webroot/main is the web root dir and ran all three files in the console and now I get a 404 - not found error when I try to access it via 192.168.1.3:8333.

 

 

SO I looked back at a few of your prior posts and actually learned (somewhat) what this does. Since I just copied this:

 

# User customizations

# Add your own settings here. These won't get overwritten upon reboot

#

$SERVER["socket"] == "192.168.1.3:8333" {

        server.document-root = "/mnt/cache/www/phpvirtualbox-4.2-4/"}

 

To my lightpd file and saved it I noticed that since my web root dir is currently /mnt/cache/appdata/webroot/main that it why I got the 404 error as the lightpd file is looking for it at /mnt/cache/www/phpvirtualbox-4.2-4/.

 

So I changed the lightpd file to match the web root dir that you had me change it to earlier and now I am looking at the login prompt for the phpVB.

 

Finally got it working! Thank you very much for all your help on this one, and to lainie as well for putting it all together and hosting the site.

 

Hopefully other nOOB's like me will benefit from my issues and get it working.

 

oh oops, i had that wrong lighttpd.cfg.. lol sorry about that. shouldn't be /mnt/cache/www....

 

well anyway, glad you got it to work!

Link to comment

Did you setup the second eth interface? This may help you:

http://lime-technology.com/forum/index.php?topic=14988.msg141655#msg141655

Anyway not sure if you will get the network performance you want for pfSense using emulated network interfaces, unless using virtio with pfSense maybe? but no idea if that would be easy... maybe esxi would be better for such setup if you hardware is ok for that...

 

I wondered if I needed to "add" it to the unraid/linux setup before VB would see it. Thank you for the link!

 

Trying to use the resources on my unraid box before I put it on a bare metal box.

Link to comment

got it to work some how..

 

will post the detail in a bit...

 

----------EDIT------------

 

VBoxManage setproperty websrvauthlibrary null

 

 

Running this, then restarting vboxwebsrv worked

 

so i guess it's something to do with authentication/permission?

 

Followed directions on lainie's website and had issues, but this is what fixed it.

 

Lainie, perhaps you should add the "changing user and pass to root and pass in config.php" and also the above "setproperty websrvauth. . .etc." to the instructions on your website

 

because the instructions actually tell users to leave the config.php as is, where it should be modified with the root password

 

thanks

Link to comment

I know I am really being lazy here but your packages have worked flawlessly for me from day 1 and I will probably just screw something up if I build it.

 

If you happen to get time to build an updated package for RC11 that would be fantastic.

 

Really appreciate your efforts lainie.  Thanks.

Link to comment

Lainie, perhaps you should add the "changing user and pass to root and pass in config.php" and also the above "setproperty websrvauth. . .etc." to the instructions on your website

I did not change root pass.

The only thing I have to do was uncomment the onAuth="true" parameter and run "VBoxManage setproperty websrvauthlibrary null"

Our phpVbox leader Lanie can affirm, but you have both described the two different approaches to get the install up and running.  Either fix the root unraid user/pw or comment the prompt out altogether.

Link to comment

Peter, if you mean assign an entire physical drive to a VM then yes.

I've been using a usb 3.0 drive connected to VM for some time with no issues so far.

 

It is however not mounted in unraid or anywhere else so not sure if you can get away with sharing it while the VM is booted up.  Probably depends on the file system.

 

example:

 

vboxmanage internalcommands createrawvmdk -filename hdd.vmdk -rawdisk /dev/sdX

 

Lainie, thanks again.  And no need to apologize!

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.