昨天我刚刚使用 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
我有同样的问题,之前的答案对我不起作用。 我打开 VirtualBox GUI,看到虚拟机正在运行。我停止了它,然后执行了“vagrant up”。一切都很好。
好的,所以我终于解决了这个问题。尝试重新启动我的笔记本电脑,它不再给我那个错误了。这是我所做的:
对于 Mac OS,关闭所有正在运行的虚拟机并使用以下命令重新启动虚拟机:
sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart
C:\Users\Justice
用用户名替换正义。.vagrant.d
文件夹。VirtualBox
VMs 文件夹并删除其中的所有内容。应该可以正常工作。
尝试按照以下步骤操作 1.以管理员身份运行cmd 2.流浪停止 3. 流浪起来 4. 如果需要 vagrant provision 但一旦 vagrant 起来了。
禁用 Windows 中启用的 Hyper-V 虚拟化。
以管理员身份打开命令提示符并运行以下命令:
dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
之后,重新启动 PC 并再次尝试 VirtualBox。
我的错误:
Stderr: VBoxManage.exe: error: Failed to open/create the internal network 'HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter' (VERR_INTNET_FLT_IF_NOT_FOUND).
VBoxManage.exe: error: Failed to attach the network LUN (VERR_INTNET_FLT_IF_NOT_FOUND)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole
我首先尝试禁用“VirtualBox Host-Only”适配器。没用。然后尝试将 virtualbox 从 6.1.28 降级到 6.1.26,但没有用。删除所有内容并从 6.1.26 重新开始,仍然没有用。兜兜转转一段时间后,我意识到还有另一个我没有禁用的适配器,名为“Ethernet 5”,带有“VirtualBox Host-Only ...”描述。不确定它是否是我第一次运行 virtualbox 6.1 时创建的.28,但在我禁用它之后,它起作用了。注意到在那之后创建了另一个(“以太网 6”),所以很确定第一个问题与 6.1.28 的其他问题相同,然后错误更改为我发布的内容以上。
在控制面板 > 网络和互联网 > 网络连接下禁用所有 VirtualBox Host-Only Ethernet Adapter #*。
Windows 更新后,我也遇到了这个问题,我认为是VirtualBox 的问题。我的解决方案是重新安装 VirtualBox。
还要确保 VirtualBox 目录路径
C:\Program Files\Oracle\VirtualBox\
在 PATH
环境变量中。
对我来说,重启机器就解决了问题。我刚刚安装了 VirtualBox,可能路径设置不正确。
我遇到了同样的问题,我只需要在我的计算机的 BIOS 中启用硬件虚拟化,如Laravel 文档中所述。
如果您使用的是 Windows,则可能需要启用硬件虚拟化 (VT-x)。它通常可以通过您的 BIOS 启用。如果您在 UEFI 系统上使用 Hyper-V,您可能还需要禁用 Hyper-V 才能访问 VT-x。
仅限 MACOS 用户 -> 我遇到了同样的问题,我所做的是 只需在 Oracle 的安全和隐私中启用 VirtualBox 的权限即可。
bcdedit /set hypervisorlaunchtype off
如果您的可用磁盘空间不足,您可能会遇到此错误。
1.Go to Oracle Virtual Box
2.Right click on the Virtual Machine and select Discard Saved State.
3.Then try to start the virtual machine using vagrant up.
完整链接:https://www.wintips.org/fix-virtualbox-vm-session-was-closed-before-any-attempt-to-power-it-on/
通过启动我的 BIOS 并激活虚拟技术解决了这个问题。在大多数计算机中,该技术默认处于关闭状态。继续并激活它然后打开你的电脑然后运行 vagrant up ......立即工作。