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

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.


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:

sudo apt-get update

Now install the GUI:

sudo apt-get install raspberrypi-ui-mods

Simple, right?

Now attach a monitor to your Raspberry Pi and reboot.

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:

sudo raspi-config nonint do_vnc 0

Now reboot your Raspberry Pi.

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.

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:

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:

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!

sudo reboot

1080p resolution


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