CloneVDI tool - Discussion & Support

Discussions related to using VirtualBox on Windows hosts.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

See my previous answer.
AlsoBort
Posts: 2
Joined: 7. Jun 2021, 00:19

Re: CloneVDI tool - Discussion & Support

Post by AlsoBort »

Thanks for the great tool! I've been Virtualbox for a long time and have always had trouble keeping image sizes in check.

A question: If I enable the option to "Compact drive", the clone of one of my VDIs is created instantly and is only a few MBs in size. I assume it's because I enabled full disk encryption when installing Linux Mint on that guest. Is there any trick to using the tool to reduce the size of such a VDI?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

AlsoBort wrote:I assume it's because I enabled full disk encryption when installing Linux Mint on that guest
I don't think so, or anyway not directly. The whole point of encryption is that third parties can't look at the contents of your drive, so I would expect CloneVDI to see it as an unknown partition and copy it as is. The only explanation I can think of is that the encryption tool messes with the partition map somehow, making it look like the drive is empty. Or maybe it's a GPT drive - which always look like empty MBR drives to MBR-only tools - and somehow the encryption stops CloneVDI from identifying the drive as GPT not MBR.
AlsoBort wrote:Is there any trick to using the tool to reduce the size of such a VDI?
Nope. Encryption randomizes the drive and makes it impossible for external tools to analyze the contents, which obviously includes not being able to detect usage.

Basically, don't encrypt drives if you want third party tools to be able to inspect the contents.
AlsoBort
Posts: 2
Joined: 7. Jun 2021, 00:19

Re: CloneVDI tool - Discussion & Support

Post by AlsoBort »

Thanks for the quick response - if I need to shrink this disk in the future I know I should set it up in a different way.

In case it's useful or just interesting, here's the parted information of the system in question - looks like it's MBR if I read the "msdos" label correctly:
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 1151GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 538MB 537MB primary fat32 boot
2 539MB 1151GB 1150GB extended
5 539MB 1305MB 767MB logical ext4
6 1307MB 1151GB 1149GB logical


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/vgmint-root: 1099GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number Start End Size File system Flags
1 0,00B 1099GB 1099GB ext4


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/vgmint-swap_1: 1023MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number Start End Size File system Flags
1 0,00B 1023MB 1023MB linux-swap(v1)


Error: /dev/mapper/sda6_crypt: unrecognised disk label
Model: Linux device-mapper (crypt) (dm)
Disk /dev/mapper/sda6_crypt: 1149GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
I just noticed I set the dynamic disk to a nowadays very over-budgeted 1TB and currently have it stored on a host disk with less than that amount free, so a potential source of issues.

For reference, another of my (Ubuntu) systems without encryption looks like this:
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 44,0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 41,9GB 41,9GB primary ext4 boot
2 41,9GB 44,0GB 2145MB extended
5 41,9GB 44,0GB 2145MB logical linux-swap(v1)
johnspack
Posts: 1
Joined: 21. Jul 2021, 01:53
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Very Many
Location: Nelson BC Canada

Re: CloneVDI tool - Discussion & Support

Post by johnspack »

Had to post to say thanks for this. Used vmware for years, it was simple to compact vms. Switched to linux a few years ago, and so switched to virtualbox. All this time I had no idea this tool existed!
I have dozens of vms, I've already lopped off 100gbs in space. Running Kubuntu 21.10 and Winehq staging 6.12, and the app runs perfectly, and fast.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

Thanks for the positive feedback.
giox79
Posts: 2
Joined: 16. Aug 2021, 17:26

Re: CloneVDI tool - Discussion & Support

Post by giox79 »

Hello everybody, I have a question related to this great tool.
I have a VDI file of 230 GB that I would like to compact.

However, I would like to generate the clone of the vdi on a different drive, and on the C partition of my Windows PC I have only 130 GB.
It seems that if I choose the source folder in

D:\FolderA\file.vdi

and select the destination folder as:

E:\FolderB\file.vdi

Lot of space in allocated also in C partition, and not only in E:

So my PC seems to be unable to clone my VDI VBOX, because of C partition, even if the external HD used to allocate the clone is quite big. Is there any alternative approach to avoid using so much space on C partition?

Best regards
Gio
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

