These notes explain how to install “XPEnology” (a project porting Synology’s NAS software on other platforms) as a virtual machine (with virtualbox), in headless mode (SSH) on a debian server (which happens to be an old netbook – but this part failed because of the proc type of the netbook).
Installing Debian on the server
I choose to install the stable version of Debian (“Wheezy”), it is not that difficult, and there is a number of tutorials on internet, so I won’t go through the procedure. In this case the “server” is a netbook “Akoya Medion e1210” (a clone of the MSI Wind).
The two “tricks”: this netbook only has USB, so I took inspiration from the Debian wiki page for the EeePC (but there are a lot of other tutorials on internet).
Also, I decided to set a static IP address (not a DHCP one).
This is just the “basics” SSH install, I let you refer to https://wiki.debian.org/SSH to get started.
I basically left it open on port 22, but for extra security you should look at changing the port (security by obfuscation but still worth on a box opened to internet), no root login, and no password login.
Installing Virtualbox and creating the VM
~$ echo "deb http://download.virtualbox.org/virtualbox/debian lenny contrib non-free" > /etc/apt/sources.list.d/virtualbox.list ~$ wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | apt-key add - ~$ aptitude update ~$ aptitude install virtualbox
We need also to install the extension pack
vboxmanage extpack install ./Oracle_VM_VirtualBox_Extension_Pack-4.1.28-89849.vbox-extpack
Then I create a directory where I’ll download Xpenology, dezip it and convert the .img file to a .vdi file.
~$ mkdir xpenology ~$ cd xpenology ~/xpenology$ wget http://xpenology.trantor.be/xpenology.com/8ded7e6d72fe7827b5a8db2e686cf774/525d6ce4/XPEnology_DS3612xs_3211-repack-trantor-v1.2.7z ~/xpenology$ 7z e XPEnology_DS3612xs_3211-repack-trantor-v1.2.7z ~/xpenology$ ls -l -rw-r--r-- 1 julien julien 32768000 août 30 17:31 synoboot-trantor-4.2-3211-v1.2.img -rw-r--r-- 1 julien julien 130066749 août 30 17:59 XPEnology_DS3612xs_3211-repack-trantor-v1.2.7z -rw-r--r-- 1 julien julien 99860480 août 30 17:24 XPEnology_trantor_v1.2_DSM_DS3612xs_3211.pat ~/xpenology$ vboxmanage convertfromraw -format VDI synoboot-trantor-4.2-3211-v1.2.img synoboot-trantor-4.2-3211-v1.2.vdi
To create the VM
vboxmanage createvm --name "syno" --register VBoxManage modifyvm "syno" --memory 512 --boot1 disk --nic1 bridged --bridgeadapter1 eth0
Some explanations, issued from the Virtualbox manual
--memory 512: This sets the amount of RAM, in MB
--boot<1-4> none|floppy|dvd|disk|net: This specifies the boot order for the virtual machine. There are four “slots”, which the VM will try to access from 1 to 4, and for each of which you can set a device that the VM should attempt to boot from.
--nic<1-N> none|null|nat|bridged|intnet|hostonly|generic: With this, you can set, for each of the VM’s virtual network cards, what type of networking should be available.
--bridgeadapter<1-N> none|<devicename>: If bridged networking has been enabled for a virtual network card, use this option to specify which host interface the given virtual network interface will use
We need to attach the “synoboot-trantor-4.2-3211-v1.2.vdi” to the VM
VBoxManage storagectl "syno" --name "IDE" --add ide VBoxManage storageattach "syno" --storagectl "IDE" --port 0 --device 0 --type hdd --medium /home/julien/xpenology/synoboot-trantor-4.2-3211-v1.2.vdi
Then we will create two (sata) hardrives, and attach them to a SATA controler. These drives will be the storage drives of the NAS.
VBoxManage storagectl "syno" --name "SATA" --add sata VBoxManage createhd --filename /mnt/nas-500/nas-450.vdi --size 450000 VBoxManage storageattach "syno" --storagectl "SATA" --port 0 --device 0 --type hdd --medium /mnt/nas-500/nas-450.vdi VBoxManage createhd --filename /mnt/nas-300/nas-280.vdi --size 280000 VBoxManage storageattach "syno" --storagectl "SATA" --port 1 --device 0 --type hdd --medium /mnt/nas-300/nas-280.vdi
One final -but critical- step: we need to change the MAC address of the VM to match it with a specific MAC Address:
vboxmanage modifyvm "Synology" --macaddress1 00113208D62A
We can now start the VM:
vboxmanage startvm "Synology" --type headless
Two notes: from http://www.robvanhamersveld.nl/2013/01/21/install-and-test-synology-dsm-in-a-virtual-machine/
1) When you have issues with the DSM installation step (DSM install wizard says it cannot connect to the DS at the end of wizard step 1), make sure that the Macaddress in the VirtualBox VM’s network adapter matches the Mac address discovered by the synology assistent. If not, stop the VM and change the macaddress so that the addresses match and try again.
2) When you get a Grub error 22 during the first reboot after the DSM install, just restore/overwrite the boot-image disk with the image inside the downloaded archive. The boot image partition sometimes gets overwritten/deleted during DSM install.
If you want to see the “boot message” from your virtual machine, you can try the following:
rdesktop -N hostingserver:3389
Actually this is only so far I went, because from what I remember I could not boot the Xpenology image. I remember (sorry I left the end of the tutorial before completing it, and since then I got rid of the install) I got an error similar to this one:
This was because the processor of my netbook did not have hardware virtualisation capabilities… which are mandatory to install Xpenology in a virtual machine.
But anyway this tutorial should get you started!
By the way, some further commands:
To stop a VM, run
VBoxManage controlvm "Synology" poweroff
To pause a VM, run
VBoxManage controlvm "Synology" pause
To reset a VM, run
VBoxManage controlvm "Synology" reset