我的服务器上运行着一台虚拟机,但我无法停止或重新启动 - 我无法再登录它,也无法使用 VMware 服务器控制台停止它。还有其他虚拟机正在运行,因此重新启动主机是不可能的。还有其他方法可以强制一台机器停止吗?

有帮助吗?

解决方案

如果您使用的是 Windows,虚拟机应该有自己的进程,该进程在任务管理器中可见。使用系统内部 流程浏览器 找到合适的人,然后从那里杀死它。

其他提示

如果你在 Linux 上,那么你可以使用以下命令来获取来宾进程

ps axuw | grep vmware-vmx

正如@Dubas 指出的,您应该能够通过 VMD 的路径名找出错误的进程

在某些情况下,您可能无法暂停虚拟机,或者就此而言无法对虚拟机执行任何“电源”操作。您可能还已经启动并运行了多个虚拟机。使用此进程来识别要杀死的正确 PID。

在 Windows 7 上 - 打开任务管理器 - 查找名为“vmware-vmx.exe”的进程,记下 PID。

切换到“性能”选项卡并启动“资源监视器”。展开“磁盘活动”面板。对“文件”列进行排序。查找与要终止的虚拟机对应的 vmdk 文件。“Image”列将列出“vmware-vmx”进程。注意PID。

切换回“进程”选项卡并终止 PID。

这是我所做的基于

a) @Espo 的评论和
b) 事实上我只有 Windows 任务管理器可以玩......

我登录到主机,打开任务管理器并使用视图菜单将 PID 列添加到“进程”选项卡。

我写下了(是的,用纸和笔)盒子上运行的 vmware-wmx.exe 进程的每个实例的 PID。

使用 VMWare 控制台,我暂停了出错的虚拟机。

当我恢复它时,我可以识别与我的计算机相对应的 vmware-vmx 进程并可以杀死它。

目前看来还没有出现任何不良影响。

类似,但是使用 WMIC 命令行来获取进程 ID 和路径:

WMIC /OUTPUT:C:\ProcessList.txt PROCESS get Caption,Commandline,Processid

这将创建一个包含每个进程及其参数的文本文件。您可以在文件中搜索 VM 文件路径,并获取正确的进程 ID 来结束任务。

谢谢 http://windowsxp.mvps.org/listproc.htm 以获得正确的命令行参数。

对于 ESXi 5,您首先需要通过 vSphere 控制台启用 ssh,然后登录并使用以下命令查找进程 ID

ps -c | grep -i "machine name"

然后您可以找到进程 ID 并使用以下命令结束进程 kill

从VMware的网页上看到以下内容

在ESXI主机(1014165)症状上为虚拟机供电

您遇到这些问题:

You cannot power off an ESXi hosted virtual machine.
A virtual machine is not responsive and cannot be stopped or killed.

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1014165

“使用 ESXi 5.x esxcli 命令关闭虚拟机电源

可以在本地或远程使用 esxcli 命令关闭 ESXi 5.x 上运行的虚拟机。有关详细信息,请参见 vSphere 命令行界面参考的 esxcli vm 命令部分。

Open a console session where the esxcli tool is available, either in the ESXi Shell, the vSphere Management Assistant (vMA), or the location where the vSphere Command-Line Interface (vCLI) is installed.

Get a list of running virtual machines, identified by World ID, UUID, Display Name, and path to the .vmx configuration file, using this command:

esxcli vm process list

Power off one of the virtual machines from the list using this command:

esxcli vm process kill --type=[soft,hard,force] --world-id=WorldNumber

Notes:
Three power-off methods are available. Soft is the most graceful, hard performs an immediate shutdown, and force should be used as a last resort.
Alternate power off command syntax is: esxcli vm process kill -t [soft,hard,force] -w WorldNumber

Repeat Step 2 and validate that the virtual machine is no longer running.

对于 ESXi 4.1:

Get a list of running virtual machines, identified by World ID, UUID, Display Name, and path to the .vmx configuration file, using this command:

esxcli vms vm list

Power off one of the virtual machines from the list using this command:

esxcli vms vm kill --type=[soft,hard,force] --world-id=WorldNumber"

对于 VmWare fusion,按住 替代 单击“重新启动虚拟机”时按 键

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006215

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top