I've recently set up a new computer using Debian 9.1 . During the initial configuration, I installed the desktop environments Gnome and LXDE.

Presently the system is set up to use Gnome as the (default) desktop. Also, it looks like the window manager is lightdm.

I would like to know how to switch to LXDE. All the other questions I've seen related to this topic hint at how to change the window manager, or how to install a new desktop environment; but I already have the environments I want to work with installed. A best answer would be a mechanism to switch to an arbitrary desktop environment (I might like to try KDE some day).

Some extra notes: This system is headless, while it does have a video display, I'm not using it (I can connect a monitor, but with some difficulty). I connect using SSH, and VNC (Xvnc TigerVNC 1.7.0). When I connect to the VNC server, it starts up a Gnome desktop immediately. During the set up of Debian (after the install), I did have a monitor attached, I don't remember the welcome/login screen ever asking which desktop environment I wanted to use.

TL-DR; How do I switch the default desktop environment between already installed desktops (Gnome,LXDE,KDE,etc) in Debian 9 ?


4 Answers 4


On my brand-new install of Debian 9 (stretch), I see options on the top right of the login window. They are icon based, one each for GE (Graphical Environment), Keyboard layout, Accessibility and power. When clicked, the GE icon drops down a list of installed environments.

  1. Power up the system, or log out if already up.
  2. At login window, before entering credentials, click GE icon at top right
  3. Login



It looks like the VNC server skips LightDM altogether, and just starts its own X server with the default window manager/desktop.

You can pick which desktop gets started by creating a ~/.vnc/xstartup script (https://askubuntu.com/q/352232/6016) that will be run when you connect. Instead of the X server being started with the defaults, it will be started and those commands will be run.

If you wanted to try LXDE, you could make an xstartup script with the following (untested) command:

exec startlxde

But that still wouldn't let you choose what desktop to use, it would just start up LXDE instead of the default.

For the ability to pick from a desktop/window manager session, you could use LightDM to start the VNC server (https://wiki.archlinux.org/index.php/LightDM#VNC_Server), which would let you log in and select a desktop/window manager via LightDM (also untested, for now :D ).


LightDM should have a switch somewhere on it's panel, (I don't use it so can't say exactly where) to switch from Gnome to LXDE or any other DE installed. That is what a login manager does.

Update: I found a screenshot that shows what I mean. From Screenshots.Debian.netenter image description here


With Centos7 vncserver there is an option -xstartup. So it should be possible to have some variant files for the different desktops and then just call them accordingly.

vncserver :30 -xstartup ~/.vnc/xstartup.kde
vncserver :30 -xstartup ~/.vnc/xstartup.mate

I myself have a single xstartup, that checks for a preferred desktop.

DSKTPMSESSION="$(type -p mate-session)"
DSKTPSTARTKDE="$(type -p startkde)"

Then I just comment out the relevant bit before launching which is a bit cumbersome. If you want to see it I have a question open on it: Centos 7 VNC xstartup multiple desktops MATE, KDE but can't get gnome-classic if DESKTOP=KDE

You must log in to answer this question.

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