Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Vagrant syntax for adding a locally existing VDI?

What is the syntax for adding a locally existing VirtualBox .vdi to vagrant?

There doesn't appear to be an example of alternate URI schemes in the documentation.

Can it also use ssh and httpauth locations?

like image 812
vfclists Avatar asked Dec 13 '13 06:12

vfclists


People also ask

What does vagrant box add do?

You can add a box to Vagrant with vagrant box add . This stores the box under a specific name so that multiple Vagrant environments can re-use it. If you have not added a box yet, do so now. Vagrant will prompt you to select a provider.


1 Answers

You cannot directly "import" a VirtualBox VM into Vagrant.

Basically you'll have to package the existing VirtualBox VM to a box and then add it to vagrant.

NOTE: a box is tarred VirtualBox Exports (could be gzipped).

You would be doing

Package the existing VirtualBox VM (VDI format)

vagrant package --base mybox --output /path/to/mybox.box

See more here => http://docs.vagrantup.com/v2/cli/package.html

Add the box to vagrant

vagrant box add mybox /path/to/mybox.box

like image 132
Terry Wang Avatar answered Oct 26 '22 00:10

Terry Wang