Without knowing enough, I made the VM Hard Disk Virtual Size too big, 150gb!
GOAL: I need to make the VM HD Virtual Size smaller!
Note: The last command used at the bottom is not supported in Windows10 yet. You'll have to use EaseUS to do the final shrinking of the vdi file.
I've followed "How to compact VirtualBox's VDI file size?" https://superuser.com/questions/529149/ ... -file-size
Using disk cleanup, optimize and sdelete64 inside the VM Win10 machine. Then from within the guest VM Win10, did a standard "Windows" shutdown.
Then executed the following:
Code: Select all
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd --compact "C:\Users\Rick\VirtualBox VMs\4.99Mui-Win\4.99Mui-Win.vdi"
So then I followed "How to reduce the virtual size of the hard disk in virtualbox" https://www.bing.com/videos/search?q=ho ... ORM=VRDGAR
Following instructions to disassociate the HD in the VM and In Virtual Media Manager and then shutdown the VM and Virtual Box. Then issued this
Code: Select all
"C:\Program Files\Oracle\VirtualBox>vboxmanage.exe" clonehd "C:\Users\Rick\VirtualBox VMs\4.99Mui-Win\4.99Mui-Win.vdi" "Win.vdi" --format vdi --variant standard
0%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage.exe: error: Failed to clone medium
VBoxManage.exe: error: Could not create the clone medium 'C:\Program Files\Oracle\VirtualBox\Win.vdi'.
VBoxManage.exe: error: VDI: cannot create image 'C:\Program Files\Oracle\VirtualBox\Win.vdi' (VERR_ACCESS_DENIED)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleCloneMedium(struct HandlerArg *)" at line 990 of file VBoxManageDisk.cpp
Also, since that does not seem to work, why shouldn't I just issue this:
Code: Select all
"C:\Program Files\Oracle\VirtualBox>vboxmanage.exe" modifymedium "C:\Users\Rick\VirtualBox VMs\4.99Mui-Win\4.99Mui-Win.vdi" "Win.vdi" --resize 40000
Is using EaseUS a reasonable way to shrink my Virtual HD Size?
https://serverfault.com/questions/77910 ... x-vdi-file
Look at the last post, He shrank his disk from 50 to 20gb.
I tried a different solution in order to shrink the VM disk (vdi), named OVdi, (OVdi has disk size of 50GB, single ntfs partition with 40GB free space).
Let's follow these steps:Have fun
- stop the VM (poweroff)
create a new disk (vdi) with name DVdi of desired size (20GB my case..)
attach DVdi to the VM
boot VM and install the utility EaseUS Backup Free
Use the EasyUS Clone function (it clones OVdi MBR, and the ntfs partition of OVdi by shrinking to new disk DVdi)
Detach OVdi from VM
Check if DVdi is the first boot device for the VM
reboot the VM
Don't forget to delete the OVdi volume.
Following these steps I successfully reduced the VM disk size from 50GB to 20GB