Skip to main content

Synology

Synology provides NAS storage and hosts virtual machines for the homelab. It is used for centralized file storage, running VMs (Ubuntu, Flatcar), hosting Docker containers, and automating tasks with Ansible and scripts.

Key technologies: Synology DSM, Synology VMM, Docker, Ansible, SOPS.


Ubuntu VM Installation

  1. Download Ubuntu Server live 23.10 ISO.

  2. Create a VM with 4 cores, 16GB RAM, 100GB SSD, VGA graphics.

  3. Install Ubuntu to disk:

    • Set keyboard layout
    • Set username/password
    • Enable OpenSSH Server
    • Leave other settings default
    • Reboot
  4. Shutdown the VM and unmount the ISO.

  5. Install QEMU Guest Agent:

    sudo -i
    apt-get -y install qemu-guest-agent
    shutdown -h now
  6. Set a fixed IP via DHCP.

  7. Prepare the VM:

    sudo -i
    swapoff -a && sed -i '/ swap / s/^/#/' /etc/fstab && rm /swap.img
    apt-get -y install nfs-common

    Install k3s:

    curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--flannel-backend=none --disable-network-policy --disable traefik" sh -

    (Optional) Add Docker registry credentials and reload k3s as needed.


Flatcar VM Installation

  1. Set a password for the core user:

    sudo passwd core
  2. SSH in as core.

  3. Create an ignition config (flatcar.ign) or generate one from Butane:

    Example ignition config:

    {
    "ignition": { "version": "3.3.0" },
    "storage": {
    "files": [
    {
    "overwrite": true,
    "path": "/etc/flatcar/update.conf",
    "contents": { "compression": "", "source": "data:,REBOOT_STRATEGY%3Doff%0A" },
    "mode": 272
    }
    ]
    },
    "passwd": {
    "users": [
    { "name": "core", "sshAuthorizedKeys": ["<id_rsa.pub>"] }
    ]
    }
    }

    Or generate with Butane:

    variant: flatcar
    version: 1.0.0
    passwd:
    users:
    - name: core
    ssh_authorized_keys:
    - <replace-me-with-public-ssh-key>

    Generate ignition file:

    podman run --interactive --rm quay.io/coreos/butane:release --pretty --strict flatcar.bu flatcar.ign
  4. Install Flatcar to disk:

    sudo flatcar-install -d /dev/sda -i flatcar.ign
    shutdown -h now