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
- starg4zeAspirant
chirpa wrote:
Next thing I am going to try is, converting the virtual guest from being an IDE drive to a SATA drive. Looks to fairly simple to do, and apparently the virtual SATA uses less CPU resouces, so should make the performance even better (http://forums.virtualbox.org/viewtopic. ... 289#p36289).
I did this with a Windows 7 machine, and it worked like a charm. Probably a little bit harder on a XP, though.
Also, Im VERY happy with the performance on my XP VM that i'm running on my PRO. This is outstanding!
One thing I dont have figured out yet is what backup strategy I should use. As I see, I have three options:
1. Use a Windows software running on the VM to clone or to backup vital parts of the VM
or
2. Take snapshots of the running VM
or
3. Use a script to shutdown VM, copy .vdi to safe location, start VM again.
Thoughts on this? Experience with snapshots? - chirpaLuminaryI'm running 2003 on the VM, going to try the IDE->SATA change tonight on it.
I'd probably go with #3.
Could maybe use the Save State, copy, restore, shouldn't take long to run that on the Pro, less than a few minutes, so there isn't much interruption to the VM.
http://srackham.wordpress.com/cloning-a ... -machines/ - chirpaLuminaryThis may be enough in a script to cronjob late at night one day a week. Pause/Hibernate the OS, clone the VDI, then bring it back up. The VM cannot be running when the clonehd command runs, and this way, when it comes back up, its not a fresh boot, but right where you left it off. My image is 30GB, so took around 10mins or so I think to finish, didn't time it yet.
pronto:/c/backup/VirtualBox# VBoxManage controlvm "ThinClient" savestate
VirtualBox Command Line Management Interface Version 2.1.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
pronto:/c/backup/VirtualBox# VBoxManage clonehd fd7c34af-5418-4911-a812-5a04909
VirtualBox Command Line Management Interface Version 2.1.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VDI'. UUID: 06616685-6447-4e59-94cd-c04a3df32a74
pronto:/c/backup/VirtualBox# VBoxHeadless -startvm "ThinClient" &
pronto:/c/backup/VirtualBox# ls -lh
-rw------- 1 root root 30G 2009-03-19 12:19 ThinClientClone.vdi
-rw------- 1 root root 30G 2009-03-19 12:48 ThinClient.vdi - Ok - I took the plunge and tried it out tonight.. Just got my VM installed (XPSP2) and must say that I'm majorly impressed with the raw speed of the VM.
chirpa wrote: At first, I was using the built in VRDP of VirtualBox. But I switched to using the virtual machine (Windows 2003) RDP server, this way I could send audio and stuff over the connection, and take full use of ClearType fonts, etc.
How do you do this? Running using your initial commands, I'm in NAT mode, so my workstation doesn't have direct access to my VM. I'm guessing I would need to change it to bridge mode (the way I usually run VMware), but I'm not sure how to accomplish this.
I see this in the built-in help for VBoxManage:
[-nic<1-N> none|null|nat|hostif|intnet]
Other searches indicate that an option called bridged used to exist, but it appears to have been replaced with hostif. Is this something safe to run as on a ReadyNAS?- chirpaLuminaryGood point, forgot to mention that. When I did start using the native RDP, I did this:
# VBoxManage modifyvm "ThinClient" -nic1 hostif
Then the VM just picked up a DHCP address from my router. I've also mapped to it as a share to copy stuff over quicker.
# VBoxManage modifyvm "ThinClient" -hostifdev1 eth1 - chirpaLuminaryAlso, GPL code for the 4.2.4 release is available. I'll try and do a quick how-to on what I did to compile the kernel modules this weekend, or one of you geeks will maybe beat me to it.
- chirpaLuminaryAdded steps in the first post on how to compile the kernel modules.
- starg4zeAspirantAllright, here's my backup-script to completly backup a VM on the ready NAS. Im running my business accounting and invoce software on the VM(because it does not run under OSX :cry: ), so backup is paramount to me...
#!/bin/sh
## Script to compleatly backup a Virtual machine and keep 10 generations
##
## Hibernate Virtual machine
VBoxManage controlvm VIRTUAL-MACHINE-NAME savestate
## Remove backup 10 days old
rm PATH-TO/VIRTUAL-MACHINE-NAME-`date -d '10 days ago' +%Y%m%d`.vdi
## Clone/Backup Virtual machine
VBoxManage clonehd PATH-TO/VIRTUAL-MACHINE-NAME.vdi PATH-TO/VIRTUAL-MACHINE-NAME-`date +%Y%m%d`.vdi
## Start Virtual machine again
VBoxHeadless -startvm VIRTUAL-MACHINE-NAME &
Put the script in the /etc/cron.daily to run the script every day
Also, don't forget thechmod +x SCRIPT-NAME
- chirpaLuminarySplit off sirozha's issue to another thread to keep this one on topic: viewtopic.php?f=35&t=27026
Related Content
NETGEAR Academy

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