Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VM in virtualbox is already locked for a session (or being unlocked)

Tags:

virtualbox

My VM in virtualbox can not start due to this error, I don't want to destroy it and reinstall it again, anyway to recover it ?

There was an error while executing VBoxManage, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below.

Command: ["modifyvm", "319fcce3-e8ff-4b6f-a641-3aee1df6543f", "--natpf1", "delete", "ssh"]  Stderr: VBoxManage: error: The machine 'centos64_c6402_1454036461345_59755' is already locked for a session (or being unlocked) VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee nsISupports VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 493 of file VBoxManageModifyVM.cpp 
like image 363
zjffdu Avatar asked Feb 03 '16 06:02

zjffdu


People also ask

How do I Uncapture in VirtualBox?

You need to press "host key" which is written in right bottom corner of VirtualBox window. Looking at your screenshot its Right Ctrl .

How do I get VirtualBox out of stretch mode?

So, while in scaled or full screen mode inside VirtualBox installed on Windows, you need to press Right Ctrl + C key combination to exit scaled mode.

How do you fix Unable to allocate and lock memory the virtual machine will be paused Please close applications to free up memory or close the VM?

1 Answer. This error is thrown because the host memory is not sufficient for the VM to run. Close all the applications running on your host machine and just run the VM. The best option will be to increase the RAM of your system and further increase the RAM provided to the VM.


1 Answers

Running this on the command line unlocked the VM:

vboxmanage startvm <vm-uuid> --type emergencystop 

Where <vm-uuid> is the number in the error message: Command: ["modifyvm", "<vm-uuid>" [...]. After that I was able to control the VM (start, halt, etc). Using Virtualbox 4.1 on Ubuntu.

like image 70
Gonzalo Matheu Avatar answered Sep 18 '22 09:09

Gonzalo Matheu