Categories: RPI Computers

Run Raspberry PI OS Lite GUI Applications from remote Windows PC

In this tutorial I’m going to show you how to run Raspberry PI OS Lite GUI applications from a Windows PC.

Sometimes it can be useful for a number of purpose to execute application with GUI in a Raspberry PI OS Lite version. With Xmin you can remote to Windows PC an X11 window, getting Raspberry PI GUI applications showed in your remote PC.

This can be useful, for example, when you need a local browser in your Raspberry PI to view pages not published, or when need to control from Windows a Linux application working only from GUI (like an x3270 terminal emulator for mainframe). Or you can play amazing games from Linux universe with a light linux box and your Windows PC exposing the GUI.

Usually people install a desktop environment in your Raspberry PI and configure a remote desktop connection. But this solution brings workload and resource usage that may be useless for you.

An alternative is using an X Server in your Windows PC together with an SSH session, then forwarding Gui applications from Raspberry PI OS to Windows. This requires in Raspberry PI OS only an X-Window, which is something far lighter than a desktop environment.

Difference Between Desktop Environment, Window Manager and X-Window

Pleasefind below the main difference between 3 graphical levels in Linux systems. Those definitions come from Wikipedia (pages referred in each item):

  • (Ref. Wikipedia X Window System) The X Window System (X11, or simply X) is a windowing system for bitmap displays, common on Unix-like operating systems. X provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting with a mouse and keyboard. X does not mandate the user interface – this is handled by individual programs. As such, the visual styling of X-based environments varies greatly; different programs may present radically different interfaces.
  • (Ref Wikipedia Window Manager) A window manager is a system software that controls the placement and appearance of windows within a windowing system in a graphical user interface. Most window managers are designed to help provide a desktop environment. They work in conjunction with the underlying graphical system that provides required functionality—support for graphics hardware, pointing devices, and a keyboard, and are often written and created using a widget toolkit.
  • (Ref Wikipedia Desktop Environment) In computing, a desktop environment (DE) is an implementation of the desktop metaphor made of a bundle of programs running on top of a computer operating system, which share a common graphical user interface (GUI), sometimes described as a graphical shell. The desktop environment was seen mostly on personal computers until the rise of mobile computing. Desktop GUIs help the user to easily access and edit files, while they usually do not provide access to all of the features found in the underlying operating system. Instead, the traditional command-line interface (CLI) is still used when full control over the operating system is required.

What We Need

Raspberry PI 4 model B image

As usual, I suggest adding from now to your favourite e-commerce shopping cart all the needed hardware, so that at the end you will be able to evaluate overall costs and decide if to continue with the project or remove them from the shopping cart. So, hardware will be only:

We’ll need also a Windows PC.

Check hardware prices with following links:

Step-by-Step Procedure

Install OS in Raspberry PI

For this step, please refer to Install Raspberry PI OS Lite. At the end, please remember to update your OS:

sudo apt update
sudo apt upgrade

Install Required Components in Raspberry PI and Windows PC

We use – from Linux side – the most known X-Window package in Linux universe: Xorg. From Raspberry PI terminal, type:

sudo apt install xorg

From Windows PC side, I suppose you already have Putty installed. We need to choose the X-Server which will show in Windows PC applications running in Raspberry PI. One of most known is Xming. You can download its installer from Xming Sourceforge page. Installation will be with the default settings with Windows installer downloaded.

Once started and running, you should see Xming icon in you icon tray:

Configure Raspberry PI OS and Windows

In Raspberry PI OS Lite, check correct value for DISPLAY environment parameter. Type:

echo $DISPLAY

And you should receive the following:

pi@raspberrypi:~ $ echo $DISPLAY
localhost:10.0

Otherwise, correct DISPLAY parameter with the following:

export DISPLAY=localhost:10.0

In Windows PC, once Xming is running, we must set Putty connection parameters to make it forwarding X11 window. From Category list (left column), go to Connection -> SSH -> X11 and configure as the picture below:

Now go from Category List (left column) in Session and configure your connection parameter. In below picture, “192.168.1.78” is my Raspberry PI address, so must be changed with your own. Port must be 22. Connection Type must be “SSH”. Saved Session Name can be whatever you want to remember your connection between other saved sessions. In my case, I’m using my Raspberry PI Zero W for this test (but works with all other Raspberry PI boards):

Now connect to your Raspberry PI terminal with this session.

Test X-Window routing

Our test will go with a cool X11 game. XBill is an arcade game from 1994 in which the player has to prevent an evil computer hacker named “Bill” from installing a popular Operating System on various machines. The OS can spread over networks and purges existing systems (BSD, Solaris, SGI IRIX, …).  Install it in your Raspberry PI with

wget http://http.us.debian.org/debian/pool/main/x/xbill/xbill_2.1-9_armhf.deb
sudo apt install ./xbill_2.1-9_armhf.deb

And execute it with the command:

xbill

The xbill game window should appear in your Windows PC and you should be able to start a new game:

Final Considerations

When using X11 forwarding from Raspberry PI to a Windows one, remember that you will save alla data within GUI application locally in your Linux OS. So, if you need to transfer them, you will likely use, for example, an SFTP transfer application like Filezilla.

Enjoy!

peppe8o

Open source and Raspberry PI lover

View Comments

Published by
peppe8o

Recent Posts

Some links in this post may be affiliate links. We may get paid if you buy something or take an action after clicking one of these, but without addictional costs for you compared to direct buying.

SPI communication between two Arduinos

In this tutorial, we will use two Arduino Uno to demonstrate the Serial Peripheral Interface…

1 week ago

Automatic irrigation system with Arduino and Sensors

In this tutorial, we will be making an automatic irrigation system (AIS) with Arduino and…

2 weeks ago

Beginner’s Guide to Use Python Virtual Environment with Raspberry PI (venv)

This tutorial will show you how to use Python Virtual Environment with Raspberry PI computer…

3 weeks ago

Get Betting Odds with Raspberry PI and Odds-API (free)

This tutorial will show you how to get betting odds with Raspberry PI by using…

1 month ago

Backup Raspberry PI (computer) Data with Rsync to Remote NAS

This tutorial will show you how to perform the backup of Raspberry PI (computer board)…

1 month ago

Honeygain and Raspberry PI: Earn by Sharing Internet Connection

This tutorial will show you how to install Honeygain on a Raspberry PI computer board…

1 month ago