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

Follow

When running RealVNC Server in Virtual Mode to access a virtual desktop, you can freely change the resolution of the remote virtual desktop as you need to.

The method to do this depends on whether you are have enabled SystemXorg mode or are using the older, legacy Xvnc.

For users running Xvnc

You can specify one or more screen resolutions (geometries) for a virtual desktop using the RealVNC Server RandR parameter.

If you set multiple comma-separated screen resolutions, a connected RealVNC Viewer user can cycle between them using the command line utility xrandr, or the virtual desktop's Display/Monitor settings app.

Specifying the resolutions 1024x768,1280x1024,800x600, for example, allows a connected RealVNC 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. The RealVNC Server RandR parameter cannot be used to dynamically define available resolutions and must be defined as Modelines instead.

In versions of RealVNC 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.

The standard dummy driver will not support large resolutions, such as 4K, that have a pixel clock above 300MHz. See the RealVNC dummy driver section for more information.

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

RealVNC dummy driver

RealVNC recommend compiling and installing the RealVNC dummy driver if you need to:

  • run a Virtual Mode session with a large desktop resolution, such as 4K (3840x2160) that has a pixel clock higher than 300MHz; or
  • make use of the RealVNC Server RandR parameter to dynamically define desktop resolutions in configuration files or at the command line; or
  • use the Dynamic Resolution feature, available in RealVNC Viewer 7.6.0 and RealVNC Server 7.6.0 and later

Compiling and installing the RealVNC dummy driver

The RealVNC dummy driver is published here: https://github.com/RealVNC/xf86-video-vnc

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

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

cd ~
git clone https://github.com/RealVNC/xf86-video-vnc
cd xf86-video-vnc
sudo ./buildAndInstall

With the RealVNC dummy driver, the configuration file used by SystemXorg is /etc/X11/vncserver-virtual-vnc.conf file.

Was this article helpful?
25 out of 141 found this helpful

Comments

0 comments

Article is closed for comments.