X on Windows 10

Run Cygserver for Shared Memory Support

Note on shared memory

Open a Cygwin terminal in administrator mode and run

$ cygserver-config

This should print the following output, confirming that the service is has been installed and is running

Overwrite existing /etc/cygserver.conf file? (yes/no) yes
Generating /etc/cygserver.conf file

Warning: The following function requires administrator privileges!

Do you want to install cygserver as service?
(Say "no" if it's already installed as service) (yes/no) yes

The service has been installed under LocalSystem account.
To start it, call `net start cygserver' or `cygrunsrv -S cygserver'.

Further configuration options are available by editing the configuration
file /etc/cygserver.conf.  Please read the inline information in that
file carefully. The best option for the start is to just leave it alone.

Basic Cygserver configuration finished. Have fun!

The Cygwin/X X Server

Cygwin/X is a X server for Windows that enable running remote X applications.

Cygwin/X Installation on Windows

Run Cygwin's usual setup-x8664.exe_ program to install the following software

Setup on remote Linux machine

Enable X11 forwarding in /etc/ssh/sshdconfig_ by writing out (or uncommenting this line)

X11Forwarding yes

The program xauth should be installed.

Ensure you can ssh into your Linux machine from Windows.

Start an X session on your local Windows machine

Start an X session using the XLaunch GUI tool on Windows. Search for the application at Windows' start menu and run it. It is worthwhile to pin it to your task bar or start menu, otherwise you have to search for it every time.

The GUI options are self-explanatory. Chose the "start with no client" option because we don't want to do anything fancy right now, but play around from the terminal later.

Now open a Cygwin shell and run

$ startx

and wait a while, don't give up. Soon a window will appear with a full fledged X desktop (xfce in my case). That is your local X server presenting you with an X desktop. Now to do things remotely close all this and go back to your Cygwin terminal.

Set the DISPLAY environment variable

$ export DISPLAY=:0.0

Now ssh into the remote Linux machine

$ ssh -v -Y rup@gablu

The -v is optional but it helps to see verbose output initially to be able to debug any connection or configuration issues.

To test, run the xlogo program in the remote shell

rup@gablu:~$ xlogo

A small square window should pop up on your Windows desktop displaying the X logo. This confirms that you can now run remote X applications from Windows. Invoke any GUI application from the remote shell and your local X server should be able to present you that inside a window.

xlogo

References

  1. Cygwin/X User's Guide
    1. Instaling Cygwin/X
    2. Using Cygwin/X
  2. Displaying Remote Clients
  3. Cygwin FAQ