r0b0 / debian-installer

Opinionated Debian Installer - alternative debian installer for laptops and desktop PCs
GNU General Public License v3.0
44 stars 3 forks source link
debian

Opinionated Debian Installer

This tool can be used to create a modern installation of Debian. Our opinions of what a modern installation of Debian should look like in 2024 are as follows:

Limitations

Downloads

Desktop environment Download SHA-256 Checksum
KDE Plasma opinionated-debian-installer-bookworm-kde-plasma-20240929a.img (5.1GB) 08278bf0 4d512918 7ea106dd 544388c0 ec54564e 3982a096 047f9f83 9feaf48f
Gnome opinionated-debian-installer-bookworm-gnome-20241020a.img (4.3GB) f329462a 358a7bed 89bb2d7c b0a194da df2d0a11 028e226f a65da968 6ffe07f4
Server opinionated-debian-installer-bookworm-server-20241110a.img (1.9GB) 9b4a37fc d371ae1b4 ce143eb 58e97e66 a1805497 466cf696 4dd7ebdf bed42833

Instructions

  1. Download one of the live image files from the table above
  2. Write the image file to a USB flash drive. Do not use ventoy or similar "clever" tools - they are not compatible with these images. If you need a GUI, use etcher or win32DiskImager or just use dd - dd if=opinionated-debian-installer*.img of=/dev/sdX bs=8MB status=progress conv=sync where sdX is your USB flash drive
  3. Boot from the USB flash drive
  4. Start the installer icon from the desktop/dash, fill in the form in the browser and press the big Install button
  5. Reboot and enjoy

Screencast & Screenshot

Video of installation of Debian with KDE Plasma:

Watch the video

Screenshot of the full installer GUI:

gui screenshot

Details

(Optional) Configuration, Automatic Installation

Edit installer.ini on the first (vfat) partition of the installer image. It will allow you to pre-seed and automate the installation.

If you edit it directly in the booted installer image, it is /boot/efi/installer.ini Reboot after editing the file for the new values to take effect.

Headless Installation

You can use the installer for server installation.

As a start, edit the configuration file installer.ini (see above), set option BACK_END_IP_ADDRESS to 0.0.0.0 and reboot the installer. There is no encryption or authentication in the communication so only do this on a trusted network.

You have several options to access the installer. Assuming the IP address of the installed machine is 192.168.1.29 and you can reach it from your PC:

Testing

If you are testing in a virtual machine, attaching the downloaded image file as a virtual disk, you need to extend it first. The image file that you downloaded is shrunk, there is no free space left in the filesystems. Use truncate -s +500M opinionated*.img to add 500MB to the virtual disk before you attach it to a virtual machine. The installer will expand the partitions and filesystem to fill the device.

Libvirt

To test with libvirt, make sure to create the VM with UEFI:

  1. Select the Customize configuration before install option at the end of the new VM dialog
  2. In the VM configuration window, Overview tab, Hypervisor Details section, select Firmware: UEFI

virt-manager uefi screenshot

To add a TPM module, you need to install the swtpm-tools package.

Attach the downloaded installer image file as Device type: Disk device, not CDROM device.

Hyper-V

To test with the MS hyper-v virtualization, make sure to create your VM with Generation 2. This will enable UEFI. TPM can be enabled and Secure Boot disabled in the Security tab of the Hyper-V settings.

You will also need to convert the installer image to VHDx format and make the file not sparse. You can use qemu-img (windows download) and fsutil like this:

qemu-img convert -f raw -O vhdx opinionated-debian-installer-bookworm-kde-plasma-20230319a.img odin.vhdx
fsutil sparse setflag odin.vhdx 0

Attach the generated VHDx file as a disk, not as a CD.

Hacking

Alternatively to running the whole browser based GUI, you can run the installer.sh script manually from a root shell. The end result will be exactly the same. Just don't forget to edit the configuration options (especially the DISK variable) before running it.

Creating Your Own Installer Image

  1. Insert a blank storage device
  2. Edit the DISK variable at the top of files make_image_*.sh
  3. Execute the make_image_*.sh files as root

In the first stage of image generation, you will get a tasksel prompt where you can select a different set of packages for your image.

Installer Image Structure

There are 3 GPT partitions on the installer image:

  1. EFI boot partition
  2. Base Image - Btrfs partition with maximum zstd compression. When the live system is running, this is used as a read-only lower device for overlayfs. When installing the target system, the installer will copy this to the target system, mount it read-write, resize to expand to the whole partition and continue with the system installation.
  3. Top Overlay - upper and work device for the overlayfs for the live system. The changes you make while the live system is running are persisted here.

Building the Front-End

The front-end is a vue application. You need npm to build it. Run the following commands to build it:

cd frontend
npm run build

Building the Text-User-Interface Front-end

The TUI front-end is a go application. Run the following commands to build it:

cd frontend-tui
go build -o opinionated-installer-tui

Configuration Flow

flowchart LR
    A[installer.ini] -->|EnvironmentFile| B(installer_backend.service)
    B -->|ExecStart| C[backend.py]
    D(Web Frontend) --->|HTTP POST| C
    E(TUI Frontend) --->|HTTP POST| C
    G(curl) --->|HTTP POST| C
    C -->|environment| F[installer.sh]

Output Flow

flowchart RL
    C[backend.py] -->|stdout| B(installer_backend.service)
    C --->|websocket| D(Web Frontend)
    C --->|websocket| E(TUI Frontend)
    C --->|HTTP GET| G(curl)
    F[installer.sh] -->|stdout| C

Comparison

The following table contains comparison of features between our opinionated debian installer and official debian installers.

Feature ODIN Netinstall Calamares
Installer internationalization N Y Y
Mirror selection, HTTP proxy support N Y N
Manual disk partitioning, LVM, filesystem selection N[4] Y Y
Btrfs subvolumes Y[2] Y[3] Y[2]
Full drive encryption Y Y[1] Y
Passwordless unlock (TPM) Y N N
Image-based installation Y N N
Non-free and backports Y N N
Browser-based installer Y N N

[1] /boot needs a separate unencrypted partition

[2] @ and @home (timeshift compatible)

[3] @rootfs

[4] Fixed partitioning (see Details above), LUKS is automatic, BTRFS is used as filesystem