Vagrant stucks during "vagrant up"

Vagrant stucks during "vagrant up"

Today i had the problem, that my vagrant box could not be started with "vagrant up" and also destroying or halting the box did not work.

The process was terminated with the following error:


Bringing machine 'master' up with 'virtualbox' provider...
An action 'up' was attempted on the machine 'master',
but another process is already executing an action on the machine.
Vagrant locks each machine for access by only one process at a time.
Please wait until the other Vagrant process finishes modifying this
machine, then try again.

If you believe this message is in error, please check the process
listing for any "ruby" or "vagrant" processes and kill them. Then
try again.

The problem in this case is, that another vagrant process is running. If you are sure, that you can terminate the running vagrant process you can kill it. To do this you need to find out the process id:


$ps aux | grep "vagrant"
username 628   0,0  0,0  2432772    632 s000  R+    8:08am   0:00.00 grep vagrant
username 576   0,0  0,2  2515940  37892   ??  S     8:08am   0:00.08 ruby /path/vagrant-1.7.4/bin/vagrant up

The relevant process, is not the first one in the list, because this is the grep itself. The relevant one is the process with the id "576". We can now kill this process.


kill 576

After killing the running process the box should be unlocked and "vagrant up / destroy / halt / ..." can be used as usual. What is usefull next, depends on the state of the box.


If you want to learn more about Vagrant and Chef, you can read our HowTo "DevOps with vagrant and chef"