Index: /trunk/src/VBox/Additions/x11/VBoxClient/display-svga-x11.cpp
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/display-svga-x11.cpp	(revision 84261)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/display-svga-x11.cpp	(revision 84262)
@@ -654,6 +654,27 @@
 }
 
+/**
+ * Tries to determine if the session parenting this process is of X11.
+ */
+static bool isX11()
+{
+    char* pSessionType;
+    pSessionType = getenv("XDG_SESSION_TYPE");
+    if (pSessionType != NULL)
+    {
+        if (RTStrIStartsWith(pSessionType, "x11"))
+            return true;
+    }
+    return false;
+}
+
 static bool init()
 {
+    if (!isX11())
+    {
+        VBClLogFatalError("The parent session seems to be non-X11. Exiting...\n");
+        VBClLogInfo("This service needs X display server for resizing and multi monitor handling to work\n");
+        return false;
+    }
     x11Connect();
     if (x11Context.pDisplay == NULL)
