How to Clone a Vagrant Environment
Execute the following commands:
- Move to the folder containing the Vagrantfile to be used as the base for cloning.
- vagrant package [vm name] –output [desired name.box]
- Check the vm name with ‘$ vagrant status’, by default it is ‘default’
- For example, run vagrant package default –output ubuntu1604base.box
- Or simply execute vagrant package
- vagrant box add [desired name] [desired name.box]
- For example, ‘vagrant box add ubuntu1604base ubuntu1604base.box’
- Check if it was added with vagrant box list
- If added successfully, [desired name] will be displayed
- Move to the desired location for cloning
- Execute ‘vagrant init [desired name]’
- Check if Vagrantfile is created
- It’s convenient to clone the Vagrantfile and merge with the created one
- Execute vagrant up