Refreshing Your Virtual Machine List in VirtualBox on Windows via SSH CLI

Sometimes, when working with VirtualBox on Windows, you might encounter an issue where your virtual machine list doesn’t update correctly, even after making changes like unlocking an encrypted drive. This can be frustrating when you’re trying to manage your VMs.

This article will guide you through a solution to refresh your VirtualBox VM list via the command line interface (CLI) accessed via SSH.

The Problem

Let’s say you have a virtual machine stored on an encrypted drive. When Windows starts, the drive is locked. You can unlock the drive via SSH, but when you try to list your virtual machines using vboxmanage within your SSH session, you might still get an “access denied” error.

The Solution: Restarting the VirtualBox Service

The solution to this issue is surprisingly simple: restart the VirtualBox service.

  1. SSH into your Windows Machine: Establish an SSH connection to your Windows machine.

  2. Stop the VirtualBox Service: Once connected, use the following command to stop the VirtualBox service:

    1
    
    net stop "VirtualBox system Service"
  3. Start the VirtualBox Service: After the service has stopped, use the following command to start the VirtualBox service again:

    1
    
    net start "VirtualBox system Service"
  4. List Your VMs: Now, try listing your virtual machines again using the following command:

    1
    
    vboxmanage list vms

    Your virtual machine list should now be updated and display your unlocked encrypted drive VM correctly.

Conclusion

By restarting the VirtualBox service, you ensure that VirtualBox is aware of any changes to your drive, including unlocking encrypted drives. This simple step can save you a lot of frustration when managing your virtual machines.

0%