I just set up a Raspberry Pi Zero to be a little breadboard computer. Running a headless machine only through SSH gets a bit dull at times, so the inclusion of VNC Connect in Raspbian is handy.
Only problem was that the default screen size — something like 720×480 — was too small for most dialogue windows. Here’s how to enable a more useful resolution of 1024 × 768.
All of these are enabled from the raspi-config tool, so open a terminal and start it with:
sudo raspi-config
Enable Boot to Desktop
Select 3 Boot Options → B1 Desktop / CLI → B4 Desktop Autologin:
Enable VNC on Startup
Select 5 Interfacing Options → P3 VNC, and answer Yes to Would you like the VNC Server to be enabled?:
Set Screen Resolution
Select 7 Advanced Options → A5 Resolution → DMT Mode 16 (1024×768) …:
Once you’ve enabled all of these, raspi-config will ask if you wish to reboot your Raspberry Pi. Once it has rebooted, you should have a usable remote desktop.
(All of the above screenshots were taken from a headless Raspberry Pi Zero via VNC.)
Before & After
These were taken later on a Raspberry Pi 2 I’m setting up for a maker festival booth:
This doesn’t work on my RPi3
I just ran through this, and all the options are in the right places still.
Rats, it looked promising but had no effect on my Raspberry Pi 4 either. After reboot, the VNC server came back still offering 1024×768, even though when I went back in to raspi-config, it showed the 1280×1024 option I had chosen as still selected. There must be something else overriding this.
What I ended up having to do in order to get this to work was find the following lines in /boot/config.txt and uncomment the last two. Change the values to whatever works for you, I liked width=1280 and height=1024.
# uncomment to force a console size. By default it will be display’s size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
Yes, the Raspberry Pi 4 is a bit different: no display detected on HDMI, no /dev/fbX created. Seems that Adding hdmi_force_hotplug=1 to /boot/config.txt can also fix this.
Worked fine on RPi 4 4gb
Good to know! I’d heard that the 4B really didn’t like starting up without a monitor.
Thanks for this.,
I have a gaggle of pi4s, a pi3, loads of Zeros and I have had to use RDP for all of the work on the GUI from a windows machine.
Now I can use my desktop pi4s and VNC as necessary and build this into the heagless builds for all of the SD cards