- 数据导出(旧电脑)
- 数据导入(新电脑)
- 1. 前置配置
- 规划目录
- 目录示例
- 2. 添加Box
- 3. 初始化工作环境,生成Vagrantfile
- 配置Vagrantfile
- 4. 启动虚拟机
- 共享目录问题
- 迁移测试
- 常用命令
将虚拟机环境从一台电脑迁移到另一台电脑 数据导出(旧电脑)
进入VirtualBox安装目录,cmd执行vboxmanage list vms
查看已经安装的虚拟机
进入到VirtualBox默认虚拟电脑位置
执行vagrant package --base 使用vboxmanage list vms查到的名字 --output 别名
- 把.vagrant.d移出系统盘
将.vagrant.d文件夹移动到其他盘
设置环境变量VAGRANT_HOME为.vagrant.d目录
在path环境变量下添加%VAGRANT_HOME%
- 配置VirtualBox默认虚拟机位置
之后启动虚拟机的命令需要在该目录下执行
修改Vagrantfile文件的config.vm.network配置
如何确定ip,查看Windows IP 配置
查看box列表,修改config.vm.box为相应名称
在Vagrantfile中的config.vm.box这一行下添加
config.ssh.username = "vagrant" config.ssh.password = "vagrant" config.ssh.insert_key = false4. 启动虚拟机
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem “vboxsf” is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:mount -t vboxsf -o uid=1000,gid=1000 vagrant /vagrant
The error output from the command was:
mount: unknown filesystem type ‘vboxsf’
安装插件
https://github.com/scotch-io/scotch-box/issues/296
vagrant plugin install vagrant-vbguest
再次vagrant up报错
迁移测试Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem “vboxsf” is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:mount -t vboxsf -o uid=1000,gid=1000 vagrant /vagrant
The error output from the command was:
/sbin/mount.vboxsf: mounting failed with the error: No such device
数据库连接测试
迁移成功!
查看box:vagrant box list



