ZFSBootMenu - installing Debian with a desktop environment

I recently installed Debian with ZFSBootMenu, a way to install Linux with ZFS on root that allows for FreeBSD-esque boot environments. However, it is pretty bare bones in the install and installs Debian with debootstrap. This leaves you without a graphical interface, only the root user, and no easy way to connect to a network to install a graphical interface. Here is what I did to avoid these papercuts:


After the step to “ZFS Configuration” (while in chroot), insert these steps:

  1. Install tasksel:

    apt install tasksel
    
  2. Install the KDE desktop (or gnome-desktop, etc):

    tasksel install desktop kde-desktop laptop
    
  3. Set your username for the subsequent commands:

    USERNAME=username-you-want-to-create
    
  4. Add your user and set a password:

    adduser ${USERNAME}
    
  5. Add your new user to the sudo group:

    usermod -aG sudo ${USERNAME}
    

    Steps 6-10 are optional to put the user directory in it’s own zfs dataset

  6. Move the home directory temporarily:

    mv /home/${USERNAME} /home/${USERNAME}_temp
    
  7. Create a new zfs dataset for the new user:

    zfs create zroot/home/${USERNAME}
    

    You can create other datasets here too (zroot/home/${USERNAME}/Documents, etc.)

  8. Change the ownership on the mountpoint of the dataset to the new user:

    chown -R ${USERNAME}:${USERNAME} /mnt/home/${USERNAME}
    chmod -R 750 /mnt/home/${USERNAME}
    
  9. Copy the home directory contents into the new dataset:

    rsync -ahP /home/${USERNAME}_temp /mnt/home/${USERNAME}
    
  10. Remove the temporary home directory:

    rm -r /home/${USERNAME}_temp
    

    You can repeat steps 3-10 for more users.

  11. Install the firmware-linux package and any other for your hardware (this is for my Qualcomm Wifi chip):

    apt install firmware-linux firmware-atheros
    
  12. Update the initramfs:

    update-initramfs -u -k all
    

Then continue one with the rest of the steps from ZFSBootMenu.