I have an existing Ubuntu VirtualBox VM (Windows 10 host). It's currently using a 50GB fixed size disk. Judging by what I see when I look at its filesystem, its currently using ~29.7GB of that space (so, yes, 20.3GB free).
I would like to make the disk dynamic, and would also like to set the upper bound of this disk to 35GB in order to save space on my laptop's SSD. I'm aware of vboxmanage's clonemedium command, but have a couple of questions:
What will happen to my install on the clone's side? In other words, is it smart enough to see that there's 20.3GB of 'space' in the original disk and shrink the clone down to size (29.7GB)? Do I run the risk of data being lost, despite the 'free space' of the original?
Is there a way to specify the upper bound of the dynamic disk through the command line, or, say, an XML file? The documentation doesn't mention anything about it. I certainly don't want the disk to grow indefinitely.