What to do if GNOME virtual desktops start at the original resolution instead of the screen size set by the user via NoMachine

In NoMachine virtual desktops, the supported resolution for virtual desktop sessions doesn't depend on the remote hardware. The remote screen can be therefore resized to whichever resolution supported by the user's monitor.

Once connected, NoMachine by default changes the resolution of the remote desktop to match the client display configuration.

This corresponds to option “Change the server resolution to match the client when I connect” being selected in the Welcome panel at the time the client is connecting to the desktop. This behavior can also be set via the NoMachine menu panel inside the session (ctrl+alt+0 to open it, then access the Display -> Change settings panel). Option is named “Match the client resolution upon connecting”. From the same panel it's also possible to specify a custom resolution (WxH).

If the “Change the server resolution to match the client when I connect” is not selected in the Welcome panel and “Match the client resolution upon connecting” is not selected in the NoMachine menu panel, the resolution set for a new virtual desktops is the same of the client window or of the browser window (if it's a web session). Resolution is not changed when the virtual desktop is reconnected unless 'Resize remote screen' has been selected.

In some cases, however, NoMachine is unable to resize the remote GNOME virtual desktop or the new resolution is not preserved at the next connection. This mainly depends on the GNOME's version on the remote host and its ability to force the display resolution to a default value or to the last value set by the user on the system.

NoMachine uses the RandR extension to resize the screen, as well as GNOME does, but it doesn't change GNOME configurations. GNOME resizes the desktop (in our case the NoMachine virtual desktop) to a default size or to the resolution set by the user by asking the X server (the NoMachine Display Server) to resize its display. This overrides whichever NoMachine setting and the virtual desktop starts therefore at the original resolution as set on the system.

The suggested solution is to set the wanted resolution in system settings, the new value will apply also to NoMachine virtual desktops and will be persistent. Each user can set his/her preferred resolution in system settings.

In particular, from GNOME v. 3.10 onward, the first NoMachine virtual desktop is started at 640x360. The second virtual desktop and all the next sessions for the same user will be started instead at 800x480. This behavior has been verified with:

O.S.

GNOME version

Fedora 27

3.26

Fedora 26/Ubuntu 17.04

3.24

Fedora 25

3.22

Fedora 24

3.2

Fedora 22

3.16

Fedora 21/ Ubuntu 15.04

3.14

Ubuntu 14.04

3.10

With GNOME v. 3 up to v. 3.10, all virtual desktops are started at 1920x1200. This behavior has been verified with:

O.S.

GNOME version

Fedora 18/ Ubuntu 13.04

3.6

Ubuntu 12.04

3.4

In both cases, if the user has set a different value on the system, the NoMachine virtual desktop will be started with such resolution.

Workaround
The user should set the preferred resolution on the system. This can be done via the desktop environment user interface in system settings. Resolution set on the system will apply also to NoMachine virtual desktops.

Older versions of GNOME (from v. 2.16.0 to v. 3) don't come with a default resolution and force the resolution only when this was previously set on the system by the user. This behavior has been verified with:

O.S.

GNOME version

Ubuntu 10.04

2.3

Ubuntu 9.04

2.26

Ubuntu 8.04

2.22

Workaround
The user can set the preferred resolution on the system.

As an alternative, delete the $HOME/.config/monitors.xml file to get rid of the configuration previously set by the user on the system.

Operations like renaming the monitors.xml file in the user's home could be executed via NoMachine custom scripts executed on the node and triggered by the 'before the session starts' event.
More information about how to set-up custom scripts are available in the guide of each product at: https://www.nomachine.com/all-documents.

For GNOME versions up to 2.16.0 it's possible to prevent GNOME from changing the resolution by using this command: