Is there any specific command to check all running processes inside a specific VM on ESXi?

I have a list of VMs running on ESXi. I have used vim-cmd vmsvc/getallvms to get a list of VMs running and also esxcli vm process list to get the World ID of VMs.

I would like to get inside the Ubuntu VM and check all the running processes inside that particular server. I am unable to find any commands for this.

It runs on ubuntu64Guest (Guest OS) the version is vmx-14

I have tried esxcli vm process list --world-id=2099753 and esxcli vm process list --vmid=3 but haven't had any luck so far.

esxcli vm process list

Ubuntu 18.04
   World ID: 2099753
   Process ID: 0
   VMX Cartel ID: 2099752
   UUID: 26 4d 83 e2 51 ef 15 13-2e e2 07 d9 40 76 88 d8
   Display Name: Ubuntu 18.04
   Config File: /vmfs/volumes/5f2c68f2-398a7f7c-35cd-a4badb4455b4/Ubuntu 18.04/Ubuntu 18.04.vmx

ansible
   World ID: 2154782
   Process ID: 0
   VMX Cartel ID: 2154781
   UUID: 26 4d 78 67 2b d0 83 82-f3 fe 03 f0 cc a3 a1 fe
   Display Name: ansible
   Config File: /vmfs/volumes/5f2c68f2-398a7f7c-35bc-a4badb4455b4/node03/node03.vmx

I have checked many esxcli command cheatsheets for a fix. Most of them talk about killing a process or an unresponsive VM rather than getting inside a specific VM.


Solution 1:

You'd be better off managing the VMs, querying their processes, in the same way that you would for any host, independent of virtualization layer.

That said, if you run PowerCLI against the VM host, you can run Invoke-VMScript to run commands inside the VMs running on it.