Posts Adding a GUI to a Raspberry Pi running Raspberry Pi OS Lite
Post
Cancel

Adding a GUI to a Raspberry Pi running Raspberry Pi OS Lite

Preview Image

You may have installed Raspberry Pi OS Lite on your Raspberry Pi, which does not ship with a GUI. If you change your mind and want a GUI after all, you can just install one.

In this exercise we will install the PIXEL desktop, which is what you would get when installing the non-Lite version of Raspberry Pi OS.

Preparation

I assume you have a Raspberry Pi running Raspberry Pi OS Lite, and you have SSH access (or a monitor/keyboard attached).

Installing the GUI

First, make sure to update your packages:

1
sudo apt-get update

Now install the GUI:

1
sudo apt-get install raspberrypi-ui-mods

Simple, right?

Now attach a monitor to your Raspberry Pi and reboot.

1
sudo reboot

You will now have a GUI to work with.

Adding VNC support

A monitor is not always convenient. Let’s work around that by adding VNC support, which will allow us to use the GUI from our own computer remotely.

We will use raspi-config noninteractively to install and enable the VNC server:

1
sudo raspi-config nonint do_vnc 0

Now reboot your Raspberry Pi.

1
sudo reboot

Install Real VNC Viewer on your computer and connect to your Raspberry Pi.

Fixing the resolution

When you unplug the HDMI cable and reboot, you might be surprised by the resolution. It is only using a resolution of 656 x 416 pixels.

1
xdpyinfo | grep dimensions

Low resolution

Let’s change that to a more HD resolution. We can control the resolution by changing a few settings in /boot/config.txt.

Before you start, backup the file before we make any modifications to it:

1
sudo cp /boot/config.txt /boot/config.txt.bak

The Raspberry Pi documentation on video settings covers this is great detail.

We want to change these settings:

SettingValueEffect
hdmi_force_hotplug1Force HDMI output even when there is no attached
hdmi_group2Use the DMT (Display Monitor Timings) standard
hdmi_mode82Choose 1080p HDMI output mode

config changes

Now reboot, and you will see a 1080p resolution!

1
sudo reboot

1080p resolution

Resources

This post is licensed under CC BY 4.0 by the author.