For users who don't want to mess with the command line, I wrote a quick-n-dirty GUI wrapper for vmware-vdiskmanager in the spirit of RDPetruska's VMware DiskManager GUI.
This program allows you to create a new virtual disk, expand an existing virtual disk, or defragment an existing virtual disk.
To expand a disk, you need to shut it down.
Pat
Well how much space would the Mac HD need... I read that windows likes 20% free space... is that the same for the Mac....
PS. I booted from an external drive.. and cannot unmount my internal Mac HD... which I was trying to do for iDefrag...
Wonderful... I went to open my virtual machine after the disk expansion... and it was just a 'resume' state... not a full boot up (I mean it was quick, no time to eat sandwiches.. )... but I thought I remembered shutting down the vm... (I was doing this on my clone on the external which is on a partition bigger than the partition on the internal)...
You might want to see. It may work in that case, but I don't recommend doing that to begin with because the suspend state is based upon the state of a known setup when suspended.
Pat
Well, after deleting most all my programs from the VM on the VD, I still couldn't use vdiskmanager to defrag, ... later when booted to an external clone, I used iDefrag to do a Quick Defrag (on-line, meaning mounted), and then afterwards, I was able to at least start the vdiskmanager defrag... I'm waiting right now to see the results...
For some reason, I can't unmount my internal drive to do the full defrag with iDefrag... and my mac has been running all night (from the external drive)... so I don't know if its spotlight that is stopping me...
To clarify, I'm booted off the external drive, and using vdiskmanager to defrag the virtual machine on the virtual disk on the internal drive. I first had to do a Quick Defrag of the entire internal disk using iDefrag to be able to even to initiate the virtual defrag using vdiskmanager.
I have an unallocated vdisk... and despite the recommended steps.. I couldn't use vdiskmanager prior to using iDefrag... after using iDefrag I was then able to use vdiskmanager. I had already used diskeeper prior to using either... and after using vdiskmanager, another run of using iDefrag didn't do any further defragmenting... but keep in mind that with iDefrag I was only doing the Quick (on-line) Defrag because for some reason I couldn't unmount the Mac HD (when booted from an external drive) to do the Full Defrag..
I do see a continuous chunk of blank space following what appears to be a large red chunk... so I assume this is an area of the yet unallocated vdisk...
There is still a good deal of red space...
For users who don't want to mess with the command
line, I wrote a quick-n-dirty GUI wrapper for
vmware-vdiskmanager in the spirit of RDPetruska's
VMware DiskManager GUI.
This program allows you to create a new virtual disk,
expand an existing virtual disk, or defragment an
existing virtual disk.
Hopefully, this functionality will be incorporated into the next release of fusion! Love the ability to resize without needing to resort to the command line!
vmware-vdiskmanager
I would like to shrink[/b] a virtual disk. How do I do that?
Why would anyone ever wanna do that? Well... when
I created the virtual disk, the host drive had sufficient
space to hold it (if it were to ever fill up). However, by
now two things have happened: first, the host disk is
getting filled up with other stuff, and second, it looks
like I won't be needing as large a virtual disk after all.
Therefore I'd link to shrink the virtual disk, to prevent
the scenario in which it would (fill up and) not fit onto
the host disk -- which kinda gives me the creeps... 😮
Fwiw, the virtual disk in question is stored in 2G files,
most of which haven't reached 2G yet -- so if I'm not
mistaken, then it's of type 1 (vmware-vdiskmanager).
Also, I am capable of shrinking the partition that is in
said virtual disk (or so I believe -- I'd have to defrag it
before using e.g. Partition Magic... but I'm worried that
defragmenting it \[in the VM] will cause all 2G chunks
to be allocated, i.e. I'd run out of host disk space).
I know about the "defrag and then eliminate the zeros, to
shrink the virtual disk" option. However, I was looking for
something else; namely the ability to shrink a virtual disk.
That is, defrag the guest, shrink its partition, and then do
a shrink of the virtual disk.
In essence a reverse of the "grow a virtual disk, then grow
the partition inside it" path.
There is no built-in tool to decrease the maximum size of a virtual disk. You need to manually create a 2nd, smaller disk; attach it to your guest; run a disk imaging utility inside the guest to transfer all the bits to the new disk; then swap the disk (make sure it is active) to be the 1st disk and remove the original disk; if the guest boots successfully, you can then delete the original larger disk.
Hopefully, this functionality will be incorporated
into the next release of fusion! Love the ability to
resize without needing to resort to the command line!
i didn't bother to check the license or usage yet, i believe it's great, but my understanding is this is a community tool and not from VMWARE. is this correct?
Eric, will you be willing to allow VMWARE take this into fusion?
thank again. i'd try it sometime later. --ss
i didn't bother to check the license or usage yet, i
believe it's great, but my understanding is this is a
community tool and not from VMWARE. is this correct?
Yes. This tool was written on my own time using only publicly-available information. VMware does not support this.
Eric, will you be willing to allow VMWARE take this
into fusion?
It'd be fine with me, but the program really doesn't do that much - it's mostly writing a GUI, which you can't exactly cut-and-paste into another program. It'd probably be cleaner/easier/faster for the developers to re-implement it.
You can create a second, smaller disk and copy the data to it. I've used the Ubuntu 7.04 Desktop live CD to do this. Just mount the iso and boot the VM. You can then use gparted to copy partitions over. Remember to mark the boot partition as active. Then remove both disks, and add the new disk as an existing VDisk to the first IDE or SCSI channel.
The other option is a little tougher, and really only suitable if you're shrinking the disk size by about 2GB. The disk needs to be of type 3 (preallocated 2GB files), and you're going to need to manually edit the vmdk file by hand. Finally, you're going to need to do a little math.
At this point you need to ask yourself if it's faster and more feasible to copy the data or allocate and zero all of the empty space in your existing virtual disk. I also don't guarantee that this will work perfectly. I haven't tested to make sure I can write all the way to the end of the virtual disk.
Let me know if you still want to try this method.
Hello etung,
I just tried to expand my vmdisk of Windows2000 from 8GB to 15GB.
Then I couldn't do it and saw the following message,
\----
Using log file /var/tmp//vmware-yoshi/vdiskmanager.log
Failed to expand the disk '/Users/yoshi/VirtualMachines/Windows2000.vmwarevm/Windows2000.vmdk': The file already exists (41).
\----
What does it mean ? And how can I expand my vmdisk ?
Thanks in advance for your help.
hello. this is fantastic tool.
however, i would like to know if this means i can add a secondary virtual hard-drive to my VM? it would be very useful/helpful if that's possible.
The output file can't already exist; e.g. you can't expand in place.
i would like to know if this means i can add
a secondary virtual hard-drive to my VM?
You can, and you don't even need this tool to do it! Make sure the virtual machine is powered off, go under Settings for the virtual machine, and click the plus button in the lower left. Choose to add a new virtual hard drive, enter your settings, and done.
If a snapshot is taken when using a fixed size virtual disc, a new "expandable" disc is created which rapidly becomes highly fragmented on the OS X disc (>6000 fragments per iDefrag in my case). Is there a way to convert the secondary vd to a fixed size to avoid this fragmentation without deleting the snapshot?
I don't think you can do this; at least my 30-second experiment failed. I converted the child disk to preallocated, fixed the parentCID, and pointed the vmx at the new child disk. It failed to power on. I suspect that unlike a sparse disk, a preallocated disk doesn't have information about when to refer back to the parent disk, so you can't use it for a snapshot.