How to open the spicy window I just closed?
- Go to the folder where you have all your VMs
- Get the name of the virtual machine, in this case
ubuntu-22.04then run
spicy --uri="spice+unix://$PWD/ubuntu-22.04/ubuntu-22.04.sock"
How to increase the size of the VM disk?
Lets say the volume of ubuntu-22.04 is 16GB and you want to increase to 50GB.
- Shut down the VM completely (not suspended/paused)
- Go to the folder where you have all your VMs
- Go inside the folder
ubuntu-22.04 - Find the disk image. It’s inside the VM’s data folder, usually named
disk.qcow2 - Check current size (optional, sanity check)
qemu-img info disk.qcow2
- Resize it by setting new size
qemu-img resize disk.qcow2 50G
- Boot the VM and grow the filesystem/partition inside the VM (ubuntu-22.04) resizing the qcow2 file only extends the virtual disk, the partition table and filesystem inside still need to be expanded.
- For which you need to install growpart inside VM
sudo apt install cloud-guest-utils
- Identify the disk and partition.
lsblk- Note the disk device (vda) and the partition number you want to grow
- Run growpart (aasuming vda and 2)
sudo growpart /dev/vda 2
- Check again
lsblk
- Grow the filesystem to use the new partition space (assuming vda2)
sudo resize2fs /dev/vda2
- Check
df -h /