代码之家  ›  专栏  ›  技术社区  ›  Rikalous

如何杀死一个不会死掉的VMware虚拟机?[闭门]

  •  23
  • Rikalous  · 技术社区  · 16 年前

    8 回复  |  直到 16 年前
        1
  •  18
  •   Ian    11 年前

    如果您在linux上,那么您可以使用

    ps axuw | grep vmware-vmx
    

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

        2
  •  17
  •   saschabeaumont    13 年前

    Process Explorer 找到合适的,然后从那里杀了它。

        3
  •  5
  •   EJ2020    12 年前

    在某些情况下,您可能无法挂起,或者因此无法对VM执行任何“Power”操作。您可能已经有多个虚拟机启动并运行。使用此过程确定要终止的正确PID。

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

    切换到性能选项卡并启动“资源监视器”。展开“磁盘活动”面板。对“文件”列进行排序。为要杀死的VM查找适当的vmdk文件。“映像”列将列出“vmware vmx”进程。注意PID。

        4
  •  4
  •   Espo    16 年前

    a) @Espo的评论和建议
    b) 事实上,我只有Windows任务管理器可以使用。。。。

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

    使用VMWare控制台,我挂起了错误的虚拟机。

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

        5
  •  4
  •   Daniel Tallentire    13 年前

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

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

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

    幸亏 http://windowsxp.mvps.org/listproc.htm 获取正确的命令行参数。

        6
  •  3
  •   saschabeaumont    13 年前

    ps -c | grep -i "machine name"
    

    kill

        7
  •  3
  •   Jocelyn    11 年前

    请参阅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

    可以在本地或远程使用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"
    
        8
  •  2
  •   spuder    11 年前