Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have Ubuntu 12.04 installed on a machine and I always use it remotely from VNC. When I have monitor connected to this machine, I can change the resolution of my VNC viewer in the following line:

$vnc4server --geometry 1440x900

This worked for me, but I always use this machine remotely, I unplug the monitor and reboot. and the above command line not work anymore.

Then I tried xrandr

 SZ:    Pixels          Physical       Refresh
*0   1024 x 768    ( 260mm x 195mm )  *60  
Current rotation - normal
Current reflection - none
Rotations possible - normal 
Reflections possible - none

There is only one option available, so I tried to add a new one.

$cvt 1440 900
# 1440x900 59.89 Hz (CVT 1.30MA) hsync: 55.93 kHz; pclk: 106.50 MHz
Modeline "1440x900_60.00"  106.50  1440 1528 1672 1904  900 903 909 934 -hsync +vsync


$xrandr --newmode "1440x900_60.00"  106.50  1440 1528 1672 1904  900 903 909 934 -hsync +vsync

$xrandr --addmode S2 "1440x900_60.00"

then I checked with xrandr again and can't see the new mode added.

I try to execute the following command and get error says my RandR is too old.

$xrandr --output S2 --mode 1440x900_60.00
xrandr: Server RandR version before 1.2

but this does not make sense to me, if I plug in the monitor back and run the xrandr command, it works again! It seems that Ubuntu must conntect to a real monitor before I can change my resolution in my VNC viewer.

Can anyone help?

UPDATE: Finally I solved this problem by changing to tightvncserver

$tightvncserver -geometry 1440x900 

works for me.

Thanks everything answered my question

share|improve this question
1  
You'll want to post what worked for you as an answer so you can mark it as accepted and others can benefit. –  minerz029 Oct 7 '13 at 12:31

2 Answers 2

Looking at the documentation for xrandr, it relies on getting information from the display for supported resolutions. With no monitor connected, xrandr has no information to draw on for setting a display resolution and most likely draws from the resolution set in your Display preferences for the VNC connection. No display = no screen resolution changing.

share|improve this answer
    
I am using the VNC Viewer client from RealVNC, and can't find the option to control the screen resolution in client. and within the Ubuntu, $vnc4server --geometry 1440x900 does not help. –  user325320 Apr 28 '13 at 11:06
    
Clarification: display resolution set from host computers' Display Preferences, not resolution settings of VNC client. If the host computer has no monitor attached, resolution switching will not work. –  douggro Apr 28 '13 at 16:15
    
But I can't change the resolution settings in System Settings >> Display, when I click it, it says "RANDR extension is too old(must be at least 1.2) –  user325320 Apr 29 '13 at 2:53
    
Then you might have to remove and reinstall xrandr. Current version is 1.4.0. Regardless, without a monitor connected, you will not be able to switch resolutions. Without a monitor connected what is the output in Terminal of xrandr? –  douggro Apr 29 '13 at 3:09
    
I have updated my xrandr to 1.4.0-1 from here and still get same error. If I can't switch resolution within VNC after I connect, how can I set the resolution before I connect so it takes effect when I initially open the VNC viewer? –  user325320 Apr 29 '13 at 7:04

You can change resolution when you connect to monitor-less PC via VNC by executing the following command:

xrandr --fb 1280x1024

Source: http://www.x.org/archive/X11R7.5/doc/man/man1/xrandr.1.html

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.