How to export a Vagrant virtual machine to transfer it

前端 未结 7 1096
臣服心动
臣服心动 2021-01-29 17:29

I have a vagrant box up and running (configured with a LAMP stack). I need to transfer it to another PC. How can I export it? I guess that I can get a file (or files) that can b

相关标签:
7条回答
  • 2021-01-29 18:21

    As of 2019 there is a subcommand: vagrant box repackage

    vagrant box repackage --help 
    Usage: vagrant box repackage <name> <provider> <version>
        -h, --help                       Print this help
    

    You can find name provider and version by running vagrant box list

    vagrant box list
    macinbox (virtualbox, 10.14.5)
    

    The ouput of vagrant box repackage is a file called package.box which is basically a tgz file which the content can be listed as below:

    tar tzf package.box
    ./metadata.json
    ./box.ovf
    ./Vagrantfile
    ./box-disk001.vmdk
    
    0 讨论(0)
提交回复
热议问题