Page 1 of 1

[Solved] problem with resize VDI

Posted: 2. Feb 2018, 12:07
by ericluce
Hi

I try to resize the vdi but i have some problem. The size Vdi is too big for my usb stick. configuration :

Code: Select all

 VBoxManage showhdinfo ~/VirtualBox_VMs/windows/windows.vdi
UUID:           ead0125d-c40a-430c-848a-39fba632fd5c
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       /Users/e-clade/VirtualBox_VMs/windows/windows.vdi
Storage format: VDI
Format variant: dynamic default
Capacity:       74080 MBytes
Size on disk:   9402 MBytes
Encryption:     disabled
The size of my usb stick is 64000 Mbytes.

i tried a lot of solution but it doesn't work. Fro exemple :

Code: Select all

VBoxmanage modifyhd --resize 61000 '/Users/e-clade/VirtualBox_VMs/windows/windows.vdi'
0%...
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize medium operation for this format is not implemented yet!
i created a new Vdi with a small size and tried to clone with this command :

Code: Select all

VBoxManage clonemedium ~/VirtualBox_VMs/windows/windows.vdi ~/VirtualBox2/winusb/winusb.vdi --existing
VBoxManage: error: Cannot register the hard disk '/Users/e-clade/VirtualBox2/winusb/winusb.vdi' {f3e69863-2644-4eef-8656-e348348c217f} because a hard disk '/Users/e-clade/VirtualBox VMs/winusb/winusb.vdi' with UUID {f3e69863-2644-4eef-8656-e348348c217f} already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBoxWr
Do you have a idea and how Could i copy my Vdi windows on my usb stick ?

Re: problem with resize VDI

Posted: 2. Feb 2018, 13:41
by mpack
You can't resize a drive to 61000MB when it is already 74000MB. "Resize" can't be used to shrink drives.

I also don't really get what your problem is: the VDI is only 7.4GB in size, so it currently fits quite easily on a 64GB USB stick.

Note that actually running a VM from a pen drive is not recommended. They tend to overheat if written to continuously: they are really only intended for data transport, not as disk drive replacements.

If you want to prevent the VDI from growing beyond 50GB say, then I'd suggest shrinking the guest partitions using the guest OS Disk Manager, or GParted etc.

As to the error message, I suggest cloning and registering the medium in separate steps. Plus I must say that I'm not sure why the task of creating a new and smaller VDI would have involved cloning. If you want to move a VM to a new drive you move it, you don't clone the media. See Howto: Move a VM.

Re: problem with resize VDI

Posted: 2. Feb 2018, 18:25
by ericluce
In fact with your advice i cleaned the usb. ( It was empty but when i used paragon, there was only 2 Go free - I cleaned the usb with paragon).
Why i don't know have only 2 Go free...
Now i moved the VDI file on the usb stick and its perfect.
Why i want to put the Vdi on the usb. because i write sometimes powershell script and i need to test them on Mac and on Windows.
I have 2 macbook and its more easy to have windows in the usb.
I just bought one EOM license for windows 10 ( 8 euros only ) to do only my tests script. I know it s not good for the i/o computer.
Now all it s all right.
Thanks a lot for you help.

Re: problem with resize VDI

Posted: 2. Feb 2018, 18:40
by mpack
It's good that you got it working. Marking the topic as solved.

For the future please bear in mind that the VDI can possibly overflow the drive (unless you limited the partition size as mentioned). Also, storing a lot of other stuff on the drive will hasten that event: however VirtualBox should pause the VM if you ever run out of drive space.