Virsh commands: Difference between revisions

From DISI
Jump to navigation Jump to search
(Created libvirt virsh command list)
(No difference)

Revision as of 17:15, 9 October 2017

virsh is command line tool for the libvirt API which allows us to interact with Linux kernel virtual machines (KVM)

Handy Commands

To list all virtual machines and their state on hypervisor

virsh list --all

To start a powered down virtual machine

virsh start <vm_name>

To force shutdown a virtual machine (pulling the plug on a VM)

virsh destroy --graceful <vm_name>

To view virtual machine network interfaces

virsh domiflist <vm_name>

Adding a network interface to a VM

virsh attach-interface --domain <vm_name> --type <bridge/network> --source <source-device> --model virtio --mac <insert-whatever-mac-address> --config