Index: /trunk/src/VBox/Additions/x11/xgraphics/vboxutils.c
===================================================================
--- /trunk/src/VBox/Additions/x11/xgraphics/vboxutils.c	(revision 7442)
+++ /trunk/src/VBox/Additions/x11/xgraphics/vboxutils.c	(revision 7443)
@@ -315,5 +315,5 @@
 
 Bool
-vbox_init(int scrnIndex)
+vbox_init(int scrnIndex, VBOXPtr pVBox)
 {
     Bool rc = TRUE;
@@ -321,7 +321,10 @@
     if (RT_FAILURE(vrc))
     {
-        xf86DrvMsg(scrnIndex, X_ERROR, "VbglR3Init failed rc=%d.\n", rc);
+        xf86DrvMsg(scrnIndex, X_ERROR,
+                   "Failed to initialize the VirtualBox device (rc=%d) - make sure that the VirtualBox guest additions are properly installed.  If you are not sure, try reinstalling them.  The X Window graphics drivers will run in compatibility mode.\n",
+                   vrc);
         rc = FALSE;
     }
+    pVBox->useDevice = rc;
     return rc;
 }
@@ -337,4 +340,6 @@
     TRACE_ENTRY();
 
+    if (!pVBox->useDevice)
+        return FALSE;
     pVBox->useVbva = FALSE;
 
@@ -733,4 +738,6 @@
     Bool rc;
 
+    if (!pVBox->useDevice)
+        return FALSE;
     pVBox->pCurs = pCurs = xf86CreateCursorInfoRec();
     if (!pCurs)
@@ -830,6 +837,8 @@
  */
 Bool
-vboxEnableGraphicsCap(void)
-{
+vboxEnableGraphicsCap(VBOXPtr pVBox)
+{
+    if (!pVBox->useDevice)
+        return FALSE;
     return RT_SUCCESS(VbglR3SetGuestCaps(VMMDEV_GUEST_SUPPORTS_GRAPHICS, 0));
 }
@@ -842,6 +851,8 @@
  */
 Bool
-vboxDisableGraphicsCap(void)
-{
+vboxDisableGraphicsCap(VBOXPtr pVBox)
+{
+    if (!pVBox->useDevice)
+        return FALSE;
     return RT_SUCCESS(VbglR3SetGuestCaps(0, VMMDEV_GUEST_SUPPORTS_GRAPHICS));
 }
@@ -860,6 +871,9 @@
 Bool
 vboxGetDisplayChangeRequest(ScrnInfoPtr pScrn, uint32_t *pcx, uint32_t *pcy,
-                            uint32_t *pcBits, uint32_t *piDisplay)
-{
+                            uint32_t *pcBits, uint32_t *piDisplay,
+                            VBOXPtr pVBox)
+{
+    if (!pVBox->useDevice)
+        return FALSE;
     int rc = VbglR3GetLastDisplayChangeRequest(pcx, pcy, pcBits, piDisplay);
     if (RT_SUCCESS(rc))
@@ -868,3 +882,2 @@
     return FALSE;
 }
-
Index: /trunk/src/VBox/Additions/x11/xgraphics/vboxvideo.h
===================================================================
--- /trunk/src/VBox/Additions/x11/xgraphics/vboxvideo.h	(revision 7442)
+++ /trunk/src/VBox/Additions/x11/xgraphics/vboxvideo.h	(revision 7443)
@@ -150,4 +150,5 @@
     size_t pointerSize;
     Bool pointerOffscreen;
+    Bool useDevice;
     Bool useVbva;
     VMMDevMemory *pVMMDevMemory;
@@ -155,18 +156,18 @@
 } VBOXRec, *VBOXPtr;
 
-extern Bool vbox_init(int scrnIndex);
+extern Bool vbox_init(int scrnIndex, VBOXPtr pVBox);
 extern Bool vbox_cursor_init (ScreenPtr pScreen);
-extern Bool vbox_open (ScrnInfoPtr pScrn, ScreenPtr pScreen, VBOXPtr pVBOX);
-extern void vbox_close (ScrnInfoPtr pScrn, VBOXPtr pVBOX);
+extern Bool vbox_open (ScrnInfoPtr pScrn, ScreenPtr pScreen, VBOXPtr pVBox);
+extern void vbox_close (ScrnInfoPtr pScrn, VBOXPtr pVBox);
 
 extern Bool vboxEnableVbva(ScrnInfoPtr pScrn);
 extern Bool vboxDisableVbva(ScrnInfoPtr pScrn);
 
-extern Bool vboxEnableGraphicsCap(void);
-extern Bool vboxDisableGraphicsCap(void);
+extern Bool vboxEnableGraphicsCap(VBOXPtr pVBox);
+extern Bool vboxDisableGraphicsCap(VBOXPtr pVBox);
 
 extern Bool vboxGetDisplayChangeRequest(ScrnInfoPtr pScrn, uint32_t *pcx,
                                         uint32_t *pcy, uint32_t *pcBits,
-                                        uint32_t *piDisplay);
+                                        uint32_t *piDisplay, VBOXPtr pVBox);
 
 #endif /* _VBOXVIDEO_H_ */
