How can I export DISPLAY from a Linux terminal to a Windows PC?

Exporting display from a Linux terminal to a Linux desktop is easy; you do the following:

On 192.168.90.121 (localPC):

xhost + 192.168.10.164

On 192.168.10.164 (remotePC):

export DISPLAY=192.168.90.121:0.0 <br/>
firefox

The Firefox window appears on my localPC. In the above case both PCs are Linux.

Can I similarly export the Linux display to a Windows PC? In the above example, localPC would be Windows and remotePC would be Linux.


Yes you can, if you install an X server on your Windows computer. There are a number of commercial choices (I used Starnet X-Win32 some time ago), and a couple of open source ones, like Cygwin/X and XMing. It's not as painless as Linux to Linux (or another Unix derivative that natively uses X11) but the result is quite acceptable and usable.


Use Cygwin. i Use ubuntu on docker container but this will work easily without containired Ubuntu , i.e. full blown ubuntu machine on the same lan as windows machine.

Just ignore the host container IP term. Host conatiner IP == Ubuntu Machine IP.

Ubuntu host container IP 192.168.1.20 Remote windows machine on same LAN IP 192.168.1.4

On ssh ubuntu conatiner : sudo vim /etc/ssh/sshd_config : restart ssh server onubuntu X11UseLocalhost no

On remote windows machine running Cywin X server

  1. Open cgywin bash 2.cd /cydrive
  2. On the bash startx -- -listen tcp &
  3. export DISPLAY=192.168.1.4:0.0
  4. xhost + 192.168.1.20
  5. On the X term launcheed by running cmd in step 3 do the same as in step 4 an 5
  6. On the xterm ssh -Y

  7. Either use putty. IP address docker host 192.168.1.20 and ssh port 22

  8. Enable port forward SSH ---> X11 tick the enable port forward. In the same tab use the Display location remote windows machine 192.168.1.4:0.0 on which the remote Ubuntu container will throw its display 10.Click connect, enter credentials and run an xll-GUI like xeyes
  9. Two eyea will appear on 192.168.1.4:0.0 remote windows machine not using linux display.

  10. So no need to install separate full blown X11 server on Ubbuntu keeping the conatiner lightweight

  11. Oh yes, for xeyes you need to install some x-11 GUI apps, sudo apt-get install x11-apps

  12. Make sure u tyoe in xeyes & so that it does not block the shell.

  13. On the Xterminal you can do the same as in putty.ssh -Y [email protected]. The -Y flag is required for trusted port forwarding.Once logged in type xeyes &