Eug*_*ene 100 virtualbox virtual-machine vagrant
我有一个流浪盒正在运行(配置了LAMP堆栈).我需要将它转移到另一台PC.我该如何出口?我想我可以得到一个可以复制到另一台PC的文件(或文件),所以我可以运行一些命令来导入流浪盒.
Emy*_*myl 111
你有两种方法可以做到这一点,我会称之为肮脏的方式和干净的方式:
1. 肮脏的方式
使用以下vagrant package命令从当前虚拟环境创建一个框:
http://docs.vagrantup.com/v2/cli/package.html
然后将该复制框复制到另一台PC,使用vagrant box add它并vagrant up像往常一样运行它.
请记住,Vagrantfile当虚拟机启动时,工作目录中的文件(带有该文件的文件)将被共享,因此您还需要将其复制到另一台PC.
2. 清洁方法
从理论上讲,永远不需要使用Vagrant进行导出/导入.如果你有先见之明,用配置来配置虚拟环境(厨师,木偶,ansible)和版本控制系统如Git的工作目录,复制的环境将是在这一点上简单的运行:
git clone <your_repo>
vagrant up
Run Code Online (Sandbox Code Playgroud)
Ken*_*nce 26
我的Mac中的硬盘驱动器在项目中间发出哔哔声,所以我决定安装一个SSD.我需要将我的项目从一个磁盘移动到另一个磁盘.需要考虑的一些事项:
这对我有用:
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`
Run Code Online (Sandbox Code Playgroud)
我在VB Guest添加中遇到了一些问题.

我用这个解决方案修复了它们.
Ste*_*abo 17
这实际上非常简单
包裹你的流浪汉机器
vagrant package --base [machine name as it shows in virtual box] --output /Users/myuser/Documents/Workspace/my.box
将盒子复制到遥控器上
通过运行来启动远程计算机上的框
vagrant init [machine name as it shows in virtual box] /Users/myuser/Documents/Workspace/my.box
跑 vagrant up
The easiest way would be to package the Vagrant box and then copy (e.g. scp or rsync) it over to the other PC, add it and vagrant up ;-)
For detailed steps, check this out => Is there any way to clone a vagrant box that is already installed
| 归档时间: |
|
| 查看次数: |
92527 次 |
| 最近记录: |