Howto clone a virtual machine with resizing the disk

Posted on 2007-10-07
Last Modified: 2012-08-13
Initially i created the C: partition for a XP-Pro virtual machine with 5GB.
After installing a lot of service packs this partition is running out of space.
Therefore i would like to clone this virtual machine with larger disk / partitions but default cloning procedure creates same size of disk.
I had an idea with booting vitual machine from DVD (Acronis True Image) and take images of the partitions but virtual machine just boot from virtual disk and not from DVD.
Any suggestions?
Thanks in advance
Question by:sahl04
    LVL 14

    Assisted Solution

    Well, there's probably a much better way of doing this, but it'll get the job done . . .

    Add yourself a secondary disc of the size you want to the VM's configuration.
    Add the cloned VHD to the VM configuration as well.  It should look something like this:
    IDE 0:0 -- Original VHD
    IDE 0:1 -- Cloned VHD
    IDE 1:0 -- Virtual CD-ROM
    IDE 1:1 -- New VHD of the size you want.

    With those settings, fire up the VM and go to to Disk Manager.

    Partition and format the new drive.  Assign it whatever drive letter you want.  It doesn't matter.

    RIGHT-click on the new volume and hit "Mark Active".  This will make it bootable.

    Once that's done, open up the cloned drive.  Simply select everything on the drive (make sure you are showing hidden/system files) and copy/paste it to the new volume.  Make sure you are copying from the cloned volume, not the boot volume since Windows has many of the files locked.

    Shut down the system and reconfigure your VM.  Remove the original and cloned volumes from the config, leaving only the new volume as IDE 0:0.

    I know -- it's pain in the arse, but it has worked for me in the past.
    LVL 4

    Accepted Solution

    You could try the following from the command line:
    C:\Program Files\VMware\VMware Workstation>vmware-vdiskmanager.exe -r <sou
    rcedisk.vmdk> -t 1 -s <20Gb> <newdisk.vmdk>

    This will copy <sourcedisk.vmdk> to <newdisk.vmdk> of the size you specify in <> i.e. 20Gb and it will be of the type - growable, pre-allocated in 2Gb files (you can use -t 0, but I prefer -t 1 as I can then access my VM's over the network).

    Once the copy is complete, you should be able to add the newdisk and remove the sourcedisk

    Let us know how you go.

    Author Comment


    I tried

    "P:\Program Files (x86)\VMware\VMware Workstation\vmware-vdiskmanager.exe" -r wwspga01.vmdk -t 3 -s 22Gb wwspga01-0.vmdk

    and - oh wonder - the new virtual disk is exactly the same size as the origin.

    Not so funny

    Author Comment


    may work generally but i have a lot of problems copying the files to the new disk. There are file corruptions and too long filenames while copying.

    Any other idea?

    Author Comment

    Hi all,

    i tried following workaround but it does not work also.

    Created a virtual disk of 22 GB
    Boot virtual machine from CD-ROM with Acronis true image 10 home.
    Clone origin virtual disk to new virtual disk with proportional partition growth.
    All partitions did grow but the one i want to grow (C:\) has still 5 GB size!?!?
    LVL 2

    Assisted Solution

    You my friend just need the right tools......

    Do a search for gparted and find an ISO called gparted-livecd-0.3.4-5.iso or greater and build your CD from that image. Now boot your VM from this cd and resize your partitions as you see fit. Just a precaution, try it on a COPY or test VM prior to using it on production. I have only used this tool once myself, to expand a C: from 5gb to 15gb and it worked like a charm.  Not many tools will allow you to resize system partitions.  


    Author Comment


    Major problem resolved.
    The corrupted filesystem of drive C: was the reason why the cloned partition did not grow.
    After running "chkdsk /f" cloning the virtual drive with "acronis true image home" works fine
    with the target partition size of 10GB.

    I don't know how to handle the points. I think all hints would work with the uncorrupted filesystem.



    Expert Comment

    I recommend you Acronis Disk Director, it's work fantastic.

    Expert Comment

    Try vhd resizer. it worked like charm for me when i had to export my physical machine having basic disks to xen server.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    A list of useful business intelligence software.
    Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
    This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
    The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now