NoMachine Support

Your questions answered

Knowledge Base

Searching in: Articles & FAQs
Filter the search results
Applies to:
Last update:
Searching in: Articles & FAQs
ID: AR05P00982
Applies to: NX Server Products
Added on: 2018-05-30
Last update: 2019-03-22
How to enable VirtualGL support on Linux in NoMachine v. 6.2 or later

This article applies to NoMachine v. 6.2 or later and to servers for Linux supporting virtual desktops (e.g. NoMachine Workstation, Terminal Server etc ...) and Terminal Server Node.

For previous NoMachine versions, please refer to:

NoMachine provides support for HW accelerated OpenGL applications in virtual desktop and custom sessions by using the VirtualGL library. This library is shipped in the NoMachine servers and node packages for Linux.

Pre-requisite is that the host machine is a physical computer and has a hardware-accelerated 3D card.

As first step, it's necessary to configure the X server on the system for giving VirtualGL access to the GPU. All users with a connection to the X server will be allowed to use the VirtualGL direct rendering.

'VirtualGL requires access to a GPU in the application server so that it can create off-screen pixel buffers (Pbuffers) and redirect the 3D rendering from X windows into these Pbuffers. Unfortunately, accessing a GPU on Linux and Unix systems requires going through an X server.'  Ref.

To configure the system for using VirtualGL, execute:

sudo /etc/NX/nxserver --virtualgl-install


Note: to restore the system configuration and remove the configuration for VirtualGL support:

sudo /etc/NX/nxserver --virtualgl-uninstall


When the system is configured to use VirtualGL, you have two options:

a) Use VirtualGL for all applications.

b) Use VirtualGL only for specific application(s).


a) How to run all applications under the provisioning of VirtualGL

In order to use VirtualGL in NoMachine virtual desktops and custom sessions for all applications, execute from a terminal:

sudo /etc/NX/nxserver --virtualgl yes

(if you don't have sudo, run the command as root)

This command will set in /usr/NX/etc/node.cfg:

EnableVirtualGLSupport 1

The system is now ready to run all applications in NoMachine virtual desktops or custom sessions under the provisioning of VirtualGL. This can be however redundant and could lead to unforeseen behaviors, since only those applications that use OpenGL will benefit from VirtualGL rendering.


To disable using VirtualGL:

sudo /etc/NX/nxserver --virtualgl no

This will set in /usr/NX/etc/node.cfg:

EnableVirtualGLSupport 0


b) How to run only a specific application under the provisioning of VirtualGL

Launch the OpenGL application by running in a console inside the NoMachine virtual desktop:

/usr/NX/scripts/vgl/vglrun <opengl app>

TIP: You may also create a wrapper script to launch the application with the command above. Multiple OpenGL applications can be launched on the desktop by specifying the command for each of them.


If you need to run the OpenGL application in a NoMachine custom session, pre-pend:


to the command specified in the 'Run the following command' field of the client User's Interface.


A specific case

Solving slowness problems when running the GNOME desktop

If you are experiencing slowness when running the GNOME desktop, you may try to run GNOME under VirtualGL and use the accelerated graphics.

To do that, edit the /usr/NX/etc/node.cfg file, uncomment and add the command to run VirtualGL to the DefaultDesktopCommand key (and also to the  CommandStartGnome key if you've 'desktop=1'  in the ConnectPolicy key in the server configuration file).

For example, for RHEL-based Operating Systems:

DefaultDesktopCommand "/etc/gdm/Xsession 'env XDG_SESSION_TYPE=x11 /usr/NX/scripts/vgl/vglrun gnome-session --session=gnome'"
CommandStartGnome "/etc/gdm/Xsession 'env XDG_SESSION_TYPE=x11 /usr/NX/scripts/vgl/vglrun gnome-session --session=gnome'"

They may be slightly different on other systems. For example:
DefaultDesktopCommand "/etc/gdm/Xsession '/usr/NX/scripts/vgl/vglrun gnome-session --session=gnome' --disable-acceleration-check"
CommandStartGnome "/etc/gdm/Xsession '/usr/NX/scripts/vgl/vglrun gnome-session --session=gnome' --disable-acceleration-check"

For Debian 9:
DefaultDesktopCommand "env XDG_SESSION_TYPE=x11 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /usr/NX/scripts/vgl/vglrun x-session-manager"
CommandStartGnome "env XDG_SESSION_TYPE=x11 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /usr/NX/scripts/vgl/vglrun x-session-manager"


DefaultDesktopCommand "env XDG_SESSION_TYPE=x11 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session gnome-session --session=gnome"
CommandStartGnome "env XDG_SESSION_TYPE=x11 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session gnome-session --session=gnome"


When using this method, disable the VirtualGL support:

sudo /etc/NX/nxserver --virtualgl no

This will set in /usr/NX/etc/node.cfg:

EnableVirtualGLSupport 0

Some references:

The NoMachine server commands to enable VirtualGL support:

More on OpenGL support:

How VirtualGL works:

Using VirtualGL to improve performance of GNOME 3 virtual desktops on RHEL 7/CentOS 7: