How to export a Vagrant virtual machine to transfer it

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

    My hard drive in my Mac was making beeping noises in the middle of a project so I decided to install a SSD. I needed to move my project from one disk to another. A few things to consider:

    • I'm vagrant w/ virtualbox on a Mac
    • I'm using git

    This is what worked for me:

    1.) Copy your ~/.vagrant.d directory to your new machine.
    2.) Copy your ~/VirtualBox\ VMs directory to your new machine. 
    3.) In VirtualBox add the machines one by one using **Machine** >> **Add**
    4.) Run `vagrant box list` to see if vagrant acknowledges your machines. 
    5.) `git clone my_project`
    6.) `vagrant up`
    

    I had a few problems with VB Guest additions.

    enter image description here

    I fixed them with this solution.

提交回复
热议问题