XPenology logo

Synology hardware and software

Synology make a variety of home, professional and even rack-mounted storage products. I’m a particular fan of their DS Plus series and own a DS1621+ which has been a trusty workhorse for a couple of years now.

To manage their hardware, they have a Linux distro with a competent Web UI called DSM. With a bunch of extra apps available, and extra security hardening, it’s a great way to manage a NAS and even connect to it with their mobile apps. However, this distro only runs on their own hardware which is a shame and in my opinion a missed opportunity - after all, one of their competitors, QNAP, licenses their OS for third-party use. But there’s one project out there that aims to fix this - XPenology.

XPenology

Think of XPenology as a “jailbreak” for DSM to run on any PC. Their forum has a lot of info, and the project has been around for a number of years now. How it works in a nutshell is by patching the boot image for DSM thus bypassing its hardware restrictions. Installing it has been a bit of a pain over the years, but recently automated loaders have become much easier to use. I’ll be using Arc “Redpill Unleashed” by AuxXxillium which gives off big Xbox softmod hacking energy 😄

Proxmox

In my previous post I mentioned using ESXi but since VMWare’s acquisition by Broadcom, free licenses are no more so I’m trying out Proxmox VE instead, which serves a similar role but instead of a custom hypervisor, it uses QEMU and LXC containers to run workloads. The installation is pretty straightforward, so I’ll assume you already have it running, and will only show you how to create a VM for Arc.

Getting Arc

Download the latest release from the Github repo - you want the “img.zip” file. After extracting it, you must upload it to your Proxmox instance’s local storage. Head to “ISO images” and upload a new one. Once it’s done, it should be on your storage as an iso.

Screenshot of Proxmox UI showing an ISO image uploaded to local storage
Arc ISO in place

Creating the VM

I’ll be passing direct hard drives to the VM for the storage disks, and not disk images like the one for Arc. Feel free to use disk images for testing, but I’d recommend either passing through individual drives or whole SATA controller devices using IO-MMU.

Creating the VM is as easy as following the “Create VM” wizard on Proxmox’s UI:

First, we need a name for the VM

Proxmox create VM wizard step 1
Step 1 - General

Select “Do not use any media” on the OS step, since we’ll be adding the boot disk manually after the wizard

Proxmox create VM wizard step 2
Step 2 - OS

Stick to the default for the “System” step, with the exception of enabling “Qemu agent”

Proxmox create VM wizard step 3
Step 3 - System

For the next step, we want to remove the default disk added by Proxmox, since we’ll be adding the storage disks manually after the wizard

Proxmox create VM wizard step 4
Step 4 - Disks
Proxmox create VM wizard step 4
Step 4 - Disks (default removed)

Next up, cores allocated to the VM. I’d recommend a minimum of 2, with the default type of x86-64-v2-AES as it’s the one I use (others might work as well)

Proxmox create VM wizard step 5
Step 5 - CPU

For memory, I’d recommend a minimum of 4GB

Proxmox create VM wizard step 6
Step 6 - Memory

The network defaults are fine (Arc will get an IP via DHCP)

Proxmox create VM wizard step 7
Step 7 - Network

Final confirmation - make sure Start after created is unchecked, as we still need to tweak the VM a bit before the first boot

Proxmox create VM wizard step 8
Step 8 - Confirmation

Adding boot and storage drives

Once the VM is created, you need to associated the ISO we uploaded to it. SSH into the Proxmox instance and use:

qm importdisk <VM_ID> /var/lib/vz/template/iso/arc-24.5.11.img local-lvm

Proxmox identifies every VM created by id starting at 100 - in my case, this new VM is 101 but adjust the command for your local ID. This will add a new hardware item to the VM’s config:

new disk on VM config
(Detached) boot disk on VM config

Edit this item, selecting SATA as “Bus/Device”.

new disk on VM config
Boot disk as sata0

This way, sata0 is our boot drive. Next, let’s add the storage drives. This is quite easy to do:

qm set <VM_ID> -sata1 /dev/disk/by-id/<your device name>

The device path here should not be /dev/sda or /dev/sdb or so on, since these designations can change between boots if you change the cabling, for example. Be sure to use the “by ID” links to the drives, that you can get from /dev/disk/by-id. For example, with a VM ID of 101 and this disk:

> ls -l /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root  9 mai 12 07:19 ata-WDC_WD30EFRX-68ETZL0_WD-WCC4N1LA97V9 -> ../../sda

The command should be:

qm set 101 -sata1 /dev/disk/by-id/ata-WDC_WD30EFRX-68ETZL0_WD-WCC4N1LA97V9

Repeat this process for sata2 through sata5 drives you might want to add.

Proxmox by default limits VMs to 6 disks (sata0->sata5), so you’ll only be able to add 5 storage disks to this VM in addition to the Arc boot one. I mean, that’s plenty 😅 but if you need more, then you need to add an extra AHCI controller to the VM’s configuration. Just SSH to the Proxmox instance, head to /etc/pve/local/qemu-server and edit the .conf file matching your VM’s id (101.conf) to add the following line:

args: -device 'ahci,id=ahci1,multifunction=on,bus=pci.0,addr=0x9' -drive 'file=/dev/disk/by-id/<your device name>,if=none,id=drive-sata6,cache=unsafe,format=raw,aio=threads,detect-zeroes=on' -device 'ide-hd,bus=ahci1.0,drive=drive-sata6,id=sata6,bootindex=107'

This adds the AHCI controller and a sata6 drive on the given device path to the VM.

With all drives added, your config should resemble something like

final VM config
Hardware config for the VM with all disks

Note that if you added more than the default max of 6 drives with an extra controller, it will not show on the UI.

Finally, we just need to set the sata0 drive as the boot drive

boot order UI
sata0 as boot disk

Configuring Arc

Time to boot the VM and configure Arc. You can use the Console tab on the UI to interact with it.

Arc boot logo
Arc boot logo

On first boot, it will automatically boot into “Config Mode” which is exactly what we need

Arc config mode UI
Arc config mode UI

Let’s start by choosing the Synology model we want to impersonate. Since the server I’m running Proxmox is Ryzen-powered, I’ll choose a copy of the one I own, the DS1621+. If you have an Intel processor, pick another model that has an x on the Arc column and meets your needs.

Arc config mode UI
Choosing a model to impersonate

Next up, which DSM version to use. There’s no reason to not use the latest, 7.2

Arc config mode UI
DSM version to run

I don’t want to use Synology’s services on this “hacked” server, so I choose No - Install with random Serial/Mac on the next step

Arc config mode UI
Using Syno Services or not

Arc allows for a series of “add-ons” for things like removing limitations of DSM, or allow for extra hardware. I select cpuinfo dsmconfigbackup expands hdddb hostspatch multismb3 sensors and storagepanel

Arc config mode UI
Arc addons selection

We’re ready to build the loader - select “Yes”

Arc config mode UI
Let's go!

You’ll see a confirmation screen. Pay close attention to the Disks (internal) number (which is 0 in my example, as this is just a test VM for this post) and make sure it reflects how many disks you added to the VM before

Arc config mode UI
Confirmation screen

Arc will download the version of DSM you requested, and patch it for use

Arc config mode UI
DSM version download

After patching the DSM download, we get a final confirmation before rebooting

Arc config mode UI
All done

Once rebooted, the default boot option will be “DSM mode”

Arc config mode UI
Boot mode defaulting to DSM

Installing DSM

Now that your VM is running with Arc’s patch done, it will be in “install mode” waiting for you to finish the DSM installation. To proceed, go to http://find.synology.com and after a little scan of your local network, you should see a new device ready to install

DSM ready to install
DSM ready to install

From this point onward, it should be straightforward to install DSM and create a storage pool (DSM will ask you to create it on first login). One final thing to install is the Qemu agent package, so that Proxmox can talk to the VM better. First, enable the SSH service in DSM’s control center:

Activating SSH on DSM's control center
Turning SSH on

Then, access DSM’s Package Center and install the app (already installed in this screenshot)

Qemu Agent app
Qemu Agent app

Finally, to activate the package, login via SSH to the DSM instance (not Proxmox!) and run:

sudo sed -i 's/package/root/g' /var/packages/qemu-ga/conf/privilege

On the Proxmox UI, the agent should now be enabled. A sign of it will be extra IP address info on the VM’s summary tab

Qemu Agent running
Qemu Agent runnings

Parting words

This is a great way for me to use my leftover hard drives on some server, mostly as a backup to my main NAS. Hope it’s useful for you too! Let me know on this toot if you have any questions or comments.

Until next time! 🖖