How do I increase disk space on drive C of a Windows Server virtual machine?

Direct answer

Revised 4/2/2011 to add merge change instructions link and link to simple way to do this using diskpart. I documented the process at: How To Expand and Extend To Increase Capacity On A Virtual Hard Disk The Easy and Fast Way–Solve the problem of “Out of Disk Space on Drive C” Forever Note… this is […]

Revised 4/2/2011 to add merge change instructions link and link to simple way to do this using diskpart. I documented the process at: How To Expand and Extend To Increase Capacity On A Virtual Hard Disk The Easy and Fast Way–Solve the problem of “Out of Disk Space on Drive C” Forever

Note… this is much, much easier with Server 2008 and higher

Smile

I finished working on an easier way to do this that does not require SCVMM. This easier way to increase capacity was documented at: How To Expand and Extend To Increase Capacity On A Virtual Hard Disk The Easy and Fast Way–Solve the problem of “Out of Disk Space on Drive C” Forever. Thanks to all that asked me to do this

Smile

There are two parts to this problem. The first is making the VHD larger. The second is expanding the boot partition to use all the new space. In this example, I am actually going to use features built into Windows Server 2008 to extend the volume of my Windows Server 2003 Boot partition by simply attaching it to the server as a data disk, doing the work on it then reattaching it to the 2003 server.

Part I – Making the VHD Larger

The first part is pretty easy using System Center Virtual Machine Manager. Since SCVMM uses PowerShell for everything, you can do this with PowerShell but I did not do the leg work to come up with the specific commands. Here is what you would need to do with SCVMM.

[

image

](http://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-65-88-metablogapi/7183.image_5F00_5B4A178F.png)

Now login to the server and open disk manager. You will see that you have successfully made the VHD capacity larger by adding unallocated space to the end of it.

[

image

](http://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-65-88-metablogapi/2072.image_5F00_78DBF28E.png)

Part II – Extending The Boot Volume To Use The Full Larger VHD Unallocated Capacity

Since this is a boot volume I am really limited on what I can do with it. I can Convert the Basic disk to Dynamic Disk but this would not solve my problem because you cannot extend the volume of an OS drive.

NOTE: Best practices for using dynamic disks on Windows Server 2003-based computers, DiskPart cannot be used in my case because this is a boot volume. If it is not a boot volume you can use DiskPart. To do this you would follow 325590 (http://support.microsoft.com/kb/325590/ ) How to use Diskpart.exe to extend a data volume in Windows Server 2003, in Windows XP, and in Windows 2000. You cannot extend the partition of an OS disk using diskpart so I am going to attach my boot disk to another server that has extend capabilities.

The only way I could figure out how to pull this off (without third party tools) is to mount the VHD on a windows Server 2008 or later machine and just extend it there. However, snapshots are a problem so you can only do this with a single VHD without any snapshots.

CAUTION: This is NOT supported so proceed at your own RISK. To do this:

Add an additional disk to an existing Windows Server 2008 or 2008 R2 machine, use the VHD you want to expand. Make sure you attach it to an IDE controller (not SCSI)

[

image

](http://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-65-88-metablogapi/1016.image_5F00_089B8793.png)

[

image

](http://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-65-88-metablogapi/2084.image_5F00_65F74917.png)

[

image

](http://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-65-88-metablogapi/2821.image_5F00_187AA68A.png)

[

image

](http://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-65-88-metablogapi/2402.image_5F00_41A23EC8.png)

[

image

](http://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-65-88-metablogapi/1732.image_5F00_5476C272.png)

[

image

](http://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-65-88-metablogapi/4555.image_5F00_44F3B0A3.png)

Smile

)

[

image

](http://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-65-88-metablogapi/3414.image_5F00_426A7EE5.png)

[

image

](http://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-65-88-metablogapi/8284.image_5F00_191336E7.png)

[

image

](http://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-65-88-metablogapi/2450.image_5F00_371144DB.png)

[

image

](http://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-65-88-metablogapi/1263.image_5F00_5BC25C52.png)

This took many hours to write so I hope someone finds it useful!

If anyone knows the PowerShell commands to extend the volume, please post to a comment. Thanks

If you like this post, please contact me on Twitter @ITProGuru or send me an email at http://ITProGuru.com/contact.aspx to let me know. To keep from missing other posts, make sure you add an RSS tomy blog.

IT Pro, VMM, Windows Server 2008, Virtual Machine Manager, Virtualization, IT Manager, System Center, How To, IT Management, Windows Server, SCVMM, VHD, Windows Server 2003, Dan Stolts, Step-By-Step, Fix

Dan Stolts

Founder and Chief AI Officer of Just In Time AI, with an IT career that began in 1988 -- nearly four decades of experience. Over a decade of that career went into building ITProGuru into a 250,000-uniques/mo IT-community resource, and he now applies the same teach-first approach to AI systems that run real businesses. Full profile →