Categories
Virtual Machine

Resizing your virtual machine's IMG virtual disk image

Resizing your virtual machine's IMG virtual disk image

I recently wrote a guide about how to create your own VM under PopOS. In that guide, we created a virtual disk image (IMG) for the VM to install the Windows 10 on it. But if you later felt that maybe the virtual disk was too small, you can easily resize the virtual disk with one command. But first make a backup just in case something goes wrong. Then go to the folder where your VM IMG is and run the following command. Replace “win10” with your VM IMG name, and change “+256G” to how much new space you want to give tp your virtual disk, so in my example I will add 256GB new empty space to the current size of the virtual disk. When you run the command it might give you a warning, that’s why it’s good to have an backup.

qemu-img resize win10.img +256G

 

And after you have run the command, just boot up your VM, and for example in case of Windows 10, just go to Windows’ Disk Utility and expand your partition to cover the new empty space.