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 »

I agree with your conclusion, OTOH I'm struggling to explain why there would be even a small difference in the two methods: both should identify all of the unused space on a disk, and both can only discard a 1MB VDI block when the entire block is unused. Normally, you should only see a difference if some extra step has been done for one case only, e.g. defragging or deleting some big file.

I would also point out that the sdelete method only works when the area to be compacted is included in a guest filesystem. CloneVDI can also clean up unpartitioned areas of the disk, e.g. left behind after shrinking a partition.
gb3
Posts: 2
Joined: 12. Jan 2015, 12:17

Re: CloneVDI tool - Discussion & Support

Post by gb3 »

Hi.
I used CloneVDI in order to add space to my virtual disk, but I have a problem.
I installed Ubuntu 14.04 in the Virtual Machine with a VDI disk 8 GB wide.
Now I want to add 72 GB to this disk without reinstalling UBUNTU; with GParted I notice that I have a partition dev/sda 8GB wide, than a 500MB of Linux Swap.
With Virtual Box command line I resized my Virtual Box size to 80 GB, and now in VB setup I see my disk with 80GB, but only 8 GB allocated. In Gparted I have 72GB not allocated space.
So I tried to use Clone VDI in order to enlarge disk dimension, but after Clone_DVI.dvi creation, I can use only 8 GB

Any ideas?

Thanks
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 »

Those are all FAQ questions.

If you use snapshots then you must clone the most recent snapshot, not the base VDI. See the CloneVDI release notes for details.

After resizing the disk (by whatever means), you need to use GParted or similar to increase the main partition size to fill the disk.

CloneVDI can automatically increase the partition size for NTFS and FAT guest filesystems, but not Linux (EXTx). Hence the need to use GParted for those guests after resizing the disk.
AnrDaemon
Posts: 134
Joined: 7. Feb 2010, 23:41
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Ubuntu Linux, Windows

Re: CloneVDI tool - Discussion & Support

Post by AnrDaemon »

gb3 wrote:Hi.
I used CloneVDI in order to add space to my virtual disk, but I have a problem.
I installed Ubuntu 14.04 in the Virtual Machine with a VDI disk 8 GB wide.
Now I want to add 72 GB to this disk without reinstalling UBUNTU; with GParted I notice that I have a partition dev/sda 8GB wide, than a 500MB of Linux Swap.
With Virtual Box command line I resized my Virtual Box size to 80 GB, and now in VB setup I see my disk with 80GB, but only 8 GB allocated. In Gparted I have 72GB not allocated space.
So I tried to use Clone VDI in order to enlarge disk dimension, but after Clone_DVI.dvi creation, I can use only 8 GB

Any ideas?

Thanks
1. Remove swap partition.
2. Use parted or fdisk (parted preferred, since fdisk can't deal with GPT) to enlarge data partition.
3. Use resize2fs to enlarge filesystem to partiton size.
4. Create a swap FILE, it'll help you with future resizes, if that comes.
All this is not a VirtualBox questions, you could find this info in any Linux FAQ.

P.S.
If I were you, I'd just add a second disk instead of enlarging your current one, and moved /home to it.
Much less hassle, and much more useful.
gb3
Posts: 2
Joined: 12. Jan 2015, 12:17

Re: CloneVDI tool - Discussion & Support

Post by gb3 »

You are right about this.
Much less hassle, and much more useful.
I posted here my question because I tought it was a Virtual Box trouble with Ubuntu.

Thank you very much
AnrDaemon
Posts: 134
Joined: 7. Feb 2010, 23:41
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Ubuntu Linux, Windows

Re: CloneVDI tool - Discussion & Support

Post by AnrDaemon »

The simplest idea you can think about, is this: VM is a separate physical system.
Anything you want to do with it, you're doing with a physical system.
Yes, you're not reaching into it with a scrwewdriver to add or replace hardware, but whatever you do with it afterward, doesn't differ from if you were doing it to the real physical system.
Creating partitions, moving data between them - all is examples of the works of your operating system, and you are better off seeking the relevant info on profile forums.
Don't forget to clearly state that you are using VM, though, if you are not sure if that info is relevant to the cause. Even if it doesn't make a difference in most cases, some issues (i.e. video driver issues) need a special treatment.
Alexis Pokrovski
Posts: 4
Joined: 16. Jan 2015, 12:26

Respect for great tool

Post by Alexis Pokrovski »

Your soft was so useful that I've even registered at Oracle to express you my respect. Enormously useful.

THANK YOU VERY MUCH!

Update: Especially useful was the feature that clears out all unpartitioned space of the processed .vdi. So shrinking the partition (say, with gParted) and cloning the result works just as expected.
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 very much for the positive feedback. :)
Alexis Pokrovski
Posts: 4
Joined: 16. Jan 2015, 12:26

