How do I change the vncserver default geometry?
Asked Answered
C

2

9

I'm using Ubuntu 12.04 (I think it's desktop...) and running vncserver to connect to it remotely. I can successfully set the resolution if I use the -geometry flag when starting the server, but I want this to be the default so I don't have to include the flag on the command line. The vncserver man page suggests to use the $HOME/.vnc/xstartup file so I made the following change:

#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-terminal-emulator -geometry 1400x850 -ls -title "$VNCDESKTOP Desktop" &

As you can see I tried to make the default '1400x850', a resolution which worked just fine when supplied by the command line. I've even tried setting this resolution in some other files which were the solutions on other OS's, but that didn't work either. I'm also curious about whether it has something to do with my X configuration

This should be a fairly straightforward thing, what is going wrong here?

Crumpler answered 21/10, 2014 at 15:2 Comment(1)
x-terminal-emulator is the command line interface (terminal interface), not the VNC canvas.Indictment
C
14

I needed to make a $HOME/.vncrc file with this entry: $geometry = "1400x850";

Details can be found in the documentation here (note that this is not what the man page suggested):

/usr/share/doc/vnc4server/examples/vnc.conf.gz

Crumpler answered 27/10, 2014 at 20:16 Comment(4)
where's the link?Optic
Thanks for that. Your answer says "Details can be found in the documentation here", but where is "here"?Optic
helpful, thanks. Btw, googling this stuff is how I got to your answer, which is to google further.Optic
Here's the link: fifi.org/cgi-bin/man2html/usr/X11R6/man/man5/vnc.conf.5x.gzGyronny
N
0

For TigerVNC + Remmina:

According to the man page there are 3 configs for VNC Server TLDR: The Configs have the following load order (last config is final):

/etc/tigervnc/vncserver-config-defaults
$HOME/.vnc/config
/etc/tigervnc/vncserver-config-mandatory

Examples in config-defaults show you can set the VNC Host Resolution by:

echo "geometry=1920x1080" >> ~/.vnc/config
vncserver -kill :1 && vncserver

Note you can see what is supported by the VNC Remote Host by,

  1. Starting a normal VNC Session
  2. On the remote VNC Session, open a terminal and type:
xrandr
# outputs
Screen 0: minimum 32 x 32, current 1920 x 1080, maximum 32768 x 32768
VNC-0 connected primary 1920x1080+0+0 0mm x 0mm
   1920x1080     60.00*+
   1920x1200     60.00  
   1600x1200     60.00  
   1680x1050     60.00  
   1400x1050     60.00  
   1360x768      60.00  
   1280x1024     60.00  
   1280x960      60.00  
   1280x800      60.00  
   1280x720      60.00  
   1024x768      60.00  
   800x600       60.00  
   640x480       60.00  

While I havent had any luck; from I read, you can also set the resolution here with:

xrandr -s 1680x1050 # or
xrandr -s 3
Noella answered 9/7, 2022 at 4:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.