Vagrant 尝试关闭虚拟机时,SSH 连接被意外关闭

vagrant reload
==> default: Attempting graceful shutdown of VM...
The SSH connection was unexpectedly closed by the remote end. This
usually indicates that SSH within the guest machine was unable to
properly start up. Please boot the VM in GUI mode to check whether
it is booting properly.

这通常是由于虚拟机未能正常启动或启动过程中遇到了问题

运行以下命令启动虚拟机的图形界面(GUI),可以更清楚地观察启动过程中的错误:

vagrant halt

然后在 VirtualBox 中手动启动虚拟机,并观察是否有错误信息或启动失败的提示。

重启 Vagrant 和 VirtualBox:确保 VirtualBox 和 Vagrant 没有挂起的进程。可以尝试完全关闭 VirtualBox,然后重新启动 Vagrant:

vagrant reload
vagrant reload--provision