I want to try out X11 on a Raspberry Pi (running as a server without display connected, OS Raspbian) and access it through VNC.

I don't like LXDE very much, so I want to change to another window manager. I tried many things, but LXDE is always starting.

Following packages are installed:

sudo aptitude install x-window-system xfce4 xfce4-themes x11vnc icewm fluxbox gnome tightvncserver

I am running the server with following command:

vncserver -geometry 800x600 :0

When I connect to the Raspberry Pi using RealVNC, I come to the LXDE desktop.

What I have tried so far:

I ran sudo update-alternatives --config x-window-manager and changed it from openbox to xfwm4

$ update-alternatives --config x-window-manager
Es gibt 5 Auswahlm¦glichkeiten f¦r die Alternative x-window-manager (welche /usr/bin/x-window-manager bereitstellen).

  Auswahl      Pfad                   Priorit¦t  Status
  0            /usr/bin/openbox        90        Auto-Modus
  1            /usr/bin/icewm          50        manueller Modus
  2            /usr/bin/metacity       60        manueller Modus
  3            /usr/bin/openbox        90        manueller Modus
  4            /usr/bin/startfluxbox   50        manueller Modus
* 5            /usr/bin/xfwm4          60        manueller Modus

I have edited /etc/X11/default-display-manager and changed it from /usr/sbin/lightdm to /usr/bin/icewm.

After a system reboot, I ran the vncserver again, and again I come to LXDE.

I am seeing openbox and lxsession in the process list:

$ ps aux | grep lx
daniel    3604  0.0  0.3  12904  1516 pts/0    Sl   01:39   0:00 /usr/bin/lxsession -s LXDE -e LXDE
daniel    3614  0.1  1.3  15268  6160 pts/0    S    01:39   0:00 openbox --config-file /rasdata/profiles/daniel/.config/openbox/lxde-rc.xml
daniel    3616  0.6  2.2 113392 10060 pts/0    S    01:39   0:02 lxpanel --profile LXDE
daniel    3632  0.0  1.0  26352  4680 pts/0    Sl   01:39   0:00 /usr/lib/arm-linux-gnueabihf/lxpolkit
daniel    3684  0.0  0.1   3836   816 pts/0    S+   01:46   0:00 grep lx

I am currently not sure which window manager I want to have. I will try all and find out the one which I like most. At the moment I am trying to find a way to change it somehow away from LXDE.

I liked KDE very much, but it does not seem to be included in Raspbian. The package could not be found in aptitude.

  • 1
    Isn't just removing LXDE enought?
    – Braiam
    Commented Aug 24, 2014 at 0:08
  • As you can see in my aptitude command line, I have never installed lxde explicitly. So it was probably a dependency of something different. Also, I see that leafpad requires lxde, and I liked this editor. Also, there must be a possibility to switch to another windowmanager/desktopmanager without uninstalling it. Commented Aug 24, 2014 at 0:15
  • Just to add a note. Raspberry OS core as of posting does not have xorg installed.
    – Paul C
    Commented Dec 31, 2020 at 1:23

3 Answers 3


X11 is already on your computer

X11 should already be installed on your system. Basically all Linux distros use it. LXDE runs on top of Xorg. Wayland is becoming the popular alternative to X Windows, but is still buggy. I'd wait to switch to it. So, what I'm saying is that you are already using X11. If not, I'd be extremely confused.

What you want to do is install a new windows manager, which is what LXDE is. Enlightenment and Openbox are good alternatives that are lightweight. KDE is my favourite, but it is a little heavier. With the Rasp pi I would stick lightweight though. If you are not going to hook it up to a monitor, then I suggest a headless system and just using the -X option with ssh.

Installing a new Windows Manager

Install the new windows manager then edit .xinitrc so that it starts the correct manager.

For example if you wanted to use KDE then install KDE (#apt-get install kde or #apt-get install kdebase, which is better for a pi but will require a little more set up) and then change your .xinitrc file. You'll see exec startlxde which needs to be changed to exec startkde

The exec command will change for your preference of windows manager.

SSHing into your pi

Now if you are sshing into your pi and want to run a program graphically then you need to do

ssh -X user@raspberry-pi-address:portnumber; gtk-program

This will still work if you are using a headless system without a windows manager. This will also be much faster than using vnc. Basically, if you aren't connecting your pi to a monitor then do this.

  • I suggest deleting ":portnumber;" from the ssh command. The port number has a standard default and the semicolon breaks the command. Commented Aug 24, 2014 at 4:45
  • I could edit it, but you should edit /etc/ssh/sshd_config instead so that it is not on the default port. If it is only accessible from the internal network then it is fine being left on 22, but if you are allowing access from outside then you should change it to a random port number for security reasons. Commented Aug 24, 2014 at 4:50
  • There are a few problems... (1) The packages "kde" or "kdebase" are not available (no candidate found). (2) There is no .xinitrc file and when I create one (e.g. with contents !#bin/bash [new line] icewm-session), it will be ignored. (3) I am running it in VNC since it was really annoying that every window was included into my Windows taskbar when I used SSH with X-forwarding. I just want to have one linux desktop with its opened programs, separated from my Windows programs. Commented Aug 24, 2014 at 9:09
  • Try "apt-cache kde" (or kdebase, kde-base) to find it. It may be labelled differently in your repo. Though it should be called kde (use "| sort" to help locate). .xinitrc should be included. If not, make your own. the .xinitrc file is an x initiation file. So as soon as x starts it executes these lines (much like how bashrc runs as soon as you run a terminal). Try "sudo find / -name .xinitrc" to see if it is anywhere. And I assure you, it will be faster to do X forwarding. VNC is pretty slow and clunky. Not meant for the raspberry pi. Commented Aug 24, 2014 at 10:04
  • The packages are not there. As I said, I made my own .xinitrc (find did not find any others), but it gets ignored or the commands fails since another window manager (lxsession) is already running(this is the message I get when I try to run any other window manager).X-Forwarding really doesn't help,unless there is a possibility to have a X-window that contains the whole desktop and all windows.At the moment,the Windows are even hiding my Windows taskbar. It is impossible to work with something like that: imgur.com/kOhVcrS .Also,I have several icons in my taskbar with just an "X" icon. Commented Aug 24, 2014 at 11:17

The answer is easier than expected. Just install xrdp and I can enjoy a full Linux desktop environment on my Windows machine, without having 20 X-Windows flowing around.

Also, it is important to know the difference between "Window Manager", "Session Manager", "Display Manager". Alas, nobody did explain that I was probably using wrong terms, and I am very confused about them, so I don't know which of these 3 things I need to change to get a "new GUI".


I suppose it's a bit late, but in case someone else is dealing with the same issue, here is what is going on.

The reason you are confused by this is because the session running on the VNC server and the session running on the local desktop don't have to be related to each other. In fact, they will only be related if you actually run a local GUI and then specifically serve it out (the servers Vino (for Gnome), krfb (for KDE), and x11vnc will serve out local sessions by default). It sounds like the local GUI isn't being run, so all the changes you made that would normally affect it aren't doing anything since it never gets started.

When you run a VNC server apart from the local GUI, it may or may not default to the same window manager as the local GUI. It will do whatever it is configured to do in the file ~/.vnc/xstartup (which is copied into your home directory the first time you start the server). If that file tells it to run another copy of the locally defined GUI, it will. If that file tells it to run some other GUI instead, it will do that. So if you want to change the window manager run by vncserver, you need to change that file, or change the script or link that file points to.

You must log in to answer this question.

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