Fixed: LXDE-core startlxde gives Gtk-WARNING **: cannot open display: error message

I’d be tasked with installing a GUI on a server for someone else to use. I opted for LXDE as it’s so lightweight and I just wanted the core, no extra gumph. I ran into an issue launching lxde once I’d installed it. Here’s how I fixed it:

Installed LXDE Core
sudo apt-get install lxde-core

I then went to try startx, how I’d normally start a shell if I’d installed gnome or such, startx didn’t exist, so I tired startlxde. It came back with the error “Gtk-WARNING **: cannot open display:
After a bit of searching online I found some people were saying about .xinitrc, but I didn’t have an xinit…. neither did it seem that I had xinit. So I tried the following with instant success

The Fix

Install xinit
sudo apt-get install xinit

Start X
startx

One thought on “Fixed: LXDE-core startlxde gives Gtk-WARNING **: cannot open display: error message

  1. Hi, I found your posting because I am searching for a solution for my problem. I am running Lubuntu 14.04 and updated the kernel recently via the normal software update. I also messed with PCmanFM and its LibFM, because I wanted to update those and it did not work out. In doing so I downloaded archlinux stuff and tried to “./configure” and “make”, which did not work out for reasons I dont know. However, after all this happened parallel I now cannot log into my Lubuntu any more. I get a strange looking login screen (greeter), put in my gredentials but then a grey screen appears and I can only access context menues. I have a feeling that my normal “session” should be lxsession or lubuntu but I am not a pro at all (as you can tell). I get the message “No session set, fall back to LXDE session” when startin lxsession manually from the terminal emulator. Advice would be greatly appreciated.

Leave a Reply