How to Install DSM 6.x on Windows Virtual Box

[ virtualbox  dsm  nssm  hyper-v  xenology  windows  synology  service  ]

Please follow the steps below to install virtual box on your windows machine.

  • Install virtualbox (recommended Version 5.2.16 and VirtualBox-6.1.46-158378-Win).
  • Create the physic disk for virtual machine. Open powershell in administrator mode
    • Use wmic diskdrive list brief to list all your harddrive
    • Put the disk offline
    • enable write for raw disk access in vm
      Diskpart
      Select disk 0
      ATTRIBUTES DISK CLEAR READONLY
      
  • Create the raw disk for VM via “C:\Program Files\Oracle\VirtualBox\VBoxManage.exe” internalcommands createrawvmdk -filename 0.vmdk -rawdisk \\.\PhysicalDrive0
  • Download the loader and convert img to vdi via “C:\Program Files\Oracle\VirtualBox\VBoxManage.exe” convertfromraw –format VDI .\synoboot.img .\synoboot.vdi
  • Download the firmware from Synology. Note newer version, e.g., 6.2.1 and 6.2.2 doesn’t work for me (cannot be found in assistant later)
  • Open the virtual box in administrator mode
  • Create the VM as following
  • Start the VM and find it in the assistant. Use F12 to select the boot drive and for boot options both bare-metal and vm options should work
  • Install

Hyper-V

Many people may want to run VirtualBox with Hyper-v environment, e.g., to use WSL and Docker. In fact, it is possible to use run DSM 6.2 in VirtualBox with Hyper-V enabled.

To do that, you need to enable Hyper-V feature in Windows first. Please refer to the image below.

Then you need to install newer VirtualBox at least V6. I have tested VirtualBox-6.1.46-158378-Win. Note there were some posts complaining VirtualBox V7 is not stable, but I didn’t personally test it. Make sure your VM is configured as below, especially for paravirtualized interface, please select KVM (others like default won’t work) and avoid hyper-v for network name.

image.png

image.png

Start VM as Service

You need NSSM to create a service from an executable. You could take the following steps:

  1. Download and extract NSSM (assume it is c:\nssm-2.24)
  2. Open powershell in admin mode;
  3. Run C:\nssm-2.24\win64\nssm.exe install DSM and it should creates a GUI
  4. Configure the settings as shown above and click install service
  5. Go to service and confirm the service is created
  6. Critical: use your own log on information
  7. Shutdown your vm in Virtual box and try to start the service

FAQ

Uuid doesn’t match

Please refer to https://stackoverflow.com/a/25510186, which you simply need to release then remove the disk from virtual media manager, and add then back in the virtual machine settings.

Only 32bit is Available

Make sure the vt-d support is enabled and hyper-v is disabled in BIOS. You could confirm that in Task Manager/Performance/CPU

Reference

Written on November 20, 2022