[Resolved] Supposedly "dynamic" vmdk file does not resize.

Discussions related to using VirtualBox on Linux hosts.
stevecoh1
Posts: 39
Joined: 6. Mar 2011, 00:10
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP, Windows 7

[Resolved] Supposedly "dynamic" vmdk file does not resize.

Post by stevecoh1 »

I am running a Windows 7 Guest on a Ubuntu 18.04 host. It's disk is full. Yet when I look at the settings for my guest, it says "Dynamically allocated storage". The name of the storage file is windows7-disk2.vmdk. Yet I find that the vmdk cannot be enlarged, either automatically, or via the "Virtual Media Manager".

So what, if anything, does "Dynamically allocated storage" mean, and how might I go about making the virtual disk bigger? I don't mind using the command line if I have to. I did see some CloneVDI mentioned but I am confused because it mentions GParted and I don't understand why partition editing comes into the picture at all, since from the perspective of the Linux host, this is just an ordinary disk file.
Last edited by socratis on 8. May 2018, 03:31, edited 1 time in total.
Reason: Marked as [Resolved].
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Supposedly "dynamic" vmdk file does not resize.

Post by socratis »

1.8. Running your virtual machine:
  • A dynamically allocated file will only grow in size when the guest actually stores data on its virtual hard disk. It will therefore initially be small on the host hard drive and only later grow to the size specified as it is filled with data.
So, if you created a dynamic disk of 25 GB, initially it will occupy 2 MB on your host. After the guest OS installation, it will grow. On the host. The more you use it, it will grow. On the host. Up to the point that it actually occupies 25 GB. On your host and your guest.

The guest however from the beginning things that you have a 25 GB hard disk. Nothing changes as far as that is concerned. There's yet to be invented an actual hard disk that grows and shrinks according to your needs. And if an actual HD like that doesn't exist, you can't expect that your guest OS will react well to such a concept.
stevecoh1 wrote:cannot be enlarged, either automatically, or via the "Virtual Media Manager".
Well have you tried the Virtual Media Manager? You can definitely resize the virtual hard drive from there, under its "Attributes" (show the "Properties" if you don't see it). There's a slider there, you can resize the hard disk, but ONLY TO A LARGER SIZE!!! Which cannot be shrunk later! (actually that applies to all methods).

The generic way to increase the size of a virtual hard drive, can be found in "How to resize a Virtual Drive". There's another special procedure for OSX, but you're not on that.

Also, if you have Wine installed on your Linux host, you can use CloneVDI. Much simpler and more "robust" in terms that it doesn't do it's operations on the actual VDI, but on a copy (not that I ever screwed up my disks with the traditional way).

But, you're not going to get away from using GParted, no matter which of the three options you choose. Because it may look to your host as a file, but to your guest it's a full fledged hard disk. And what you're doing by the resizing operation is "cloning" your virtual hard drive to a bigger virtual hard drive. You'll still need to adjust the partition sizes after that. No way around it, even in real life.

To be 100% honest, I don't remember if the Disk Tools in Win7 can handle the resizing or not. After you enlarge the theoretical size of your virtual hard disk, check to see if "Disk Management" can do it. I remember there were some restrictions regarding the System partition, but I can't remember which version of Windows had that...
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.
stevecoh1
Posts: 39
Joined: 6. Mar 2011, 00:10
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP, Windows 7

Re: Supposedly "dynamic" vmdk file does not resize.

Post by stevecoh1 »

Thanks for explaining what Dynamic resizing means. I get it now. I DID try the Virtual Media Manager and it failed with the error code:

Code: Select all

VBOX_E_NOT_SUPPORTED (0x80BB0009)
I think this is because the file I tried to enlarge was a .vmdk file and I read somewhere that that won't work. Meanwhile, I've used VBoxManage to clone a .vdi version of my disk. I think maybe that this will be able to be resized. Is there some way I can tell the VM to USE this new hopefully resizable version of my virtual disk instead of the vmdk version? And I haven't got Wine installed.
Last edited by socratis on 7. May 2018, 22:02, edited 2 times in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Supposedly "dynamic" vmdk file does not resize.

Post by socratis »

Post the output of the command:
  • VBoxManage showmediuminfo "<YourVirtualHardDrive>"
BTW, I hope you don't have any snapshots, 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.
stevecoh1
Posts: 39
Joined: 6. Mar 2011, 00:10
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP, Windows 7

Re: Supposedly "dynamic" vmdk file does not resize.

Post by stevecoh1 »

Thanks.

Code: Select all

$ VBoxManage showmediuminfo windows7-disk2.vmdk 
UUID:           11d9c4da-9862-480f-8641-a95ce4c2ccf6
Parent UUID:    base
State:          locked write
Type:           normal (base)
Location:       /home/scohen/VirtualBox VMs/windows7/windows7-disk2.vmdk
Storage format: VMDK
Format variant: dynamic default
Capacity:       81062 MBytes
Size on disk:   80727 MBytes
Encryption:     disabled
In use by VMs:  windows7 (UUID: 51b7134c-7eb9-42ba-aa98-155730548cf9)
I may have some snapshots but they're of no use to me and I can get rid of them. While I'm walking down this path, I came to the realization that I don't see any reason why I need 80 GB on on this VM, unless some programs are much bigger than I thought. I have 20 years of Turbo Tax records, but I just moved all that to the drive shared with the host, and that only saved me 300MB.
Last edited by socratis on 7. May 2018, 23:06, 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: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Supposedly "dynamic" vmdk file does not resize.

Post by socratis »

stevecoh1 wrote:
State:          locked write
• That VMDK is running. Can't resize while it's running (duh).
• That's a VMDK. Can't do. And you don't have to read it "somewhere", read it in the manual, ch. 8.23 VBoxManage modifymedium, at the "--resize" detail:
8.23 VBoxManage modifymedium wrote:This currently works only for VDI and VHD formats, and only for the dynamically allocated variants, and can only be used to expand (not shrink) the capacity.
As per your other question that I didn't answer before:
stevecoh1 wrote:Is there some way I can tell the VM to USE this new hopefully resizable version of my virtual disk instead of the vmdk version?
You release the VMDK from the VM, you attach the VDI to the VM. Done. You make sure that the VDI is working, you delete the VMDK. Profit! ;)


