How To: Run Graphical Linux programs from your SBC on your Windows Computer or Android Phone/Tablet

How To: Run Graphical Linux programs from your SBC on your Windows Computer or Android Phone/Tablet

In the January 2019 issue of ODROID Magazine, I came across an article on BASH. This great article mentioned a way to run graphical programs from one Linux computer on another, and briefly mentioned software that allows this on Windows (MobaXterm).

How-To on Windows!

I decided to download MobaXterm and give it a try. It has a portable version, which means you don't have to install it on Windows - you can simply run the executable, so it can be placed on a flash drive or other removable media for easy access on any Windows computer.

Upon launching MobaXterm on Windows 10, I entered the IP of my ODROID-XU4 running Ubuntu 18.04 in the "Quick Connect" field and then entered the username and password that I wanted to use from the XU4. The same method also works for other ARM computers, such as Raspberry Pi.

As you can see, this logged me in to my XU4. But that is pretty basic stuff that any SSH client can do. However, next I entered 'libreoffice', and a new window was opened on my Win10 desktop with the LibreOffice splash screen from the XU4. Shortly after that, the LibreOffice Writer screen appeared. Clicking on the 'Open' requester opened the file requester as if it were opened on my XU4, and I was able to open and save files from/to my XU4's filesystem.

The filesystem tree on the left of the MobaXterm window is also useful as you can drag and drop files between the connected system and the Windows computer. This makes it easy to move files between systems without having to manually mount network shares.

How-To on Android?

Just out of curiosity, I wondered if the same were possible using Termux or JuiceSSH on Android. In either case, launching a graphical application resulted in a message "Failed to Open Display". However, downloading and installing 'XServer XSDL' allowed this to work in conjunction with Termux or JuiceSSH on the same device (and certainly other terminal emulators on Android as well).

This is a bit more complicated than it was on Windows, but still possible.

First, start 'XServer XSDL' on your Android device as this will give you the commands that you need to run on your Termux/JuiceSSH/terminal session. When 'XServer XSDL' starts, it allows changing the screen resolution and font scale. I found best results on my phone at 1280x960.

Next, switch to your Termux/JuiceSSH session and enter the two 'export' commands near the top of the above screen:

The first export sends the display data to your Android device, and the second export sends audio data to your Android device. Any command you enter after this that would normally open a window will now display on the 'XServer XSDL' window. In this case, I entered 'pluma' which is a graphical text editor on Ubuntu, which resulted in Pluma opening on the 'XServer XSDL' window:

The full list of 'XServer XSDL' controls can be found on the 'Google Play' page for the app at https://play.google.com/store/apps/details?id=x.org.server

Of course, if you are going to connect to your Linux machine from outside your network, you will either need to have a VPN Server installed on your network allowing you to connect to it using a VPN Client on your device, or open the necessary ports on your router/firewall to allow traffic from outside the network to get to your Linux machine. Note, however, that opening ports on your router/firewall can be a big security risk if proper security isn't in place!

I hope this helps with your diabolical plans to control your Linux machine when you aren't near it, or if you are running it headless (with X11 installed)!

Previous article How-To: Build a Game Console with the OGST Case (plus ODROID-N2 Retrogaming)

Leave a comment

Comments must be approved before appearing

* Required fields