(LINUX) LINUX (2023)

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.

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.

5. Alternative ways to receive Linux GUI on Windows.

There are three potential ways.

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 ...



Comments ( )
Link to this page: http://www.vb-net.com/X11/Index.htm
< THANKS ME>