PuTTY X11 Forwarding – How to Get X11 Forwarding to Work on Windows with PuTTY and Xming

gnomeputtyx-windowsxorg

I've always wanted to get X11 Forwarding to work with PuTTY, and the X Window System I'm using is Xming. When I have Xming running and I establish a new connection to my server, I receive the following after a command:

$ firefox
PuTTY X11 proxy: wrong authentication protocol attemptedPuTTY X11 proxy: wrong authentication protocol attemptedError: cannot open display: localhost:10.168

$ google-chrome
PuTTY X11 proxy: wrong authentication protocol attempted
(google-chrome:7083): Gtk-WARNING **: cannot open display: localhost:10.168

$ gedit
PuTTY X11 proxy: wrong authentication protocol attempted
** (gedit:6990): WARNING **: Could not open X display
PuTTY X11 proxy: wrong authentication protocol attemptedCannot open display:
Run 'gedit --help' to see a full list of available command line options.

$ gnome-system-monitor
PuTTY X11 proxy: wrong authentication protocol attempted
** (gnome-system-monitor:7024): WARNING **: Could not open X display
PuTTY X11 proxy: wrong authentication protocol attempted
(gnome-system-monitor:7024): Gtk-WARNING **: cannot open display: localhost:10.168

How do I fix these errors and get X11 Forwarding to work as a whole?

Best Answer

Copied from: http://www.math.umn.edu/systems_guide/putty_xwin32.html

Configuring Putty

  • Add Unix hostname
  • Switch Protocol to SSH
  • Type name of session in saved sessions
  • Click 'Save'

<img src='putty_xwin32/default_putty_rev-sm.png'/>

  • Expand the 'SSH' tab from the 'Category' list
  • Choose 'X11' from 'SSH' list
  • Check 'Enable X11 Forwarding'

<img src='putty_xwin32/xfwd_putty_rev-sm.png'/>

  • Choose 'Session' from 'Category' list
  • Click 'Save'

Starting the X Server on Windows

Configuring Xming

Just run "All Programs > Xming Xming" and it should work if you've got PuTTY configured.

Connecting

  • Start Xming
  • Start Putty
  • Double click on the saved session you want

<img src='putty_xwin32/session_putty_rev-sm.png'/>

  • Enter username and password as requested
  • You should now be able to run X applications from the host on your local desktop

EDIT: To fix the wrong authentication protocol attempted error, try enabling “ForwardX11Trusted yes” in the /etc/ssh/sshd_config file and then restart the OpenSSH server.

Related Question