Thursday, April 15, 2010

Patch for VIrtualbox not working on Freebsd after updating graphics/png port.

I have had a very frustrating time over the last few days.  After doing a full portupgrade I found that virtualbox-ose would no longer work properly.  The GUI portion was working and I could run vm's but I was unable to manage any machines from the console with VBoxManage.  Trying to do any operations would just die with the following error.

ERROR: failed to create a session object!
ERROR: code NS_ERROR_FACTORY_NOT_REGISTERED (0x80040154) - Class not
registered (extended info not available)
Most likely, the VirtualBox COM server is not running or failed to start.

The only changes where Virtualbox being bumped from 3.1.4 to 3.1.6 and a new version of the dependent graphics/png package.  After much testing I determined that the problem was with the png update change but I couldn't figure out how to resolve it.  I finally found a patch out and about that fixed this problem so I am posting more details here.  The patch listed in that page is actually not a patch at all but rather a replacement makefile so i created a patch and posted instructions below.

Build the pached version
Patch, build, and install.

cd /usr/ports/emulators/virtualbox-ose
sudo wget
sudo patch -p0 < virtualbox-ose-3.1.6_2-1.patch
sudo portupgrade -f virtualbox-ose

No comments: