.docs/install-os.md
Docs/install-os.md

OS & Live Installer

Monarch.linux is an Arch-based KVM host distribution installed from a browser. The live ISO boots into a minimal environment that serves a Nuxt 4 web installer on your local network.

Base system & preinstalled packages

  • Kernel & base: Arch core/extra + CachyOS generic x86-64 repository only (no v3/v4 AVX2 requirement), linux-lts with headers, Intel and AMD microcode, ext4 root, and GRUB for both legacy BIOS and UEFI (including the --removable fallback path).
  • Virtualization: qemu-full, qemu-img, libvirt, virt-install, edk2-ovmf, dnsmasq, and swtpm. QEMU runs as libvirt-qemu:libvirt-qemu, /home/QEMU/{ISO,QCOW} are configured as autostarted ISO and QCOW pools, and the admin user is placed in wheel, libvirt, libvirt-qemu, and kvm. Nested KVM and IOMMU (intel_iommu=on iommu=pt) are configurable in the wizard.
  • Networking: systemd-networkd and systemd-resolved. The bridge virtbr0 sits on top of the selected NIC and inherits its MAC address so existing DHCP reservations stay intact. lan (bridge mode) becomes the default libvirt network for new VMs while NAT default remains available.
  • Utilities & agents: yay (yay-bin), monarch-daemon (always enabled), optional monarch-panel, btop, zsh with oh-my-zsh, fastfetch, git, sudo, openssh, pacman-contrib, wireguard-tools, and netclient v1.7.0 (pinned by SHA-256).

Building the ISO

On an Arch or CachyOS machine:

sudo pacman -S --needed archiso base-devel git nodejs npm dotnet-sdk librsvg ttf-dejavu jq
git clone https://code.weexnes.dev/monarch/linux.git
cd linux
./build.sh packages        # unprivileged: builds AUR/Monarch packages into [monarch] repo
sudo ./build.sh offline    # optional: caches all target packages for air-gapped installs
sudo ./build.sh iso        # runs mkarchiso -> out/monarch-0.1.0-x86_64.iso

Booting and accessing the installer

Write the ISO to a USB stick (replacing /dev/sdX with the target device):

sudo dd if=out/monarch-0.1.0-x86_64.iso of=/dev/sdX bs=4M oflag=direct status=progress conv=fsync

Alternatively, mount the ISO via IPMI or iDRAC virtual media. The boot menu supports legacy BIOS (syslinux), UEFI (systemd-boot), and a copy to RAM option that lets you unplug the USB stick after boot.

On tty1, the live system prints:

  • https://<address>/ for every LAN IP (with a QR code for the first address)
  • A one-time access code
  • The SHA-256 fingerprint of the installer's self-signed TLS certificate

The installer binds only to private addresses (RFC 1918, CGNAT, link-local, ULA). nftables drops everything else, and SSH is disabled on the live environment. After comparing the browser's certificate fingerprint against tty1, enter the access code to start a 12-hour session.

Wizard steps

  1. Hardware — CPU, memory, NICs, and detected block devices.
  2. System — Hostname, timezone, locale, keymap, kernel flags (nested KVM / IOMMU).
  3. Users — Admin user (wheel, libvirt, libvirt-qemu, kvm) and SSH keys.
  4. Storage — Drag disks (or use the mobile menu) into System, Data volume, Cache, or Unused roles.
  5. Network — Choose the bridge NIC and static or DHCP addressing for virtbr0, with live previews of the generated systemd-networkd and libvirt files.
  6. Virtualization — Storage pools and libvirt network setup.
  7. Fleet — Run monarch-panel locally on this host (using local-join.json), or enroll into a remote panel with a join token and fingerprint on first boot. Optionally supply a Netmaker token or enable native ClyoCloud integration.
  8. Review — Lists every disk to be wiped and shows the dry run: every exact command and generated file (with passwords and tokens redacted). Nothing touches a disk until you type ERASE.
  9. Install — Streams live installation progress over WebSocket. Logs are written to /run/monarch/install.log (live) and /var/log/monarch-install.log (target).

First boot & ClyoCloud

monarch-firstboot.service runs once on the installed system to:

  • Install netclient and join Netmaker if /etc/monarch/netclient-token was provided (then shreds the token).
  • Enroll monarch-daemon against a remote panel using /etc/monarch/join/* if configured (then wipes the join token).
  • Start the ISO and QCOW libvirt storage pools and the lan bridge network.

If clyocloud is enabled in the Fleet step, Monarch installs the unmodified AUR package and applies configuration outside package-owned paths (/etc/systemd/system/clyocloud.service.d/zz-monarch.conf, /etc/clyocloud/clyocloud.env, /etc/clyocloud/secret.env, /etc/sysusers.d/monarch-clyocloud.conf, and /etc/tmpfiles.d/monarch-clyocloud.conf) so yay -Syu upgrades never overwrite your setup.