M
M
maolo2016-01-26 18:51:28
virtual box
maolo, 2016-01-26 18:51:28

Vagrant: how to properly remove duplicate containers?

I downloaded box for vagrant, did it vagrant init, and then vargant up(OS Ubuntu) - as a result, in addition to box, I have 2 copies of the vmdk container - in ~/.vagrant.d, and in ~/VirtualBox VMs. Those. instead of one container for vitualbox in ~20 GB, I have ~ 60 GB - too fat for a virtual machine on my 256 GB SSD :) leave only virtualbox, and not break vagrant?
Did vagrant box remove BOXNAMEand vagrant destroy BOXNAME- virtual machines are deleted, but I just need to leave the virtual machine. You can, of course, manually remove the vmdk from ~/.vagrant.d, but then vagrant, apparently, will not function for this virtual machine? )
As I understand it, the original box can be safely deleted - it's just an archive. But how to correctly remove vmdk from ~/.vagrant.d so as not to break vagrant?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maolo, 2016-01-27
@maolo

Using vagrant, I did not find a way to clean up duplicates, but through experiments I found that the image ~/.vagrant.dcan be deleted after deploying the virtual machine ( vagrant up). The main thing is, after you have deployed the virtual machine, make sure that there is an initial snapshot, if not, then create it yourself. Otherwise, there will be nowhere to roll back and you will have to download the vagrant box again.
And, yes, BOXNAME.box itself can be safely deleted after unpacking. it's just an archive with an image of a virtual machine.
In general, after these actions, I was left with only a virtual machine with the expected ~ 20GB

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question