VBoxManage modifyhd --resize == VBOX_E_NOT_SUPPORTED

Discussions related to using VirtualBox on Linux hosts.
Locked
LaughingBoy
Posts: 44
Joined: 16. May 2007, 02:16
Location: Adelaide, SA, Australia
Contact:

VBoxManage modifyhd --resize == VBOX_E_NOT_SUPPORTED

Post by LaughingBoy »

Possibly filed under the "you're doing it wrong" category, but I just upgraded to v4.0.4 in an effort to take advantage of the long-awaited "resize hd" feature.

Before the upgrade, I got "unknown option --resize", which upon further reading indicates that it's just not there in v3.x. OK, happy with that. The alternatives are a little painful for this day and age so upgrading to v4.04 took little convincing.

Code: Select all

$ VBoxManage --version
4.0.4r70112
Yup - the tool has been upgraded.

BUT... now when I try to run it, I get:

Code: Select all

$ VBoxManage modifyhd windows7x64.vdi --resize 40960
0%...
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!
This type of HDD?

Code: Select all

$ VBoxManage showhdinfo windows7x64.vdi 
UUID:                 15dccff1-30e0-4eac-a8d9-90ae90161a64
Accessible:           yes
Logical size:         20480 MBytes
Current size on disk: 20480 MBytes
Type:                 normal (base)
Storage format:       VDI
Format variant:       fixed default
In use by VMs:        Win7x64 (UUID: 129eea26-f578-405a-924c-7a5076bcc5c8)
Location:             /mnt/moredata/VMs/Windows7x64/windows7x64.vdi
It seems it's VDI, which I thought was one of the formats that was supported.

Now, I've checked other posts and haven't done something silly like "tried to make it 40M instead of 40G" so I figured it's something else silly that I've missed.

Anyone?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VBoxManage modifyhd --resize == VBOX_E_NOT_SUPPORTED

Post by Perryg »

--resize only works for VDI/VHD and only for dynamic drives at the moment.
If you do not fit this requirement you will receive the error mentioned. Also the --resize parameter in in megabytes and if you specify a size lower to or equal to than the original the same error shows.
LaughingBoy
Posts: 44
Joined: 16. May 2007, 02:16
Location: Adelaide, SA, Australia
Contact:

Re: VBoxManage modifyhd --resize == VBOX_E_NOT_SUPPORTED

Post by LaughingBoy »

Perryg wrote:--resize only works for VDI/VHD and only for dynamic drives at the moment.
If you do not fit this requirement you will receive the error mentioned. Also the --resize parameter in in megabytes and if you specify a size lower to or equal to than the original the same error shows.
Thanks for replying, but apparently you missed the original details in my first post.

Drive type is VDI, and as can be clearly seen the size requested is greater than the original (40G v 20G).

Any other suggestions?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VBoxManage modifyhd --resize == VBOX_E_NOT_SUPPORTED

Post by Perryg »

I didn't miss anything I was stating what the requirements are. What about dynamic? Did you specify fixed when you created it.
LaughingBoy
Posts: 44
Joined: 16. May 2007, 02:16
Location: Adelaide, SA, Australia
Contact:

Re: VBoxManage modifyhd --resize == VBOX_E_NOT_SUPPORTED

Post by LaughingBoy »

Perryg wrote:I didn't miss anything I was stating what the requirements are. What about dynamic? Did you specify fixed when you created it.
Dunno. It was a number of years ago, and done with the GUI.

But that reading thing again ... re-reading the first post gives that answer :-

Code: Select all

Format variant:       fixed default
How does one change that?
Y E T I
Posts: 161
Joined: 9. Aug 2010, 01:47
Primary OS: Other
VBox Version: OSE self-compiled
Guest OSses: ?
Location: H i m a l a y a s
Contact:

Re: VBoxManage modifyhd --resize == VBOX_E_NOT_SUPPORTED

Post by Y E T I »

AFAIK it is not possible (well at least easily). You could create a new HDD and set it to a larger size and set it to dynamic then image the original to the new drive. But there is no way that I know of to convert it with VirtualBox.
LaughingBoy
Posts: 44
Joined: 16. May 2007, 02:16
Location: Adelaide, SA, Australia
Contact:

Re: VBoxManage modifyhd --resize == VBOX_E_NOT_SUPPORTED

Post by LaughingBoy »

Y E T I wrote:AFAIK it is not possible (well at least easily). You could create a new HDD and set it to a larger size and set it to dynamic then image the original to the new drive. But there is no way that I know of to convert it with VirtualBox.
Apparently, the "default" when I created the original drive back then was fixed. Now, when I create a drive, it is dynamic by default:

Code: Select all

$ VBoxManage createhd --filename test.vdi  --size 40960
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Disk image created. UUID: 0170809d-df56-470e-9476-6ea85f9ac3c4
$ VBoxManage showhdinfo test.vdi 
UUID:                 0170809d-df56-470e-9476-6ea85f9ac3c4
Accessible:           yes
Logical size:         40960 MBytes
Current size on disk: 0 MBytes
Type:                 normal (base)
Storage format:       VDI
Format variant:       dynamic default
Location:             /mnt/moredata/VMs/Windows7x64/test.vdi
Now, realising that I can't use the drive "as is" due to out-dated defaults, I now try this:

