There are so many ways to control a remote desktop of a Linux computer - VNC, RDP, etc. I will touch the most basic way - CLI (command line).
Part one has already been on Habré
here as one of the tips. Let's start with this - this is a fairly easy way to launch an application from a remote computer to a local screen. This can be useful as a quick solution for overcoming local limitations that are not present on the remote machine (network or hardware limitations, the launch of which application is not on the local computer). You must have an X server running on the local machine and at least one terminal operating window. From the terminal (
GNOME-Terminal, Konsole, Xterm ) we do
SSH to another machine with session expeditions for X.
localuser@localhost:~$ ssh -X remoteuser@remotehost
localuser@localhost:~$ ssh -Y remoteuser@remotehost
The first option is used generally, the second is when the session is in a secure network where security is not so important (for example, in a home network, behind a firewall). Then run the application:
')
remoteuser@remotehost:~$ firefox &
Note - Firefox will not start on a remote machine if it is already running on a local one. No errors are output, but in the end a transition is made to a working Firefox window. Maybe this is true for other programs as well!The disadvantage of this method is that you cannot use the desktop menu to launch the application, everything is started from the command line.
An alternative to this method is to run only the X server and Xterm (
or another terminal emulator ) on the local machine, and the window manager (
Window Manager ) to run on the server. In the end, the window manager is just another application running on the X server. Thus, all the menus on the desktop are actually the menus from the remote computer. Applications also run on the remote computer as before, and their interface is also displayed on the local desktop. The advantage of this method is the ability to use old machines (Pentium I, II) as an X terminal for a powerful computer, when LTSP is more than we need.
In the text console (
Ctrl-Alt-F1 ) we start the X server with a single terminal window, without a window manager:
localuser@localhost:~$ xinit /usr/bin/xterm -- :1 &
(It is possible and easier:
localuser@localhost:~$ xinit /usr/bin/xterm
but only under the conditions that the X server is not working, i.e. gdm, kdm or xdm are inactive, and no one started X through startx)Now you need to add permission for the sessions on the remote computer. A connection can be made through SSH tunneling if the network is not secure, but this leads to a decrease in speed. If the network is secure enough, you can allow the X session through “xhost + remotehost”
1. SSH tunneling:
localuser@localhost:~$ ssh -fY remoteuser@remotehost /usr/bin/wmaker
2. Or without tunneling:
localuser@localhost:~$ xhost +remotehost
localuser@localhost:~$ ssh -f remoteuser@remotehost /usr/bin/wmaker -display localhost:1
In the first case, if the remote SSH server supports it, the local variable DISPLAY and session tunneling through SSH are used. The second option allows remotehost to send data directly to the local X display. All your actions are performed on the remote machine, but displayed on the local desktop.
Note: Fluxbox, Blackbox, TWM, FVWM or another window manager can be used instead of WindowMaker. Using KDE or Gnome is possible, but not recommended due to high speed requirements. Better choose a simple and easy window manager.PS Russian is not abusive for me, this material was edited with the help of
SpellChecker.net . Write in the comments, I will be correcting.
PPS Here is the
original and
translated into Bulgarian