How to export a Vagrant virtual machine to transfer it

前端 未结 7 1106
臣服心动
臣服心动 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:08

    This is actually pretty simple

    1. Install virtual box and vagrant on the remote machine
    2. Wrap up your vagrant machine

      vagrant package --base [machine name as it shows in virtual box] --output /Users/myuser/Documents/Workspace/my.box

    3. copy the box to your remote

    4. init the box on your remote machine by running

      vagrant init [machine name as it shows in virtual box] /Users/myuser/Documents/Workspace/my.box

    5. Run vagrant up

提交回复
热议问题