VM Disk Image ============= The VM disk image is based on Fedora. The particular version of Fedora being used can be determined using the command: cat /etc/fedora-release Or alternatively, use the command: (source /etc/os-release && echo $PRETTY_NAME) Package Management ================== The package manager used by Fedora is called dnf. To list all packages with metadata containing the keyword $keyword, use the command: dnf search $keyword To print summary information about the package $package, use the command: dnf info $package To install the package $package, use the command: dnf install $package To update the package $package, use the command: dnf upgrade $package Resizing VM Disk ================ It is possible to resize the VM disk image. If you are running some variant of Linux as your host OS, the VM disk image can be resized from the host OS using the procedure described below. The libguestfs and qemu-img software is required and should be available on most modern Linux distributions: libguestfs software: Fedora and Ubuntu: libguestfs-tools qemu-img software: Fedora: qemu-img Ubuntu: qemu-utils *** WARNING *** BE SURE TO MAKE A BACKUP ON THE DISK IMAGE FILE BEFORE ATTEMPTING TO PERFORM A RESIZE OPERATION. IF ANYTHING GOES WRONG, YOU WILL LOSE ALL DATA STORED IN THE DISK IMAGE. *** WARNING *** THE DISK IMAGE BEING RESIZED MUST NOT BE IN USE. THAT IS, THE GUEST MUST BE SHUTDOWN WHILE PERFORMING A DISK RESIZE. Note: This approach is intended to be used for disk images in the QCOW2 format. Note: The directory that contains VM disk images varies from one Linux distribution to the next. Fedora places disk images in: /var/lib/libvirt/images 0. Let $disk_image denote the file name of the disk image to be resized (e.g., "f35.qcow2"). 1. List the disk partition information for the VM disk image: virt-filesystems --long --parts --blkdevs -h -a $disk_image NOTE: The remaining steps assume that there is a single block device called /dev/sda with a single partition called /dev/sda1. 2. Rename the disk image: mv $disk_image $disk_image.backup 3. Create an empty QCOW2 image of the desired new size: qemu-img create -f qcow2 $disk_image $new_size If no suffix is used, the size $new_size is in bytes. A suffix of "G" can be used for units of GiB. 4. Copy the contents of the original disk image to the new disk image and adjust partition and filesystem sizes appropriately: virt-resize --expand /dev/sda1 $disk_image.backup $disk_image 5. If the new disk image works correctly, $disk_image.backup can be removed. Suppose that the disk image file to be resized is called f35.qcow2 and the new size is to be 80 GiB. The disk image contains a single partition associated with the block device /dev/sda1. The following commands would be used: virt-filesystems --long --parts --blkdevs -h -a f35.qcow2 # Ensure devices listed are named as expected. mv f35.qcow2 f35.qcow2.backup qemu-img create -f qcow2 f35.qcow2 80G virt-resize --expand /dev/sda1 f35.qcow2.backup f35.qcow2 For additional information, refer to the following references: Expand or extend KVM virtual machine disk size in Linux https://www.linuxhowto.net/how-to-extend-kvm-virtual-machine-disk-size-in-linux/ virt-resize Manual Page https://libguestfs.org/virt-resize.1.html