X11 forwarding to Windows
I have million of various Linux recipes Linux recipes, but still has no description of my way to forward X11. This is huge theme, because we usually apply X11 forwarding inside VPN and with various difficulties.
- 1. Remote Linux X11 GUI for Linux X11 server.
- 2. Remote Window X11 GUI for Linux X11 server.
- 3. Browser profile with X11 redirection.
- 4. GUI from VM on KVM/VmWare/VirtualBox.
- 5. Alternative ways to receive Linux GUI on Windows.
- 6. Install GUI on server.
- 7. Dummy desktop on Server.
- 8. X11 redirect over VPN.
1. Remote Linux X11 GUI for Linux X11 server.
But firstly,what is X11 forwarding at all?
If /etc/ssh/sshd_config allow X11 forwarding:
we can start SSH with parameter -X
Some program can start quickly and fast (gedit on screen below), but some program working very slow with high loading network and processor (Vs code on the screen below).
We can see what X11 we can use - local or remote by this commands:
# xauth list # env | grep DISPLAY
2. Remote Window X11 GUI for Linux X11 server.
More interesting case is start X11 on Windows for remote Linux server. In this case there are classic program Xming http://www.straightrunning.com/XmingNotes/, but currently guy who working for improvements of this program need money and that program because not free. But still there is full free solution VcXsrv Windows X Server https://sourceforge.net/projects/vcxsrv/.
To configure forwarding in mRemoteNG https://mremoteng.org/download (I use only this program on any my Windows), we need go to Tools->Advanced
And we need to set two parameters enable X forwarding and MIT-Magic-Cookie-1. Also we need to select X11 server location.
After that new SSH profile appear in mRemoteNG.
After that we can start any application on remote server with redirection X11 GUI to local windows.
This is simplest as possible redirection X11 from Linux server to Windows.
3. Browser profile with X11 redirection.
Most interesting question begin with program that can not started at all with redirection.
And more interesting question with Chrome, what lost profile all after it start with redirection. Even we start it with local X11 again.
Of course, If we use SSH redirect to local X11 computer than disconnect and application with Chrome will break.
And in this place we need to dive deeper to browser session - There are two different "sides" of desktop in X Window System. From the application point of view, "desktop" is just some logical resource that enables applications to run the GUI. It doesn't need to be actually displayed anywhere. From the other side, from user's point of view, that logical desktop may be connected to physical graphics card, to VNC server, to a (logical) display on another machine over the network (the case of SSH tunneling goes here) or nowhere at all (a "dummy" desktop).
4. GUI from VM on KVM/VmWare/VirtualBox.
Of course, if we use some virtualization we don't need redirect to receive GUI in Windows or Linux. Virtualization software usually git us way to receive GUI without any implicit X11 redirection.
- Connect to VM with graphic.
- Virtualization on my developer computer (ASUS PRIME B550-PLUS, AMD AM4 Ryzen 7 5700G).
- VmWare 7 management.
5. Alternative ways to receive Linux GUI on Windows.
There are three potential ways.
- First way is avoid X11 at all, we can use any software in WebMin style https://alternativeto.net/software/webmin/, I have a million screenshot on my blog with Webmin, Cockpit and so on, for example Webmin.
- Install VNC server on Linux server and VNC client to Windows, there are millions of screenshot and recipes in my site also to demonstrate this way, for example VNC
- Install Windows RDP service to Linux. How to do this, look for example to this page https://linuxconfig.org/ubuntu-20-04-remote-desktop-access-from-windows-10
- Use Chrome Remote Desktop https://remotedesktop.google.com/headless
6. Install GUI on server.
Old official recommendation for Ubuntu was to install Openbox or Fluxbox instead GNOME or KDE - https://help.ubuntu.com/community/ServerGUI.
But currently we can use any X11 GUI, look please all opportunities in this post https://askubuntu.com/questions/943750/how-to-install-gui-on-ubuntu-server-16-04.
7. Dummy desktop on Server.
If we need application with Chrome, but is not interactive and can run unattended, we can install Xdummy, a "dummy X server". It simulates a display which GUI applications can use, but it's just similar to /dev/null device, there isn't any real display, the output goes nowhere. It is specifically meant for running unattended GUI applications on servers.
8. X11 redirect over VPN.
...I'm sorry, I have no time more, will continue soon ...
|