We’re big fans of Oracle’s VirtualBox software. It’s powerful and free, and it enables our small company to efficiently test and validate our software on various versions of Windows without having to invest in costly, dedicated hardware.
However, we noticed a strange problem with VirtualBox last week. After following our tutorial to setup a VirtualBox Virtual Machine (VM) as a Windows Service with AlwaysUp, we noticed that even though the machine was working normally, the VirtualBox Manager application incorrectly listed the VM as “Powered Off”. But it had been on for more than 10 days!
And it wasn’t just the VirtualBox Manager. Even the powerful VBoxManage command line utility thought that our VM wasn’t running:
However, when we ran a command prompt in Session 0, VBoxManage saw the VM there:
So it seems that the VirtualBox tools can only see virtual machines running in the same session that they are in.
Therefore, we simply can’t rely on the state shown in the VirtualBox Manager application when running our VM in the background (in Session 0) with AlwaysUp.