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

christopher's avatar

Delete Vagrant box

Hey,

i want to delete a vagrant box, the problem is i have three boxes with the same name:

code: vagrant box list
hashicorp/precise32    (virtualbox, 1.0.0)
laravel/homestead      (virtualbox, 0.1.7)
laravel/homestead      (virtualbox, 0.2.1)
laravel/homestead      (virtualbox, 0.2.2)
precise32              (virtualbox, 0)
puphpet/debian75-x64   (virtualbox, 1.2)
trusty64               (virtualbox, 0)
vagrant-ubuntu-1204_32 (virtualbox, 0)

How can i delete the first two laravel/homestead boxes because they all have the same name ?

0 likes
12 replies
bashy's avatar
bashy
Best Answer
Level 65

Vagrant Docs

BOX REMOVE

Command: vagrant box remove NAME

This command removes a box from Vagrant that matches the given name.

If a box has multiple providers, the exact provider must be specified with the --provider flag. If a box has multiple versions, you can select what versions to delete with the --box-version flag.

Ref: https://docs.vagrantup.com/v2/cli/box.html

You can delete them inside Virtualbox as well.

6 likes
bashy's avatar

I gave you what you needed but of course someone replying with the command without getting you to read the docs is always better :)

2 likes
bashy's avatar

Didn't mean for you to change it but thanks :P long live documentation!

christopher's avatar

Yep i should definitely use more my brain and think a bit more about problems .. :D

Flank's avatar

why can not use vagrant box remove --all ?

thinsoldier's avatar

PRUNE: This command removes old versions of installed boxes.

To see which will be removed and which will be kept if you ran the prune command: vagrant box prune --dry-run

If you like what you see: vagrant box prune to actually execute the deletion

example output

> vagrant box prune --dry-run  
The following boxes will be kept...  
laravel/homestead (virtualbox, 5.0.1)  
ubuntu/trusty64   (virtualbox, 20171012.0.0)  

Checking for older boxes...  
Would remove laravel/homestead virtualbox 2.0.0  
Would remove laravel/homestead virtualbox 4.0.0  
> vagrant box prune
The following boxes will be kept...
laravel/homestead (virtualbox, 5.0.1)
ubuntu/trusty64   (virtualbox, 20171012.0.0)

Checking for older boxes...
Removing box 'laravel/homestead' (v2.0.0) with provider 'virtualbox'...
Removing box 'laravel/homestead' (v4.0.0) with provider 'virtualbox'...
2 likes
kitesurf's avatar

the more specific the answer the better. in the docs I don't see an = but this solved:

vagrant box remove laravel/homestead --provider=hyperv

vagrant box remove laravel/homestead --provider=virtualbox --all

Please or to participate in this conversation.