Code: Select all

$ VBoxManage clonehd windows7x64.vdi windows7x64_C.vdi 
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VDI'. UUID: 4e067a69-0f9b-4394-9607-8d7cc37b8223
$ VBoxManage showhdinfo windows7x64_C.vdi 
UUID:                 4e067a69-0f9b-4394-9607-8d7cc37b8223
Accessible:           yes
Logical size:         20480 MBytes
Current size on disk: 20364 MBytes
Type:                 normal (base)
Storage format:       VDI
Format variant:       dynamic default
Location:             /mnt/moredata/VMs/Windows7x64/windows7x64_C.vdi
$ VBoxManage modifyhd windows7x64_C.vdi --resize 40960
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
$ VBoxManage showhdinfo windows7x64_C.vdi 
UUID:                 4e067a69-0f9b-4394-9607-8d7cc37b8223
Accessible:           yes
Logical size:         40960 MBytes
Current size on disk: 20365 MBytes
Type:                 normal (base)
Storage format:       VDI
Format variant:       dynamic default
Location:             /mnt/moredata/VMs/Windows7x64/windows7x64_C.vdi
Sheesh, that wasn't so hard. Now surely that ability could be added to VBox somewhere...

Anyway, I think that solves the problem for me, and at least documents it for anyone else coming across this post.
rstewart
Posts: 15
Joined: 2. Jul 2009, 14:32
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows 7, Ubuntu 10.04, Linux Mint 9

Re: VBoxManage modifyhd --resize == VBOX_E_NOT_SUPPORTED

Post by rstewart »

@LaughingBoy: So am I reading this correctly that when you cloned your original "fixed" (vs. dynamic) VDI, the clone was created as dynamic which then allowed you resize it?

I am in exactly this same spot: I have a fixed VDI originally created back in the VB3.x days that is now running out of space and I need to expand it. So it sounds like I need to squash out the snapshots, clone it, and then resize it?

That would be sweet if it works...

--
/ron
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: VBoxManage modifyhd --resize == VBOX_E_NOT_SUPPORTED

Post by Sasquatch »

rstewart, that's exactly how it works. To be sure you get a dynamic disk, you can specify the variant in the clone command. Something else that can be done, is use modifyhd --compact to see if that changes it to dynamic. I know it used to be possible that way, but since I don't have fixed drives, I can't test it right away. I'm also short on hard drive space on the Host, so I can't create a fixed drive either.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
rstewart
Posts: 15
Joined: 2. Jul 2009, 14:32
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows 7, Ubuntu 10.04, Linux Mint 9

Re: VBoxManage modifyhd --resize == VBOX_E_NOT_SUPPORTED

Post by rstewart »

@sasquatch: thanks for the follow-up.

Eventually I got there. I ended having to clone the VDI through the GUI -- I must have done something wrong when I did it via VBoxManage -- then was able to resize it using VBoxManage (after about half an hour of stupidity-induced frustration where I was specifying --resize 60 instead of --resize 61440, in trying to increase the size to 60G), and finally managed to convince Windows 7 to use the larger space. It happens to be the system boot disk under Win7, so I ended up needing to boot gparted to resize the disk. After much chkdsk'ing and whining, Win7 now seems to be running OK on the larger partition and volume.

--
/ron
S Murugan
Posts: 1
Joined: 25. Aug 2013, 09:45

Re: VBoxManage modifyhd --resize == VBOX_E_NOT_SUPPORTED

Post by S Murugan »

Hey Guys,

i have done the same with below workarounds....

just assume the win7.vmdk is my current Virtual Machine Hdd with 10 GB, so i am creating the Newhardisk.vdi with 20 GB size and cloning the win7 hdd, then attaching to the Machine.

Step 1 : Get into the Virtual Machine Directory with "cd" command,

ex: cd /home/Vbox/Virtualbox Vms/Windows 7

Step 2 : Create the New Virtual Hardisk with below command

VBoxManage createhd --filename Newhardisk.vdi --size 20480

Step 3 : Clone the the image of Existing Hardisk to New one which we created.

VBoxManage clonehd old hardisk.vmdk --existing Newhardisk.vdi


Step 4 : After completion of the Clone job, just Remove the win7.vmdk from the VM and attache the newly Created Newhardisk.vdi. to do that follow the options below,

a. Go to Virtualbox Media Manager ---> Select Win7.vmdk ---> Click the "Release" option. then delete it with Remove option and you can keep the Hdd without deleting from the system

b. Open the Machine folder and check the permission of the Created Hardisk. if it doesnt have the proper permission then it gives error while attaching to the machine
c. Open the Settings of the Virtual Machine ----> Storage ---> Add Hardisk -----> Select the Hardisk which we created.

Step 5 : format the Free space through Disk management and get the new drives or if you want to increase the system folder, then you want to use some kind of tool like gparted, Partition Magic.

Please share if any corrections.

Thanks !!

S. Murugan
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VBoxManage modifyhd --resize == VBOX_E_NOT_SUPPORTED

Post by mpack »

Thanks for joining in order to pass along this tip, unfortunately I have to tell you that your advice is bad: that's a very unnecessarily complicated way to resize a disk. The correct way is given here.

I believe this discussion topic has served its purpose, hence locking it.
Locked