For some reasons, if the Oracle VirtualBox is giving this error while powering on a virtual machine, this simple trick will be useful. While powering on a VM, I got this error message; “The VM session was closed before any attempt to power it on“, then closed by itself. It is strange behavior. Finally, I managed to fix with the following methods.
I tried the following methods but did not work.
1) Tried several snapshots to restore back to the previous state which gave me the same error.
2) Restarted the host computer.
3) Stopped all VirtualBox services and restarted. It is almost identical to restarting the physical computer.
All failed, finally, Google helped me to find out this thread from the VirtualBox website.
If you get The VM session was closed before any attempt to power it on message and Virtual Machines cannot be started, don’t panic. Do take a snapshot of the virtual machine to protect the current state.
The working Method
Go to Storage option of VM; remove hard disks and CD drives.
Once all storage removed, it will have no attached storage. Start the Virtual machine now. You could see Oracle VirtualBox screen, but as expected boot medium error will appear because no bootable CD or hard disk attached.
Shut down VM and add storage disks as it was earlier.
Now switch on the virtual machine, that will start normally.
Other Possible Cause
Also, the possibility of the corrupted or broken stored state of VM could cause this issue. That meant you haven’t shut down the guest VM properly, you just saved the VM while the guest OS was working. When you try to start the same VM, you may get this similar error.
In this case, discard the ‘Saved State” and start the Virtual Machine.
VirtualBox may come up with some fixes for this issue. But, I can confirm this method worked for me. This method can work on any host such as Windows or Mac.