smhk

VirtualBox VM freezes at 'Loading essential drivers'

TL;DR: If a VM gets stuck during boot, simply pausing and resuming can get it unstuck.

Problem §

When starting my Ubuntu 22.04 VM in VirtualBox, about half the time it gets stuck at:

Begin: Loading essential drivers ...

For example:

Screenshot of Ubuntu 22.04 VM stuck about 4 seconds into booting with the text 'Begin: Loading essential drivers ...' as the last line.
The VM waits forever at this point.

Solution (workaround) §

Thanks to this post, I found a simple workaround: pause and then resume the VM.

You can do this via the Machine → Pause menu:

Same screenshot as above, except the VM is paused, and the 'Machine' menu is open with the 'Pause' option highlighted.
Click to pause, then again to resume.

Alternatively, you can press Right Ctrl + P to pause/resume (assuming Right Ctrl is your Host key, which it is by default).

Sometimes it takes two or three rounds of pause/resume for the VM to unfreeze.

Vagrant §

If starting the VM via Vagrant (e.g. vagrant up), then it is especially helpful to just press Right Ctrl + P twice in quick succession, because if the machine is paused for more than a couple of seconds Vagrant will abort with:

The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'paused' state. Please verify everything is configured
properly and try again.