Re: CloneVDI tool - Discussion & Support

Post by Alexis Pokrovski »

Btw, I would suggest to add a couple of paragraphs to your top post that would address the two most common issues one uses CloneVDI for: shrinking and expanding .vdi files. Of course, all info required is in releasenotes.txt... but... anyway, these are very standard operations.

As for shrinking (I didn' try expansion yet), I would suggest step-by-step instruction
...............................................
How to decrease .vdi size if guest system uses only part of available space:
1. Make linked copy of the virtual machine used with source .vdi (using VirtualBoxManager; it creates .vbox files, NOT .vdi)
2. Resize the partition from within the guest machine (e.g. mount .iso with gparted)
3. Make CloneVDI copy of the resized snapshot .vdi with the "Compact drive" option checked
4. In the COPY of the machine remove old .vdi and attach the one from CloneVDI.
................................................

(By the way, steps 1 and 4 smoothly solve the issue from release notes "Instead go carefully through the settings, making absolutely sure that the old and new VMs have the same settings". I tried it only once, but copying the VM automatically copies all settings; anything other would be strange. )

All this is very simple, but maybe will save someone a couple of hours that I've lost on trial and error.

The order of steps supposes that first you make the copy of the machine, and only then clone the .vdi. Thus you can place the clone to the folder of the new VM.

The procedure is completely safe, since both old machine and .vdi remain untouched. Of course, one can attach cloned .vdi to
the old machine directly, but I prefer to waste extra 30 seconds to be on the safe side.
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 »

If "linked copy" refers to a linked clone, then that isn't really a safe procedure. Creating a linked clone modifies the original VM, and the clone too expects to use a difference image.

At the time the release notes were written, VirtualBox had no facility to clone a VM, and only command line support for cloning a disk. I agree that some of the procedures in the release notes could be simplified nowadays.
Alexis Pokrovski
Posts: 4
Joined: 16. Jan 2015, 12:26

Re: CloneVDI tool - Discussion & Support

Post by Alexis Pokrovski »

mpack wrote:If "linked copy" refers to a linked clone, then that isn't really a safe procedure. Creating a linked clone modifies the original VM, and the clone too expects to use a difference image.
Yes, it should've been "linked clone", sorry. It does create an extra snapshot in the source VM, but the previous snapshot remains unchanged. So we can discard the extra snapshot in the source VM. Or am I missing something?

Yes, the cloned machine expects to use the difference image. But step 4 of the suggested procedure substitutes the link to the source .vdi with the cloned .vdi (using official VBoxManager). Or maybe there are some hidden traps?
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 »

I don't really want to get into a technical discussion of how snapshots work, as that would be off topic here.
Alexis Pokrovski
Posts: 4
Joined: 16. Jan 2015, 12:26

Re: CloneVDI tool - Discussion & Support

Post by Alexis Pokrovski »

mpack wrote:I don't really want to get into a technical discussion of how snapshots work, as that would be off topic here.
Sure. Anyway many thanks for the great soft.
herakles
Posts: 48
Joined: 8. Jan 2013, 09:53

Make a bootable external hdd from an archlinux.vdi

Post by herakles »

Hello everybody from Mauritius ~! :D

I am Caron from Mauritius. I run Mint 17 Quiana 64 bit and an Archlinux Vm. My aim is to convert my archlinux vdi into a bootable external hdd ( I use a laptop so I'll be using a laptop external hdd in a usb casing.)
I read that I had first to convert the .vdi into a .raw and then use dd command. Unfortunately I failed because the commands are not working- unable to find the .vdi on my system. :?
Can u help please ?

Thanks in advance. :)

Caron
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 »

Please post non-CloneVDI questions in an appropriate forum.
Post Reply