Use your Raspberry Pi as an headless server that has a GUI you can control using VNC.
Pick what desktop environment to use, if you want a barebones desktop just to control the GUI on the Raspberry Pi, use an window manager like Openbox and Fluxbox.
Or if you want the full desktop experience on your Raspberry Pi, use a full desktop environment like LXQT.
- Install a window manager or desktop environment.
sudo apt install openboxfor openbox or
sudo apt install lxqtfor LXQT or any other WM/DE like
- Install TigerVNC Server.
sudo apt install tigervnc-standalone-server
- Create a new VNC configuration file.
- Add the following text inside tigervnc.conf to choose your own screen resolution and to enable access outside localhost.
- Start TigerVNC Server. This will prompt a new password if password has not yet set.
- Now you can connect to your Raspberry Pi using VNC on the IP address of your Raspberry Pi.
As the default settings on TigerVNC prevents clients outside the localhost of Raspberry Pi from connecting to the server, the setting
$localhost = "no"; should be included inside tigervnc.conf.
If you have installed multiple window/desktop managers, you can select what to use by
sudo update-alternatives --config x-session-manager.
- If you want to install LXQT without all the recommended packages just append
sudo apt install lxqt --no-install-recommends
Tested on Raspberry Pi 4 Model B.
If you are using Ubuntu 20.04, there is a bug that kills TigerVNC just after connect, to fix this just append
LD_PRELOAD=/lib/aarch64-linux-gnu/libgcc_s.so.1if you are using 64-bit Ubuntu before the vncserver command.
For 32-bit Ubuntu use