Index: src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
===================================================================
--- src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp	(revision 27964)
+++ src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp	(working copy)
@@ -962,9 +962,10 @@
         }
 #endif /* defined(VBOX_FFMPEG) */
 #ifdef VBOX_WITH_VNC
+        VNCFB *pFramebufferVNC = NULL;
         if (fVNCEnable)
         {
-            VNCFB *pFramebufferVNC = new VNCFB(console, uVNCPort, pszVNCPassword);
+            pFramebufferVNC = new VNCFB(console, uVNCPort, pszVNCPassword);
             rc = pFramebufferVNC->init();
             if (rc != S_OK)
             {
@@ -1180,6 +1181,14 @@
         }
 #endif /* defined(VBOX_FFMPEG) */
 
+#ifdef VBOX_WITH_VNC
+        if (fVNCEnable)
+        {
+            pFramebufferVNC->Release();
+            Log(("Released VNC framebuffer\n"));
+            pFramebufferVNC = NULL;
+        }
+#endif
         /* we don't have to disable VRDP here because we don't save the settings of the VM */
     }
     while (0);
Index: src/VBox/Frontends/VBoxHeadless/FramebufferVNC.cpp
===================================================================
--- src/VBox/Frontends/VBoxHeadless/FramebufferVNC.cpp	(revision 27964)
+++ src/VBox/Frontends/VBoxHeadless/FramebufferVNC.cpp	(working copy)
@@ -120,6 +120,7 @@
 DECLCALLBACK(int) VNCFB::vncThreadFn(RTTHREAD hThreadSelf, void *pvUser)
 {
     rfbRunEventLoop((rfbScreenInfoPtr)pvUser, -1, FALSE);
+RTPrintf("DEBUG VNC THREAD DONE\n");
     return VINF_SUCCESS;
 }
 
@@ -142,8 +143,14 @@
 	if (buttonMask & 1) buttons |= 1;
 	if (buttonMask & 2) buttons |= 4;
 	if (buttonMask & 4) buttons |= 2;
-	mMouse->PutMouseEvent(x - mouseX, y - mouseY, dz, 0, buttons);
-	//mMouse->PutMouseEventAbsolute(x + 1, y + 1, dz, 0, buttonMask);
+	
+	BOOL abs = FALSE;
+	mMouse->GetAbsoluteSupported(&abs);
+	if (abs) {
+		mMouse->PutMouseEventAbsolute(x + 1, y + 1, dz, 0, buttons);
+	} else { //if (mMouse->RelativeSupported) {
+		mMouse->PutMouseEvent(x - mouseX, y - mouseY, dz, 0, buttons);
+	}
 	mouseX = x;
 	mouseY = y;
 }
