Monday, March 28, 2011

Spontaneous Problems with VirtualBox on OSX

    In December I upgraded VirtualBox on my Mac to 3.2.12. Everything went great, and I proceeded to use it with very few glitches until later February, when I saw there was a version 4.0.4, and figured it was time to upgrade again. The upgrade went ok, but as soon as I installed the new Guest Add-ons for my Windows & Linux virtual machines, things started going south. Every time I tried to launch these machines, VirtualBox would produce lengthy error messages about unavailable USB support due to missing Guest Add-ons. I got in the habit of simply clicking through a bunch of modal errors on startup, and reinstalling Guest Add-ons every time I started a session. Trying to save the running machine state & reload resulted in a fatal error, so there was no short-cut. Well, a week ago, for reasons unknown, VirtualBox stopped working completely, giving me this gut-wrenching message as the virtual machine was initializing, and then closing the virtual machine - neither my Windows nor Fedora virtual machines would run anymore. This was a big deal, because I can't read my ReiserFS backup disk without the Fedora VirtualBox, and I can't initialize my 3G modem with the OSX software, (Movistar 3G Modem control program is deserving of its own post) but I can in the Windows VirtualBox.
    Searching, I found a smattering of posts on the error-message. Most of them from other operating systems, but all describing exactly the same problem, and most concluding that the problem was that /usr needed to be owned by root for VirtualBox to work properly. To be fair, some people claimed having made this change and then being able to use VisrtualBox again. Swapping owners and permission-masks in the core OS because VirtualBox spontaneously stopped working seems like a perfectly irrational guns-ablaze panic response, like what one might get from a corporate tech preceded by a disclaimer about responsibility. Instead, I packaged my virtual machines into appliances, saved them off, uninstalled Virtual Box, and re-installed it, figuring that the installation script would set whatever it needed correctly as it did once before, and things would be OK again, but much to my surprise, the exact same error was generated every time I tried to start a virtual machine. I went back to look for more postings on the problem, and mostly ran into the same ones. What I noticed this time was that the ones that mentioned a version at all were all running version 4.x.x. On a lark, I went fishing in my packages directory and found 3.2.12, so I uninstalled 4.0.4 again, and this time rolled back, installing 3.2.12, and now everything works perfectly!
    It seems like some external change, like updates to the core OS, might have changed something that 4.0.4 relies on, and I am sure a lot of folks using some of the newer features in VirtualBox really have no use for this solution, but if, like me, you use it mostly to test cross-compatibility, to use devices that have OS-specific drivers, or to access disks in different formats, it works. The lesson remembered is that whenever upgrading anything, it is a good idea to have a rollback plan and the necessary tools, like my older VirtualBox package, in hand. Of course, may OS's have tools to make this easier. OSX has Time Machine, and Windows has Restore Points, so if you have them, use them.