XQuartz error on ssh connection - linux

I'm connected to a remote Linux server via ssh, and I'm trying to execute ImageMagick's display command. I know that the problem is probably not on the server side, because when I connect from different machines I don't get the same problem. And I installed XQuartz on my local machine as well as connected using the ssh tags -Y and -X (neither fix the problem) and I'm still getting the following error. My computer is a MacBook Pro running El Capitan. Any idea?
display: unable to open X server `' # error/display.c/DisplayImageCommand/426.
Thanks!

I think the trick is to start XQuartz in the background on your Mac before you do anything and allow remote machines to connect.
So, on your Mac, in Terminal, start XQuartz:
X &
Now right-click the XQuartz icon in your Dock and click:
Applications -> Terminal
and in the Terminal that appears, type:
xhost +
Later, when you have it working, tighten up the security on the xhost command by being a bit more specific with IP addresses.

Related

How can I open a x-window application on a remote machine and make that window shown in my local machine

I have a remote server running Linux and I am using macOS. I can connect to that server through ssh command. I noticed that ssh -X is used to enable X11 forwarding. So I tried to connect to that server by running ssh -X name#ip-address command and launched an application on the connection terminal. I expect that window should be shown on my macOS but it didn't. Is there any other configuration I need to set in other to make the X11 forward works?
Macs don't run their GUI in X. You need to install XQuartz first.

How to share Mac screen to Linux docker container?

I want to run odesk time tracker (a Qt4 app) which captures your screen and keystrokes for freelance work logging. But I don't trust it and want to sandbox it.
On Linux, there are ways to run GUI items on docker container and forward X11 to Linux host. Can I do this on mac? The app will run on Linux container and will be displayed on Mac with capturing screen/keystroke.
I think VNC method would display the linux host, not the mac. If linux connects mac, I have to install the software on mac. I don't know if I can do X11 forwarding.
You need to have XQuartz installed on your Mac. You can get it here -
http://xquartz.macosforge.org/landing/
Once you installed it, follow this procedure -
Run X11 application (included with XQuartz)
Open X11 Preferences and make sure "Allow connections..." is checked
Restart X11 application
Open a terminal
ssh to your docker with X11 forwarding: ssh -X YOUR_DOCKER_IP
From now on, any GUI application that you run on your docker will show up on your Mac.

Grey blank screen with various vnc services from Windows 7 to Ubuntu 14.04

So, I have been attempting to access my work computer (Ubuntu 14.04) from home (windows 7).
I am using vnc and I have tried both tightvnc, xrdp, and default vino services on work computer.
Here is what I found not working and working.
Tightvnc server/xrdp server (linux) + tightvnc viewer (windows): NOT WORKING
Result: grey blank screen with X cursor
Attempted diagnosis: gnome-fallback, x-windows, gdm, all variations of xstartup files I could find online. Didn't find a solution
Vino server (linux) + tightvnc viewer (windows): WORKING if encryption disabled
Very straight forward setup through Desktop Sharing
Result: No matching security types! from tightvnc viewer connection
Solution: gsettings set org.gnome.Vino require-encryption false
Tightvnc server/Vino server (linux) + Remote Desktop (windows): NOT WORKING
Result: grey blank screen with X cursor (regardless of the vino security session)
So, I now have one solution that works but I don't feel secured with the encryption turned off. And I am really curious why I always get grey screen. Is it a security matching problem, or display problem? And are vino server and tightvnc server or other vnc server using the same ubuntu system service? Or these vnc services are independent of each other?
Thanks!
For the grey blank screen problem, try to use xfce4 desktop environment, install it by:
sudo apt-get install xfce4
And then create an xfce session
sudo gedit ~/.xsession
Where place only one line xfce4-session
Then reboot your linux machine and try to access it remotely again.

SSH tunnelling into arch box

I have a raspberry pi running arch linux connected to the TV and want to run commands on that screen by SSH'ing from my Ubuntu machine elsewhere.
I have tried running the command SSH -Y root# and starting xclock as a test. However I get the following error:
No protocol specified
Error: Can't open display: :0
I then tried running "export DISPLAY=:0" on the arch machine, but this doesn't solve the issue.
I have X running fine and can see it on the TV and I have edited the file /etc/ssh/ssh_config to allow X11 forwarding.
Anyone know what I am doing wrong?
Many thanks
The ArchLinux wiki has some good instructions on setting things up. I struggled for a while until I found them, but for me the key was to set up SSH forwarding within sshd_config (most distros seem to enable this by default, but Arch doesn't).
Once you've enabled X forwarding in SSHD, I also found it helpful to install the dummy video driver for Xorg ("pacman -S xf86-video-dummy"), which gets rid of irritating errors about missing the RANDR extension. This might not be necessary if you already have it running a real X server locally on the Pi - personally, I'm running mine completely headless.
I've found that I don't have to worry about setting up the DISPLAY variable, or xhost, when running with 'ssh -X' from an iMac. I'd expect Ubuntu to behave the same.
looks like an authentication problem. The answer used to be
xhost +
on the console of the X display. Might help.
You probably want to set
export DISPLAY=[IP_ADDRESS_OF_ARCH_BOX]:0
on your Ubuntu box, then when you run xclock from your Ubuntu box, it'll forward the screen to the Arch box.

Can't get remote desktop to open in x11 window through ssh

I am having trouble getting an x11 window of the desktop of a remote machine.
I am VPN'ed into a local network and I can get into the computer I want through the command line using:
ssh -X computer_name -l login_name
I thought that the -X would cause the remote machine's desktop to pop up in x11, and although x11 launched on my mac, I did not get an x11 window of the machines desktop.
I can get things like emacs to run and pop up in new x11 windows, but I want to get the whole desktop going.
I am running Mac OS 10.7, and the remote machine is running linux.
Any help would be appreciated.
Figured it out.
after the command
ssh -X computer_name -l login_name
I had to start a gnome-session
gnome-session >&/dev/null &
this gave me the linux desktop in an x11 window.
ssh -X (or -Y) only tunnels the connection to your local X server for the applications started on the remote machine from your SSH session. It cannot do anything about the desktop environment that is running on the remote machine's own X server.
You're probably looking for something like VNC, not X11 forwarding.
X-Window allows you to run programs remotely, and have their windows appear locally on your machine. As you stated, you were able to get this working properly. If you want to see the entire linux desktop on your mac, you will want to use a program like VNC.
You will need to run vncserver on your linux machine, then you can use any of a number of VNC clients on your mac to see the entire linux desktop. For example, Chicken of the VNC.
If you want your remote Linux desktop to be displayed on a window on your Mac you should use on your Mac (providing that the VPN is already setup and running, you have access to your Linux server, and XDMCP is configured on it):
$ Xephyr -query <linux-ip-or-name> :1

Resources