Tag Archives: virtual disk

How to easily resize a qemu disk image for Windows

To add e.g. 30 GB to an existing raw image usethis command:

qemu-img resize nameofimg.img +30G

In my case, the command was run instantly and it added 30 GB to my existing file, as expected. The output was:

WARNING: Image format was not specified for ‘nameofimg.img’ and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the ‘raw’ format explicitly to remove the restrictions.

See also QEMU Emulator User Documentation > qemu-img Invocation or the man page:

man qemu-img

In my case my image was used in a Windows 10 virtual machine. In the Windows 10 VM: click Start and search “partitions” > the search finds “Create and format hard disk partitions” > which clicked opens up “Disk Management” > Right click target partition > Extend > follow the instructions to extend your partition. It’s super easy.

Resize virtual disk VHD file

The easiest way to resize a VHD file is via command line. Check this blog post on technet.com.

Note: maybe you googled for VHD Resizer (or vhdresizer) and could not find the download.

If you need VHDResizer, check this blog post on burksy.net (it contains a working download link).

Note: I used BitLocker to password protect my virtual disk. After executing “extend” I had no feedback. This because I forgot to unlock my drive. After unlocking it I could extend the partition as wished.