Tech-savvy users know you can easily connect to a Linux server using various secure shell (SSH) clients. If you prefer – or are required – to use a tool with a graphical user interface (GUI), the solution is X11 forwarding.
X11 forwarding is a mechanism that allows a user to start up remote applications, and then forward the application display to their local Windows machine. It enables you to run GUIs from a local server. It’s essentially remote desktop software that looks better on your screen and is easier to work with.
To determine if a remote desktop is right for your business, read our reviews of the best remote PC access software that provides access and control from any device or major operating system from any location.
To set up X11 forwarding on Linux, you’ll need to perform functions on both the Linux machine and the Windows desktop.
You first need to make a few minor changes to your Linux machine to enable X11 forwarding. In this example, we’ll use a standard CentOS 6.5 installation with GNOME installed. Other Linux distributions will have a very similar SSH daemon configuration.
service sshd restart
yum -y install xeyes
service iptables stop
The first requirement on the Windows guest is to install PuTTY, which provides the mechanism to forward the display data between the host (the Linux server) and guest (your Windows machine).
Hopefully, a silly pair of eyes like this one will appear that follow your cursor around the screen.
To keep the terminal available for additional commands after you launch the X11-forwarded application, use an ampersand (&) at the end of the command to prevent tying up the terminal in question.
No matter which GUI you use on your Linux host – GNOME or KDE – both have an xdisplay manager that underlies the GUI portion of the display. The xdisplay manager is a network protocol designed to allow items to be forwarded to whichever destination that’s required.
Though intended primarily for humor, the xeyes command can be helpful for accessibility. If you’re visually impaired and struggle to locate your cursor, the big eyes can help.
X11 forwarding on a Mac is just as easy as installing it for Linux.
ssh -X root@mylinuxhost
X11 forwarding is safe if you’re confident the server is fully secure. Otherwise, you could be introducing cybersecurity risks. X11 forwarding gives a server all of your information without any protection.
X11 uses port 6000, though some systems use port 6001. Others may involve additional ports; however, such systems are relatively rare.
The X11UseLocalhost command connects your X11 forwarding server to either the wildcard address or loopback address. Without this command, your forwarding will automatically be linked to the loopback address.
To become more proficient with IT to help your company run more smoothly or boost your tech career, below are three articles that can help you find appropriate IT certifications:
To learn more about working with Windows Server, check out this resource.
Max Freedman contributed to the writing and research in this article.