virsh Cheatsheet

List VMs

1
2
3
4
5
6
7
[ecomaikgolf@laptop ~/]$ sudo virsh list --all
 Id   Name            State
--------------------------------
 -    burpsuite       shut off
 -    fedora-kernel   shut off
 -    kCTF            shut off
 -    reversing       shut off

Start/Restart/Shutdown VM

1
2
[ecomaikgolf@laptop ~/]$ sudo virsh start fedora-kernel
Domain 'fedora-kernel' started

Get IP of VM

1
2
3
4
[ecomaikgolf@laptop ~/]$ sudo virsh domifaddr fedora-kernel
 Name       MAC address          Protocol     Address
-------------------------------------------------------------------------------
 vnet0      52:54:00:13:2c:24    ipv4         192.168.124.252/24