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
- cmasseyGuideI upgraded again to 4.2.20 and still couldn't get it to work even after following the notes from itachi1, I guess I must have missed a step or did something wrong.
I think I did something wrong here:itachi1 wrote: tar -xjf linux-2.6.37.6.tar.bz2
tar -xzf kernel-build-tools-x86-4.2.20-T43.tar.gz
mv linux-2.6.37.6/ kernel-build-tools-x86/2.6.37/
cd kernel-build-tools-x86/2.6.37/linux-2.6.37.6/
../netgearize_kernel.sh
make oldconfig
make all
Once "make all" was done for the altered source in my temp directory, I moved the official source out of the way and moved my new fresh source to my now-empty "2.6.37" directory so the system could find it - plus I didn't want to break my symlinks.
Anyway, after that, I was able to run the VirtualBox installer 4.1.14 for amd64, then I started vboxdrv service to confirm:/etc/init.d/vboxdrv start
Starting VirtualBox kernel modules ...done.
Anyway, moved back to 4.2.19 and re-installed virtualbox and it's working fine again, will try again this weekend. - AMRivlinApprenticeDid you ever get it working on 4.2.20 or .21?
- cmasseyGuideI never got it working, but i tried again with the 4.2.21 and got futher than I did with 4.2.20.
Give it some more time and I suspect I will get 4.2.21 working it just finding the right tweaks and settings to get it right.
The biggest difference between the 2 is this command didn't work (unzip -q RNDP6xxx_4.2.20_WW_src.zip "linux-2.6.37.6/*")
It appears to now be stored into a sub folder of the kernel directory, also arch/x86/configs/defconfig.smp didn't exist (or should I say I didn't find it so I used the one from 4.2.20)
Anyway I will keep playing with it or hope that someone with more skills than me is kind enough to type up a how to guide :) - AMRivlinApprentice
cmassey wrote:
Anyway I will keep playing with it or hope that someone with more skills than me is kind enough to type up a how to guide :)
+1 - krylonAspirant
AMRivlin wrote: cmassey wrote:
Anyway I will keep playing with it or hope that someone with more skills than me is kind enough to type up a how to guide :)
+1
+2! - itachi1AspirantOkay, so I got VirtualBox amd64 4.1.18 working on 4.2.21.
Sorry this isn't really a step-by-step, but kind of a "what I did" using a very abbreviated version of j6harri's post (page 23, bottom) at
http://www.readynas.com/forum/viewtopic.php?f=35&t=26468&start=330#p352009
Got the source, put it in a directory and unzipped the whole thing, but you could probably just dounzip -q RNDP6xxx_4.2.21_WW_src.zip "kernel/*"
As far as I can tell, it's a vanilla kernel with the "netgearize" tool to make it device specific. I followed the README in the kernel directory:
Steps 1-3 immediately below are already done!
1) Grab your preferred kernel source tarball from kernel.org.
(eg. "# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.4.tar.bz
2) Change to the directory that matches your selected kernel.
(eg. "# cd 2.6.32")
3) Extract it into this directory. That should leave you with a linux-2.6.xx directory.
4) Change into the new linux-2.6.xx directory.
(eg. "# cd linux-2.6.32.4")
5) Run the netgearize script.
(eg. "# ../netgearize_kernel.sh")
BUILD INSTRUCTIONS
x86_64 SMP
1) Copy the SMP defconfig file to .config.
# cp arch/x86/configs/defconfig.smp .config
2) Run 'make oldconfig'.
# make ARCH=x86_64 oldconfig
3) Build the kernel.
# make ARCH=x86_64
So under kernel/2.6.37/linux-2.6.37.6, run../netgearize_kernel.sh
It takes about 15 seconds with 2 "Hit Enter" prompts. It appears to copy the "defconfig.smp" from the directory above to .config .
Then I ran the Build Instructions above, steps 2 & 3 only because 1 was just done.
Make sure the symlink from /usr/src/linux points to whatever directory you decide to place your fresh kernel source.
ln -snf [your kernel source directory] /usr/src/linux
./VirtualBox-4.1.18-78361-Linux_amd64.run
Everything appeared to compile okay, but I couldn't load some of the VirtualBox modules like vboxnetflt.ko until I ran "depmod" and then was able to do "/etc/init.d/vboxdrv start"
Possibly "depmod -a" might do better even though I don't think ReadyNAS includes a modules.conf file.
A reboot confirmed that the vboxdrv and the four compiled modules (list using lsmod) were being loaded at boot. Then I could install the VBox Extensions.
Like I said in a previous post, under 4.2.20 I installed various packages from the debian archive to get some of my stuff working, like aptitude and mc, so I'm not sure how my build environment compares with other users'.
Off topic, I highly recommend mc for a quick and dirty Norton Commander. It makes it pretty painless to move stuff around and quick-view things. Read the F1 help for key commands, but "ctrl-t" selects.
I hope you all can get it working. I'm absolutely no expert, but was able to get the modules to compile and load. I may be able to help with errors -- I went through so many it may be tough to remember what I did for any particular one! - Original Post: VBox Guide v1.0
Updated version posted below.
Thanks
################################################################### - cmasseyGuideThanks guys!
Works like a charm :D - j6harriAspirant@MattyShack I am running into the following issue. When I try to install aptitude and synaptic, I get the error you described from apt-get being at a higher level. But when I try to downgrade apt-get, it wants to remove dpkg, ssh. I tried this once and it is a bad thing. Had to re-install the OS since ssh was gone. Do you have any advice?
NASHOG:~# apt-get install aptitude synaptic
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
aptitude: Depends: libapt-pkg-libc6.3-6-3.11
synaptic: Depends: libapt-inst-libc6.3-6-1.1
Depends: libapt-pkg-libc6.3-6-3.11
E: Broken packages
NASHOG:~#
NASHOG:~# apt-get install apt=0.6.46*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version 0.6.46.4-0.1+etch1 (Debian:4.0r9/oldstable) for apt
Suggested packages:
aptitude synaptic gnome-apt wajig dpkg-dev apt-doc
The following packages will be REMOVED:
dpkg openssh-client openssh-server ssh
The following packages will be DOWNGRADED:
apt
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
dpkg
0 upgraded, 0 newly installed, 1 downgraded, 4 to remove and 26 not upgraded.
Need to get 0B/1438kB of archives.
After this operation, 10.4MB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
?] no
Abort. - See if this helps to clear and reset installed deb packages, then downgrade apt.
Matt
#######################################################################################
### Update Sources.list ###
mv /etc/apt/sources.list /etc/apt/sources.list.bak
rm -rf /etc/apt/sources.list
##########################################
sudo sh -c "cat >> /etc/apt/sources.list" <<EOF
deb http://www.readynas.com/packages 4.2.21/
deb http://www.readynas.com/packages 4.2.22/
deb http://archive.debian.org/debian etch main
#deb http://download.virtualbox.org/virtualbox/debian squeeze contrib non-free
#deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free
EOF
##########################################
gpg --keyserver pgpkeys.mit.edu --recv-key E9C74FEEA2098A6E && gpg -a --export E9C74FEEA2098A6E | sudo apt-key add -
gpg --keyserver pgpkeys.mit.edu --recv-key 54422A4B98AB5139 && gpg -a --export 54422A4B98AB5139 | sudo apt-key add -
gpg --keyserver pgpkeys.mit.edu --recv-key AED4B06F473041FA && gpg -a --export AED4B06F473041FA | sudo apt-key add -
# Setup Root Directory Storage Area
mkdir /root/src
mkdir /root/system
cp /etc/apt/sources.list* /root/system
### Refresh Packages from the APT repository ~ may help remove BADSIG messages ###
# Clear the APT Repositories
sudo killall apt apt-get aptitude
sudo -s -H
apt-get clean
rm -rf /var/lib/apt/lists/*
chmod 755 /var/lib/apt/lists
mkdir /var/lib/apt/lists/partial
chmod 755 /var/lib/apt/lists/partial
rm -rf /var/cache/apt/archives
mkdir -p /var/cache/apt/archives/partial
apt-get clean
# Replace File Locks
rm -rf /var/lib/dpkg/lock
sudo touch /var/lib/dpkg/lock
sudo chmod 640 /var/lib/dpkg/lock
rm -rf /var/lock/aptitude
sudo touch /var/lock/aptitude
sudo chmod 640 /var/lock/aptitude
rm -rf /var/lib/apt/lists/lock
sudo touch /var/lib/apt/lists/lock
sudo chmod 640 /var/lib/apt/lists/lock
rm -rf /var/cache/apt/archives/lock
sudo touch /var/cache/apt/archives/lock
sudo chmod 640 /var/cache/apt/archives/lock
# Fresh download of Repository Packages
apt-get update && apt-get upgrade
# Say 'Y'es to any recommended Fixes. It is OK if either apt-get or dpkg will be upgraded/downgraded
# But, make sure neither apt-get nor dpkg will be removed. If so the aBORT changes.
apt-get -f install
apt-get update
# packages needed after a clean install
apt-get install nano curl
## Note: You may need to downgrade apt-get to apt_0.6.46.4-0.1+etch1_i386.deb for the correct versions of deb files.
# Raidiator 4.2.21 upgrades apt-get to apt_0.7.20.2+lenny2_i386.deb. This may cause conflicts.
# Display apt-get Version
apt-get -v
# Force apt-get and dpkg Downgrade
apt-get --reinstall install apt=0.6.46.4-0.1+etch1 dpkg=1.13.26 dpkg-dev=1.13.26
# I use aptitude most of the time. It does a better job at resolving conflicts.
apt-get install aptitude
# Setup the Build Environment
apt-get install build-essential gcc
aptitude install libmagic-dev libpcre3-dev
aptitude install unzip par2 parchive bzip2 gpp libssl-dev zlibc zlib1g-dev p7zip p7zip-full
#######################################################################################
Related Content
NETGEAR Academy

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