Hi,
Running VirtualBox 6.1.16 with Ubuntu Studio host and Ubuntu Server guest.
My old guest containing several projects (53 GB disk usage on / ext4 partition) have been cleaned to get only one useful project (23 GB disk usage).
Then, I shut down my VM, and export it. Created OVA file is 80 GB !
So my question is: how can I manage to export my VM without huge unused ext4 disk space exported ?
Exporting VM with small disk usage creates huge OVA file
-
- Site Moderator
- Posts: 20965
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Windows, Linux
Re: Exporting VM with small disk usage creates huge OVA file
You may have 23GB in the VM but the disk file can be bigger. How big is the VM's disk file on the host drive?Dmoss wrote:My old guest containing several projects (53 GB disk usage on / ext4 partition) have been cleaned to get only one useful project (23 GB disk usage).
Re: Exporting VM with small disk usage creates huge OVA file
Yes, the disk files are bigger, but containing useless data for VM:scottgus1 wrote:You may have 23GB in the VM but the disk file can be bigger. How big is the VM's disk file on the host drive?
Code: Select all
-rw------- 1 dmoss dmoss 14G avril 26 2020 2020_04_26_WebODM-disk001.vdi
-rw------- 1 dmoss dmoss 118G mars 15 06:58 Snapshots/{2a19a488-a299-47ee-b9f2-51f7edb39c7b}.vdi
-rw------- 1 dmoss dmoss 4,1G mars 16 23:03 Snapshots/{dda7b4f1-a298-45a7-aab5-1c3cfef7bc0d}.vdi
I understand VirtualBox is unable to get into filesystem and save only allocated blocks. It's a shame, but how to workaround ?
-
- Site Moderator
- Posts: 20965
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Windows, Linux
Re: Exporting VM with small disk usage creates huge OVA file
Dmoss wrote:My old guest containing several projects (53 GB disk usage on / ext4 partition) have been cleaned to get only one useful project (23 GB disk usage).
If the cleanup happened between the two quoted snapshots then the dead data may still be in the drive. I am not familiar with how a snapshotted VM handles dead data in an export, but I suspect the data is not known to be dead and is preserved.Dmoss wrote:-rw------- 1 dmoss dmoss 118G mars 15 06:58 Snapshots/{2a19a488-a299-47ee-b9f2-51f7edb39c7b}.vdi
-rw------- 1 dmoss dmoss 4,1G mars 16 23:03 Snapshots/{dda7b4f1-a298-45a7-aab5-1c3cfef7bc0d}.vdi
You may want to clone the VM's disk with Mpack's CloneVDI, with the Compact option, then get a fresh VM using the clone, then export that.
Re: Exporting VM with small disk usage creates huge OVA file
Thanks, I didn't know about it. I'll try it later (with Wine).scottgus1 wrote:You may want to clone the VM's disk with Mpack's CloneVDI, with the Compact option, then get a fresh VM using the clone, then export that.
At the moment, I'm following another way:
1/ create a new virtual disk and attach t it to my VM
2/ boot my VM on live CD
3/ clone old disk to new one (thanks to clonezilla)
4/ reboot my VM to new disk to check it's ok, poweroff and export
I'll give news... cloning in progress...
-
- Site Moderator
- Posts: 20965
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Windows, Linux
Re: Exporting VM with small disk usage creates huge OVA file
That sounds like a good idea too. It's the same concept: clone the final state of the VM to another drive.