VirtualBox

Changeset 99478 in vbox


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.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r99458 r99478  
    78757875  ifeq ($(KBUILD_TARGET),linux)
    78767876   TEMPLATE_VBoxQtGuiExe_LDFLAGS += -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed)
     7877   TEMPLATE_VBOXQTGUIEXE_LDFLAGS += -Wl,-rpath,$(PATH_SDK_QT5_LIB)
    78777878   TEMPLATE_VBoxQtGuiExe_LIBS += \
    78787879        $(VBOX_XCURSOR_LIBS) \
  • 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