Starting NICE DCV sessions - NICE DCV
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Starting NICE DCV sessions

When you use the defaults to install Windows NICE DCV server, a console session is automatically created and active after the server is installed. The default console session is owned by Administrator and has a default session ID of console. You can use this session or you can close it and create a new session.

If you chose to opt out of the automatic console session creation when you installed the NICE DCV server, you must create one manually. After you install the NICE DCV server, you can enable or disable the automatic console session creation at any time.

Note

Linux NICE DCV servers don't get a default console session after installation.

Assume that you use a floating license on an on-premises or alternative cloud-based server and exceed the maximum number of concurrent sessions that's supported by your license. You might get a no licenses error. If you get this error, stop an unused session to release the license and try again.

The NICE DCV server must be running to start a session. For more information, see Starting the NICE DCV Server.

Manually starting console and virtual sessions

You can start a NICE DCV session at any time. You can only run one console session at a time. If you're using a Linux NICE DCV server, you can run multiple virtual sessions at the same time.

It's good practice to run dcv list-sessions before creating a session, especially if you're using Windows NICE DCV server.

To create a console or virtual session on a Windows or Linux NICE DCV server, use the dcv create-session command.

Syntax

The minimal syntax of the command to start a session is:

dcv create-session session_ID

The full syntax with all the options is:

dcv create-session \ --type console|virtual \ --name session_name \ --user username \ --owner owner_name \ --permissions-file /path_to/permissions_file \ --storage-root /path_to/storage_directory \ --gl on|off \ --max-concurrent-clients number_of_clients \ --init /path_to/init_script \ session_ID
Note

The \ symbol represents the syntax to split a command in multiple lines.

You can also use dcv create-session --help to display a quick reference to the syntax.

Options

The following options can be used with the dcv create-session command:

--type

This option is supported on Linux NICE DCV servers only. It specifies the type of session to be created and can be either console or virtual.

Type: String

Allowed values: console | virtual

Required: No

--name

Specifies a name for the session. Session names can be any string of up to 256 characters. If the string exceeds 256 characters, the command fails. Session names don't need to be unique across running sessions.

You can change a session's name at any time using the dcv set-name command. For more information, see Managing the session name.

Type: String

Required: Yes

--user

This option is supported with virtual sessions on Linux NICE DCV sessions only. This value is the user to be used to create the session. Only the root user can impersonate other users.

Type: String

Required: No

--owner

Specifies the session owner. Defaults to the currently signed in user if omitted.

Type: String

Required: No

--permissions-file

Specifies a path to a custom permissions file. Defaults to the server defaults if omitted.

Type: String

Required: No

--storage-root

Specifies the path to the folder used for session storage.

You can use %home% to specify the home directory of the user who is currently signed in. For example, the following sets the directory for session storage as c:\Users\username\storage\ for Windows servers or $HOME/storage/ for Linux servers.

--storage-root %home%/storage/
Note

If a specified subdirectory doesn't exist, session storage is disabled.

Type: String

Required: No

--gl

This option is supported with virtual sessions on Linux NICE DCV sessions only. It overrides the default dcv-gl state and can be either on or off.

Type: String

Allowed values: on | off

Required: No

--max-concurrent-clients

Specifies the maximum number of NICE DCV clients that are allowed to connect to the session. Defaults to unlimited connections if omitted.

Type: Integer

Required: No

--init

This option is supported with virtual sessions on Linux NICE DCV servers only. It specifies the path to a custom init script. The script can be used to start a specific desktop environment and launch specific applications automatically when the session starts. The script must be executable. Defaults to a script that starts the default desktop environment if omitted.

Type: String

Required: No

session ID

Provides an ID for your session at the end of the command.

Type: String

Required: Yes

Examples

Example 1 - Console session

The following command creates a console session owned by dcv-user with a unique session ID of my-session, and a session name of my graphics session. It also specifies a permissions file named perm-file.txt.

  • Windows NICE DCV server

    C:\> dcv create-session^ --owner dcv-user^ --name "my graphics session"^ --permissions-file perm-file.txt^ my-session
  • Linux NICE DCV server

    $ sudo dcv create-session \ --type=console \ --owner dcv-user \ --name "my graphics session" \ --permissions-file perm-file.txt \ my-session
Example 2 - Virtual Session (Linux NICE DCV servers only)

The following command creates a virtual session using the root user to impersonate the intended session owner, dcv-user. The session is owned by dcv-user even though it is created by the root user

$ sudo dcv create-session \ --owner dcv-user \ --user dcv-user \ my-session
Example 3 - Virtual Session (Linux NICE DCV servers only)

The following command creates a virtual session owned by the user who creates it:

$ dcv create-session my-session

Enabling Automatic Console Sessions

Enabling an automatic console session ensures that a console session is automatically created each time that the NICE DCV server starts. The automatic console session is owned by the NICE DCV user specified by the owner configuration parameter. Its session ID is always console.

Other parameters affecting automatic console sessions are max-concurrent-clients, permissions-file, and storage-root. For more information about these parameters, see session-management/automatic-console-session Parameters.

Note

NICE DCV doesn't support automatic virtual sessions.

Windows NICE DCV server
To enable an automatic console session on a Windows NICE DCV server
  1. Open the Windows Registry Editor.

  2. Navigate to the HKEY_USERS/S-1-5-18/Software/GSettings/com/nicesoftware/dcv/session-management key.

  3. Create a create-session parameter:

    1. In the navigation pane, open the context (right-click) menu for the session-management key and choose New, DWORD (32-bit) Value.

    2. For Name, enter create-session and press Enter.

    3. Open the create-session parameter. For Value data, enter 1, and choose OK.

  4. Navigate to the HKEY_USERS/S-1-5-18/Software/GSettings/com/nicesoftware/dcv/session-management/automatic-console-session key.

  5. Create an owner parameter:

    1. In the navigation pane, open the context (right-click) menu for the automatic-console-session key and choose New, String Value.

    2. For Name, enter owner and press Enter.

    3. Open the owner parameter. For Value data, enter the session owner's name and choose OK.

  6. Choose OK and close the Windows Registry Editor.

  7. Stop and restart the NICE DCV server.

Linux NICE DCV server
To enable an automatic console session on a Linux NICE DCV server
  1. Navigate to /etc/dcv/ and open the dcv.conf with your preferred text editor.

  2. Add the create-session and owner parameters to the [session-management/automatic-console-session] section using the following format:

    [session-management] create-session = true [session-management/automatic-console-session] owner="session-owner"
  3. Save and close the file.

  4. Stop and restart the NICE DCV server.