VirtualBox

Changeset 99478 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Apr 20, 2023 8:22:45 AM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
156971
Message:

Check if XDG_SESSION_TYPE is set to tty, else GUI refuses to start in ssh sessions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.cpp

    r99436 r99478  
    740740DisplayServerType NativeWindowSubsystem::detectDisplayServerType()
    741741{
     742    /* Warning: All the following assumes:
     743         - the system does not have several sessions with different display server configurations,
     744         - XDG_SESSION_TYPE is set accordingly.
     745    */
    742746    const char *pSessionType = RTEnvGet("XDG_SESSION_TYPE");
    743747    if (pSessionType != NULL)
     
    752756        else if (RTStrIStr(pSessionType, "x11"))
    753757            return DisplayServerType_XOrg;
     758        /* On systemd systems XDG_SESSION_TYPE is set to tty for ssh sessions. Check xserver processes then:*/
     759        else if (RTStrIStr(pSessionType, "tty"))
     760        {
     761            if (RTProcIsRunningByName("Xorg"))
     762                return DisplayServerType_XOrg;
     763            else if (RTProcIsRunningByName("Xwayland"))
     764                return DisplayServerType_XWayland;
     765        }
    754766    }
    755767    return DisplayServerType_Unknown;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette