I am using Raspian Stretch and I can not set the resolution of my desktop when using VNC headless.

I am using Real VNC because it comes by default (I have it configured there).

I have no monitors plugged in.

I have tried all the suggestions here

Currently I have the following saved in /boot/config.txt


but still it looks like it boots into 640x480.

When I try to set this from the Raspberry Pi Configuration GUI, no options are available (only "Default - preferred monitor settings").

When I do not make these changes to config.txt I can set the monitor resolution from the GUI but still no changes take place.

Please let me know if you have a solution to this issue.

6 Answers 6


My solution for this problem of resolution being stuck at 640x480 wwith RealVNC access to a headless Raspberry PI with Raspbian Buster was not exactly listed in the answers above, and to compound matters, my config.txt is apparently newer than that posted by @andrew-g-za. After some experimentation, I found that if I comment out the lines towards the end (as shown below) I was able to achieve a 1920x1080 resolution with my remote headless connection.

    # Enable DRM VC4 V3D driver on top of the dispmanx display stack


I want to thank @Luis Augusto Libório and @breversa for their contributions to this solution. Also, I beg to differ with @David G over his comment:

If you are using a true HEADLESS VNC, then nothing in config.txt will do a damn thing.

as those of you facing the same problem that I had will probably attest once you try this fix.

  • 1
    I worked my way down through the answers and this one did it for me. Feb 24, 2021 at 19:28
  • this FIXED for me! I was stuck on "Composite-1" poor resolution. Doing the above, it "unlocked" the resolution settings in raspi-config! So you have to set it and reboot and it works!
    – Allexj
    Feb 22, 2022 at 15:35

Thank you so much!! I've been trying really hard to solve this problem, and this is it, as you said:

in the config.txt file, comment those lines:

#Enable DRM VC4 V3D driver on top of the dispmanx display stack

and voila!! Now you can configure your video settings as you wish.


I followed the instructions on RealVNCs troubleshooting page.

In brief,

  • Open the Raspberry Pi configuration application ('Start' > Preferences > Raspberry Pi Configuration)
  • On the system tab, click the Set Resolution.. button
  • Choose the resolution you want
  • Reboot

I did this all in headless mode via a VNC session on a fresh Raspian Stretch install, using VNCViewer 6.0.1 on Windows.

Perhaps you aren't given any resolution options because you have already forced a resolution - have you tried editing config.txt to set the video mode back to default?

For reference, here's my /boot/config.txt file:

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border

# uncomment to force a console size. By default it will be display's size minus
# overscan.

# uncomment if hdmi display is not detected and composite is being output

# uncomment to force a specific HDMI mode (this will force VGA)

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display

# uncomment for composite PAL

#uncomment to overclock the arm. 700 MHz is the default.

# Uncomment some or all of these to enable the optional hardware interfaces

# Uncomment this to enable the lirc-rpi module

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)

This corresponds to a display resolution of 1024x768 @ 60Hz according to the config.txt documentation

Here's the options that are presented in the resolution settings: enter image description here

I find the drop-down a bit touchy, you need to click and hold to get the list to display correctly.

  • Yes and there are still no options to set resolution.
    – Startec
    Sep 25, 2017 at 18:47
  • Does the GUI not provide options, or do they not apply when you select them? Sep 26, 2017 at 15:13
  • It presents no options.
    – Startec
    Sep 28, 2017 at 2:12
  • i've added a screenshot of the config i see - is yours anything like that? do you have any custom settings for VNC, either on the pi or locally? Which model of raspberry pi are you running this on? Sep 28, 2017 at 21:03

In addition to @andrew-g-za’s answer, please make sure that you’re NOT using the (at the current time) still experimental OpenGL driver !

Using the Full KMS OpenGL driver results in the resolution being set to the lowest one, even if you select another.

Using the Fake KMS OpenGL driver results in the resolution being able to be set higher, but not necessarily as high/the same as what you selected (but it may be sufficient enough for your needs).

Using the legacy driver should honor the selected resolution.

In the /boot/config.txt file, the OpenGL driver options are (usually) at the bottom of the file (look for vc4-kms-v3d or vc4-fkms-v3d). I don’t have access to my RaspPi right now, but I’ll try and add more info later.

Also worth reading/exploring : https://github.com/raspberrypi/linux/issues/1644


If you are using a true HEADLESS VNC, then nothing in config.txt will do a damn thing. This is also the right way to run VNC on a unix system. This means a VNC server that does not interact with any physical display. I believe "tightvnc-standalone-server" is a current packaging for this.

What you do in this case is ensure the VNC server's command line includes "-geometry widthxheight" (and maybe "-dpi number") to explicitly set the values.

Edit: The current packages appear to be tightvncserver and tigervnc-standalone-server. Apparently I combined the two names.

  • Using vncserver -geometry 1280x1024 from my ssh session and then using the New Desktop is in VncViewer worked for me. Also, vncserver -geometry 1280x768 and vncserver -geometry 1920x1080 Jan 2, 2021 at 10:44
  • 1
    As others have said, config.txt does affect the way the VNC server operates with the Raspberry Pi OS.
    – Bob Brown
    Nov 17, 2021 at 12:40
  • @BobBrown I said "true headless vnc". Not no monitor -- no video card. A purely software solution. config.txt affects the hardware resolution, and as such is irrelevant. (I suspect OP assumed incorrectly that no monitor meant headless.)
    – David G.
    Nov 20, 2021 at 13:12
  • @DavidG. The concept of "video card" does not make sense in the context of the Raspberry Pi as the GPU is part of the Broadcom SoC. Using the VNC server that's part of the OS release requires changed to config.txt.
    – Bob Brown
    Nov 20, 2021 at 20:38
  • @BobBrown OP asked about HEADLESS VNC. He may not have been using it, but that doesn't mean that shouldn't be answered. The [corrected] package(s) I referred to are part of the OS distribution, though perhaps not part of some prepackaged filesystem. And while "video card" makes less sense with a PI, it makes perfect sense when talking about headless VNC.
    – David G.
    Nov 22, 2021 at 12:30

This is an old thread but here is my take after a day of researching and testing.

hdmi_force_hotplug=1 This is forcing fake monitor on HDMI port with resolution set to 640x480. Headless option does not work as long as hotplug=1 is in effect.

You could set hdmi_group=2 and hdmi_mode=16 (or similar) to get resolution permanent but it defeats headless settings. After plugging monitor with hotplug=1 "xrandr -s 0" will reset it to current monitor default size.

dtoverlay=vc4-fkms-v3d max_framebuffers=2 This will set new multimonitor driver or revert to old settings when disabled. Headless works with this driver when hotplug is desabled.

2 options for this issue:

  1. Don't use hotplug=1 option in config.txt and utilize headless for VNC. You need to reboot to get local monitor working with this.
  2. Use hdmi_force_hotplug=1, group and mode to set resolution for VNC. Use "xrandr -s 0" in command mode to reset the screen when monitor is plugged in. You could use "xrandr -s 0" again when monitor unplugged to set it back to your preferred VNC resolution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.