Page 1 of 1

Set VNC resolution?

Posted: Sun Dec 17, 2017 9:38 pm
by Khatharr
So I have a headless Pi2 running Raspbian (all up to date) and I connect to it using the bundled VNC. I've set the resolution in raspi-config as low as 640x480, but when I connect via VNC it's always at 1280x900. My question is thus how can I set the VNC resolution, since setting the desktop resolution is not doing the job?

Thanks in advance for any advice. :)

Re: Set VNC resolution?

Posted: Sun Dec 17, 2017 9:43 pm
by fruitoftheloom
Khatharr wrote:
Sun Dec 17, 2017 9:38 pm
So I have a headless Pi2 running Raspbian (all up to date) and I connect to it using the bundled VNC. I've set the resolution in raspi-config as low as 640x480, but when I connect via VNC it's always at 1280x900. My question is thus how can I set the VNC resolution, since setting the desktop resolution is not doing the job?

Thanks in advance for any advice. :)


If run in Virtual Mode, then the HELP section has information:

https://www.realvnc.com/en/connect/docs ... pi-virtual

Re: Set VNC resolution?

Posted: Sun Dec 17, 2017 11:06 pm
by Khatharr
I don't think it's in virtual mode. The settings indicated are the ones for setting the desktop resolution. I've already checked them and they're as I set them.

Thank you, though.

Re: Set VNC resolution?

Posted: Sun Dec 17, 2017 11:45 pm
by fruitoftheloom
Khatharr wrote:
Sun Dec 17, 2017 11:06 pm
I don't think it's in virtual mode. The settings indicated are the ones for setting the desktop resolution. I've already checked them and they're as I set them.

Thank you, though.

Run in Virtual Mode and set the desired resolution as per instructions for ""Specifying a screen resolution for a virtual desktop""

Re: Set VNC resolution?

Posted: Mon Dec 18, 2017 12:09 am
by Khatharr
If I'm understanding correctly, you're saying that I should disable the bundled VNC server, install a different one, and change the setting for that one?

Re: Set VNC resolution?

Posted: Mon Dec 18, 2017 5:52 am
by timrowledge
Not quite: disable vnc in the preferences so that it is not coupled to the ‘real’ screen. Then use ‘vncserver ‘ to make a virtual screen. You can specify the resolution of that screen with (IIRC) -randr 1280x1024 (for example). There are about forty-gazillion options to read about in the RealVNC documentation. Some of them even seem to do something useful!

Re: Set VNC resolution?

Posted: Mon Dec 18, 2017 6:07 pm
by Khatharr
Okay, I had to monkey with it for a while, but I got it working. It looks like it uses 5900 for the bundled server, but when you start it from the CLI it shows something like "192.168.1.99:1", where the appended 1 is the "display number". It turns out the port to connect to is 5900 + that number, which would be neat if it were written down somewhere. Oh well.

Thank you for your help, you two. :D

Re: Set VNC resolution?

Posted: Mon Dec 18, 2017 6:52 pm
by mattmiller
Coming to this one late but I run all my Pi headless using standard VNC server and the only thing I change is

Code: Select all

# uncomment to force a console size. By default it will be display's size minus
# overscan.
framebuffer_width=1900
framebuffer_height=1024
in /boot/config.txt

nothing else needed at all

Re: Set VNC resolution?

Posted: Tue Dec 19, 2017 4:27 pm
by knute
mattmiller wrote:
Mon Dec 18, 2017 6:52 pm
Coming to this one late but I run all my Pi headless using standard VNC server and the only thing I change is

Code: Select all

# uncomment to force a console size. By default it will be display's size minus
# overscan.
framebuffer_width=1900
framebuffer_height=1024
in /boot/config.txt

nothing else needed at all
+1

Re: Set VNC resolution?

Posted: Wed Jan 03, 2018 8:28 pm
by Roken
OK, driving me nuts. I've tried editing /boot/config.txt and for me, it still gives me a 720x480.

I've tried setting via raspi-config - with the same result. (raspi-config on the tiny display does confirm 1920x1080 (which is what I want).

So how do I get a 1920x1080 via vnc?

Sorry to hijack, but it's the same problem. May not be a problem at the end of the month, since I'm considering buying a dedicated screen and one of those dinky little keyboards, but for now....

Edit: For info, the client is Archlinux using realvnc-vnc-viewer

Re: Set VNC resolution?

Posted: Wed Jan 03, 2018 9:34 pm
by beta-tester
can you try this in config.txt:

Code: Select all

hdmi_force_hotplug=1
hdmi_force_mode=1
hdmi_drive=2
hdmi_group=1
hdmi_mode=16
this should force to use [email protected] even no monitor is plugged,
https://www.raspberrypi.org/documentati ... t/video.md
on my RPi it has direct effect to vnc resolution to force it also to use 1920x1080.

Re: Set VNC resolution?

Posted: Wed Jan 03, 2018 9:56 pm
by Roken
Nope. Just the same:

Code: Select all

$ xrandr 
Screen 0: minimum 320 x 200, current 720 x 480, maximum 2048 x 2048
HDMI-1 disconnected primary (normal left inverted right x axis y axis)
Composite-1 unknown connection 720x480+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   720x480       62.69* 
DSI-1 disconnected (normal left inverted right x axis y axis)
EDIT: I tried replacing openbox with xfce (much more my comfort zone) in the hope that I could use the display settings, but nothing available there, either.

