12

I have an Ubuntu server with no physical access to it, only via ssh/vnc.

It is stuck on a 1680x1050 resolution and in the system display settings the menus are disabled since there is no detected real display connected.

I need to lower the resolution to e.g. 800x600.

When I try:

$ xrandr --output VGA1 --mode 800x600

I'm getting:

xrandr: cannot find mode 800x600

The results are the same even if I first try:

$ xrandr --newmode "800x600_60.00"   38.25  800 832 912 1024  600 603 607 624 -hsync +vsync

The props are:

$ xrandr --prop
Screen 0: minimum 320 x 200, current 1680 x 1050, maximum 4096 x 4096
VGA1 disconnected 1680x1050+0+0 (normal left inverted right x axis y axis) 593mm x 371mm
  1680x1050 (0x43)  146.2MHz
        h: width  1680 start 1784 end 1960 total 2240 skew    0 clock   65.3KHz
        v: height 1050 start 1053 end 1059 total 1089           clock   60.0Hz

Any ideas?

2

3 Answers 3

11
+50

It sounds like you are using the vino server to share the desktop via VNC. Although I think you can change your /etc/X11/xorg.conf, or whatever the X config file is now, I have another suggestion. Leave the X config alone and create another session for your vnc.


Install vnc

$ sudo apt-get install vnc4server

Create vnc start and stop scripts

vnc.sh

#!/bin/sh

vncserver :12 -name "My-Server" -geometry 1600x1100

vnc-kill.sh

#!/bin/sh

vncserver -kill :12

12 is just an arbitrary display number. You will use this when you connect to the server. It can be any number except 0. That is what the vino server uses by default (I think). Don't forget to chmod +x the scripts.

Optional: Start vnc session on boot

Add the vnc.sh to your /etc/rc.local so that the session will start when the computer starts. sudo vi /etc/rc.local and add this to the end before the "exit 0"

su - YourUserName -c "/home/YourUserName/bin/vnc.sh"

I run the vnc server as a user here. I don't want the server to run under the root context. Replace the "YourUserName", of course. Alternatively, you do not need to put this here, you could ssh in and run the "vnc.sh" script manually. Your call.

Set your vnc password

(this is separate from the other vnc desktop password)

$ vncpasswd

Edit your vnc session file

$ vi ~/.vnc/xstartup

Comment out everything and put this at the end

gnome-session &

Test it

Run your vnc.sh script and connect from another computer.

vncviewer.exe -connect Server:12
3
  • 2
    Thanks, it works great for a new desktop. However, I need to use an existing desktop with various open windows already there. Is there a way I can connect to the original display :0 with a different geometry?
    – GJ.
    Sep 26, 2010 at 18:43
  • ... alternatively is there a way to move all windows in a single batch operation from the the main display to this new VNC display?
    – GJ.
    Sep 26, 2010 at 18:44
  • Although I have not tried it yet, I believe that you can use "x11vnc" in the place of the "vncserver" above, with a specific -geometry parameter. This should give you access to the :0 display. I looked for parameters to the gnome vino server, but could not find any.
    – SuperJames
    Sep 27, 2010 at 19:36
1

You could consider changing the resolution on the VNC server? I'm not sure of your setup but if the VNC server is on the virtualized machine you could check the vncserver instantiation point and change the -geometry flag there?

Alternatively, I would look at xorg.conf and add the mode you are looking for, since xrandr is saying its not availiable. This article covers the basics of xorg.conf editing

1

I'm able to change my vncserver resolution at will with the following command:

vncconfig -set randr=1552x1175 ; xrandr -s 1552x1175

( HT Matt D.)

3
  • 1
    What is vncconfig? You mean vnc4config?
    – Wtower
    Dec 19, 2014 at 9:42
  • 1
    Suse calls it vncconfig. Dec 19, 2014 at 16:45
  • 1
    Ah, right then :)
    – Wtower
    Dec 20, 2014 at 11:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .