VirtualBox allows me on my MacBook, for a while, to use some applications unavailable with OSX. For example, Some applications of configuration. I produced, from my website, an video tutorial regarding the installation of a Windows system 7 on a Mac with VirtualBox.
At the first installation, the application allows to create a default dynamic virtual disk 20 GB. The term "dynamic" means that the actual size occupied by the virtual volume will be that of the files installed., and that this size will increase with new files created, up to a maximum of 20 GB. As Windows 7 system needs only 12 to 13 GB space, that seems actually enough and one do not change this size.
But today, with more and more applications, my virtual disk is full. I cannot add more files, nor proceed the major update, as the Service Pack 1 recently available. Do not panic. Since version 4.0 VirtualBox allows you to increase the size of the virtual disk.
[SHIFT version 5.0]
For this, must proceed in two steps.
1 – Use the command-line interface VBoxManage
VirtualBox is provided, as install, with a command line interface for performing actions on the implementation progress. Detailed explanations are provided in Chapter 8 User Manual (in English). VirtualBox must be closed before using this command.
Command in Terminal :
sudo vboxmanage modifyhd "path / volume name" –resize [size]
[Update] The "sudo" command is now mandatory, your session password will be asked.
- Volume Name : To be sure not to make mistakes in entering the absolute path of the virtual disk, must select the file .vdi in the Finder and drag it with mouse in the terminal after vboxmanage modifyhd and between quotation marks. then type the following –resize 30720 in my example (two dashes – front resize).
- Size : 15360 = 15 GB, 20480 = 20 GB, 30720 = 30 GB, etc.
Warning, in the Terminal, white spaces are replaced by the \ that you must delete and keep the spaces in the names of the folders as you read them in the Finder.
This gives the new size in the user interface of VirtualBox :
2 – Increase the partition in Windows
Once restarted Windows in VirtualBox, you see that the hard disk seen in the file manager is always the same size as before. That's normal, the virtual disk has been increased, but Windows only sees the partition, it, was unchanged.
You will open the utility Command Prompt in All programs > Accessories (The DOS window, equivalent of the Terminal in OSX) to launch the utility DiskPart.
Once DiskPart launched in a new window, commands to follow are :
- list volume (to see the number of boot volume, which displays the old size)
- select volume x (where x is the volume number)
- extend (no arguments, extend the partition to increase the size of the virtual disk)
You enter the command again :
- list volume (to verify that the size is identical to the one you set in VBoxManage)
You can close the window and check your hard disk is displayed with its new size :