Synology Virtual Machine Manager: Running a Linux VM
Docker handles most of what I run on a NAS, but now and then I want a whole operating system: a scratch Linux box, something with its own kernel modules, or a thing I want fenced off from DSM. Virtual Machine Manager (VMM) on DSM 6.2 turns supported x86 models into a small KVM host with a web console, snapshots and virtual switches. I run an Ubuntu 18.04 server VM on a DS918+ with 8 GB of RAM.
Check the support list first (plus-series and up, Intel CPU with VT-x). You want a Btrfs volume, at least 4 GB of RAM in the NAS since every gigabyte a VM gets is taken from DSM, VMM installed from Package Center, and an ISO such as ubuntu-18.04.2-live-server-amd64.iso sitting in a shared folder.
Host and storage
Open VMM. The first-run wizard registers the NAS as a cluster of one host, asks which volume to use for VM storage and creates a virtual switch bound to the physical interface. That switch works by putting the NIC into Open vSwitch mode; if you had a bond or VLAN configured, double-check Control Panel → Network afterwards because the interface names change to ovs_eth0 and ovs_bond0.
Under VMM → Storage you can add more volumes later; I keep VMs on the SSD volume and the video share on spinning disks.
ISO and VM creation
VMM → Image → ISO File → Add → From NAS → browse to the ISO. It is copied into VMM's own storage, so the original in the share can be deleted afterwards.
Then VMM → Virtual Machine → Create → Linux.
My settings:
Name: ubuntu-test
CPU: 2
Memory: 2 GB
Video card: vmvga
Storage: Virtual disk 1, 32 GB, VirtIO
Network: Default VM Network (the virtual switch), VirtIO
ISO for bootup: ubuntu-18.04.2-live-server-amd64.iso
Autostart: Yes (last state)
Permission: administrators
VirtIO for disk and network is the right choice for any modern Linux; the driver is in every mainline kernel. For Windows guests you would need the VirtIO driver ISO from the Fedora project, which VMM offers to download.
Installing the guest
Select the VM → Power on → Connect. A noVNC console opens in a browser tab. Install Ubuntu as usual; when it asks for the network, DHCP on the VirtIO adapter picks up an address from your LAN router because the virtual switch bridges to the physical interface. After the reboot, install the guest agent so VMM can shut the VM down cleanly and report its IP:
sudo apt update
sudo apt install qemu-guest-agent
sudo systemctl enable --now qemu-guest-agent
Then in VMM edit the VM → Others → tick "Enable Synology Guest Tool"; the IP shows in the VM list once the agent is running.
Snapshots, export, clone
VMM → Virtual Machine → the VM → Action → Take snapshot before any risky change. I do this every time, even for "quick" package upgrades, because rolling back is faster than debugging. Snapshots are Btrfs-based and instant. For scheduled snapshots go to Protection → Create → Snapshot plan; I keep hourly for a day and daily for a week on test machines.
Note that snapshot restore rolls back the entire disk; there is no file-level browse inside a VM disk from VMM.
Export: VMM → Virtual Machine → Action → Export writes an .ova (with the disk as a .vmdk) to a shared folder, which imports into VMware Workstation or VirtualBox. Clone creates a copy from a snapshot in a few seconds, handy for spinning up a throwaway box from a prepared template.
Did it work?
Inside the guest:
lspci | grep -i virtio
systemctl status qemu-guest-agent
Both VirtIO block and network devices should be listed and the agent active. On the NAS, Resource Monitor → Performance shows the VM's CPU as qemu-system-x86_64 processes, and VMM → Virtual Machine lists the guest with its IP and Status: Running.
Gotchas
- Creating the VM fails with "Not enough memory": DSM reserves memory for itself; on an 8 GB unit about 6 GB is available for VMs and VMM's own overhead. Reduce the VM size or stop other packages.
- The VM boots but has no network: the virtual switch was created on the wrong interface, or the physical port has no link. Check VMM → Network → Virtual Switch and the mapped physical NIC.
- Console shows "Failed to connect to server" in noVNC: the browser is blocking the WebSocket to port 5000/5001, usually because you reached DSM through a reverse proxy without WebSocket headers. Open DSM directly.
- After enabling VMM, Docker containers in
--net=hostlost connectivity: Open vSwitch renamed the interface. Restart the Docker package once; if a container hard-codeseth0, change it toovs_eth0.
Don't expect miracles from the CPU, but for light Linux VMs it saves me buying another box.