NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
chirpa
Mar 07, 2009Luminary
Running VirtualBox VM host on ReadyNAS Pro
What is VirtualBox?
So, I got bored while laundry was going... and decided to see how well a virtual OS would run on the Pro. My first choice of VM was VirtualBox, just cause I'm familiar with it after using it for ages, plus its open and free :) Eventually, I may look into VMWare as well.
After a bit of messing around, got it installed. Since the system is based off of Debian, was easy to get VirtualBox itself there (deb package). The trickiest part was getting the kernel modules required installed (see end of post).
In the end, I've got Windows 2003 R2 running on my Pro, interacting with it via RDP, and I am happy with the performance. I've added an extra 1GB memory (for a total of 2GB). I assigned 1GB of ram to my virtual OS, which still leaves the default configuration of 1GB for the NAS itself (which is more than enough still, 800MB+ is always cached).
I made a 10GB virtual disk to install the OS on. If I need more space later for extra applications, I can just add another virtual drive to that installation. And since I always like a bit extra security, I went a bit beyond the usual, and also have TrueCrypt running full disk encryption in the virtual OS. So no one can even boot and read the data in that OS without my bootup password.
I don't really have any screenshots to show, just a standard Windows installation. Here is a few of the steps I used while creating the VM on the console:
VirtualBox 3.1 has changed the CLI configuration. Until I update this how-to, please reference this: http://www.uhleeka.com/blog/2009/12/vir ... 9-04-host/
With the OS booted up and just sitting at the desktop, top reports:
Ad-hoc installation of VirtualBox. Should work for RAIDiator 4.2.4. Download links for the kernel modules, for those who don't want to go through the mess of compiling them.
So, I got bored while laundry was going... and decided to see how well a virtual OS would run on the Pro. My first choice of VM was VirtualBox, just cause I'm familiar with it after using it for ages, plus its open and free :) Eventually, I may look into VMWare as well.
After a bit of messing around, got it installed. Since the system is based off of Debian, was easy to get VirtualBox itself there (deb package). The trickiest part was getting the kernel modules required installed (see end of post).
In the end, I've got Windows 2003 R2 running on my Pro, interacting with it via RDP, and I am happy with the performance. I've added an extra 1GB memory (for a total of 2GB). I assigned 1GB of ram to my virtual OS, which still leaves the default configuration of 1GB for the NAS itself (which is more than enough still, 800MB+ is always cached).
I made a 10GB virtual disk to install the OS on. If I need more space later for extra applications, I can just add another virtual drive to that installation. And since I always like a bit extra security, I went a bit beyond the usual, and also have TrueCrypt running full disk encryption in the virtual OS. So no one can even boot and read the data in that OS without my bootup password.
I don't really have any screenshots to show, just a standard Windows installation. Here is a few of the steps I used while creating the VM on the console:
VirtualBox 3.1 has changed the CLI configuration. Until I update this how-to, please reference this: http://www.uhleeka.com/blog/2009/12/vir ... 9-04-host/
# Creating the Virtual Machine.
$ VBoxManage createvm -name "Windows2003" -register
$ VBoxManage modifyvm "Windows2003" -memory "1024MB" -acpi on -boot1 dvd -nic1 nat
$ VBoxManage createvdi -filename "/c/backup/VirtualBox/Windows2003.vdi" -size 10000 -register
$ VBoxManage modifyvm "Windows2003" -hda "/c/backup/VirtualBox/Windows2003.vdi"
$ VBoxManage registerimage dvd /c/backup/VirtualBox/Windows2003Ent.iso
$ VBoxManage modifyvm "Windows2003" -dvd /c/backup/VirtualBox/Windows2003Ent.iso
$ VBoxHeadless -startvm "Windows2003" &
# Connected via Remote Desktop at this point.
# After the installation, first page requires Ctrl-Alt-Del, so I sent the keycodes.
$ VBoxManage controlvm "Windows2003" keyboardputscancode 1d 38 53
# System is up and running, time to install GuestAdditions for better video, etc.
$ wget http://download.virtualbox.org/virtualbox/2.2.2/VBoxGuestAdditions_2.2.2.iso
$ VBoxManage registerimage dvd /c/backup/VirtualBox/VBoxGuestAdditions_2.2.2.iso
$ VBoxManage controlvm "Windows2003" dvdattach /c/backup/VirtualBox/VBoxGuestAdditions_2.2.2.iso
With the OS booted up and just sitting at the desktop, top reports:
top - 16:17:10 up 1 day, 17:58, 1 user, load average: 0.00, 0.01, 0.00
Tasks: 93 total, 1 running, 92 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.7%us, 0.2%sy, 0.0%ni, 99.2%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 2072432k total, 2020100k used, 52332k free, 6120k buffers
Swap: 1048536k total, 144k used, 1048392k free, 784620k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
10297 root 20 0 1104m 1.0g 4720 S 4 52.5 57:31.53 VBoxHeadless
12792 root 20 0 46092 9520 1720 S 1 0.5 59:54.51 motion
12196 root 20 0 9196 7688 980 S 0 0.4 0:57.72 wastesrv
1 root 20 0 1948 600 508 S 0 0.0 0:01.30 init
Ad-hoc installation of VirtualBox. Should work for RAIDiator 4.2.4. Download links for the kernel modules, for those who don't want to go through the mess of compiling them.
$ mkdir /lib/modules/`uname -r`/miscOr, if you want to compile the kernel modules yourself:
$ cd /lib/modules/`uname -r`/misc
$ wget http://www.readynas.com/contributed/chirpa/modules/virtualbox/pro/vboxdrv.ko
$ wget http://www.readynas.com/contributed/chirpa/modules/virtualbox/pro/vboxnetflt.ko
$ echo "deb http://download.virtualbox.org/virtualbox/debian etch non-free" >> /etc/apt/sources.list
$ wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O- | apt-key add -
$ apt-get update
$ apt-get install virtualbox-2.1
$ /etc/init.d/vboxdrv start
envyious:/c/backup# echo "deb http://download.virtualbox.org/virtualbox/debian etch non-free" >> /etc/apt/sources.listInstall of VirtualBox 2.2.2, before Sun updates the Debian Repository...
envyious:/c/backup# wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O- | apt-key add -
envyious:/c/backup# apt-get update && apt-get install build-essential
...
Setting up build-essential (11.3) ...
envyious:/c/backup# wget -q http://www.readynas.com/download/GPL/RNDP6xxx_4.2.4_WW_src.zip
envyious:/c/backup# unzip -q RNDP6xxx_4.2.4_WW_src.zip -d ./GPL
envyious:/c/backup# cd GPL/linux-x86-2.6/
envyious:/c/backup/GPL/linux-x86-2.6# make && make prepare
...
envyious:/c/backup/GPL/linux-x86-2.6# ln -s /c/backup/GPL/linux-x86-2.6/ /usr/src/linux
envyious:/c/backup/GPL/linux-x86-2.6# KERN_DIR=/usr/src/linux
envyious:/c/backup/GPL/linux-x86-2.6# apt-get install virtualbox-2.1
...
Setting up virtualbox-2.1 (2.1.4-42893_Debian_etch) ...
Adding group `vboxusers' (GID 101) ...
Done.
Messages emitted during module compilation will be logged to /var/log/vbox-install.log.
Success!
Starting VirtualBox kernel module: done.
envyious:/c/backup/GPL/linux-x86-2.6# cd
envyious:/c/backup/GPL/linux-x86-2.6# VBoxManage list vms
VirtualBox Command Line Management Interface Version 2.1.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
# wget -q http://www.readynas.com/download/GPL/RNDP6xxx_4.2.4_WW_src.zip
# unzip -q RNDP6xxx_4.2.4_WW_src.zip -d ./GPL
# cd GPL/linux-x86-2.6/
# make && make prepare
# ln -s /c/backup/GPL/linux-x86-2.6/ /usr/src/linux
# export KERN_DIR=/usr/src/linux
# apt-get install libfontconfig1 libglib2.0-0 libice6 libsdl1.2debian libsm6 libx11-6 libxcursor1 libxext6 libxi6 libxmu6 libxrandr2 libxrender1 libxslt1.1 libxt6 python2.4
# wget -q http://download.virtualbox.org/virtualbox/2.2.2/virtualbox-2.2_2.2.2-46594_Debian_etch_i386.deb
# dpkg -i virtualbox-2.2_2.2.2-46594_Debian_etch_i386.deb
Setting up virtualbox-2.2 (2.2.2-46594_Debian_etch) ...
Recompiling VirtualBox kernel module: done.
Starting VirtualBox kernel module: done.
441 Replies
Replies have been turned off for this discussion
- jmalmlundAspirant
Mackila wrote: Hi,
You are the guy who made me buy 2x4GB for my pro...
As I changed processor to E6600, I use my nas to host some VM.
I got them running "as services" with help from scripts from http://sisco.laf.free.fr/codes/MyVM.html and http://www.glump.net/howto/virtualbox_as_a_service#create_the_init.d_script.
When you want to start a VM then disconnect your ssh session, & is not enough. It only sends VBoxHeadless to the background, but it stays attached to your ssh session.
Try this instead :nohup VBoxHeadless --startvm <uuid|name> --vrde on --vrdeaddress <host ip> --vrdeport <port for RDP> &
- Mackilafbmachines wrote: jmalmlund wrote: Edited my start command in the previous post.. you just need to add an '&' to the end of the start command to put the VBox process into the background allowing you to disconnect your ssh session.
Thanks! I'll give it a try when I get home. I knew it had to be something simple.
[...]
If you exit your shell cleanly whatever process you have put running in the background should keep running, I've never had any problems with this.
To cleanly disconnect/exit the shell you may use 'logout', 'exit' or press <ctrl-D> on an empty prompt. - leakAspirantOk, I've got to missed something here. Right now I have successfully installed Virtualbox on my Ultra, but then what?
I want to install CentOS, but how do I do that? Never used VB before. Is there any program I run on my PC that connects and manage VB on my NAS? Where I can install my ISO's, stop, start the server and so on?
And how do I check if VB is running? When i start it it says thist0wnz:/backup/GPL# /etc/init.d/vboxdrv start
Starting VirtualBox kernel module ...done.
t0wnz:/backup/GPL#
But when I typet0wnz:/backup/GPL# ps | grep vboxdrv
t0wnz:/backup/GPL#
I see nothing. What should I do :) ?
edit; my bad.t0wnz:/backup/GPL# ps -ef | grep vboxdrv
root 12170 20742 0 14:33 pts/0 00:00:00 grep vboxdrv
t0wnz:/backup/GPL# - mdgm-ntgrNETGEAR Employee RetiredYou might want to take a look at this add-on: http://www.readynas.com/forum/viewtopic.php?f=48&t=44145
- leakAspirant
mdgm wrote: You might want to take a look at this add-on: http://www.readynas.com/forum/viewtopic.php?f=48&t=44145
Wonderful, exactly what I was looking for, but one problem tho...
How do I get the config file for the addon? Right now the config file looks like this86400, // "never" changes 'getGuestOSTypes' => 86400, 'getSystemProperties' => 86400, 'getInternalNetworks' => 86400, 'getMediums' => 600, 'getVMs' => 2, '__getMachine' => 7200, '__getNetworkAdapters' => 7200, '__getStorageControllers' => 7200, '__getSharedFolders' => 7200, '__getUSBController' => 7200, ); */ }
which I assume is wrong? Anyway, I cant access http://nas-ip/phpvboxmgr/ . "An unknown PHP error occurred...". - WhoCares_MentorTry a different browser, that's a known problem of the jquery-version I'm forced to use in the add-on.
-Stefan - leakAspirant
WhoCares? wrote: Try a different browser, that's a known problem of the jquery-version I'm forced to use in the add-on.
-Stefan
Tried both Firefox and Explorer, same thing. Is there any way I can doublecheck if vboxdrv really is running?
Edit; Looks like VB isnt running at all. And I dont get any error's when I runt0wnz:~# /etc/init.d/vboxdrv start
Starting VirtualBox kernel module ...done.
t0wnz:~# - WhoCares_MentorI fear using SSH would be the only way. And while you're on the command line you may also fix the config file for the problem with line breaks shouldn't show there.
-Stefan - leakAspirant
WhoCares? wrote: I fear using SSH would be the only way. And while you're on the command line you may also fix the config file for the problem with line breaks shouldn't show there.
-Stefan
Theres no problem using ssh for me. And for the config file in frontview folder (ssh) there are not any linebreaks at all.
Should I see the VB when I type "ps -A" lika a running proccess? How can I confirm that it actually working?t0wnz:~# /etc/init.d/vboxdrv status
VirtualBox kernel modules (vboxdrv, vboxnetflt and vboxnetadp) are loaded.
It all looks good, but I cant find anything about vbox under "ps -A" at all. - WhoCares_MentorCan't say much about that right now, will have to check when I'm in the office again later at night today.
-Stefan - leakAspirant
WhoCares? wrote: Can't say much about that right now, will have to check when I'm in the office again later at night today.
-Stefan
Thank you for taking time anyway. Really looking forward to getting this to work!
If it matter, I followed sphardy's guide (viewtopic.php?f=35&t=26468&start=225#p258406). But used the newest version (4.2.15) but the same VB version.
Edit; Made som headway! Installed the 4.0 instead, and now I get a config file for the phpscript. I have the vboxwebsrv running, but when i try to access nas-ip/phpboxmgr I get this messageSoapFault Object
(
[message:protected] => Method 'ns1:ISystemProperties_getMaxVDISize' not implemented: method name or namespace not recognized
[string:private] =>
[code:protected] => 0
[file:protected] => /frontview/ui/resource/html/phpvboxmgr/lib/vboxServiceWrappers.php
[line:protected] => 3592
[trace:private] => Array
(
[0] => Array
(
[file] => /frontview/ui/resource/html/phpvboxmgr/lib/vboxServiceWrappers.php
[line] => 3592
[function] => __soapCall
[class] => SoapClient
[type] => ->
[args] => Array
(
[0] => ISystemProperties_getMaxVDISize
[1] => Array
(
[0] => Array
(
[_this] => 2980c5227245087f-000000000000007e
)
)
)
)
[1] => Array
(
[file] => /frontview/ui/resource/html/phpvboxmgr/lib/vboxServiceWrappers.php
[line] => 54
[function] => getMaxVDISize
[class] => ISystemProperties
[type] => ->
[args] => Array
(
)
)
[2] => Array
(
[file] => /frontview/ui/resource/html/phpvboxmgr/lib/vboxconnector.php
[line] => 2631
[function] => __get
[class] => VBox_ManagedObject
[type] => ->
[args] => Array
(
[0] => maxVDISize
)
)
[3] => Array
(
[file] => /frontview/ui/resource/html/phpvboxmgr/lib/vboxconnector.php
[line] => 218
[function] => getSystemPropertiesCached
[class] => vboxconnector
[type] => ->
[args] => Array
(
[0] => Array
(
[fn] => getSystemProperties
)
[1] => Array
(
[data] =>
[errors] => Array
(
)
[persist] => Array
(
)
)
)
)
[4] => Array
(
[function] => __call
[class] => vboxconnector
[type] => ->
[args] => Array
(
[0] => getSystemProperties
[1] => Array
(
[0] => Array
(
[fn] => getSystemProperties
)
[1] => Array
(
[0] => Array
(
[data] =>
[errors] => Array
(
)
[persist] => Array
(
)
)
)
)
)
)
[5] => Array
(
[file] => /frontview/ui/resource/html/phpvboxmgr/lib/ajax.php
[line] => 93
[function] => getSystemProperties
[class] => vboxconnector
[type] => ->
[args] => Array
(
[0] => Array
(
[fn] => getSystemProperties
)
[1] => Array
(
[0] => Array
(
[data] =>
[errors] => Array
(
)
[persist] => Array
(
)
)
)
)
)
)
[faultstring] => Method 'ns1:ISystemProperties_getMaxVDISize' not implemented: method name or namespace not recognized
[faultcode] => SOAP-ENV:Sender
)
Edit2; Seems like phpvirtualbox isnt compatible with php5 at all. Altho they have released a new build, version 0.4-5.
Is anyone here running phpvirtualbox with vbox 4.x.x successfully?
Edit3; Installed phpvbox 0.4-5 instead and now it works flawless! I just swaped the config file with the old config file and it worked (probably missed some new feature tho).
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!