vagrant package packing their box mirror

On how to create a CentOS7 Box virtual machine under Virtual Vagrant and win my blog there are tutorial:
https://www.tiance.club/post/2370098709.html

After the completion of the details of the structures and other virtual machines are strongly recommended adjust packed into their mirror image, the future will need to install a virtual machine environment when a virtual machine or computer problems on other computers can direct a key to restore, or to re-build a little tedious .

1, view the virtual machine name

Go to the virtual machine installation directory, execute the command:  

vboxmanage list vms

There may be prompted: 'vboxmanage' is not an internal or external command, operable program
or batch file. That is because there is no time to install VirtualBox will vboxmanage automatically placed in the environment variable, we can go directly to the installation directory of VirtualBox command execution sentence, which is at the same level of the file directory VirtualBox.exe  

upload successful

_default_1583637544209_19565 is my local virtual machine name, copy down the name behind the mirror need to use packing box.

2, performing a packing command

vagrant comes packaged command, you need to go to the next vagrant directory, which is the next vagrantFile file directory


$ vagrant package –-base _default_1583637544209_19565 –-output CentOS20200119.box

vagrant package --base [Virtual Machine Name] --output [after the packing box name]  

3, back to his box deployment environment

The second step has been to the top of the pack when finished, if you want to deploy their own box in the other computer is very simple
first box files and Vagrantfile need to deploy files on disk directory.  
Do the following order:  
1, the container box mounted vagrant

 $ vagrant box add -name xuni CentOS20200119.box

vagrant box add -name [vmname] [Box placement position]

2, can then be started directly
$ vagrant up

Author: xingguang
link: Original link: https://www.tiance.club/post/299409888.html

Guess you like

Origin www.cnblogs.com/yizhidaozuihou/p/12446081.html