Investigating Virtual Session Creation Failure on Linux - Amazon DCV

Investigating Virtual Session Creation Failure on Linux

A virtual session is created on Linux with the command:

$ dcv create-session session

This command will return an error only if the creation of the session fails. However, it might happen that the session is initially created successfully, but it terminates before a user can connect. You might notice this because when you check for the existing sessions, for example with the command dcv list-sessions or with dcv describe-session session, you might get no listed sessions.

In most of the cases, this happens because the desktop session is created but then immediately fails, for example in case one of the applications launched by the init script crashed or failed, or in case one of the required tools is missing.

Check the following in case the session creation fails:

  • Check the /var/log/dcv/sessionlauncher.log file containing the log related to the dcv component creating the new session processes.

  • Check the /var/log/dcv/dcv-session.user.session.log file containing the log related to the dcv init script.

  • Check the $HOME/.xsession-errors file in the home directory corresponding to the session owner. This file contains a log generated by the system X session init script, and usually contains the log generated by the desktop session manager or by other applications called by the script.

  • Check the system logs to get more information about failing systems and components. As a start, check the output of dmesg (e.g in case of a process failure) and journalctl -xe.

  • Test with a failsafe session to verify that the issue does not depend on the session manager in use.

In case the failure only occurs to a specific user, you might also try the following:

  • Check the user configuration, in particular what happens when the user configuration is deleted or renamed.

    Depending on the desktop environment and version, the configuration directory might be .gnome or .kde or .config in the user directory.

  • Check for specific user configurations affecting the user PATH or environment. Quite often, session start failures for specific users are due to frameworks such as anaconda overriding some standard native commands that may cause dbus connections in sessions initialization to fail.

  • Check for permission issues. Wrong permissions set on local ~/.dbus or ~/.Xauthority (for example they might be owned by root instead of the user) might cause a desktop session to terminate immediately.