Kabuntel
Posts: 22
Joined: Thu Jun 14, 2018 6:14 am

Setting screen resolution explicitedly for VNC Viewer

Sat Jul 14, 2018 8:28 am

Hello,
how can I set a screen resolution that is only valid for the VNC Viewer. Right now if connect to my pi with VNC viewer I get the default resolution that I specified in raspberry-pi-configuration.
But I would like to have a different (smaller resolution) when I connect via VNC viewer.
Please help me out! I cannot figure it out by myself. Thx.
Raspberry Pi 3 Model B+

Roomain951
Posts: 1
Joined: Sat Jul 14, 2018 9:50 am

Re: Setting screen resolution explicitedly for VNC Viewer

Sat Jul 14, 2018 9:52 am

You need to do this with the magnifying glass button at the top of your connection window (showing the remote desktop) and not from the initial connection dialog. I haven't seen a way to make it the default for all VNC connections, but it does remember that state the next time you connect.

pws
Posts: 73
Joined: Mon Apr 11, 2016 4:16 pm

Re: Setting screen resolution explicitedly for VNC Viewer

Sat Jul 14, 2018 12:33 pm

Look for these lines in /boot/config.txt and change the values to whatever works for you.

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

DirkS
Posts: 9220
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Setting screen resolution explicitedly for VNC Viewer

Sat Jul 14, 2018 12:40 pm

pws wrote:
Sat Jul 14, 2018 12:33 pm
framebuffer_width=1280
framebuffer_height=720
That's not what the OP is asking for.
The same framebuffer size is used by VNC and the main screen
Meaning that display of fonts, windows, etc on the main screen changes when you change these values in config.txt

If you decrease the fb size (and that's what the OP wants to do) then the equality on the main screen will deteriorate.

rohtua
Posts: 40
Joined: Sat Jul 16, 2016 9:01 am

Re: Setting screen resolution explicitedly for VNC Viewer

Sat Jul 14, 2018 1:27 pm

I don't know a way to have the pi automatically detect when it's vnc viewer is connecting and set a specific resolution but if you start the vnc server from the terminal the below should work:

Code: Select all

vncserver -geometry 1920x1080
Obviously replace the resolution with the one you want and then when you connect to your vnc server it should display on that resolution.

What I do I put the above in a script which goes in a folder automatically loaded into my users PATH and then I can just run the script I want so I normally run just vnc to do the above but if I'm connecting via a different device I might run vnc_phone which will do the same thing but I've saved a different resolution in the script so I get that resolution on that server.

klricks
Posts: 5892
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Setting screen resolution explicitedly for VNC Viewer

Sat Jul 14, 2018 1:46 pm

Kabuntel wrote:
Sat Jul 14, 2018 8:28 am
Hello,
how can I set a screen resolution that is only valid for the VNC Viewer. Right now if connect to my pi with VNC viewer I get the default resolution that I specified in raspberry-pi-configuration.
But I would like to have a different (smaller resolution) when I connect via VNC viewer.
Please help me out! I cannot figure it out by myself. Thx.
Not sure that can be done using RealVNC in service mode?

If you use virtual mode instead of service mode then you can specify a screen size for the VNC session without changing the default local monitor setting.

Code: Select all

vncserver -geometry 1024x768
You will have to run that command from a local console or ssh session or put the command in autostart.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

Kabuntel
Posts: 22
Joined: Thu Jun 14, 2018 6:14 am

Re: Setting screen resolution explicitedly for VNC Viewer

Sat Jul 28, 2018 10:03 am

Thank you for your replies.
Now I have what I want :D
BIG THX!
Raspberry Pi 3 Model B+

Return to “Troubleshooting”