Cannot change vncserver default geometry

0

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 can't get it to change the default so I don't have to set the flag every time. The manual 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.

This should be a fairly straightforward thing, what is going wrong here? Does it have something to do with desktop versus server edition? Or my X configuration?

s g

Posted 2014-10-21T15:20:17.603

Reputation: 552

Answers

1

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

Details can be found in the documentation here:

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

s g

Posted 2014-10-21T15:20:17.603

Reputation: 552

1I'm glad you found this, I'm going to use it myself. You'd think that .vncrc would be mentioned in the vncserver man page. – Omnipresence – 2014-10-28T13:32:08.620

0

The xstartup file is used to specify alternative commands to run after a vncserver is started. You could start an xterm with a specific geometry, but it won't change the geometry of the vncserver itself. vncserver doesn't read any configuration files, as far as I can tell.

However, it sounds like your ultimate goal is to save yourself some time, and not have to type -geometry 1400x850 each time.

If that's the case, I would add this to your $HOME/.profile:

alias myvnc="vncserver -geometry 1400x850 $@"

Then you just need to run myvnc and it'll start your vnc server for you. You can also add any vncserver arguments to the myvnc command and still not need to type the -geometry. Ex:

myvnc :6 -name "My desktop is the best desktop"

If you want it to work for all users (and you have root access), you can put it in /etc/profile instead.

Omnipresence

Posted 2014-10-21T15:20:17.603

Reputation: 569

Not perfect, but a good answer – s g – 2014-10-27T20:18:31.453