Gregg's MOTD

Tips & Tricks that I've Encountered Over the Years...

Virt-Manager Pool Running Out of Space

September 10, 2023 — Gregg Szumowski

Once upon a time, I had an issue with virt-manager’s pool space running low. I was creating too many VMs using the default configuration. This needed to be resolved because images are being created in /var/lib/libvirt/images which was part of my root partition, which was also low. Since I am the only user on this machine, I decided to change this to default to my home directory:

  1. Create ~/libvirt/images
  2. Run $ sudo virsh pool-edit default as a privileged user or as the root user.
  3. Change the path to point to your new directory.

Tags: cli, virt-manager, virsh, motd

Find the IP Addresses of KVM Virtual Machines (Command Line)

July 22, 2023 — Gregg Szumowski

To find details about the virtual network you can use these commands:

root@slacker:~# virsh net-list
Name State Autostart Persistent
--------------------------------------------
default active yes yes

root@slacker:~# virsh net-info default
Name: default
UUID: 14a90f27-9a85-42ca-b434-6ce6c142690c
Active: yes
Persistent: yes
Autostart: yes
Bridge: virbr0

root@slacker:~# virsh net-dhcp-leases default
Expiry Time MAC address Protocol IP address Hostname Client ID or DUID
------------------------------------------------------------------------------------------------------------
2023-07-22 16:18:45 52:54:00:dd:7b:62 ipv4 192.168.122.216/24 centos7-bbk -

You will find the IP address and hostname listed in the last command’s output.

Optionally, to find the network interfaces’s addresses for a running domain called centos7-bbk:

root@slacker:~# virsh list
Id Name State
-----------------------------
3 centos7-bbk running

root@slacker:~# virsh domifaddr centos7-bbk
Name MAC address Protocol Address
-------------------------------------------------------------------------------
vnet2 52:54:00:dd:7b:62 ipv4 192.168.122.216/24

root@slacker:~#

Tags: cli, kvm, virsh, networking, motd