Trouble resizing virtual box VHD disk

virtual machinevirtualboxwindows 10windows 7

I'm new to VirtualBox and VMs in general. I need to resize my current disk from 32G to 60G so I can fit one last piece of software on it. My host is Windows 10 and my guest is Windows 7. This is the result of running showhdinfo on my current drive:

UUID:           0c04f9ef-f9e6-4a7f-b418-6d62fab5d557
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       C:\Users\ICS User\VirtualBox VMs\Win7_Rockwell\Win7_Rockwell.vhd
Storage format: VHD
Format variant: dynamic default
Capacity:       65536 MBytes
Size on disk:   30283 MBytes
Encryption:     disabled
In use by VMs:  Win7_Rockwell (UUID: 764685c2-03cd-4ff8-9e21-37157af8e024)

As seen above I have 65536 MBytes allocated to the disk, but the partition is only using 30283.

When I run the command:

VBoxManage modifymedium disk "C:\Users\ICS User\VirtualBox VMs\Win7_Rockwell\Win7_Rockwell.VHD" --resize 65536

I receive the following print out:
0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%

It feels like it worked, I mean there aren't any error codes, but when I run the showhdinfo command again the "Capacity" and "Size on Disk" look exactly the same as they did before. Am I missing something here?

Best Answer

Did you extend the volume in the guest OS? Windows won't use the space until you tell it to do so. Microsoft has a guide on how to do this: https://docs.microsoft.com/en-us/windows-server/storage/disk-management/extend-a-basic-volume

Depending on how the disk was partitioned, you may not be able to extend it from Windows. For example, if you're trying to extend C: but there are other likely hidden partitions after it. If that is the case, you'll need to use something like GParted: https://gparted.org/ to extend C: and push the other partitions to the end of the drive.

VHD files can be configured to only take up as much space as the guest is using, I'm guessing that's why the size on disk doesn't match the capacity.

Related Question