How to change the screen resolution in VNC viewer for Ubuntu 12.04 without a monitor?
Mia Lopez
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 1440x900This 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 - noneThere 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.2but 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
42 Answers
You can change resolution when you connect to monitor-less PC via VNC by executing the following command:
xrandr --fb 1280x1024Source:
2Looking 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.
6