Today, I tried to increase space on my working notebook. I usually work in virtual environment and in the last period I’ve found very cool VirtualBox virtualization product.
From a first analysis, I found that the logical space occupied by guest disk was less than the physical space on my hard disk (32 GB versus 37 GB). Unfortunately VirtualBox UI don’t provide any tools to shrink volume such as in MS Virtual PC. So, I had a short search on Google and I found out a couple of very interesting posts to accomplish the task.
Here, summarized the steps:
- Defrag your guest disk using windows defrag,
- Download the following tool (SDelete) and copy and extract it in your virtual environment,
- Open a console in guest system, go to SDelete directory and type the following command:
sdelete -c c:\
where C:\ is the volume to shrink. - Shutdown the virtual machine.
- In the host environment open a console, go to VirtualBox directory (in my case was: “C:\Program Files\Sun\VirtualBox”)
- Type the following command:
VBoxManage.exe modifyvdi <your path to vdi file>\file.vdi compact
The last operation is the slowest and requires about 20 minutes (probably depends on machine and file size).
Assumptions:
VirtualBox version: 3.1.4
Host O.S.: Windows 7 x64
Guest O.S.: Windows 2008 x86
References:
- How to compact a VirtualBox virtual disk image (VDI)
- How To Shrink Your Virtualbox VM And Free Up Space For Your Hard Disk
- SDelete v1.51
No comments:
Post a Comment