I have a Windows 10 VM on my Mac, via VirtualBox. The virtual hard drive ran out of space. Looking in the UI, there doesn’t seem to be a way to manually resize it:
So how do you resize it?
Step 1 - Resize the
Go to the VirtualBox package.
$ cd /Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS
Run the command to resize the .vdi file. The new size must be passed in MB, in this example 60000 = 60GB.
$ VBoxManage modifyhd --resize 60000 ~/VirtualBox\ VMs/Windows\ 10/Windows\ 10.vdi
Confirm it was resized.
$ VBoxManage showhdinfo ~/VirtualBox\ VMs/Windows\ 10/Windows\ 10.vdi <other info omitted> Storage format: VDI Format variant: dynamic default Capacity: 60000 MBytes Size on disk: 31991 MBytes Encryption: disabled
Step 2 - Resize the partition in Windows to use the new space
- Open the Computer Management
- Open Storage, then Disk Management.
- Right click on your drive (probably C:). Select Extend Volume.
- Extend it into the new space you created in step 1.
I’m not sure why you can’t do this through VirtualBox’s GUI, but this solution works just fine.
If you have any issues with this, stop using Windows and the problem will go away automatically.