VirtualBox 4.0.0. Changes to VBoxManage Syntax…

I just got home to find a question about my RAC on VirtualBox article. The poster was having problems creating the virtual disks using the commands in the article. A quick scan through the docs reveals a number of changes to the way VirtualBox 4.0.0 handles disks and also changes to the VBoxManage syntax. I’ve amended the article to include a version of the commands for version 4.0.0 which seem to create and attach the shared disks in the same state, but it will be a few days before I get to test this properly.

So what’s happened that affects shared disk setup?

First, you can’t create a shareable disk. You have to create the disk (createhd), then modify it to shareable (modifyhd). That sounds fine, but there is an issue. The manual says,

“Before VirtualBox 4.0, it was necessary to call VBoxManage openmedium before a medium could be attached to a virtual machine; that call “registered” the medium with the global VirtualBox media registry. With VirtualBox 4.0 this is no longer necessary; media are added to media registries automatically. The “closemedium” call has been retained, however, to allow for explicitly removing a medium from a registry”

Well that is not entirely true. When you create a new disk it is not visible in the media manager until it is attached to a VM. That means you have to create the disk, attach it to a VM and then convert it to shareable. If you try to modify it before attaching it to a VM you get told the disk doesn’t exist. This just feels wrong.

As a minor annoyance, the VM detail pane doesn’t notice the “–type” change so the disks still display as normal unless you restart VirtualBox, or click the “Storage” link for the VM and come straight out, which seems to get the screen to update.

This is not a big deal, it’s just a little annoying as the old syntax was more straight forward. I’m sure it was done for a good reason… 🙂