![]() ![]() * In a Windows guest we can replace unused space with the utility sdelete. This will considerably decrease the file size of our VDI file. The problem here is that writing fails but doesnt give a clear meaning in the guest. Once all unused drive space is filled with zeros we then shrink the drive with VBoxManage modifyhd. In these cases, the guest cannot make any changes to the host, and in case of a dynamically sized disk, once the disk wants to write data that is larger than the allocated space because the hosts disk is full, a write error occurs within the guest, thats it. Keep in mind that by filling with zeros the virtual file will temporarily grow up to it's maximum size. ![]() ![]() On more than one partition we my have to repeat zerofree for each partition. Replace /dev/sdxX with the ext2, ext3 or ext4 formatted partition in question. We therefore may have to bind it temporarily to another VM we had created for this purpose, or we need to boot an Ubuntu live environment on this VM. This needs the drive to not be in use, and to be unmounted. In case the disk had grown too much we can compact it again, provided the unused space is filled with zeros, and the drive is in VDI format.įor an ext2 to ext 4 filesystem this can be done from the Ubuntu guest with the command line utility zerofree *. It does not however free the space of files we deleted in the guest OS. Open the Virtual Media Manager File > Virtual Media Manager and select the machine that size you want to enlarge. A dynamically growing Virtual Box virtual hard drive file is capable of growing on demand of the virtual machine up to the maximum size we defined in setting up this file. Go back to the VirtualBox dashboard, right-click on the VM, select Settings and select Storage from the Settings windows left column. ![]()
0 Comments
Leave a Reply. |