Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to change the resolution / geometry of my VNC session dynamically without affecting the programs running inside it.

I referred: Changing the resolution of a VNC session in linux. I don't have root permission to update the newer vncserver version, so following command doesn't work as of now:

vncserver -geometry 1280x1024 -randr 1280x1024,1280x800

For now, whenever I want to change the screen size from one monitor to other, I kill the session and restart it with modified -geometry option. Due to this I have to loose the programs inside it.

Is there any way to hack the file which stores the geometry and change the values for changing the resolution? I couldn't find such file. In my home folder, I see below files:

mgandhi@starbase:~/.vnc$ ll
total 12
-rwxr-xr-x 1 mgandhi bc  334 Jun 25 10:32 xstartup
-rw------- 1 mgandhi bc    8 Jun 25 10:32 passwd
-rw-r--r-- 1 mgandhi bc    6 Jun 25 11:08 starbase.radisys.com:23.pid
-rw-r--r-- 1 mgandhi bc 1664 Jun 25 11:08 starbase.radisys.com:23.log

The contents of xstartup file doesn't help:

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

... here xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & line remains constant for any resolution.

[Note: I see that xrandr is installed in the linux machine.]

share|improve this question

migrated from stackoverflow.com Jun 25 '12 at 12:37

This question came from our site for professional and enthusiast programmers.

1 Answer 1

$HOME/.vnc/xstartup is the file you are looking for and yes, you can set the geometry there. It should adjust on reconnect without borking your session (not 100% sure but pretty sure).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.