Index: /trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp	(revision 54007)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp	(revision 54008)
@@ -285,7 +285,12 @@
 static int run(struct VBCLSERVICE **ppInterface, bool fDaemonised)
 {
-    int rc = vboxClipboardConnect();
+    int rc;
 
     NOREF(ppInterface);
+    /* Initialise the guest library. */
+    rc = VbglR3InitUser();
+    if (RT_FAILURE(rc))
+        VBClFatalError(("Failed to connect to the VirtualBox kernel service, rc=%Rrc\n", rc));
+    rc = vboxClipboardConnect();
     if (RT_SUCCESS(rc))
         rc = vboxClipboardMain();
@@ -297,4 +302,10 @@
 }
 
+static void cleanup(struct VBCLSERVICE **ppInterface)
+{
+    NOREF(ppInterface);
+    VbglR3Term();
+}
+
 struct VBCLSERVICE vbclClipboardInterface =
 {
@@ -304,5 +315,5 @@
     VBClServiceDefaultHandler, /* pause */
     VBClServiceDefaultHandler, /* resume */
-    VBClServiceDefaultCleanup
+    cleanup
 };
 
Index: /trunk/src/VBox/Additions/x11/VBoxClient/display.cpp
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/display.cpp	(revision 54007)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/display.cpp	(revision 54008)
@@ -123,4 +123,8 @@
     int status;
 
+    /* Initialise the guest library. */
+    int rc = VbglR3InitUser();
+    if (RT_FAILURE(rc))
+        VBClFatalError(("Failed to connect to the VirtualBox kernel service, rc=%Rrc\n", rc));
     pState->pDisplay = XOpenDisplay(NULL);
     if (!pState->pDisplay)
@@ -395,4 +399,5 @@
     NOREF(ppInterface);
     disableEventsAndCaps();
+    VbglR3Term();
 }
 
Index: /trunk/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp	(revision 54007)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp	(revision 54008)
@@ -2200,4 +2200,8 @@
 int DragAndDropService::x11DragAndDropInit(void)
 {
+    /* Initialise the guest library. */
+    int rc = VbglR3InitUser();
+    if (RT_FAILURE(rc))
+        VBClFatalError(("Failed to connect to the VirtualBox kernel service, rc=%Rrc\n", rc));
     /* Connect to the x11 server. */
     m_pDisplay = XOpenDisplay(NULL);
@@ -2210,5 +2214,4 @@
         return VERR_NO_MEMORY;
 
-    int rc = VINF_SUCCESS;
     do
     {
@@ -2409,4 +2412,10 @@
 }
 
+static void cleanup(struct VBCLSERVICE **ppInterface)
+{
+    NOREF(ppInterface);
+    VbglR3Term();
+}
+
 struct VBCLSERVICE vbclDragAndDropInterface =
 {
@@ -2416,5 +2425,5 @@
     VBClServiceDefaultHandler, /* pause */
     VBClServiceDefaultHandler, /* resume */
-    VBClServiceDefaultCleanup
+    cleanup
 };
 
Index: /trunk/src/VBox/Additions/x11/VBoxClient/hostversion.cpp
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/hostversion.cpp	(revision 54007)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/hostversion.cpp	(revision 54008)
@@ -131,4 +131,8 @@
 
     NOREF(ppInterface);
+    /* Initialise the guest library. */
+    rc = VbglR3InitUser();
+    if (RT_FAILURE(rc))
+        VBClFatalError(("Failed to connect to the VirtualBox kernel service, rc=%Rrc\n", rc));
     /* Because we need desktop notifications to be displayed, wait
      * some time to make the desktop environment load (as a work around). */
@@ -193,4 +197,5 @@
     }
 # endif /* VBOX_WITH_GUEST_PROPS */
+    VbglR3Term();
     LogFlowFunc(("returning %Rrc\n", rc));
     return rc;
Index: /trunk/src/VBox/Additions/x11/VBoxClient/main.cpp
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/main.cpp	(revision 54007)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/main.cpp	(revision 54008)
@@ -89,5 +89,4 @@
     if (g_szPidFile[0] && g_hPidFile)
         VbglR3ClosePidFile(g_szPidFile, g_hPidFile);
-    VbglR3Term();
     exit(0);
 }
@@ -287,9 +286,4 @@
     if (!pcszFileName)
         pcszFileName = "VBoxClient";
-    /* Initialise the guest library. */
-    rc = VbglR3InitUser();
-    if (RT_FAILURE(rc))
-        VBClFatalError(("%s: failed to connect to the VirtualBox kernel service, rc=%Rrc\n",
-                 pcszFileName, rc));
 
     /* Parse our option(s) */
Index: /trunk/src/VBox/Additions/x11/VBoxClient/seamless.cpp
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/seamless.cpp	(revision 54007)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/seamless.cpp	(revision 54008)
@@ -357,4 +357,8 @@
     if (pSelf->mIsInitialised)
         return VERR_INTERNAL_ERROR;
+    /* Initialise the guest library. */
+    rc = VbglR3InitUser();
+    if (RT_FAILURE(rc))
+        VBClFatalError(("Failed to connect to the VirtualBox kernel service, rc=%Rrc\n", rc));
     rc = pSelf->mSeamless.init();
     if (RT_FAILURE(rc))
@@ -404,4 +408,5 @@
     NOREF(ppInterface);
     VbglR3SeamlessSetCap(false);
+    VbglR3Term();
 }
 
Index: /trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11.cpp
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11.cpp	(revision 54007)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11.cpp	(revision 54008)
@@ -89,4 +89,7 @@
 }
 
+VBGLR3DECL(int)     VbglR3InitUser(void) { return VINF_SUCCESS; }
+VBGLR3DECL(void)    VbglR3Term(void) {}
+
 /**
  * Xlib error handler for certain errors that we can't avoid.
