Skip to content

Unofficial: Dualboot with Windows

This guide uses the official installer image. Instead of letting the installer wipe the disk, you run a similar systemd-repart --copy-from command it uses yourself, but against a disk that already has Windows on it. Your Windows partitions and the EFI system partition (ESP) are left as they are, and AstrOS is added next to them.

  1. Your EFI Partition needs to be at least 1G.

    For existing installs use: Arch Wiki: Replace the partition with a larger one

    For fresh installs use: Arch Wiki: dictate the size of the EFI system partition during installation

  2. Disable Secure Boot and verify that Windows still boots up. You can re-enable it later with the astros+microsoft secureboot keys.

  3. Lastly, open Disk Management and shrink your Windows NTFS partition.

  1. Download the official installer and write it to a USB stick as described on the installation page.

  2. Boot the USB stick. The installer starts on its own. Just leave it on its first screen and don’t answer its prompts.

  3. Switch to a second console with Ctrl+Alt+F2 and log in as root with the password AstrOS.

  4. Find your Windows disk. It’s the one with the EFI System, Microsoft reserved and Microsoft basic data partitions:

    Terminal window
    lsblk -o NAME,SIZE,PARTTYPENAME,PARTLABEL
  5. Dry run the installation. Compared to the installer, --empty=force (wipe the disk) is replaced by --empty=refuse (keep the existing partition table):

    Terminal window
    DEFS=$(mktemp -d)
    systemd-repart \
    --dry-run=yes \
    --empty=refuse \
    --seed=random \
    --definitions="$DEFS" \
    --copy-from=/images/AstrOS.raw \
    "/dev/disk-containing-windows"

    Check the output:

    • The ESP and all Windows partitions must show no changes (no → in their size column).
    • Make sure AstrOS_<version> gets the remaining free space as padding. First boot uses it to grow /usr to 5G and to create the second update slot and your encrypted root partition.
  6. If everything looks good, run it again with --dry-run=no.

  7. Since the ESP already existed, systemd-repart kept it as it is and didn’t copy anything into it. Copy the content of the image’s ESP to your system’s ESP:

    Terminal window
    LOOP=$(losetup -frP --show /images/AstrOS.raw)
    mkdir -p /mnt/image-esp /mnt/esp
    mount -o ro "${LOOP}p1" /mnt/image-esp
    mount "/dev/esp-partition" /mnt/esp
    cp -rv /mnt/image-esp/. /mnt/esp/
    umount /mnt/image-esp /mnt/esp
    losetup -d "$LOOP"
  8. Create a boot entry (only required on some hardware).

    Terminal window
    efibootmgr --create --disk /dev/sdX --part Y --loader '\EFI\systemd\systemd-bootx64.efi' --label "AstrOS" --unicode
  9. Reboot and remove the USB stick:

    Terminal window
    systemctl reboot