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 a...
Xaver
May 14, 2011Tutor
Hi,
well I'm also new with running the VBox on a Linux Host but this is how i did it (after a lot try and error):
if did the Installation like here: http://www.readynas.com/forum/viewtopic.php?f=35&t=26468&p=296922#p296922
first thing is to change the default machine folder of VBox, it is "~/VirtualBox VMs" otherwise VBox is saving the snapshot there:
the link you have posted is using an old syntax for Vbox 3.x I guess
starting the VM with
after Installation of the Guest system we install the VBox Guest Add-on (much better performance with VRDP) on the Readynas
Port forwarding for Torrent client inside the VM
on the Readynas enter
Sharedfolders:
on the Readynas
in the guest system edit the "/etc/fstab" file and add these lines at the end, so it will automount the sharedfolders on boot
eject guest add-on iso file
on the Readynas
finally we print a summery in a txt file:
ok hope you can use some of this.
if someone has ideas which flag should be turned on to improve the performance of the VM please let me know
edit:
here is a deamon script for the nas so it will save the VM when the NAS will restart or shutdown and auto launch it on powerup:
the only know issue is that
could somebody please tell me which command I could use so it will be displayed in the deamon.log or in frontview in the protocol tab or both?
well I'm also new with running the VBox on a Linux Host but this is how i did it (after a lot try and error):
if did the Installation like here: http://www.readynas.com/forum/viewtopic.php?f=35&t=26468&p=296922#p296922
first thing is to change the default machine folder of VBox, it is "~/VirtualBox VMs" otherwise VBox is saving the snapshot there:
than we can start create the vm
VBoxManage setproperty machinefolder "/c/VirtualBox"
the link you have posted is using an old syntax for Vbox 3.x I guess
last line only work if the ISO file is in the default machine folder, otherwise use absolute path (e.x. "/c/media/ISO/kubuntu-11.04-desktop-i386.iso")
cd /c/VirtualBox
VBoxManage createvm --name "Kubuntu" --ostype Ubuntu --register
VBoxManage modifyvm "Kubuntu" --memory 1024 --acpi on --boot1 dvd --boot2 disk --boot3 none --nic1 nat
VBoxManage modifyvm "Kubuntu" --pae off --nestedpaging off --vtxvpid off --hwvirtex off --hwvirtexexcl off --ioapic off
VBoxManage modifyvm "Kubuntu" --vram 32 --usb off --usbehci off
VBoxManage createhd --filename "Kubuntu.vdi" --size 10000
VBoxManage storagectl "Kubuntu" --name "IDE Controller" --add ide --controller PIIX4
VBoxManage storageattach "Kubuntu" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium "Kubuntu.vdi"
VBoxManage storageattach "Kubuntu" --storagectl "IDE Controller" --port 0 --device 1 --type dvddrive --medium kubuntu-11.04-desktop-i386.iso
starting the VM with
now connect with your rdp client (I use Win7 so) "windows key + R" than enter "mstsc.exe IP-of-your-nas"
VBoxHeadless -startvm "Kubuntu" &
after Installation of the Guest system we install the VBox Guest Add-on (much better performance with VRDP) on the Readynas
in guest system run console
VBoxManage storageattach "Kubuntu" --storagectl "IDE Controller" --port 0 --device 1 --type dvddrive --medium /opt/VirtualBox/additions/VBoxGuestAdditions.iso
sudo su
apt-get install dkms build-essential linux-headers-generic
cd /media/VBOXADDITIONS_4.0.6_71344
sh ./VBoxLinuxAdditions.run
init 6
Port forwarding for Torrent client inside the VM
on the Readynas enter
VBoxManage modifyvm "Kubuntu" --natpf1 "torrent,tcp,,44110,,44110"
Sharedfolders:
on the Readynas
make sure chmod 0777 is set for folders you want to write in.
VBoxManage sharedfolder add "Kubuntu" --name media --hostpath /c/media --readonly
VBoxManage sharedfolder add "Kubuntu" --name archiv --hostpath /c/archiv --readonly
VBoxManage sharedfolder add "Kubuntu" --name backup --hostpath /c/backup --readonly
VBoxManage sharedfolder add "Kubuntu" --name transfer-a --hostpath /c/archiv/Transfer
VBoxManage sharedfolder add "Kubuntu" --name transfer-m --hostpath /c/media/Transfer
VBoxManage sharedfolder add "Kubuntu" --name torrent --hostpath /c/media/Torrent
in the guest system edit the "/etc/fstab" file and add these lines at the end, so it will automount the sharedfolders on boot
for all folder you want to automount
archiv /home/xaver/readynas/archiv vboxsf defaults 0 0
media /home/xaver/readynas/media vboxsf defaults 0 0
...
eject guest add-on iso file
on the Readynas
VBoxManage storageattach "Kubuntu" --storagectl "IDE Controller" --port 0 --device 1 --type dvddrive --medium emptydrive
finally we print a summery in a txt file:
my file look like this:
VBoxManage showvminfo Kubuntu > Kubuntu.txt
Name: Kubuntu
Guest OS: Ubuntu
UUID: 3fe68c7e-341d-45ad-8cbb-1ef0d9ee3f2c
Config file: /c/VM/VirtualBox VMs/Kubuntu/Kubuntu.vbox
Snapshot folder: /c/VM/VirtualBox VMs/snapshot
Log folder: /c/VM/VirtualBox VMs/Kubuntu/Logs
Hardware UUID: 3fe68c7e-341d-45ad-8cbb-1ef0d9ee3f2c
Memory size: 1024MB
Page Fusion: off
VRAM size: 32MB
HPET: off
Chipset: piix3
Firmware: BIOS
Number of CPUs: 1
Synthetic Cpu: off
CPUID overrides: None
Boot menu mode: message and menu
Boot Device (1): DVD
Boot Device (2): HardDisk
Boot Device (3): Not Assigned
Boot Device (4): Not Assigned
ACPI: on
IOAPIC: off
PAE: off
Time offset: 0 ms
RTC: local time
Hardw. virt.ext: off
Hardw. virt.ext exclusive: off
Nested Paging: off
Large Pages: off
VT-x VPID: off
State: running (since 2011-05-12T20:03:29.459000000)
Monitor count: 1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address:
Teleporter Password:
Storage Controller Name (0): IDE Controller
Storage Controller Type (0): PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0): 2
Storage Controller Port Count (0): 2
Storage Controller Bootable (0): on
IDE Controller (0, 0): /c/VM/Kubuntu.vdi (UUID: cb3e9d18-64e7-41b3-b725-ef648ccd8b12)
IDE Controller (0, 1): Empty
NIC 1: MAC: 08002733AF29, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0
NIC 1 Settings: MTU: 0, Socket( send: 64, receive: 64), TCP Window( send:64, receive: 64)
NIC 1 Rule(0): name = torrent, protocol = tcp, host ip = , host port = 44110, guest ip = , guest port = 44110
NIC 2: disabled
NIC 3: disabled
NIC 4: disabled
NIC 5: disabled
NIC 6: disabled
NIC 7: disabled
NIC 8: disabled
Pointing Device: PS/2 Mouse
Keyboard Device: PS/2 Keyboard
UART 1: disabled
UART 2: disabled
Audio: disabled
Clipboard Mode: Bidirectional
Video mode: 1920x1200x32
VRDE: enabled (Address 0.0.0.0, Ports , MultiConn: off, ReuseSingleConn: off, Authentication type: null)
VRDE port: 3389
Video redirection: disabled
VRDE property: TCP/Ports = <not set>
VRDE property: TCP/Address = <not set>
VRDE property: VideoChannel/Enabled = <not set>
VRDE property: VideoChannel/Quality = <not set>
VRDE property: Client/DisableDisplay = <not set>
VRDE property: Client/DisableInput = <not set>
VRDE property: Client/DisableAudio = <not set>
VRDE property: Client/DisableUSB = <not set>
VRDE property: Client/DisableClipboard = <not set>
VRDE property: Client/DisableUpstreamAudio = <not set>
USB: disabled
USB Device Filters:
Index: 0
Active: yes
Name: remoteUSB
VendorId:
ProductId:
Revision:
Manufacturer:
Product:
Remote: yes
Serial Number:
Available remote USB devices:
<none>
Currently Attached USB Devices:
<none>
Shared folders:
Name: 'media', Host path: '/c/media' (machine mapping), readonly
Name: 'archiv', Host path: '/c/archiv' (machine mapping), readonly
Name: 'backup', Host path: '/c/backup' (machine mapping), readonly
Name: 'transfer-a', Host path: '/c/archiv/Transfer' (machine mapping), writable
Name: 'transfer-m', Host path: '/c/media/Transfer' (machine mapping), writable
Name: 'torrent', Host path: '/c/media/Torrent' (machine mapping), writable
VRDE Connection: not active
Clients so far: 8
Last started: 2011/05/14 13:59:14 UTC
Last ended: 2011/05/14 14:05:14 UTC
Sent: 0 Bytes
Average speed: 0 B/s
Sent total: 0 Bytes
Received: 0 Bytes
Speed: 0 B/s
Received total: 0 Bytes
Guest:
OS type: Linux26
Additions run level: 2
Configured memory balloon size: 0 MB
ok hope you can use some of this.
if someone has ideas which flag should be turned on to improve the performance of the VM please let me know
I'm not sure if these really needed but the Pro Pionner has not a CPU with VTX or things like these and VBox turned on these flags on default i guess
VBoxManage modifyvm "Kubuntu" --pae off --nestedpaging off --vtxvpid off --hwvirtex off --hwvirtexexcl off --ioapic off
VBoxManage modifyvm "Kubuntu" --vram 32 --usb off --usbehci off
edit:
here is a deamon script for the nas so it will save the VM when the NAS will restart or shutdown and auto launch it on powerup:
put this code in a file in "/etc/init.d/"
#!/bin/bash
### BEGIN INIT INFO
# Provides: vboxheadless
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
#
# vboxheadless This init.d script is used to start and Stop VM'S.
#
VBOXNAME="Kubuntu"
VBOXHEADLESS=/usr/bin/VBoxHeadless
VBOXMANAGE=/usr/bin/VBoxManage
test -f $VBOXHEADLESS || exit 0
test -f $VBOXMANAGE || exit 0
. /lib/lsb/init-functions
case "$1" in
start) log_daemon_msg "Starting virtual machine" "$VBOXNAME"
sudo -H -u root $VBOXHEADLESS -startvm $VBOXNAME &
sleep 1
log_end_msg $?
exit 0
;;
stop) log_daemon_msg "Stopping virtual machine" "$VBOXNAME"
sudo -H -u root $VBOXMANAGE -nologo controlvm $VBOXNAME savestate
log_end_msg $?
exit 0
;;
reset) log_daemon_msg "Resetting virtual machine" "$VBOXNAME"
sudo -H -u root $VBOXMANAGE -nologo controlvm $VBOXNAME reset
log_end_msg $?
exit 0
;;
poweroff) log_daemon_msg "Switching off virtual machine" "$VBOXNAME"
sudo -H -u root $VBOXMANAGE -nologo controlvm $VBOXNAME poweroff
log_end_msg $?
exit 0
;;
acpioff) log_daemon_msg "Sending ACPI-off to virtual machine" "$VBOXNAME"
sudo -H -u root $VBOXMANAGE -nologo controlvm $VBOXNAME acpipowerbutton
log_end_msg $?
exit 0
;;
esac
echo No valid option found. Valid options are: start, stop, reset, poweroff, acpioff
exit 0
make it executable and link it with runlevel 2, 0 and 6
vi /etc/init.d/vboxheadlessdeamon
from now on you can start your VM also with
chmod a+x /etc/init.d/vboxheadlessdeamon
ln -s /etc/init.d/vboxheadlessdeamon /etc/rc2.d/S99vboxheadlessdeamon
ln -s /etc/init.d/vboxheadlessdeamon /etc/rc0.d/K99vboxheadlessdeamon
ln -s /etc/init.d/vboxheadlessdeamon /etc/rc6.d/K99vboxheadlessdeamon
/etc/init.d/vboxheadlessdeamon start
the only know issue is that
wont work, well it does not make an error or something but it also wont be displayed in the logs (messages, syslog, system, deamon or dmesg) maybe a netgear thing.
log_daemon_msg "Starting virtual machine" "$VBOXNAME"
could somebody please tell me which command I could use so it will be displayed in the deamon.log or in frontview in the protocol tab or both?
Related Content
NETGEAR Academy

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