When accessing your Raspberry Pi 4 remotely via a VNC viewer or Teamviewer for the first time it is very likely the screen size shown has a very small resolution (320×200) and hence is unusable. How to set the remote connection screen resolution for a Raspberry Pi 4?
Perform the following steps:
- Connect to your Raspberry Pi via a SSH connection (for example via Windows by using PuTTY) and login.
- Execute the following command:
sudo nano /boot/config.txt
This will open the nano file editor with the Raspberry Pi 4 OS configuration file.
- Find the following 5 lines and if uncomment these if they are commented:
#framebuffer_width=1280 #framebuffer_height=720 #hdmi_force_hotplug=1 #hdmi_group=1 #hdmi_mode=1
- Set the
framebuffer_heightto your required resolution
hdmi_modesettings to the values shown below:
- Ensure that the following two settings are commented by placing a # in front of them.
# Enable DRM VC4 V3D driver dtoverlay=vc4-kms-v3d max_framebuffers=2
- After we complete all the changes, press
Ctrl+Oto write the changes, and then press
- Reboot the Raspberry Pi 4 by entering the command:
When connected again via VNC viewer or Teamviewer the resolution should be the same as set above.