Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Roni's avatar
Level 33

Debugging Vagrant

Not sure why, but homestead wouldn't halt after a work session. I was playing witht npm install gulp-ruby-sass so I could fiddle with sass files. Anyhow, I had to kill the process because homestead uses a ton of RAM and the kids wanted to play a game.

I started getting Parse errors from ruby files when trying to halt homestead or destroy the VM. So I killed the process. Now a couple of hours later, I can't start up and I'm debugging vagrant ruby files. Crap! Is there a way to just destroy the whole VM and re-install? I've tried doing it through Virtual Box, but it seems homestead is still alive and kicking even though it said it was gone.

I've already debuged several of these issues, but it seems like there is no end. I thought using a VM meant you can kick the damn thing and get a new one.

if anyone has a solution that will blow the VM away, please let me know.

Cheers and thanks in advance, here is an example of what I'm taking about

➜  2.0.0  vagrant destroy f8e36b3
/Applications/Vagrant/embedded/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): found character that cannot start any token while scanning for the next token at line 25 column 1 (Psych::SyntaxError)
 from /Applications/Vagrant/embedded/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
 from /Applications/Vagrant/embedded/lib/ruby/2.0.0/psych.rb:153:in `parse'
 from /Applications/Vagrant/embedded/lib/ruby/2.0.0/psych.rb:129:in `load'
 from /Users/restein/.composer/vendor/laravel/homestead/Vagrantfile:17:in `block in <top (required)>'
 from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/v2/loader.rb:37:in `call'
 from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/v2/loader.rb:37:in `load'
 from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/loader.rb:103:in `block (2 levels) in load'
 from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/loader.rb:97:in `each'
 from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/loader.rb:97:in `block in load'
 from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/loader.rb:94:in `each'
 from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/config/loader.rb:94:in `load'
 from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/vagrantfile.rb:28:in `initialize'
 from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:614:in `new'
 from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:614:in `vagrantfile'
 from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:537:in `machine'
 from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/v2/command.rb:138:in `block in with_target_vms'
 from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/v2/command.rb:192:in `call'
 from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/v2/command.rb:192:in `block in with_target_vms'
 from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/v2/command.rb:174:in `each'
 from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/v2/command.rb:174:in `with_target_vms'
 from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/destroy/command.rb:30:in `execute'
 from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/cli.rb:42:in `execute'
 from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:292:in `cli'
 from /Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.5/bin/vagrant:174:in `<main>'
0 likes
2 replies
Roni's avatar
Roni
OP
Best Answer
Level 33

Follow up, once you kill the vagrant process and if you happen to delete it and all files from virtual box, you are essentially screwed as far as I could find. You need the internal hex key which you can supposedly (I'll have to verify that on re-install) get from VirtualBox you can't get it from ps aux | grep -i vagr at least not on yosemite running vagrant 1.6.5.

After an hour of reading and going through commands that had no effect, reboots etc.. It seemed far faster to completely remove vagrant and re-install. you can find that here:

https://docs.vagrantup.com/v2/installation/uninstallation.html don't forget to remove the .vagrant and .homestead directories in your home directory or you might run into the same ugliness.

For re-install and setup check the homestead 2.0 video here: https://laracasts.com/lessons/say-hello-to-laravel-homestead-two

But the whole thing took about 25 min, including all the downloads.

Hope this helps someone

keeprockman's avatar

You may also want to check your Homestead.yaml file for any invalid characters (tabs, spaces, etc.). It may cause it to break too.

Please or to participate in this conversation.