X11 forwarding not working from putty and XMing on RHEL 6.x
X11 forwarding:
We can run graphical programs on Linux machines remotely and display them on your desktop computer running Windows. We can do this by using running two applications together on your Windows machine: Xming and PuTTY.What is Xming:
Xming is a PC X Window Server. This enables programs being run remotely to be displayed on your desktopAbout PuTTY:
PuTTY is a free SSH client. Through PuTTY we connect to a remote machine via SSH protocol.Install Xming and run Xming on task-bar.
Configuring PuTTY
- Enter the hostname and port (ssh) of the server you want to connect.
- Next scroll to Connection > SSH > X11. Check the box next to Enable X11 Forwarding. By default the X Display location is empty. You can enter localhost:0. The remote authentication should be set to MIT-Magic-Cookie-1
- Click open to connect the session using X11 forwarding.
- Try run your graphical applications.
X11 forwarding not working
In some of cases you might get stuck and don't get graphical interface coming in your local Windows Desktop.- Check X11 forwarding it setting $DISPLAY or not in your remote server first.
To resolve this problem you have to check and configure few things in your remote server.
- To get X11 forwarding running you need following RHEL packages in your remote server.
# yum install xauth -y
- If you use X-Forwarding: you don't need to directly use xauth or set a DISPLAY variable. Use PuTTY with SSH and X-Forwarding and enable it in the sshd server on the remote machine i.e. check its sshd_config file has following configurations
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
- Now try connect to remote server using X11 Forwarding enable in PuTTY. You will get result of $DISPLAY
Warning: I strongly recommend you do not alter DISPLAY on the remote server terminal, when using X11 Forwarding...you may end up with working graphical windows.
- Now try run some graphical application from remote server and get the GUI in your Windows Desktop.