Connecting to virtual desktop sessions in NoMachine
This article assumes that you are using NoMachine version 4 or later on both the end-user's machine and on the server host (it's advisable to keep server/client versions aligned) and will describe:
i) how to start a new virtual desktop automatically
Do the following on your machine
1) Connect for the first time to the server: open the NoMachine User Interface (GUI) and initiate a new connection.
2) Once logged-in, click on 'New virtual desktop or custom session'.
3) In the next panel showing all the desktop types available on that server, check 'Save this setting in the configuration file'.
4) Then choose the desktop you want to create and click on it.
5) Disconnect the session by closing the window or disconnecting from the NoMachine menu (CTRL+ALT+0 -> Connection).
6) Start this connection again: you should connect automatically to the desktop you just configured.
ii) how to reconnect a virtual desktop automatically
To reconnect automatically you must have already configured a connection and disconnected it (see section (i)).
On your machine run the same connection again: you should be re-connected automatically to the virtual desktop you have created the first time.
Auto-reconnection for web sessions requires to use a connection file and specify the appropriate value for the "Session" and "Desktop" keys. Please see also the following guide for details: https://www.nomachine.com/DT11R00193#3
Auto-reconnection when session is lost (v. 6 or later)
Auto-reconnection when the connection is lost for whatever reason (including when the client host has entered sleep mode), is available since v. 6.
NoMachine will automatically try to reconnect for as long as the user keeps the client User Interface or the browser open. If reconnecting is not possible, then the user will have to reconnect manually.
iii) how to migrate a virtual desktop from one client computer to another
Pre-requisite is that you are already running a connection from client machine "A" and that this connection is still active.
From client machine "B" start the same connection (same connection name and user). The session will open and migrate from client A to client B (i.e. the session is automatically disconnected from machine A and reconnected from machine B).
iv) how to configure the server to let users start any of the available desktop types (since v. 7)
The NoMachine User Interface presents to the user the default desktop environment of the server host unless you configure it otherwise. The default desktop is defined in the DefaultDesktopCommand key in /usr/NX/etc/node.cfg.
Since NoMachine v.7 it's possible to configure the server to display to user all the desktop types installed and configured on the system (i.e. available in /usr/share/xsessions).
To enable that, set 'xsessions=1' in the ConnectPolicy key in /usr/NX/etc/server.cfg:
ConnectPolicy autocreate=1,autoconnect=1,automigrate=1,desktop=0,dialog=0,xsessions=1,udp=1
Be sure to remove the pre-pending # from the key name.
Options autocreate, autoconnect and automigrate are always on, regardless of whether their settings are on or off in the ConnectPolicy key.
In case of multi-node environments, do the following.
Enterprise Terminal Server (ETS) + Terminal Server Nodes
Edit /usr/NX/etc/server.cfg on ETS and on the Terminal Server Node(s) and set 'xsessions=1':
ConnectPolicy autocreate=1,autoconnect=1,automigrate=1,desktop=0,dialog=0,xsessions=1,udp=1
Cloud Server + any of the terminal server products (e.g. Workstation, Small Business Server etc ...)
Edit /usr/NX/etc/server.cfg on the node(s) and set 'xsessions=1':
ConnectPolicy autocreate=1,autoconnect=1,automigrate=1,desktop=0,dialog=0,xsessions=1,udp=1
vi) how to configure the server to let users start GNOME and KDE desktops
If your remote server host has both GNOME and KDE desktops installed, you can give users the possibility to choose between any of them.
To do that set 'desktop=1' in the ConnectPolicy key in /usr/NX/etc/server.cfg:
ConnectPolicy autocreate=1,autoconnect=1,automigrate=1,desktop=1,dialog=0,xsessions=0,udp=1
and define the command to start GNOME and KDE in the following keys in /usr/NX/etc/node.cfg:
CommandStartGnome ""
CommandStartKDE ""
Be sure to remove the pre-pending # from the key name. Options autocreate, autoconnect and automigrate are always on, regardless of whether their settings are on or off in the ConnectPolicy key.
Note that all the other available options (autocreate,autoconnect and automigrate) are always on, regardless of whether their settings are on or off in the ConnectPolicy key. For versions earlier than 4.1.28, it's necessary to set autocreate and autoconnect options to 1 if you want to enable them.
vii) how to configure a multi-node environment to let users start GNOME and KDE virtual desktops
This applies to a multi-node environment v.6 or later made of a main Enterprise Terminal Server, ETS (which is the single point of access to the system) and a number of nodes where Terminal Server Node, TSN is installed.
The virtual desktop session on the node is started according to the default desktop environment set on the system, if NoMachine is not configured otherwise. (See https://www.nomachine.com/AR04K00667 for configuring a different desktop environment).
Given that both GNOME and KDE are installed, it's possible to configure the NoMachine environment for allowing users to choose if creating a GNOME or KDE virtual desktop.
To do that, set in the server configuration file (/usr/NX/etc/server.cfg) on the main server host ETS the 'desktop=1' option in the ConnectPolicy key. E.g.:
ConnectPolicy autocreate=1,autoconnect=1,automigrate=1,desktop=1,dialog=0,xsessions=0
Note that the server, ETS, will choose the node where to start the virtual desktop from the pool of nodes where the selected session type is effectively available.
The GNOME and KDE virtual desktops will be launched according to the command set in the CommandStartGnome and CommandStartKDE keys respectively in the node configuration file (/usr/NX/etc/node.cfg) of the Terminal Server host.
TIPS
The types of sessions allowed in the whole multi-node environment are defined in the AvailableSessionTypes key in server.cfg on the main server ETS host. Types 'unix-gnome' and 'unix-kde' must be set in such key.
The types of sessions available on the specific node are defined in the AvailableSessionTypes key in node.cfg. Types 'unix-gnome' and 'unix-kde' must be set in such key to allow creating either a new GNOME or KDE virtual desktop.
If GNOME and KDE are already installed, the NoMachine setup scripts take care of populating the relevant keys (AvailableSessionTypes, CommandStartGnome and CommandStartKDE) with the proper values. In this case it's enough to enable 'desktop=1' in the ConnectPolicy key of the ETS server.cfg file.
If either GNOME and/or KDE is installed on the node after NoMachine TSN, it's necessary to update manually the NoMachine multinode environment:
1) Ensure that these keys are uncommented (remove the pre-pending #) and set to the proper command for launching the correspondent desktop environment:
CommandStartGnome ""
CommandStartKDE ""
2) Ensure that the AvailableSessionTypes key in node.cfg file on the node has the following types set:
unix-gnome
unix-kde
3) Align the main server to configuration changes made on the node(s) by running on the ETS host:
/etc/NX/nxserver --nodeupdate NODE:PORT
where NODE:PORT is the name of the node as it appears in the output of 'nxserver --nodelist'.
You may be also interested in:
How to run RDP sessions with NoMachine v. 4 or later
http://www.nomachine.com/AR07J00645
Running VNC sessions with NoMachine
https://www.nomachine.com/AR10K00720
Creating a NoMachine XDM virtual desktop
https://www.nomachine.com/AR06Q01035
How to disable specific session types (e.g. custom sessions) on Linux
https://www.nomachine.com/AR07P00989
