2

I use remote desktop connection & XRDP to remote to my Ubuntu 14.04 VM which is running Xfce.

I can start any program from the Application Menu (diffuse, meld, gedit) but when I try to run those same programs from the terminal, the GUI never appears.

So for example, if I run meld --version or chromium-browser everything is fine, but if I run gedit or meld the GUI never appears. No output on the console either.

I can run some GUIs from command line - chromium-browser but firefox generates a bunch of Glib errors.

Any ideas?

ventsyv
  • 1,009

1 Answers1

1

After a little rooting around I believe your DISPLAY variable is incorrectly set. According to the user at Is there a command to list all open displays on a machine? :10 is normally used for SSH forwarding, but not a local session.

You are able to list your available displays using

ls /tmp/.X11-unix/ 

You should see X0 among them, if so set your display variable using

export DISPLAY=:0.0

If you don't see X0 and instead see something like X1 you'll want

export DISPLAY=:1.0

You can add this export line to you .bashrc to make the change permanent.

Centimane
  • 4,490
  • I have X0, X10, X11 & X12. When I set DISPLAY to 0, I get Gtk Warning that it cannot open display:0.0. I got it to work on display 12 though. Is there a way to close the other displays? – ventsyv Sep 02 '15 at 17:56
  • you should be able to use display :0.0 if you configure xhosts, but you shouldn't need to do that for a local session, it sounds like you have some strange configurations on your box that might merit a re-image. As for the displays X10, X11, and X12, are there currently SSH sessions to the machine? Do these displays persist after a reboot? – Centimane Sep 02 '15 at 17:59
  • I rebooted and X11 & 12 are gone, but still getting an error on X0. I think my .Xauthority file is messed up. – ventsyv Sep 02 '15 at 18:05
  • If the problem is that DISPLAY is not set correctly, the fix would be to undo whatever is overriding it. DISPLAY should be set to the correct value automatically. If the Ubuntu machine is displaying a login prompt, :0 is probably that. – Gilles 'SO- stop being evil' Sep 02 '15 at 22:28
  • @Gilles I agree that the DISPLAY variable shouldn't be overwritten, but I figure the first step is setting it properly and seeing that it fixes the issue. That's why I also recommended a re-image, hunting down where the DISPLAY is overwritten could be quite the witch-hunt. – Centimane Sep 04 '15 at 11:46