Install a Xpenology NAS on KVM with Its Own IP Address
Our lab ended up with four spare mechanical drives, and I asked my boss to buy a NAS enclosure for them. I made a mistake and bought a DAS instead: it has USB, but no Ethernet port or operating system. It is essentially a large external drive. Fortunately, its 5 Gbps USB 3.0 connection is enough for four drives in RAID 0, so I decided to build a virtual NAS around it.
The virtualized Xpenology system needed its own IP address on the network, so I looked at running it in a virtual machine.
I considered three VM approaches:
- KVM + block device passthrough +
virtio-scsi - VMware + disk passthrough
- Hyper-V + disk passthrough
I chose the first approach for this build. In my assessment, VMware had too much performance overhead, while the Hyper-V option required an expansion card. My enclosure is just a USB drive and I do not have that card.
Install KVM and configure bridging
1 | sudo apt update |
On my Ubuntu 22.04 installation, NetworkManager manages networking instead of netplan. That makes many online bridge tutorials inapplicable, so I configured the bridge with nmcli. First, find the active connection:
1 | nmcli connection show --active |
Write down the physical interface name. Mine is enp39s0. Next, create a bridge named br0 and configure it for DHCP:
1 | sudo nmcli connection add type bridge con-name br0 ifname br0 |
I recommend DHCP. If you have a reason to use a static address, configure the bridge like this instead:
1 | sudo nmcli connection modify br0 ipv4.method manual \ |
The next steps can disconnect the machine from the network. Take care if you can only access it remotely.
Remove the old physical connection and attach the interface to the new bridge:
1 | # 删除旧的物理网卡连接配置(将 "Wired connection 1" 替换为你的连接名),执行这一步会断网 |
The bridge has a different MAC address from the original interface, so the assigned IP may change. Reconnect using the new address.
Install Xpenology in KVM
The QEMU command line is long and I did not want to keep editing it, so I used libvirt and its graphical manager for the KVM guest:
1 | sudo apt install virt-manager libvirt-daemon-system libvirt-clients bridge-utils -y |
When installation finishes, launch virt-manager from the command line.
For the boot image, download rr, an open-source one-click Xpenology installer:
1 | wget https://github.com/RROrg/rr/releases/download/25.6.5/rr-25.6.5.img.zip |
I recommend checking for a newer release, which may have fewer bugs than the version in this example.
Extract the downloaded archive. The resulting image is the guest’s boot disk:
In the QEMU settings, create a new virtual machine.
Create a normal 25 GB virtual disk for the operating system.

Attach the extracted img as a USB device, then select it under Boot Options.

Start RR and choose a NAS model. I chose the DS918+.
After RR finishes compiling and installing, boot the VM and map the physical disk into it. My disk is
/dev/sda. Then start the installation:
Here is the finished system:

That completes the build.