10

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.

Gareth
  • 19,080
suppie
  • 201
  • 1
  • 2
  • 4

2 Answers2

3

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.

DavidPostill
  • 162,382
fvu
  • 233
2

Use Cygwin. I use Ubuntu on Docker container but this will work easily without containered Ubuntu, i.e. full-blown Ubuntu machine on the same LAN as the Windows machine.

Just ignore the host container IP term. Host container 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 container : sudo vim /etc/ssh/sshd_config:

X11UseLocalhost no

restart ssh server on Ubuntu

On remote Windows machine running Cygwin X server:

  1. Open Cygwin bash

  2. cd /cygdrive

  3. On the bash startx -- -listen tcp &

  4. export DISPLAY=192.168.1.4:0.0

  5. xhost + 192.168.1.20

  6. On the X term launched by running the command in step 3 do the same as in steps 4 and 5

  7. On the xterm ssh -Y

  8. Either use PuTTY. IP address docker host 192.168.1.20 and ssh port 22

  9. 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 X11-GUI like xeyes

  11. Two eyes will appear on 192.168.1.4:0.0 remote windows machine not using linux display.

  12. So no need to install a separate full-blown X11 server on Ubuntu, keeping the container lightweight

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

  14. Make sure you type in xeyes & so that it does not block the shell.

  15. On the Xterminal you can do the same as in PuTTY. ssh -Y wasadmin@192.168.1.20. The -Y flag is required for trusted port forwarding. Once logged in type xeyes &.

AJM
  • 500