clearing old vagrant configs , how ?

9,615 views
Skip to first unread message

PePe Amengual

unread,
Sep 26, 2012, 8:10:12 PM9/26/12
to vagra...@googlegroups.com
Hi.

I'm testing ansible to deploy vagrant boxes and I need to delete and create boxes all the time for testing but I realize that my disc was almost full and I start deleting all boxes with vagrant box remove command but I saw that virtualbox still have the boxes in the list so I went to the directory of Virtual box and I deleted all folders plus the VM in the list.

after that I deleted the vagrant.d directory in my home to start fresh and now I get this error :

"Vagrant cannot forward the specified ports on this VM, since they
would collide with another VirtualBox virtual machine's forwarded
ports! The forwarded port to 8888 is already in use on the host
machine.

To fix this, modify your current projects Vagrantfile to use another
port. Example, where '1234' would be replaced by a unique host port:

  config.vm.forward_port 80, 1234"

I thought that all the configs where on the vagrant.d directory but it doesn't looks like.

What else I need to delete to make my mac like if never have a vagrant box before ?

Any caches ?

Thanks.

Mathias Lafeldt

unread,
Sep 27, 2012, 5:08:42 AM9/27/12
to vagra...@googlegroups.com
After deleting the files in ~/.vagrant.d, I also removed the invalid
VM entries in the VirtualBox GUI.

If somebody knows how to fix things without GUI, please share.

-Mathias

Bruce Wang

unread,
Sep 27, 2012, 6:19:16 AM9/27/12
to vagra...@googlegroups.com
On Thu, Sep 27, 2012 at 10:10 AM, PePe Amengual <jose.a...@gmail.com> wrote:
Hi.

I'm testing ansible to deploy vagrant boxes and I need to delete and create boxes all the time for testing but I realize that my disc was almost full and I start deleting all boxes with vagrant box remove command but I saw that virtualbox still have the boxes in the list so I went to the directory of Virtual box and I deleted all folders plus the VM in the list.

after that I deleted the vagrant.d directory in my home to start fresh and now I get this error :
[snip]

AFAIK, vagrant box remove just remove the boxes you downloaded or created using package command, to delete the VM, you should use `vagrant destroy` at the folder where Vagrantfile is.
vagrant destroy will only delete the VM, so you still need to manually delete Vagrantfile and any other files in that folder.

Cheers,

PePe Amengual

unread,
Sep 27, 2012, 1:12:35 PM9/27/12
to vagra...@googlegroups.com
I try destroy, remove, deleting vagrant.d directory, using virtualbox gui etc and still same error message!!!!

Where is that freaking entry of file ?

Any developer that can chime in?

Thanks.

Diego Zamboni

unread,
Sep 27, 2012, 1:16:25 PM9/27/12
to vagra...@googlegroups.com, Diego Zamboni
vagrant stores project-specific information in a file called .vagrant, in the same directory as the corresponding Vagrantfile. Maybe there is a leftover file that is causing the problem?

--Diego

PePe Amengual

unread,
Sep 27, 2012, 1:49:38 PM9/27/12
to vagra...@googlegroups.com
All directories removed, I made sure of that.

nothing left over, I even changed the name of the Box to make sure the right Vagrant file is getting called but nothing.


On Wednesday, 26 September 2012 17:10:12 UTC-7, PePe Amengual wrote:

Diego Zamboni

unread,
Sep 27, 2012, 1:58:20 PM9/27/12
to vagra...@googlegroups.com, Diego Zamboni
I would suggest:

- Using the VirtualBox GUI, make sure all VMs are powered off or destroyed.
- Exit the GUI, and inspect the running processes to make sure there are no VirtualBox processes running. On OS X, this command should show no output, I'm not sure which process names are used on other platforms (you don't mention on which platform you are running VirtualBox):
ps -axww | grep -i 'vbo[x]'
- Create a new directory
- Copy *only* the Vagrantfile into the new directory (plus any support files you need, but nothing else, don't copy the entire directory).
- Try vagrant up from the new directory.

--Diego

PePe Amengual

unread,
Sep 27, 2012, 2:16:34 PM9/27/12
to vagra...@googlegroups.com, Diego Zamboni
ok, so a stupid reboot solved the issue.....now I will like tot know is it was because a process running or a environment variable.....

Cameron Roe

unread,
Oct 16, 2013, 5:57:55 PM10/16/13
to vagra...@googlegroups.com, Diego Zamboni
when you run `vagrant up` it starts a VM. This is a virtual machine that runs as a separate process on your machine. If you run `top` in terminal you'll see the VM running. To end the process you have to call `vagrant halt` or `vagrant destroy`. Vagrant destroy will actually remove the resources created during the vm usage. http://docs.vagrantup.com/v2/cli/index.html
Reply all
Reply to author
Forward
0 new messages