Is it possible to start a desktop environment entirely in systemd-nspawn or chroot?

I want to be able to boot to a console, then optionally enter a chroot and launch Gnome or another desktop environment.

1 Answer 1


Launching a DM from chroot is in fact possible (if configured correctly). A thorough tutorial can be found here. The process can be summarized as such:

  1. Mount the special mountpoints (/dev, /proc, etc) from your host to your chroot.
  2. chroot
  3. Start the X server (startx)
  4. Start your display manager

All of the corresponding commands can be synthesized into a bash script for convenience.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .