在WSL上使用VirtualBox的Vagrant出现VERR_PATH_NOT_FOUND错误

16

我尝试从WSL运行Vagrant:

Windows 10专业版版本1703构建15063.540

Ubuntu 16.04.2 LTS

Vagrant版本:1.9.7

VirtualBox版本:5.1.26r117224

将其添加到我的bachrc文件中。

export VAGRANT_WSL_ENABLE_WINDOWS_ACCESS="1"

我已经将VirtualBox添加到Windows的路径中。

图片描述

当我运行vagrant up时,我遇到了这个错误:

Stderr: VBoxManage.exe: error: RawFile#0 failed to create the raw output file /mnt/d/Projects/GOPATH/src/github.com/hyperledger/Fabric/devenv/ubuntu-xenial-16.04-cloudimg-console.log (VERR_PATH_NOT_FOUND)

如果我尝试直接从VirtualBox启动虚拟机,则会出现以下错误:

Failed to open a session for the virtual machine hyperledger.

RawFile#0 failed to create the raw output file /mnt/d/Projects/GOPATH/src/github.com/hyperledger/Fabric/devenv/ubuntu-xenial-16.04-cloudimg-console.log (VERR_PATH_NOT_FOUND).

Result Code: E_FAIL (0x80004005) Component: ConsoleWrap Interface: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}

图片描述

2个回答

27
我已经找到解决方案,是将其添加。
config.vm.provider "virtualbox" do |vb|
  vb.customize [ "modifyvm", :id, "--uartmode1", "disconnected" ]
end

至于vagrant文件,您可以通过如下方式进行操作。此处也可以通过VirtualBox UI来完成,即所示的“断开连接”将达到同样的效果。vb.customize - 对于某些版本的vagrant而言,.customize可能无法正常工作。

https://github.com/mitchellh/vagrant/issues/8604

enter image description here


3
不确定为什么你被踩了...这个对我有帮助。谢谢! - njbair
我认为这个代码片段只是一个临时解决方案。正如@mmarchini在这里所解释的那样,问题是由于Vagrant或者Vagrantfile中的代码没有正确计算日志文件路径所致。 - Alex MM

6

我通过在虚拟机配置中关闭串口解决了相同的问题。

如果你需要使用串口,你可以保持开启,但是需要将日志文件路径更改为与你的文件系统匹配。


我可以确认,在禁用串口之后,现在它对我来说是可用的。 - whng
你能告诉我在哪里更新日志文件路径吗? - undefined

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接