giox79 wrote: Lot of space in allocated also in C partition, and not only in E:
Nope. CloneVDI doesn't allocate any space at all except as it writes the destination file, which will be on drive E: if your information is accurate.

Why do you believe that anything is allocated by CloneVDI on drive C?
giox79
Posts: 2
Joined: 16. Aug 2021, 17:26

Re: CloneVDI tool - Discussion & Support

Post by giox79 »

w
Last edited by giox79 on 24. Apr 2022, 11:16, edited 1 time in total.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

As I already said, the only writing that CloneVDI does is to the destination file. In supporting your case I expected you to identify any file on drive C that CloneVDI writes to (*).

(*) Note that CloneVDI does write to its own CloneVDI.ini file which probably lives on drive C, but this file is tiny (<< 1KB typical) and should only get written to once, on exit, when it saves the dialog contents for next time. Furthermore it is only written to using standard Windows API calls (SetPrivateProfileString).

I don't know what's writing to C while CloneVDI is running, but it isn't CloneVDI. As I total guess I'd say that it's a growing pagefile created by some kind of AV which is trying to analyze what CloneVDI is writing to drive E. Or, drive E is somehow actually a symlinked folder on drive C. Or, it's some kind of strange caching software you have installed (would only make sense if C is an SSD).

Either way, it isn't CloneVDI, which doesn't do anything fancy: it reads from one file and writes to another. A single 16MB RAM buffer is allocated at the start, and that will account for almost all of the memory use.

Please don't respond again unless you can identify the culprit file on C which is being written to (to this extent) by CloneVDI. There are free tools available which can identify the largest files on your system, I use WizTree.
own3mall
Posts: 2
Joined: 13. Mar 2011, 01:16
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: XP

Re: CloneVDI tool - Discussion & Support

Post by own3mall »

I cloned my drive, but the clone doesn't have all of my files from the existing drive, and it's 4 times smaller.

The original is a 50 GB fixed disk, and the clone ends up being 12 GB containing files that were last modified in 2016 rather than 2021.

I noticed the tool claims to be able to smush all of the snapshots into a VDI file as well... how do you do this, and will this fix my issue? I need a bigger sized VDI, as I'm out of space in my fixed size existing drive.

Please help!
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

Have a read of the PDF instructions pinned to the first page of this topic.
analogscott
Posts: 12
Joined: 23. Dec 2011, 23:58
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Ubuntu 20.04 various Windows

Re: CloneVDI tool - Discussion & Support

Post by analogscott »

Anybody familiar with this issue,

I setup source (secondary SSD) and destination (secondary HDD), keep UUID, compact, then Proceed.

A progress pops for a second showing 100% and disappears.

The original VDI is 90gb, the clone ends up 6,144kb.

I tried running as admin, running from a different location (C Drive M.2) than Program Files.

It feels like maybe a dependency is missing?


Win 10 Pro x64
CloneVDI v4.01 (fresh install/rookie user)
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

From the symptoms: you asked it to compact the drive but the drive doesn't contain any partitions it recognizes (i.e. empty or no partition map), hence the entire contents of the drive can be (and was) discarded.

Post a screenshot of the "Partition Info" data in CloneVDI - that will tell us what CloneVDI sees on the drive.

What filesystem does the source VDI use? What type of partition map? CloneVDI recognizes MBR and GPT (as used by UEFI), so it puzzles me what you could possibly have there. An encrypted drive perhaps?

btw, CloneVDI has no dependencies other than requiring a Windows 32bit/64bit host (XP or later). It will also run under Wine on other hosts.
analogscott
Posts: 12
Joined: 23. Dec 2011, 23:58
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Ubuntu 20.04 various Windows

Re: CloneVDI tool - Discussion & Support

Post by analogscott »

The guest is Ubuntu and not encrypted.
partition.jpg
partition.jpg (50.02 KiB) Viewed 45335 times
partitions.jpg
partitions.jpg (74.53 KiB) Viewed 45335 times
Thanks for this quick reply and thanks for creating such a useful utility. The current clone task is really to test out CloneVDI. My main issue is another VDI that is growing way too fast and needs compacting. I do like the idea of using the features of CloneVDI as a backup method for VDI. If it does work well for backups, maybe via the commandline i can setup a scheduled reoccurring backup.
Last edited by mpack on 11. Feb 2022, 10:44, edited 2 times in total.
Reason: Making images local.
Post Reply