X11 Forwarding
X11 forwarding is an extremely useful tool that allows for the displaying of graphical applications running on remote Linux systems onto local PCs. This offers versatility and convenience for different applications.
X11 Forwarding Functionality
X11 forwarding works by running an X server locally on the PC that renders the GUI from the remote Linux system after establishing an SSH connection between the two.
Linux systems have the X server preinstalled. For Windows systems, it is necessary to install Xming or VcXsrv to run as the servers. Xming is functional for small graphical applications such as X11 apps, while VcXsrv is more suitable for heavier tasks such as RQT and RViz. The X server for MacOS systems is called XQuartz.
Basic X11 Forwarding Demo on Windows System
Follow the steps below to show X11 Forwarding in action:
On PC
Download VcXsrv installer and install the server on your PC.
Search for XLaunch and open it. It should bring up the following window:
Ensure the following options are chosen as you go select 'next':
Multiple Windows
Start no client
Clipboard
Primary selection
Native opengl
Disable access control
Then select ‘Finish’.
On Local Linux System
Access the local Linux system on your PC by running
ssh linux@linux.local
replacing 'linux' with the username of the system.Open a file called
sshd_config
by runningsudo nano /etc/ssh/sshd_config
.Scroll to the of the code in the file with the text
#X11 Forwarding no
or similar. Uncomment the line by deleting the '#' and change it toX11 Forwarding yes
. Save and exit.Run the command export
DISPLAY=PI_IP_Address:0
, replacing PI_IP_Address with your PC's IP address. You could get your PC's IP address by runningipconfig
on a Windows CMD terminal. The IP address is usually underIP4V
atWireless LAN adapter Wi-Fi
.
The set up should now be ready to run. Confirm this by running rviz2
on the remote Linux system’s terminal. RViz should open on the PC.
X11 Apps
Some fun and useful graphical applications may be installed on the remote Linux machine called X apps.
They are installed using the command sudo apt install x11-apps
.
The apps include xeyes, xclock, xterm etc.
xeyes for example follows the position of the cursor on the screen. It is started by simply running the command xeyes
.
Comments
Post a Comment