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 SystemXorg (vncserver-x11 -virtual)

Standard dummy driver

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.

RealVNC dummy driver

There is a known issue when using the standard dummy driver that prevents resolutions with a pixel clocker greater than 300MHz from being available. Consider the following Modeline for a 4K resolution:

Modeline "3840x2160_60.00" 712.34 3840 4152 4576 5312 2160 2161 2164 2235 -HSync +Vsync

The pixel clock is 712.34 and will not be available to select in the Virtual Mode session. To use resolutions like this, you will need to install the RealVNC dummy driver, which is published here:

To install it, you will need to compile it on the computer running VNC Server using the below commands:

sudo apt install git # Ubuntu
sudo yum install git # RedHat / CentOS

cd ~
git clone
cd xf86-video-vnc
sudo ./buildAndInstall

Once the process completes, you will be able to use Modelines with a pixel clock above 300MHz. Alternatively, if you are also running VNC Server 6.7.x or later, you can once again use the RandR parameter as you would with Xvnc (shown above).

Was this article helpful?
23 out of 125 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.