How do I adjust the screen resolution of a virtual desktop under Linux?


It depends upon the version of the Xorg server in use. By default under Linux, VNC Server in Virtual Mode uses an old version of the Xorg server built into Xvnc, which is still recommended for Ubuntu and SUSE systems providing you change the desktop environment. However, from VNC Connect 6.2.0 you can configure VNC Server to utilise the latest version of the Xorg server on your system instead, which may give a considerably better experience for Red Hat and CentOS systems.

For users running Xvnc

You can specify one or more screen resolutions (geometries) for a virtual desktop using the VNC Server RandR parameter. If you set multiple comma-separated screen resolutions, a connected VNC Viewer user can cycle between them. For example, specifying the resolutions 1024x768,1280x1024,800x600 allows a connected VNC Viewer user to choose the one they want dynamically by running the command xrandr –s <0|1|2>.

For users running the latest version of the Xorg server

You can set non-standard screen resolutions by adding additional ModeLine entries to the Monitor section of the /etc/X11/vncserver-virtual-dummy.conf file. In versions of VNC Server earlier than 6.7.0, the file is /etc/X11/vncserver-virtual.conf

A convenient way to generate the required Modeline is by using the gtf command, e.g.

gtf 1920 1080 60

where 1920 is the width, 1080 is the height, and 60 is the refresh rate. Replace these values as required.

For larger resolutions, you may also need to increase the VideoRam entry in the Device section.

Refer to the Xorg.conf man page for more information.

Note the VNC Server RandR parameter cannot be used to enable a connected VNC Viewer user to cycle between available screen resolutions in this environment. A connected user should use the standard Screen Display or Monitor app instead.

Was this article helpful?
21 out of 109 found this helpful


1 comment
  • I found that just using the xrand command on Ubuntu 16.04 and setting the resolution worked best through the terminal using the following command

    xrandr --fb 1580x900

    That size looked good on my 27-inch monitor using 2560 x1440

    Comment actions Permalink

Please sign in to leave a comment.