Synology introduced Docker support back in May 2015. It was the start of a brand new era for Synology NAS users. This was when DSM was in its fifth major version.

Soon after the proprietary Docker package included a DSM option inside it, allowing the users to run one additional instance of DSM free of charge. This was a great way to test out new updates, packages, and configurations without needing to update the host device first, especially because DSM does not support downgrading.

Docker package back in the day. Notice the DSM section in the upper left corner

The requirement was an Intel-driven NAS with enough RAM (1GB additional was needed for the Docker DSM instance) and we had to be mindful of the host DSM version. The catch was that the DDMS (Docker DSM) instance had to be on the same version as the host NAS.

If that was not something we wanted, we had an option just like today, to run an additional instance inside Virtual Machine Manager (VDSM).

At the end of 2019, Synology started to sunset some 3rd party apps and functionalities, so in Docker package version 18.9-0506. DDSM was removed altogether after the update.

  1. Docker DSM will reach End-Of-Life on December 31, 2019. This will not affect activated Docker DSM licenses, and you can check their expiration date in the package.
  2. The DDSM tab is removed and no longer supported if there is no running Docker DSM in Docker.

After that Synology started to push with its VMM package and continued to offer DSM instances as part of its feature. VMM included one free license for an additional DSM but any other instance has to be purchased.

vDSM - DSM Multi-tenant solution
How to run and configure VDSM (virtual Disk Station Manager) by Synology. Turn your NAS into a multi-tenant solution. When and why you would use VDSM? Check it out.

For a detailed overview of the VDSM deployment, check this article

DDSM is back (sort of)!

In April of last year, April 1st, 2023 no less, a user kroese announced the development of a Virtual DSM setup that can run inside Docker. To not mix up VDSM (Virtual DSM) and Docker DSM, from this point forward I will be addressing this solution as DDSM.

The reason why it was called Virtual DSM is that it uses Synology's official VDSM package and runs it inside Docker.

GitHub - vdsm/virtual-dsm: Virtual DSM in a Docker container.
Virtual DSM in a Docker container. Contribute to vdsm/virtual-dsm development by creating an account on GitHub.

Virtual DSM (or DDSM) Github page by Kroese

The Docker image is also hosted on the official hub.docker.com page under the vdsm/virtual-dsm name.

The GirHub page is well documented, so anyone with some Docker knowledge will have no issue using this setup.

Before going with the actual setup and testing, Synology has confirmed via an official reply, that this project is completely safe and legitimate:

We've confirmed that the release of Virtual DSM on GitHub is known by SIRT and for now we are not going to take actions to have it removed since it does not lead directly to any security concerns.

💡
NOTE: SIRT is short for Security Incident Response Team. This is Synology's PSIRT team that manages the receipt, investigation, coordination, and public reporting of security vulnerability information regarding Synology products.

Now that we know Synology is ok with it, let's move forward with the actual deployment.

Deploying Virtual DSM via Docker (compose)

With the release of Synology 7.2, their Docker support has finally got some love as well in the shape of a new and improved Docker client for DSM, called Container Manager.

New name, new logo, Container Manager is still Docker under the hood
DSM 7.2 public beta is LIVE
The new #Synology #DSM 7.2 beta is now live! Volume encryption, WORM, and a few other new features have made it in this release.

Container Manager announced in DSM 7.2 beta (March 2023)

This solution can be deployed on any number of Docker hosts, not just Synology NAS machines, and that means that we can use docker-compose to deploy it using the Container Manager, pure command line, or any other Docker management solution, like Portainer.

I am a Portainer user, but regardless of what we chose as our deployment platform, the compose file is the same.

version: "3"
services:
  dsm:
    container_name: dsm
    image: vdsm/virtual-dsm
    environment:
      DISK_SIZE: "16G"
    devices:
      - /dev/kvm
    cap_add:
      - NET_ADMIN
    ports:
      - 5000:5000
    volumes:
      - /var/dsm:/storage
    restart: on-failure
    stop_grace_period: 2m

The default compose code as listed above will get us started with no issues at all. DDSM instance will be in the end again presented on port 5000 using the Docker host IP address.

If we are running this on a Synology NAS that by default runs on 5000 port, we will have to change the ports parameter to some other value like 5500:5000 to avoid conflict.

The volumes parameter also needs to change to accommodate the location of the "storage pool" and its volume.

The image supports all sorts of changes, from network to ports, adding more storage volumes, CPU and RAM, and more. As mentioned before, the GitHub page is very well documented, so edit and modify the compose code to your liking.

The log file as the DDSM process begins

The current version of the image will by default use the DSM_VirtualDSM_69057.pat file that will load up the DSM 7.2 version. Automatic or manual updates are fully supported and work as expected.

In case we want to use a specific version, we simply need to alter the URL variable and point to the exact PAT file of our choice:

environment:
  URL: "https://global.synologydownload.com/download/DSM/release/7.0.1/42218/DSM_VirtualDSM_42218.pat"
🚨
NOTE: Keep in mind that the supported version of the host needs to have all the prerequisites to run with no issues. Here is an example of running the DDSM version 7.2 on Synology 7.1.1 host:

Trying to run DDSM 7.2 on a 7.1.1 Synology DSM host

Following the same install and post-install setup (setting up the name, account, etc), we are allowed to log in and use the new DDSM instance.

The Docker DSM instance is up and running

The location of all data saved inside the DDSM's "volume" will be part of a single data.img file saved in the configured location on the host.

List of all the files that make up the storage content of a particular DDSM instance

Why would I use a DDSM instance instead of a VDSM (via VMM)?

Just as the situation back in the day was with models in 2015, the same rule applies today. Certain models (like the DS223) simply do not support VMM (Virtual Machine Manager), but Container Manager (aka Docker) on the other hand works and is supported.

Synology DS223 overview
One of the new #Synology value series models has arrived. The new #DS223 is here bringing more than meets the eye. Lots of features in a compact 2-bay design

One of the current 2-bay model that doesn't support VMM but does support Container Manager, the DS223

Considering that the CPU and RAM utilization will be the same in either case (DDSM vs VDSM) there is no winner there. The only reason that was already mentioned was that if we run an instance inside VMM we can run any compatible and supported version of DSM that we want, whereas with Docker we can only run the host-supported version (in the case of a Synology NAS that is).

Also, some might just find it easier and more "natural" to run a container than a full-blown VM. Considering that this instance can be run on any Docker-compatible host (not just a Synology NAS), like an Ubuntu machine running on Proxmox, the scenarios are endless.

Finally, it is nice to have a choice if nothing else. For someone who already has DSM running inside VMM, this will allow for any number of additional DSM instances running with no licenses needed.

A well-documented, tested, and agile solution using clean Synology PAT files and Docker standard deployment will allow anyone looking into Synology DSM to have all the benefits of the OS without the need to buy the NAS. Still, saying that there are two things that this deployment will not support. The Virtual Machine Manager package is not available, and the Surveillance Station will not include any free licenses.

Application for this implementation will for sure find a home with many self-hosters and homelab enthusiasts as well as anyone not having a spare Synology NAS that could come in handy for testing that new version of DSM or Synology package.