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_width
andframebuffer_height
to your required resolution - Set
hdmi_group
andhdmi_mode
settings to the values shown below:hdmi_group=2 hdmi_mode=16
- 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+O
to write the changes, and then pressCtrl+X
to exit. - Reboot the Raspberry Pi 4 by entering the command:
sudo reboot
When connected again via VNC viewer or Teamviewer the resolution should be the same as set above.