From owner-freebsd-emulation@FreeBSD.ORG Sat May 12 19:35:52 2012 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED1C2106564A for ; Sat, 12 May 2012 19:35:52 +0000 (UTC) (envelope-from gjp@in-addr.com) Received: from noop.in-addr.com (mail.in-addr.com [IPv6:2001:470:8:162::1]) by mx1.freebsd.org (Postfix) with ESMTP id B415C8FC12 for ; Sat, 12 May 2012 19:35:52 +0000 (UTC) Received: from gjp by noop.in-addr.com with local (Exim 4.77 (FreeBSD)) (envelope-from ) id 1STI63-000KqZ-6s for freebsd-emulation@freebsd.org; Sat, 12 May 2012 15:35:19 -0400 Date: Sat, 12 May 2012 15:35:19 -0400 From: Gary Palmer To: freebsd-emulation@freebsd.org Message-ID: <20120512193519.GC31698@in-addr.com> References: <20120512193138.GB31698@in-addr.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="jho1yZJdad60DJr+" Content-Disposition: inline In-Reply-To: <20120512193138.GB31698@in-addr.com> X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: gjp@in-addr.com X-SA-Exim-Scanned: No (on noop.in-addr.com); SAEximRunCond expanded to false Subject: Re: headless virtualbox crashing - possible problem with interaction with libvncserver (including patch) X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 May 2012 19:35:53 -0000 --jho1yZJdad60DJr+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, May 12, 2012 at 03:31:38PM -0400, Gary Palmer wrote: > Hi, > > I have virtualbox-ose-4.1.14 and libvncserver-0.9.9 installed on FreeBSD 9 > and while I could start one VM using VBoxHeadless fine, the 2nd one would > start but if I tried to attach to the VNC server it would crash with a bus > error. The only thing I noticed in the startup messages was > > 12/05/2012 19:01:24 Listening for VNC connections on TCP port 5901 > 12/05/2012 19:01:24 rfbListenOnTCP6Port: error in bind IPv6 socket: Address already in use > > I tracked this down to libvncserver having IPv6 support but virtualbox > not setting the IPv6 port, just the IPv4 port. I recompiled with debugging > symbols and the attached patch and the crashes have stopped. I'm > inclined to suspect that the patch stops the crash. I'm half pondering > altering the patch a little so that if a port isn't specified it uses the > autoprobe feature of libvncserver to find a free port rather than blindly > assuming 5900 all the time. The patch got stripped, probably for having the wrong MIME type. Let me try again. Gary --jho1yZJdad60DJr+ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch-src-VBox-Frontends-VBoxHeadless-FramebufferVNC.cpp.txt" --- src/VBox/Frontends/VBoxHeadless/FramebufferVNC.cpp.orig 2012-05-12 19:50:26.807639833 +0100 +++ src/VBox/Frontends/VBoxHeadless/FramebufferVNC.cpp 2012-05-12 19:50:38.568636058 +0100 @@ -89,7 +89,10 @@ vncServer = rfbGetScreen(0, NULL, mWidth, mHeight, 8, 3, 1); vncServer->screenData = (void*)this; if (mVncPort) + { vncServer->port = mVncPort; + vncServer->ipv6port = mVncPort; + } char *pszDesktopName; rc = RTStrAPrintf(&pszDesktopName, "%s - VirtualBox", pszName); if (rc >= 0) --jho1yZJdad60DJr+--