Re: Set VNC resolution?

Posted: Wed Jan 03, 2018 10:02 pm
by Roken
Probably going to leave it until weekend to keep trying. Gotta go to my parents tomorrow (already missed festivities and dad's birthday with them) and I still have work to think about :(

Re: Set VNC resolution?

Posted: Wed Jan 03, 2018 11:01 pm
by mattmiller
I've tried editing /boot/config.txt and for me, it still gives me a 720x480.
paste contents of your config.txt

Better still - stick this in it instead

Code: Select all

# 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
#hdmi_safe=1

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

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

# uncomment to force a console size. By default it will be display's size minus
# overscan.
framebuffer_width=1280
framebuffer_height=720

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

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

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

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

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

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

# Enable audio (loads snd_bcm2835)
dtparam=audio=on
All I've done is alter framebuffer sizes

(I don't have a monitor capable of the sizes you want but the above settings should give you 1280x720

If they do - change them to what you want and reboot to see if it works

Re: Set VNC resolution?

Posted: Thu Jan 04, 2018 10:20 pm
by Roken
OK, you got me there, not so much with what you have, as with what you don't.

I already had the framebuffer set, and so time to try commenting out where you had commented and I didn't. None made a difference. However, I have an entry that you don't:

Code: Select all

dtoverlay=vc4-kms-v3d
This was enabled. Commenting out and rebooting got me full resolution on vnc.

Thank you :)

Re: Set VNC resolution?

Posted: Wed Jan 31, 2018 2:03 am
by Daegara
Roken wrote: OK, you got me there, not so much with what you have, as with what you don't.

I already had the framebuffer set, and so time to try commenting out where you had commented and I didn't. None made a difference. However, I have an entry that you don't:

Code: Select all

dtoverlay=vc4-kms-v3d
This was enabled. Commenting out and rebooting got me full resolution on vnc.

Thank you :)
Just stumbled upon this issue too - Can confirm commenting out this line works.

(The line relates to device tree item of the *experimental* Open GL display driver; disabling or commenting out that line provides the desired virtual server behaviour rather than you being limited to 720x480 which it locks to when enabled.

Re: Set VNC resolution?

Posted: Sun Apr 15, 2018 11:09 pm
by syscorp
yes!!! thanks so much! it works...
have full resolution working again with no HDMI connected.

Re: Set VNC resolution?

Posted: Sun May 06, 2018 2:31 am
by crowmagnumb
This was solved for me by uncommenting out the framebuffer_width and framebuffer_height properties and rebooting.

```
# uncomment to force a console size. By default it will be display's size minus
# overscan.
framebuffer_width=1280
framebuffer_height=720
```

Re: Set VNC resolution?

Posted: Sat Oct 27, 2018 5:53 pm
by amitray
I too faced the same issue and disabling dtoverlay=vc4-kms-v3d in config.txt file solved it. Many many thanks for that.

Re: Set VNC resolution?

Posted: Thu Dec 13, 2018 7:51 pm
by Srandista
I had the same problem with headless Pi and RealVNC. Thanks to this topic, I was able to fix it. Just one advice, you don't have to completely disable OpenGL driver, if you don't want to. You can set dtoverlay=vc4-fkms-v3d, which is experimental GL driver with so called Fake KMS. With this setting, Pi will start with set resolution from config.txt and functional GL driver, even with headless configuration,.

Re: Set VNC resolution?

Posted: Mon Dec 24, 2018 8:49 pm
by mandaltechtv
Worked for me!

Suggest

Code: Select all

sudo vi /boot/config.txt 
as this file needs root permission to edit
mattmiller wrote:
Mon Dec 18, 2017 6:52 pm
Coming to this one late but I run all my Pi headless using standard VNC server and the only thing I change is

Code: Select all

# uncomment to force a console size. By default it will be display's size minus
# overscan.
framebuffer_width=1900
framebuffer_height=1024
in /boot/config.txt

nothing else needed at all

Re: Set VNC resolution?

Posted: Tue Jan 29, 2019 9:41 am
by jimjtron
Gidday. Just wanted to confirm and thank Beta_tester for the code he submitted which worked on my RPi 3.
I was using Teamviewer Server and knowing that it was based upon VNC I thought I would try the code suggested and it worked.
hdmi_force_hotplug=1
hdmi_force_mode=1 THIS ONE I COULDN'T FIND AND DIDN'T USE.
hdmi_drive=2
hdmi_group=1
hdmi_mode=16

It had cost me lots of hours searching internet and stuffing around with a DVI monitor switching back and forth between Macosx & the Pi.
Can confirm #hdmi_safe=1 did NOT help and hdmi_force_hotplug=1 by itself did NOT cure the problem.

Thanks once again.
JimJtron

Re: Set VNC resolution?

Posted: Tue Jul 16, 2019 9:49 pm
by OMR
This is still true for the Pi 4, just comment out the line in the [pi4] section:

Code: Select all

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
#dtoverlay=vc4-fkms-v3d
max_framebuffers=2