Home > virtualbox > shrink size of ova file in virtualbox

shrink size of ova file in virtualbox

November 8Hits:8

I've got an Ubuntu 64bit VM that I derived from a ~1GB ova file, I used it under VMware vSphere to install some more software on it and use the system against a few datasets that took some 2-3GB of space, but now that I deleted these big files, I was expecting that the newly generated ova file from it would also take about ~1.1GB of space, but instead is taking about 3GB. If I look at the details the .vmdk file in virtualbox, I see the following:

Hart Disk: SATA Port 0 Type (Format): Normal (VMDK) Virtual Size: 8.00 GB Actual Size:  7.90 GB Details: Dynamically allocated storage Location: /somewhere/myVM-disk1.vmdk Attached To: myVM.virtualbox 

The size of the ova when I export this machine is ~3GB.

Any ideas how I can shrink it?


A space in .vmdk is allocated when OS makes a first write into particular sector. Once written, it's allocated forever.

So, you need to add second dynamically-sized virtual HDD to your virtual machine, then boot VM from LiveCD, create partitions with fdisk and copy all of the files (cp -R). Then shutdown VM, swap virtual HDDs, boot again and verify everything works, then detach original virtual HDD from VM and delete it as a file on disk of the host system.

Direct copying with dd in VM won't work, because it will write each sector into target .vmdk file, so it will expand to its full size instead of shrinking.

See the article How to shrink a dynamically-expanding guest virtualbox image.

It describes how to shrink the disk via :

  1. Zero out the free space, using zerofree for Ubuntu
  2. Shrink the VM using
    VBoxManage modifyhd my.vdi –compact

