[Solved] Shrinking a dynamic VDI file and convert to fixed.

Discussions related to using VirtualBox on Linux hosts.
Post Reply
luquino
Posts: 41
Joined: 10. Mar 2009, 18:27
Primary OS: Ubuntu 12.04
VBox Version: OSE Debian
Guest OSses: windows
Location: Lima, Perú

[Solved] Shrinking a dynamic VDI file and convert to fixed.

Post by luquino »

Hi to all, first of all I apologize if my question has been already treated, I've made a large search over the net but I couldn't find any answer that fitted my problem.
I'm using VBox version 5.2.18 r124319 (Qt5.6.1) on Ubuntu 16.04 (Mate desktop).
I have an 120 GB SSD drive with an ext4 partition of 56 GB (no way to extend that partition, because the rest of SSD is reserved for 2 linux systems) that hosts the VDI of my Windows 10 virtual machine. When I created the virtual machine I didn't care about the format fixed / dynamic of the VDI and the procedure created a dynamic VDI, logical size 50 GB.
I know that 50 GB is very little, but actually I use that system only to produce MSOffice documents that are immediately transferred to a USB key, unfortunately MSOffice is the only thing that linux cannot replace.
On the windows disk, after the installation I have 17 GB free (more than I need), but Vbox after a couple of months blocked the virtual machine: "Disk Full". Obviously the full disk is the ext4 partition, because the virtual windows disk has still 17 GB free.
At the moment I fixed the problem with "sdelete.exe" and "vboxmanage modifymedium --compact", but after that I tried to convert the VDI to a fixed one in order to avoid future problems.

I have another disk HDD (samsung, not very young, but still good) with about 100 GB free, so I cloned there the VDI, but the virtual machine becomes a tortoise (Windows thanks), endless waits for every action.
I red and tried many guides and threads, hoping to find the solution to convert my dynamic VDI to fixed and shrink it to fit the 56 GB partition where it has to stay. But I couldn't achieve my goal.
The real problem is that at the moment the dynamic VDI has a logical size of 50 GB (51200 MB), that produce a fixed VDI of about 55 GB that exceed the capacity of the partition: 56 GB less 1.5 GB (approx) reserved from the system. A solution should be to quit the journaling from the partition, but is not really good because here we suffer frequently lacks of power supply.

So, finally my answer is: there is any option to convert my VDI to a fixed format and reduce it to a logical size of 48 GB (more or less)?
No way to reinstall from scratch: it take about 2 days to stabilize the system, due to the endless upgrades.

Thank you for the patience to read that and for the answer you'll give me.
Last edited by luquino on 3. Sep 2018, 03:43, edited 1 time in total.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Shrinking a dynamic VDI file and convert to fixed.

Post by socratis »

luquino wrote:Hi to all, first of all I apologize if my question has been already treated, I've made a large search over the net but I couldn't find any answer that fitted my problem.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
luquino
Posts: 41
Joined: 10. Mar 2009, 18:27
Primary OS: Ubuntu 12.04
VBox Version: OSE Debian
Guest OSses: windows
Location: Lima, Perú

Re: Shrinking a dynamic VDI file and convert to fixed.

Post by luquino »

Thanks a lot for your answer, but that was unuseful because I have a Linux host, and a Windows guest.
Anyway, I'm still searching.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Shrinking a dynamic VDI file and convert to fixed.

Post by mpack »

luquino wrote:unuseful because I have a Linux host, and a Windows guest.
Curious. What made you think that matters? VirtualBox is cross platform, i.e. a solution on one platform is nearly always the solution on every other platform.
luquino
Posts: 41
Joined: 10. Mar 2009, 18:27
Primary OS: Ubuntu 12.04
VBox Version: OSE Debian
Guest OSses: windows
Location: Lima, Perú

Re: Shrinking a dynamic VDI file and convert to fixed.

Post by luquino »

I understand what you mean, but is not the same to shrink a partition on a windows guest than on a linux guest.
Anyway after extended goggleing I understood that my problem has not a solution because to shrink a windows 10 partition is a lottery, in my case it permits to reduce only 500 MB that is not enough for me and therefore the VDI doesn't sense the reduction (I don't know why and is not important any more).
Finally I decided to backup everything and to risk a partitions resize on the SSD. Luckily everything has gone well.
Thanks a lot for your patience.
Post Reply