User avatar
Khatharr
Posts: 16
Joined: Fri Jan 15, 2016 2:19 am

Set VNC resolution?

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. :)

fruitoftheloom
Posts: 17838
Joined: Tue Mar 25, 2014 12:40 pm

Re: Set VNC resolution?

Sun Dec 17, 2017 9:43 pm

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
Adieu

User avatar
Khatharr
Posts: 16
Joined: Fri Jan 15, 2016 2:19 am

Re: Set VNC resolution?

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.

fruitoftheloom
Posts: 17838
Joined: Tue Mar 25, 2014 12:40 pm

Re: Set VNC resolution?

Sun Dec 17, 2017 11:45 pm

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""
Adieu

User avatar
Khatharr
Posts: 16
Joined: Fri Jan 15, 2016 2:19 am

Re: Set VNC resolution?

Mon Dec 18, 2017 12:09 am

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?

timrowledge
Posts: 1144
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Set VNC resolution?

Mon Dec 18, 2017 5:52 am

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!
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

User avatar
Khatharr
Posts: 16
Joined: Fri Jan 15, 2016 2:19 am

Re: Set VNC resolution?

Mon Dec 18, 2017 6:07 pm

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

mattmiller
Posts: 1966
Joined: Thu Feb 05, 2015 11:25 pm

Re: Set VNC resolution?

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

knute
Posts: 358
Joined: Thu Oct 23, 2014 12:14 am

Re: Set VNC resolution?

Tue Dec 19, 2017 4:27 pm

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

Roken
Posts: 248
Joined: Sun Dec 31, 2017 4:35 pm

Re: Set VNC resolution?

Wed Jan 03, 2018 8:28 pm

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
Headless PI. OMG, someone cut it's head off. Oh, hang on. it didn't have one to start with.

beta-tester
Posts: 1209
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: Set VNC resolution?

Wed Jan 03, 2018 9:34 pm

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.
{ I only give negative feedback }
RPi Model B (rev1, 256MB) & B (rev2, 512MB) & B+, RPi2B (1GB), 64GB microSDXC1 class 10, HDMI 1920x1080, keyboard-mouse-combo (wireless), PiCamera, ethernet-cable, 5V/1.2A power supply, Wifi dongle (rt5370)

Roken
Posts: 248
Joined: Sun Dec 31, 2017 4:35 pm

Re: Set VNC resolution?

Wed Jan 03, 2018 9:56 pm

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.
Headless PI. OMG, someone cut it's head off. Oh, hang on. it didn't have one to start with.

Roken
Posts: 248
Joined: Sun Dec 31, 2017 4:35 pm

Re: Set VNC resolution?

Wed Jan 03, 2018 10:02 pm

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 :(
Headless PI. OMG, someone cut it's head off. Oh, hang on. it didn't have one to start with.

mattmiller
Posts: 1966
Joined: Thu Feb 05, 2015 11:25 pm

Re: Set VNC resolution?

Wed Jan 03, 2018 11:01 pm

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

Roken
Posts: 248
Joined: Sun Dec 31, 2017 4:35 pm

Re: Set VNC resolution?

Thu Jan 04, 2018 10:20 pm

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 :)
Headless PI. OMG, someone cut it's head off. Oh, hang on. it didn't have one to start with.

Daegara
Posts: 1
Joined: Wed Jan 31, 2018 1:58 am

Re: Set VNC resolution?

Wed Jan 31, 2018 2:03 am

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.

syscorp
Posts: 1
Joined: Mon Dec 25, 2017 10:25 pm

Re: Set VNC resolution?

Sun Apr 15, 2018 11:09 pm

yes!!! thanks so much! it works...
have full resolution working again with no HDMI connected.

crowmagnumb
Posts: 1
Joined: Sun May 06, 2018 2:29 am

Re: Set VNC resolution?

Sun May 06, 2018 2:31 am

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
```

amitray
Posts: 1
Joined: Sun May 27, 2018 11:38 am

Re: Set VNC resolution?

Sat Oct 27, 2018 5:53 pm

I too faced the same issue and disabling dtoverlay=vc4-kms-v3d in config.txt file solved it. Many many thanks for that.

Srandista
Posts: 3
Joined: Fri Sep 14, 2018 2:05 pm

Re: Set VNC resolution?

Thu Dec 13, 2018 7:51 pm

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,.

Return to “Raspbian”