[Solved] Vboxmanage modifymedium: --resize bug?

Discussions related to using VirtualBox on Windows hosts.
Vilnth
Posts: 3
Joined: 21. Jan 2017, 03:24

[Solved] Vboxmanage modifymedium: --resize bug?

Post by Vilnth »

Hey guys! New to VirtualBox, was getting pretty frustrated trying to resize a virtual disk using the vboxmanageutility and wondering if I am doing something wrong or if this might be a bug.

Host: Windows 10 Pro (x64)
Guest: Windows Server 2016
Virtualbox: 5.1.14 r112924 (Qt5.6.2)

Basically, I had a 20GB dynamic .vhd file that was filling up rather quickly, so I wanted to increase the size to 30GB. However, I quickly ran into a problem where the modifymedium command would immediately generate an error and not complete. This persisted across normal and admin command prompts, and survived both a host restart and a repair reinstall of Virtualbox. Eventually, I did achieve the desired result with in the following sequence:

Code: Select all

C:\Program Files\Oracle\VirtualBox>vboxmanage modifymedium C:\_dev\vm\Magus\Magus.vdi --resize 30720
VBoxManage.exe: error: Error: Attempt to resize the medium from 0.0 MB to 30720.0 MB. Use --resizebyte if this is intended!

C:\Program Files\Oracle\VirtualBox>vboxmanage modifymedium C:\_dev\vm\Magus\Magus.vdi --resizebyte 30720000000
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Note: The second operation not exactly the 30 GB I had envisioned, but I was frustrated and just wanted to throw enough 0's after my original input to pass as a parameter. Thankfully, it was successful!

Anyway, I was thinking maybe the sanity check that got added to the --resize flag in the latest available version might be getting triggered incorrectly? Based on the current documentation, I'm not seeing what else might be going on with my input...
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Vboxmanage modifymedium: --resize bug?

Post by mpack »

It certainly does look like a bug with the new sanity check feature. For some reason it seems to think that the old VHD is 0MB in size.

Speaking of which: frankly, you shouldn't be using VHD, as that is an alien format. IMHO if you choose VHD then my sympathies for the many things that can go wrong are somewhat limited.
 Edit:  Belay that. I made the mistake of accepting what you wrote, and not noticing that the filename contradicted you. You said you had a .vhd, the command line filename you provided says .vdi. Which is it? Because if it's a VHD with a .VDI extension then that is certainly asking for trouble.

p.s. FYI, 30GB is 30*(1024^3)==32212254720 bytes. 
Vilnth
Posts: 3
Joined: 21. Jan 2017, 03:24

Re: Vboxmanage modifymedium: --resize bug?

Post by Vilnth »

My bad, the original disk attached to my VM was a VHD, but I had cloned it to a VDI to test the same command and it still wasn't working.

Good catch though! My first few guests were created as VHD for portability, to possibly test with Hyper V alongside Virtual Box. At this point though, due to storage issues I've pretty much cloned and converted everything to VDI.
frank
Oracle Corporation
Posts: 3362
Joined: 7. Jun 2007, 09:11
Primary OS: Debian Sid
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows
Location: Dresden, Germany
Contact:

Re: Vboxmanage modifymedium: --resize bug?

Post by frank »

I would like to see the output of

Code: Select all

VBoxManage showhdinfo C:\_dev\vm\Magus\Magus.vdi
.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Vboxmanage modifymedium: --resize bug?

Post by mpack »

Hi Frank, if you wanted to see the disk size, note that the OP says in his first post that he successfully used --resizebytes, so the drive size will be 30GB (ish). No easy way to know what it was before. Maybe the other occurrence would provide better info.

@Vilith: please don't let my post stop you from providing the info Frank is asking for. I imagine it would still be nice to see proof of the container format.
Vilnth
Posts: 3
Joined: 21. Jan 2017, 03:24

Re: Vboxmanage modifymedium: --resize bug?

Post by Vilnth »

The original disk (.VHD) had a size of 20GB when it was created through the VirtualBox GUI.

Code: Select all

C:\Program Files\Oracle\VirtualBox>vboxmanage showhdinfo C:\_dev\vm\Magus\Magus.vdi
UUID:           e03bfb6b-4324-4893-9842-7b5ffbd71e81
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       C:\_dev\vm\Magus\Magus.vdi
Storage format: VDI
Format variant: dynamic default
Capacity:       29296 MBytes
Size on disk:   28913 MBytes
Encryption:     disabled
In use by VMs:  Magus (UUID: 6a32ec9b-d52a-4eab-a58c-a18297daf079)
Knoll42
Posts: 1
Joined: 27. Jan 2017, 12:26

Re: Vboxmanage modifymedium: --resize bug?

Post by Knoll42 »

Any update on this at all please? I have exactly the same issue.

Code: Select all

E:\KCI-VBOX-WK8VM\KCI-VBOX-W2K8>VBoxManage showhdinfo E:\KCI-VBOX-WK8VM\KCI-W2K8\KCI-VBOX-W2K8.vdi
UUID:           5f75a303-1689-4ea3-960d-478fdd3b1578
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       E:\KCI-VBOX-WK8VM\KCI-VBOX-W2K8\KCI-VBOX-W2K8.vdi
Storage format: VDI
Format variant: dynamic default
Capacity:       53480 MBytes
Size on disk:   53118 MBytes
Encryption:     disabled
In use by VMs:  KCI-VBOX-W2K8 (UUID: 96368daa-3e60-44f1-b9f2-c01376d0ea30)
Last edited by socratis on 27. Jan 2017, 13:39, edited 1 time in total.
Reason: Enclosed the information in [code] tag for better readability
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Vboxmanage modifymedium: --resize bug?

Post by socratis »

@Knoll42
Please define "I have exactly the same issue". What are the exact command input and output?
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.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Vboxmanage modifymedium: --resize bug?

Post by mpack »

If you have the OPs problem then the OP's first post already documents the workaround: use "--resizebytes" until there is a new maintenance release, which will probably happen in a month or so.

The good news is that the bug is reported as fixed in ticket #16311 (correct from VBox 5.1.16).
Last edited by mpack on 9. Mar 2017, 18:00, edited 1 time in total.
Reason: Added fix version info.
stefgosselin
Posts: 1
Joined: 23. Feb 2017, 00:31

Re: Vboxmanage modifymedium: --resize bug?

Post by stefgosselin »

Same issue here. Any idea when next release is out that fixes this?

Thanks!
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Vboxmanage modifymedium: --resize bug?

Post by socratis »

Unless you're a VirtualBox developer, nobody knows. Post a comment to the ticket if you want to get notifications. Plus, you know about the "--resizebytes" workaround, right?
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.
ashm314
Posts: 2
Joined: 3. Mar 2017, 06:11

Re: Vboxmanage modifymedium: --resize bug?

Post by ashm314 »

I have the same issue.
I've tried and got error message
a) --resize 33792
>> VBoxManage.exe: error: Error: Attempt to resize the medium from 0.0 MB to 33792.0 MB.
Use --resizebyte if this is intended!
b) --resizebyte 34603008
>> VBoxManage.exe: error: Resize medium operation for this format is not implemented yet!

my environment:
Windows 10 Pro (64-bit) version 1607, Build 14393.693
Windows 7 Ultimate (64-bit)
VirtualBox : 5.1.14 r112924 (Qt5.6.2)

I'm afraid it's a bug in VirtualBox.
With the older version of VirtualBox, I could resize the size of virtual machines. I cannot remember their version...
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Vboxmanage modifymedium: --resize bug?

Post by socratis »

ashm314 wrote:I'm afraid it's a bug in VirtualBox.
You didn't read the thread, did you? At all...
mpack wrote:It certainly does look like a bug with the new sanity check feature.
mpack wrote:The good news is that the bug is reported as fixed in ticket #16311.
socratis wrote:you know about the "--resizebytes" workaround, right?
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.
ashm314
Posts: 2
Joined: 3. Mar 2017, 06:11

Re: Vboxmanage modifymedium: --resize bug?

Post by ashm314 »

Your guess is right. I have not read all threads thoroughly.

I'm a software developer, and published a work that can modify VM's storage size with GUI, without command line.
And a user told me he could not resize(expand) the storage size, and I've just noticed the issue.

Sorry, if my thread would be some noise to you.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Vboxmanage modifymedium: --resize bug?

Post by socratis »

ashm314 wrote:I'm a software developer, and published a work that can modify VM's storage size with GUI, without command line.
That sounds interesting... Is there a link or a website? Since you're new, the spam filters won't let you post a URL, so if you can, obfuscate it, like "www . virtualbox . org /wiki/Downloads".
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.
Post Reply