About
The X Windows System permit to see on your local computer, software that run on a remote server. This software are known als:
- X Window System applications
- remote client
This articles shows a step by step tutorial.
Steps
Start the server on your machine
Start a X server on your machine for instance X11 - Cygwin/X
To do that start XLaunch.
- Program Files > Cygwin-X > Xlaunch
Make a connection with X11 forwarding
Enabled
The SSH protocol has the ability to securely forward X Window System applications over your encrypted SSH connection, so that you can run an application on the SSH server machine and have it put its windows up on your local machine without sending any X network traffic in the clear.
To enable x forwarding, you have two ways:
With openssh
- Make sure you have the openssh package installed.
- Launch Cygwin/X
- In an X terminal, you can run the following in an X terminal:
$ ssh -Y username@remote_hostname_or_ip_address
where the Y parameter enables trusted X11 forwarding. Trusted X11 forwardings are not subjected to the X11 SECURITY extension controls.
- Enter your password when prompted by ssh.
- Your ssh session should now show you a shell prompt for your remote machine.
With Putty
- Launch Cygwin/X. Close the X terminal windows if necessary
- Open Putty and change the X11 forwarding configuration as below:
The X display location box is blank by default, which means that PuTTY will try to use a sensible default such as :0, which is the usual display location where your X server will be installed.
- Made a connection and enter your credentials
Launch remote X clients
From Putty of OpenSsh, you have now a ssh connection and you can now launch remote X clients in your session. For example:
firefox&
xlogo
xclock
will launch an x terminal running on your remote host that will display on your Cygwin/X screen.
By appending & to the command name, the remote clients start in the background and you don't have to open several others ssh sessions.
Disabled
Without the X11 forwarding, you are subjected to the X11 SECURITY and then you must:
In this example:
- 192.168.2.223 is the IP of the server
- 192.168.2.2 is the IP of the local computer where the x server is installed. localhost can also be used.
xhost 192.168.2.223
192.168.2.223 being added to access control list
ssh -l root 192.168.2.223
- On the remote:
export DISPLAY=192.168.2.2:0.0
xclock&
Then the xclock application must launch.
By starting the remote clients in the background, by appending & to the command name (xclock&), you don't have to open several ssh sessions.
Support
Connection to “192.168.2.2:0.0” refused by server without X Forwarding
If when you don't use the X forwarding method by using xhost, you:
- forgot to add the remote server to your authorized list
- gave a bad IP/name of your remote server
you will then receive this error:
[root@oel5u5 ~]# xclock&
Xlib: connection to "192.168.2.2:0.0" refused by server
Xlib: No protocol specified
Error: Can''t open display: 192.168.2.2:0.0
To resolve this error, exit your ssh session, use the xhost command to add the remote server to your authorized list and follow again the complete process.
Authorization required, but no authorization protocol specified
Xlib: connection to "localhost:10.0" refused by server
Xlib: Authorization required, but no authorization protocol specified
Error: Can't open display: localhost:10.0
or
Authorization required, but no authorization protocol specified
Error: Can't open display: localhost:10.0
This was an error with my X Server. I had started XWin Server in place of X Launch. Restart your X Server to be sure.