본문 바로가기

가상화/VirtualBox

How do I increase the hard disk size of the virtual machine?

Open a terminal and navigate to the folder with the VirtualBox disk image, then use the following command:

VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB  

replacing YOUR_HARD_DISK and SIZE_IN_MB with your image name and desired size. This answer and a fuller explanation are here, on webupd8. Credit to Andrew there for posting this answer.

linkimprove this answer
unfortunately it does not work.. see my edit – wim Dec 19 '11 at 8:13
Sorry that didn't work. Judging from the comments over there it looks like it only works some of the time. Hopefully someone more experienced can reply here or over on webupd8. Don't bother trying to clone the .vdi either, you can't specify a larger partition. I just tried and all you can do is an exact clone. Just a thought, did you do a fixed 10GB initially, or dynamically expanding storage? That might be a clue. – Tom BrossmanDec 19 '11 at 9:36
iirc it was dynamic – wim Dec 19 '11 at 9:45
1 
+1. Just used this to increase the size of my Windows 7 disk from 20 to 30 GB, and it worked very smoothly (no unregistering etc needed). $ VBoxManage modifyhd Windows7.vdi --resize 30720 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% At first Windows didn't detect the increased space, but after a poweroff it did, and then I was able to use the built-in Disk Management tool to increase the size of my C: partition. – Jonik Dec 22 '11 at 10:05
1 
+1, This is certainly the cleanest way to do it. – Starx May 3 at 15:08