Thanks! The VNC server works fine for me, even in text mode. Perhaps the text mode VM has blanked the screen? ;-)

The attached patch adds support for absolute mouse pointer updates and some code to free the VNC framebuffer object.

It appears that, while properly shutting down the virtual machine (either via savestate or ACPI), the call to session->Close() in VBoxHeadless.cpp causes a segmentation fault. This does not seem to affect the operation though. This problem exists even with the VNC extension disabled, so I suppose it is not related to the VNC code.

Ivo

Op 2-4-2010 19:28, Knut St. Osmundsen schreef:
Ivo Smits wrote:
Never mind, I have not checked whether it actually compiled the VNC
code. Turns out that it did not. I will try to get it fixed and then get
back to you.
I've fixed the merge errors as well as logging and malloc errors in the
original patch file.  The code builds now (r27963).  Not sure if it
actually works or not, though, as my text mode test VM gave me a blank
VNC screen.  I leave this for you to figure out... :-)


By the way, what's the correct way to set the VBOX_WITH_VNC define?

Add it to the LocalConfig.kmk file in the root of the source tree (where
you find the huge Config.kmk file):
    echo VBOX_WITH_VNC=1>>  LocalConfig.kmk


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;
 }
_______________________________________________
vbox-dev mailing list
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-dev

Reply via email to