How to reduce Virtual Box's VDI size - Android guest

0

1

As in title. I use Genymotion to emulate Android devices. With time passing, VDI size increases to the point there's no space left on the partition I placed it in. After reading guides I found out that I'm supposed to zero-out space as a guest and then defrag as a host, but how to do so if I have Android as guest?

chomiak

Posted 2015-09-29T16:17:32.973

Reputation: 1

Answers

2

You can accomplish this task in a few steps:

WARNING: Make a backup of all vdi/vdmk files you wish to compact just incase something goes wrong during the process.

1. Use an android app inside of genymotion such as "Secure Eraser" to Zero fill the free space for the corresponding vdi/vdmk (Use the 0000-0000 option from the drop down list)

Secure Eraser link

https://play.google.com/store/apps/details?id=com.aiuspaktyn.secureeraser&hl=en

2. Shutdown genymotion and clone the vdi/vmdk using the follwong command:

VBoxManage clonehd "file" "newfile"

where file and newfile are the source and destination vdi/vmdk

3. Because step 2 will create a new uuid for the cloned vdi/vdmk you will need to set the old uuid to the cloned copy using the following command

VBoxManage internalcommands sethduuid "FILE" "UUID"

(where file points to the cloned vdi/vdmk and uuid is the uuid you wish to set.)

jimbo677

Posted 2015-09-29T16:17:32.973

Reputation: 21

0

If you are using windows you could put that vdi on a compressed folder (right click on folder, general tab, advanced button, check on "compress contents to save disk space")... I know this is a workaround, but could work for you as i don't know any method to defrag a android OS as i believe it is designed to work on flash storage. Good luck!

Daniel Rubio Rocamora

Posted 2015-09-29T16:17:32.973

Reputation: 1

Thanks for suggestion, such workaround is fina, as long as it makes me able to use that android emulated device for longer time without recreating it from scratch to reclaim used up space :D – chomiak – 2015-09-29T16:47:57.650