Using virsh to control KVM and openvz

Jens asked:

On different servers I’m using virsh to manage openvz containers or KVM guests.

No I have a server with both, KVM and openvz installed and would like to controll both with virsh.

I can’t figure out how to ‘switch’ between openvz and KVM. Currently (maybe because I first installed openvz)

# virsh list

only displays my vz containers.

Any hints?

My answer:


Choose which hypervisor to connect to with the -c option.

For instance for KVM:

virsh -c qemu:///system list

And for openvz:

virsh -c opencz:///system list

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.