Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 如何转移流浪环境?_Windows_Vagrant_Virtualbox_Vagrantfile - Fatal编程技术网

Windows 如何转移流浪环境?

Windows 如何转移流浪环境?,windows,vagrant,virtualbox,vagrantfile,Windows,Vagrant,Virtualbox,Vagrantfile,“流浪癖:……通过创造一个初始的 流浪汉档案……” 我在windows中将该文件夹从E://移动到C://中,在尝试执行vagrant snapshot restore XXX ==> default: Booting VM... There was an error while executing `VBoxManage`, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown

“流浪癖:……通过创造一个初始的 流浪汉档案……”

我在windows中将该文件夹从E://移动到C://中,在尝试执行
vagrant snapshot restore XXX

==> default: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "7aff8d5d-7193-4f6d-966b-4076543c0e90", "--type", "headless"]

Stderr: VBoxManage.exe: error: RawFile#0 failed to create the raw output file E:/Proyectos/do-sf2-dev/ubuntu-xenial-16.04-cloudimg-console.log (VERR_PATH_NOT_FOUND)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole
据我所知,VirtualBox一直在引用E:/drive。


我试图手动编辑从E:/to C:/I可以在文件夹下找到的任何引用,也可以在相关机器的VirtualBox GUI中找到,但没有成功。

这个答案很晚,但希望能帮助下一个人遇到这个问题。错误是因为机器配置为输出到不再存在的位置。当将一个不稳定的环境移动到另一个驱动器时,除了移动VM文件外,还需要更新一些不稳定的元数据。您可以使用
vagrant up--debug
查看错误的确切含义

如果移动.vagrant.d目录,则需要将环境变量
vagrant\u HOME
设置到其新位置。在windows上,需要重新启动才能生效。如果不起作用,请将以下内容之一添加到您的文件中:

  • v.customize[“modifyvm”,“id”,“uartmode1”,“disconnected”]
    • 这将禁用对丢失的日志文件(ubuntu-xenial-16.04-cloudimg-console.log)的串行输出

  • v.customize[“modifyvm”,“id”,“uartmode1”,“file”,file.join(Dir.pwd,“ubuntu-xenial-16.04-cloudimg-console.log”)]
    • 这将更新日志文件的路径以指向当前目录
对于大多数vagrant设置,这应该足够了,但是,在
vagrant up
成功运行之前,我还需要重新创建错误日志文件的路径。在那之后,我运行了
vagrant provision
,能够删除旧文件路径而没有问题

这些帖子也很有帮助(参考文献):