Monday 25 May 2020

Setting a default screen size for a headless Raspberry PI

I have a few Raspberry Pis, and most of them are run "headless" (without keyboard or display).

Now the default screen size for a headless PI is what used to be called VGA and has a resolution of 640 x 480. This was state of the art in the 'nineties, but unfortunately the majority of software expects a larger display. This means that programs tend to fall off the available screen size, in some case losing the close button as well.

You can set the display resolution via the Raspberry Pi configuration tool or via the command line using raspi-config. The problem is that there is no guarantee that your chosen display mode will then work with your monitor.

This particuklar resolution (720p) works okay on monitors and via VNC. Other options are available.

This can be set by editing the config.txt file

sudo nano /boot/config.txt

Scroll down to this section (the highlighted text areas will probably read VGA and 1 respectively). Change the mode to 4 and the resolution description - that is for your information later).
# uncomment to force a specific HDMI mode (this will force 720p resolution)hdmi_group=1hdmi_mode=4
Use Control X, Y to save and accept the default file name to save the changes.

Reboot your machine and you should have a much more workable graphics screen on VNC.

References