PS: For housekeeping reasons, it would be best if you re-allocated the VDI to the same path as the VMDK (prior to the detach/attach procedure), so that the whole VM is self-contained. That is if you haven't messed with the defaults...
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.
stevecoh1
Posts: 39
Joined: 6. Mar 2011, 00:10
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP, Windows 7

Re: Supposedly "dynamic" vmdk file does not resize.

Post by stevecoh1 »

Yeah, Obviously, I wasn't trying to resize while it was running. But it was running when I ran that command you requested. I don't suppose all the other data would have changed. When the resize failed, it wasn't running. But we know that was because of VMDK.

As for Release and Attach, I see a Release button in the Virtual Media Manager. But I see no Attach button and the new vdi image doesn't appear in the Virtual Media manager even though I can see it in the directory.
Last edited by socratis on 8. May 2018, 01:08, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Supposedly "dynamic" vmdk file does not resize.

Post by socratis »

I should have given clearer directions...

Go to the VM Settings » Storage » SATA controller (or IDE) » select the HD icon with the VMDK. At the bottom there's a "kind of floppy" icon with a minus sign. Hover over it to read the tooltip. Then remove the VMDK from the HD controller.

Select the HD controller anew, and now select the icon to the left of the previous icond. "kind of floppy" icon with a plus sign. Click and select "Add Hard Disk" » "Choose existing disk". Point it to the VDI. Done...


PS. Can I draw your attention to my signature (at the bottom of each message of mine) for a minute? Thanks...
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.
stevecoh1
Posts: 39
Joined: 6. Mar 2011, 00:10
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP, Windows 7

Re: Supposedly "dynamic" vmdk file does not resize.

Post by stevecoh1 »

.Thanks. You've been very helpful and it seems to work like a charm.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Supposedly "dynamic" vmdk file does not resize.

Post by socratis »

Great! Thanks for the feedback and your comments... ;)
I can close this now I guess with a [Resolved] resolution.
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.
stevecoh1
Posts: 39
Joined: 6. Mar 2011, 00:10
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP, Windows 7

Re: [Resolved] Supposedly "dynamic" vmdk file does not resize.

Post by stevecoh1 »

Sorry, one more question.

So, I switched to VDI and as previously reported, everything worked. Then I enlarged the drive using the virtual media manager, adding about 30GB. But now Windows itself still sees only the 79GB originally available. I started the "Disk Management" utility in Windows and it shows only the 79GB partition. The extra 30GB does not show up, even as free space.

I had, yesterday, gotten rid of some 14 GB (out of 79 GB total) of crap to give myself a little breathing room. So my question is what will happen when I exceed the 79GB limit. Will it automatically resize itself using the new allocation? Or do I need a tool more powerful that Microsoft's Disk Management?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: [Resolved] Supposedly "dynamic" vmdk file does not resize.

Post by socratis »

First of all repeat the:
  • VBoxManage showmediuminfo "windows7-disk2.vmdk"
command so that we can compare the before and after information. Next you should download the GParted latest LiveCD. Boot the VM from that, see what it says.
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.
stevecoh1
Posts: 39
Joined: 6. Mar 2011, 00:10
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP, Windows 7

Re: [Resolved] Supposedly "dynamic" vmdk file does not resize.

Post by stevecoh1 »

I think you meant this (.vdi instead of .vdmk):

Code: Select all

$ VBoxManage showmediuminfo "windows7-disk2.vdi"
UUID:           9baa7d3b-4e7e-4fcf-878f-6e621cc8d8a8
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       /home/scohen/VirtualBox VMs/windows7/windows7-disk2.vdi
Storage format: VDI
Format variant: dynamic default
Capacity:       112045 MBytes
Size on disk:   80899 MBytes
Encryption:     disabled
In use by VMs:  windows7 (UUID: 51b7134c-7eb9-42ba-aa98-155730548cf9)
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: [Resolved] Supposedly "dynamic" vmdk file does not resize.

Post by socratis »

stevecoh1 wrote:I think you meant this (.vdi instead of .vdmk):
But, of course! You converted it!!! :D
It looks fine. The property I was looking for was the "Capacity", which you took from 81062 to 112045 MB (79.16 to 109.41 GB). Now, give it a go with GParted, as described in the FAQ "How to resize a Virtual Drive".

I really don't understand why Win7 can't resize the drive in your case. I'll try it here with a test-clone and see what's going on...
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.
stevecoh1
Posts: 39
Joined: 6. Mar 2011, 00:10
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP, Windows 7

Re: [Resolved] Supposedly "dynamic" vmdk file does not resize.

Post by stevecoh1 »

Hmm. GParted won't let me resize the partition except to add 1 MiB
In this image, only the 79.06GiB shows.  Note the warning icon.
In this image, only the 79.06GiB shows. Note the warning icon.
gparted1.png (79.66 KiB) Viewed 8073 times
Detail view of what GParted sees
Detail view of what GParted sees
gparted2.png (89.04 KiB) Viewed 8073 times
Information about the warning.
Information about the warning.
gparted3.png (120.08 KiB) Viewed 8073 times
I suppose this warning means something but not sure what.
Post Reply