Hi I wanted to find out if there is way to list all the running processes in a guest VM from the hypervisor. Like the output of 'ps -ef' from inside the guest VM, but without logging in or ssh into it. Thanks dtsweval
On 20.04.2015 06:22, dt sweval wrote:> Hi > I wanted to find out if there is way to list all the running processes in a > guest VM from the hypervisor. Like the output of 'ps -ef' from inside the > guest VM, but without logging in or ssh into it.No, I don't think there's a way. Problem is, libvirt views guest internals private to the guest. Having said that, I don't think there ever will be an API for that. Nor qemu-ga has an API for executing an arbitrary shell commands. Michal
As I know, you can use Libvmi API to access the memory of VM and then walk through the double-linked list of process to reconstruct the process list. it is easy, and libvmi has provide the example 在2015-04-20 22:52:02,hanyandong<hanyandong@iie.ac.cn>写道:> On 20.04.2015 06:22, dt sweval wrote: > > Hi > > I wanted to find out if there is way to list all the running processes in a > > guest VM from the hypervisor. Like the output of 'ps -ef' from inside the > > guest VM, but without logging in or ssh into it. > > No, I don't think there's a way. Problem is, libvirt views guest > internals private to the guest. Having said that, I don't think there > ever will be an API for that. Nor qemu-ga has an API for executing an > arbitrary shell commands. > > Michal > > _______________________________________________ > libvirt-users mailing list > libvirt-users@redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-users
this is the libvmi API: https://github.com/libvmi/libvmi this is the example : https://github.com/libvmi/libvmi/blob/master/examples/process-list.c -- Best Regards, yandong> -----原始邮件----- > 发件人: "Michal Privoznik" <mprivozn@redhat.com> > 发送时间: 2015年4月20日 星期一 > 收件人: "dt sweval" <dtsweval@gmail.com>, libvirt-users@redhat.com > 抄送: > 主题: Re: [libvirt-users] libvirt and guest processes > > On 20.04.2015 06:22, dt sweval wrote: > > Hi > > I wanted to find out if there is way to list all the running processes in a > > guest VM from the hypervisor. Like the output of 'ps -ef' from inside the > > guest VM, but without logging in or ssh into it. > > No, I don't think there's a way. Problem is, libvirt views guest > internals private to the guest. Having said that, I don't think there > ever will be an API for that. Nor qemu-ga has an API for executing an > arbitrary shell commands. > > Michal > > _______________________________________________ > libvirt-users mailing list > libvirt-users@redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-users