Skip to content

Instantly share code, notes, and snippets.

@romancin
Forked from aondio/ova-to-box.md
Created May 12, 2020 09:15
Show Gist options
  • Save romancin/bbd30c8fe5d57b80cc3a6710262d41f3 to your computer and use it in GitHub Desktop.
Save romancin/bbd30c8fe5d57b80cc3a6710262d41f3 to your computer and use it in GitHub Desktop.
Convert VirtualBox .ova to Vagrant box

Here's a step by step guide to convert a Virtualbox .ova to a Vagrant box.

  1. List your VMs to find the VM id you want to convert:
$ VBoxManage list vms
"testing" {a3f59eed-b9c5-4a5f-9977-187f8eb8c4d4}
  1. You can now package the .ova VM as Vagrant box:
$ vagrant package --base a3f59eed-b9c5-4a5f-9977-187f8eb8c4d4 --output name-of-your-box.box

the command vagrant package runs for quite some time before it can creates a Vagrant box. Be faithful and wait.

  1. Add the new box to the list of local Vagrant boxes:
$ vagrant box add new-box-name name-of-your-box.box
  1. Init, up, ssh and start usign your Vagrant box:
$ vagrant init #Init the new box with a Vagrantfile
$ vagrant up
$ vagrant ssh

And enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment