Ticket #9103 (reopened defect)

Opened 4 years ago

Last modified 11 months ago

modifyvm --resize doesn't work

Reported by: jonsiddle Owned by:
Priority: major Component: virtual disk
Version: VirtualBox 4.0.8 Keywords: modifyhd resize
Cc: Guest type: other
Host type: Linux

Description (last modified by frank) (diff)

I have a 20GB dynamic .vdi which I want to resize to 40GB so I issue:

VBoxManage modifyhd /full/path/to/hd.vdi --resize 40960

and it responds (instantly) with:


Running VBoxManage showhdinfo on the image tells me:

... Logical size: 40960 MBytes Current size on disk: 18464 MBytes Type: normal (base) Storage format: VDI Format variant: dynamic default ...

and also reports the same logical size for the snapshot files.

The problem is that gparted reports that the drive is still 20G (not the partition; the whole drive).

Windows disk management also sees the drive as 20G.

It looks like while VirtualBox can see the new logical size, it's not reporting it to the guest correctly.

Change History

comment:1 Changed 4 years ago by long

So I ran into this same problem and the reason it doesn't work is because you have snapshots. I hope you have a backup of your .vdi before you resized it because you will need it. Basically you will need to fall back to the original .vdi and then delete all of your snapshots before trying to resize it. It seems to me that modifyhd shouldn't let you resize a .vdi that has snapshots associated with it.

comment:2 Changed 4 years ago by klaus

  • Status changed from new to closed
  • Resolution set to invalid

Sorry, the answer by the previous user is not correct.

You can resize a VM which has snapshots, but you must resize the right thing.

Resizing the first snapshot (more accurately the base image) only affects that one. It doesn't magically change anything else.

So what you need to do is to identify the diff image which is associated with "Current State", i.e. what is attached to the VM. This image needs to be resized.

This is working correctly, so I'm closing this ticket.

comment:3 Changed 4 years ago by thierrybo

Please explain what you mean by "identify the diff image which is associated with "Current State", i.e. what is attached to the VM. "?

I look for my HOME .VirtualBox folder and only found the base vdi and snapshots. Where is the Current State?

comment:4 Changed 4 years ago by frank

Have a look at VBoxManage showvminfo VM_NAME. The status text contains the current hard disks which is attached to the VM. If the VM has a snapshot, the information will show the current differential image.

comment:5 Changed 4 years ago by thierrybo

OK, but I just see snapshots I can already see in the GUI, but not further "current state". IF I run:

VBoxManage modifyhd "~/.VirtualBox/Machines/XPPRO/Snapshots/{6a9489b3-3d02-4492-b0f4-00b4027a1925}.vdi" --resize 25000

on the last snapshot I get: Progress state: VBOX_E_NOT_SUPPORTED VBoxManage: error: Resize hard disk operation for this format is not implemented yet!

but it works on the base vdi

comment:6 Changed 2 years ago by Corvin

I'm having exactly the same problem as thierrobo wrote. Using VB 4.1.22

I've run the resize action on my primary vdi file, it completed successfully. I run VBoxManage showvminfo on my machine, looked at what UUID is associated with my current state HDD snapshot, run showhdinfo on that, it shows the new, resized logical size. But the guest OS still sees the old size. modifyhd on the UUID of the snapshot throws VBOX_E_NOT_SUPPORTED.

Oracle folks, please explain the steps that we need to do for the guest OS to see the updated size.


comment:7 Changed 2 years ago by Corvin

  • Status changed from closed to reopened
  • Resolution invalid deleted

comment:8 Changed 2 years ago by JSW

I am seeing the same not supported message using VirtualBox 4.2.4

VBoxManage modifyhd \{5f4afe34-8165-4f90-b3b5-1e9d88716cad\}.vdi --resize 40960
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!

Please advise ASAP

comment:9 Changed 2 years ago by frank

  • Description modified (diff)

Resizing of differential images is not supported. To resize the hard disk you have to merge the differential images with the base image (delete all snapshots) and then resize the base image. And resizing does only work if you increase the size, decreasing is not implemented.

comment:10 Changed 11 months ago by carter

I ran into this same problem: I resized the original disk image, did not see the new size in the guest, found this bug. Then I tried to delete the snapshots, but virtualbox crashed while merging the first snapshot.

Suggestion: The resize command should fail when applied to a disk image attached to a VM that has snapshots. In the meantime please update the documentation of modifyhd and add a warning that this command will not work correctly and will cause data loss if you have snapshots.

Note: See TracTickets for help on using tickets.
ContactPrivacy policyTerms of Use