Related Articles

  • shrink size of ova file in virtualboxNovember 8

    I've got an Ubuntu 64bit VM that I derived from a ~1GB ova file, I used it under VMware vSphere to install some more software on it and use the system against a few datasets that took some 2-3GB of space, but now that I deleted these big files, I was

  • Can not open REMnux after importing the .ova file in VirtualBoxJune 18

    I want to install REMnux. Therefore, I have installed the REMnux virtual appliance file from https://remnux.org/. But when I start REMnux (after creating the VM) then nothing happens. I see only a black screen. The installation process does not start

  • Is it possible to import VirtualBox 4.2.12 exported OVA file into VMWare ESX 4? September 5

    I have created an OVA file from VirtualBox 4.2.12, and someone tried to import this ova file into VMWare ESX 4. When he was doing so, VMWare ESX 4 promopted: Line 25: Unsupported hardware family 'virtualbox-2.2'. I assumed that the OVA file can be un

  • What's the difference between an *.ova file and a *.ovf file when exporting from VirtualBox?October 26

    I'm trying to export a Virtual Machine I have on VirtualBox so I can back it up, and when I went to export it, I was prompted with a "Save As..." dialog that asks me if I want to save it as a .ovf or an .ova file. What is the difference between

  • Can I just run OVA file, without "importing" it into VirtualBox?

    Can I just run OVA file, without "importing" it into VirtualBox?November 18

    I have downloaded Sage 6.3 for Windows and it is provided in OVA format. It is said in manual, that to run Sage, one should: First, start VirtualBox. To start the Sage notebook server, power on Sage-x.y.z by selecting it and clicking 'Start'. (This m

  • Geny Motion - trick to download the .ova files for Ubuntu 12.04 (old links are not working)February 6

    I'm using the Ubuntu 12.04 LTS version . I had also installed the genymotion. But I had a slow internet connection, so I'm unable to download that large size file in my home. I had searched many many blogs,sites too.. Where they are provided the link

  • Unable to shrink the transaction log file in Sql Server 2008December 16

    Am using the below to script shrink the transaction log *USE AVPC GO BACKUP DATABASE AVPC TO DISK = 'H:\DBBackup\AVPC\FullBackUp\AVPC.bak' USE AVPC GO BACKUP LOG AVPC TO DISK = 'H:\DBBackup\AVPC\Transaction\AVPC.trn' GO USE AVPC GO -- Truncate the lo

  • How To Shrink VMware Virtual Disk Files (.vmdk)

    How To Shrink VMware Virtual Disk Files (.vmdk)January 10

    How To Shrink VMware Virtual Disk Files (.vmdk) Version 1.0 Author: Falko Timme This guide shows how you can shrink the virtual disk files (they have the extension .vmdk) of your VMware virtual machines so that if you zip them, they will use much les

  • Can I shrink the transaction log file on a mirror database?April 22

    This is a followup question to a previous question about why I couldn't shrink the log file on the principal database. To make a long story short, I setup database mirroring but forgot to make sure the job that backed up the transaction log was runni

  • Shrink my database log file, make sense? June 8

    This question already has an answer here: Why Does the Transaction Log Keep Growing or Run Out of Space? 4 answers I am now taking log backups daily after a long gap(1.5 years). Now when I run, DBCC SQLPERF('logspace') Result, Database Log Size (MB)

  • Can't run an ova fileAugust 10

    I download virtual box from http://www.modern.ie/en-US/virtualization-tools#downloads and extracted it. When I tried to run ova file, I couldn't. $ sudo ./"IE11 - Win8.1.ova" ./IE11 - Win8.1.ova: ./IE11 - Win8.1.ova: cannot execute binary file $

  • Changing the initial size of log filesJuly 1

    I am changing the initial size of log files but it goes back to its previous size. Can somebody please let me know what do I need to do so that it gets the new size? Thanks --------------Solutions------------- If a SQL log file size reduces unexpecte

  • How to shrink size of raw virtual machine disk image (kvm)?October 11

    Let's say I have image.raw with size of 10GB. Inside is one primary etx4 partition (no LVM used), extending to the entire volume. And the data on that partition is, for example, 7GB. This image is prepared to use for some virtualization environment (

  • How do I convert a VMWare file to VirtualBox?May 1

    I want to take an existing VMWare virtual machine and run it in VirtualBox 2.2+. Is there any utility to do this? --------------Solutions------------- There's a tutorial on using qemu tools and vditool to do that here. I don't think there's a utility

  • Does using a large NTFS disk allocation size for a file share make a difference?July 2

    I'm formatting a drive using NTFS which will be dedicated as a file share for users to centrally store their files. The files will likely be large (10's to 100's of megabytes). Someone suggested that using a large allocation unit size than the defaul

  • Windows 7 Explorer: how to show total size of all files in current folder?November 5

    In Windows XP Explorer one can turn on Status Bar which shows, among other things, the total size of all the files in the current folder, or if the cumulative size of the selected files. How do I get the same at-a-glance information in Windows 7? Sel

  • Why is the total size of my files on Windows 7 more than total disk size?September 3

    I have a virtual machine with Windows 7 x64 quest OS. When I boot from PE OS CD and run file manager (Total Commander) I see that the total size of my files on virtual machine is more than total disk size. What is the reason? EDIT: My Windows folder

  • Reducing size of EPS file after export from GIMPDecember 15

    I have a jpeg file that's 400k that I used gimp to convert to eps. The eps file is 10.8 MB. I didn't make any modifications other than cropping. Why is it so large and how do I reduce the size. --------------Solutions------------- I would suggest usi

  • how to create VMDK file in Virtualbox for adding USB as a new OS?March 29

    I have a USB which has OSes on it. Now I want to create VMDK file to use them in VirtualBox. I read many articles but never found how I can use them. In an article I found the way that: C:\Program Files\Oracle\VirtualBox > VBoxManage internalcommands

  • How can I get the size of a file in a bash script?July 13

    How can I get the size of a file in a bash script? How do I assign this to a bash variable so I can use it later? --------------Solutions------------- Your best bet: stat --printf="%s" file.any NOTE: see @chbrown answer below how to use stat in

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.714 s.