在使用Vagrant控制VirtualBox时,执行CLI命令`VBoxManage`出现错误。该错误发生在Windows 10操作系统中。

38

昨天我刚刚在powershell上使用laravel homestead成功运行了。但现在,它甚至都无法运行。我只是暂停了vagrant并关闭了电脑。现在它一直提示我这个错误:

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Clearing any previously set forwarded ports...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["modifyvm", "b21f2dd0-7f73-4d0f-b1e0-0f82ecdda1fe",    
"--natpf1", "delete", "ssh", "--natpf1", "delete", "tcp33060", 
"--natpf1", "delete", "tcp44300", "--natpf1", "delete", "tcp54320", 
"--natpf1", "delete", "tcp8000"]

Stderr: VBoxManage.exe: error: Code E_FAIL (0x80004005) - Unspecified   
error (extended info not available)
VBoxManage.exe: error: Context: "LockMachine(a->session,  
LockType_Write)" at line 493 of file VBoxManageModifyVM.cpp

1
它无法再找到虚拟盒了,它是否仍然安装着?PATH有所变化吗?你能否从命令行中运行VBoxManage.exe - Frederic Henri
我不明白,今天早上我通过删除“.vagrant”文件夹再次修复了它,现在错误又出现了... - rendell
如果你使用的是Windows系统,这个链接可能会有所帮助。 - VivekDev
17个回答

0

我遇到了同样的问题,只需要像Laravel文档中提到的那样,在我的计算机BIOS中启用硬件虚拟化即可。

如果您使用的是Windows系统,则可能需要启用硬件虚拟化(VT-x)。通常可以通过BIOS启用。如果您在UEFI系统上使用Hyper-V,则可能还需要禁用Hyper-V才能访问VT-x。


0

如果您的可用磁盘空间不足,可能会出现此错误。


0

仅适用于MACOS用户 -> 我遇到了同样的问题,我所做的就是在Oracle的安全与隐私中启用VirtualBox的权限。


0
  1. 以管理员身份打开 PowerShell 或 cmd
  2. 输入 bcdedit /set hypervisorlaunchtype off
  3. 重新启动计算机

0
也许现在提供我的经验已经太晚了。您可能需要重新启动计算机,并安装VirtualBox,确保环境变量的值为“C:\Program Files\Oracle\VirtualBox” System Variable Entry 系统变量中的路径条目应该有%VBOX_MSI_INSTALL_PATH% %VBOX_MSI_INSTALL_PATH%

0

通过启动我的BIOS并激活虚拟技术解决了这个问题。在大多数计算机上,该技术默认是关闭的。请激活它,然后打开计算机,运行vagrant up...立即生效。


0

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