117
58
After launching the X11 app (XQuartz 2.3.6, xorg-server 1.4.2-apple56) on my Mac (OS X 10.6.8), opening an terminal in X11 and running xhost +
, I then ssh -Y
to my Ubuntu 10.04 VM (running on VMware Fusion). When I run gedit .bashrc
(for example), I get:
(gedit:9510): Gtk-WARNING **: cannot open display:
set | grep DISPLAY
returns nothing.
But if I ssh -Y
into my Ubuntu 11.04 machine, gedit .bashrc
works. echo $DISPLAY
returns "localhost:10.0".
I tried export DISPLAY=localhost:10.0
while sshed into my VM and then running gedit .bashrc
, but I get:
(gedit:9625): Gtk-WARNING **: cannot open display: localhost:10.0
What could be different in the configuration of the two difference Ubuntu machines that would explain why one works and the other doesn't?
Update: As suggested by Zoredache in the comment below, I ran sudo apt-get install xbase-clients
, but I continue to have the same problem.
1In my case it was just a matter of upgrading the XQuartz version of MacOS – Waruna Ranasinghe – 2016-12-29T18:20:56.307
In my case, I needed to restart XMing on Windows. X-forwarding was always working until it stopped for unknown reasons. I had no idea why
$DISPLAY
would outputlocalhost:10.0
either. In Putty, my X11 location is set tolocalhost:0.0
. Force quitting XMing and restarting fixed the issue without changing anything. – Shailen – 2018-03-01T17:14:19.793I also have the same error and setting DISPLAY won't fix it. ```eog new.png Failed to connect to Mir: Failed to connect to server socket: No such file or directory Unable to init server: Could not connect: Connection refused
(eog:9994): Gtk-WARNING **: cannot open display: :0``` – skyuuka – 2019-08-18T09:22:15.230
2Does the Ubuntu 10.04 box have the proper tools for X11 installed? Install xbase-clients, if it isn't installed already. – Zoredache – 2011-07-13T18:22:14.960
I installed it but still have the same problem. (See above.) – Daryl Spitzer – 2011-07-13T18:29:52.657
Yes. Just to be sure, I restarted the VM (and reconnected through SSH afterward). – Daryl Spitzer – 2011-07-13T18:38:00.667
3Maybe try passing the -vv option to ssh when you connect, this prints verbose debug messages, you should see several comments about X11 forwarding while connecting. – Zoredache – 2011-07-13T18:43:32.837
1@jcrawfordor You did check the
X11Forwarding
on the ubuntu one, and that you havexbase-clients
installed and that you can start Xapps on the mac on the terminal you're making ssh connection from. (Check that$DISPLAY
is set on the terminal you run ssh from. – Manwe – 2012-02-27T08:16:30.453Note that I'm ready to accept DefK's answer, after it's modified to include both enabling X11 forwarding and installing base-clients. (Or I'll accept a new answer if someone else takes the time to explain both.) – Daryl Spitzer – 2012-02-27T19:10:15.567