Index: /trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_13.c
===================================================================
--- /trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_13.c	(revision 7442)
+++ /trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_13.c	(revision 7443)
@@ -402,7 +402,8 @@
     DisplayModePtr pModes = NULL;
     ScrnInfoPtr pScrn = output->scrn;
+    VBOXPtr pVBox = VBOXGetRec(pScrn);
 
     TRACE;
-    rc = vboxGetDisplayChangeRequest(pScrn, &x, &y, &bpp, &display);
+    rc = vboxGetDisplayChangeRequest(pScrn, &x, &y, &bpp, &display, pVBox);
     /* @todo - check the display number once we support multiple displays. */
     if (rc && (0 != x) && (0 != y)) {
@@ -652,10 +653,9 @@
                VBOX_VERSION_STRING "\n");
 
-    /* Initialise the guest library */
-    if (!vbox_init(pScrn->scrnIndex))
-        return FALSE;
-
     /* Get our private data from the ScrnInfoRec structure. */
     pVBox = VBOXGetRec(pScrn);
+
+    /* Initialise the guest library */
+    vbox_init(pScrn->scrnIndex, pVBox);
 
     /* Entity information seems to mean bus information. */
@@ -709,5 +709,6 @@
 
         /* We only support 16 and 24 bits depth (i.e. 16 and 32bpp) */
-        if (   vboxGetDisplayChangeRequest(pScrn, &cx, &cy, &cBits, &iDisplay)
+        if (   vboxGetDisplayChangeRequest(pScrn, &cx, &cy, &cBits, &iDisplay,
+                                           pVBox)
             && (cBits != 16))
             cBits = 24;
@@ -925,7 +926,6 @@
             xf86DrvMsg(scrnIndex, X_INFO,
                       "The VBox video extensions are now enabled.\n");
-        vboxEnableGraphicsCap();
-    } else
-        xf86DrvMsg(scrnIndex, X_ERROR, "Failed to open the VBox system device - make sure that the VirtualBox guest additions are properly installed.  If you are not sure, try reinstalling them.\n");
+        vboxEnableGraphicsCap(pVBox);
+    }
     return (TRUE);
 }
@@ -948,5 +948,5 @@
     if (pVBox->useVbva == TRUE)
         vboxDisableVbva(pScrn);
-    vboxDisableGraphicsCap();
+    vboxDisableGraphicsCap(pVBox);
 }
 
@@ -959,5 +959,5 @@
     if (pVBox->useVbva == TRUE)
         vboxDisableVbva(pScrn);
-    vboxDisableGraphicsCap();
+    vboxDisableGraphicsCap(pVBox);
     if (pScrn->vtSema) {
 	VBOXSaveRestore(xf86Screens[scrnIndex], MODE_RESTORE);
@@ -1078,5 +1078,5 @@
         if (vboxEnableVbva(pScrn) != TRUE)  /* Bad but not fatal */
             pVBox->useVbva = FALSE;
-    vboxEnableGraphicsCap();
+    vboxEnableGraphicsCap(pVBox);
     return (TRUE);
 }
Index: /trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_70.c
===================================================================
--- /trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_70.c	(revision 7442)
+++ /trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_70.c	(revision 7443)
@@ -391,10 +391,9 @@
                VBOX_VERSION_STRING "\n");
 
-    /* Initialise the guest library */
-    if (!vbox_init(pScrn->scrnIndex))
-        return FALSE;
-
      /* Get our private data from the ScrnInfoRec structure. */
     pVBox = VBOXGetRec(pScrn);
+
+    /* Initialise the guest library */
+    vbox_init(pScrn->scrnIndex, pVBox);
 
     /* Entity information seems to mean bus information. */
@@ -467,5 +466,6 @@
         uint32_t cx, cy, iDisplay, cBits = 24;
 
-        if (vboxGetDisplayChangeRequest(pScrn, &cx, &cy, &cBits, &iDisplay))
+        if (vboxGetDisplayChangeRequest(pScrn, &cx, &cy, &cBits, &iDisplay,
+                                        pVBox))
         {
             /* We only support 16 and 24 bits depth (i.e. 16 and 32bpp) */
@@ -739,6 +739,5 @@
             xf86DrvMsg(scrnIndex, X_INFO,
                       "The VBox video extensions are now enabled.\n");
-    } else
-        xf86DrvMsg(scrnIndex, X_ERROR, "Failed to open the VBox system device - make sure that the VirtualBox guest additions are properly installed.  If you are not sure, try reinstalling them.\n");
+    }
     return (TRUE);
 }
