How-To Geek
How to Create a Virtual Hard Drive in Windows 7
Have you ever wished you had an extra Hard Disk to store files, share, or set aside as an encrypted vault? One of the new features in Windows 7 is the ability to create Virtual Hard Disks and we’ll show you how.
Create a Virtual Drive
This process creates virtual disks in the .VHD format where the minimum size is 3MB. To begin, Right-click on My Computer and select to Manage. Alternately you can type diskmgmt.msc into the Start search box and enter.
The Computer Management screen opens click on Disk Management then Action and Create VHD.

Browse to the directory you want the disk to reside, choose the size you want it to be, and select dynamic or a fixed. If you want the disk to expand in size as you add files to it, then pick Dynamically expanding. Check Fixed size if you want a specific size and for it to stay that way.

In Disk Management you will see the virtual drive listed as unallocated space.

To begin using it you’ll need to Right-click and select Initialize Disk.

In the initialize disk box just keep MBR selected and hit OK.


Create a Volume
Now it is time to create a volume by Right-clicking the unallocated space and select New Simple Volume.

The New Simple Volume Wizard starts up and it’s just a matter of completing it.

Choose the amount of space you want to use for the volume.

Assign it a dive letter that is not currently being used.

Format the new volume as NTFS, FAT32, or FAT. Check if you want a quick format and file compression.

The wizard is complete, click on Finish.

If you have AutoPlay enabled it should pop up for you to open up your new virtual hard disk.

It will be listed with the other disks in Disk Management.

Of course you will also see it listen under My Computer.


This is a cool new feature that will let you use the disk as you would any type of real disk. You can encrypt it, share it out to other systems, store files to it…however you would use an extra disk connected to your system.

This is a cool new feature in Windows 7 that will add extra functionality and options to your current system. There are several ways you can use your VHD including making it bootable. If you have used your geek imagination and have come up with unique ways to use a VHD, leave a comment to tell us about it.
Got Feedback? Join the discussion at discuss.howtogeek.com
Comments (71)
Programmer by day, geek by night, The Geek, also known as Lowell Heddings, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on Google+ if you'd like.
- Published 10/22/09




Great tip :-)
Thank you
I’m confused: what would happen if it were bootable? In reality, it’s just another file that lives within the file system of the OS, right? How would the BIOS know to use it?
i’m guessing bootable in a virtual machine? vhd has been the native virtual pc format for a few years now
here’s a microsoft page about it:
http://technet.microsoft.com/en-us/virtualserver/bb676673.aspx
I am confused. Why would I want this for a single machine? I can understand the ability to copy and reuse the VHD on other boxes but other than that I see no benefit. What am I missing?
Richard, I’ve got several virtual machines on my work machine, and I can see how being able to create a drive, write whatever data I want to it, and then unmount it so it can be used by a virtual machine would be a great tool (or vice-versa).
Still don’t see what good it is to mark it bootable, but whatever.
Full volume encryption is not a new concept – I’m using it right now. There is a custom boot loader involved, which only knows to ask for a passphrase – everything else is encrypted. Search for “volume encryption” and you’ll find the products offering it. I’m using BCVE as it’s got the best features (supports RAID5) and so far has been incredibly robust.
Otherwise, you don’t see good reasons for VHD? Security. Store your documents, pictures, etc, there. If someone steals your computer, they’ll have to enter a password to see the encrypted partition.
Artem
You can edit the BCD to boot the VHD. A way to test out another os without borking your 7 installl.
A reason could be so can run Xp and try windows 7 as I did or vice versa.
Thanks alot for the help, only had the jist of the idea, but with your help not a problem.
Just a quick question however, how would I enable the drive to run automatically? I had a little trouble there.
Cheers
Hello all,
I just created a virtual hard drive on my laptop but now that I have made it, I am wondering, how do I remove it? Is it as simple as deleting the .vhd file? I figured I’d ask before I tried it…
Thanks for any help you can provide!
Nice tutorial! I think Do you think I can use this Virtual Drive as a recovery drive? Using your tutorials:
1. How to Create a Virtual Hard Drive in Windows 7
2. Make the VHD bootable:
a. Diskpart, list disk, select disk 1 (VHD), clean, create partition primary, select parition 1, active, format fs=fat32, assign, exit
3. How to Create a System Image in Windows 7
a. create a system image and place on the VHD
b. create a system repair disc (just for the repair disc files)
c. xcopy all the repair disc files to the VHD
4. Choose boot device at startup (F12)?
Just wondering… Thanks! :D
What is the real point if creating a VHD? I don’t get it. Can somebody please help.
One of the advantages is when trying to back up your hard drive to a smaller one.
First you create a VHD the same size of the original hard drive you want to back up then clone it to the VHD.
Second, reduce the VHD partition size to the one of the smaller HD and clone it to the smaller HD.
Am I right?
There are many reasons to create a VHD on a single machine. As Mos pointed out, you can use the VHD as a portable storage location that can be easily backed up with a single file and transportable to any machine that has Virtual PC or Windows 7. In addition, with the encryption capabilities your files are safe to transport without worry of someone else accessing them. Think of having a large amount of client or sensitive digital material that need to be transported from one computer to another. This would be a perfect transport medium.
I’m wondering if you could create the VHD on a 8 or 16 gig flash drive.
Hi…
I Followed the same steps given, it is created VHD .But,,,after restart it is disappearing…
I’ve seen the same issue with secondary drives on virtual machines. The secondary drive needs to be reactivated. Not sure why, but I keep loosing my secondary drive..
BTW, Undo disks is not enabled.
I have my windows 7 ultimate and cant find the Create VHD when i press the Action tab, pls help :(
nvermind.
btw. what location should i select? im running windows 7 ultimate
To Koi: First select Storage and Disk Manager in the left pane (as shown on the 2nd picture in the article) then you will found it. If you need further help pls send me an e-mail.
Very helpful, thanks.
VHD’s become “unattached” to my second hard drive after shutdown also.??????????
I followed the instructions to the T and after reboot the virtual Drive disappeared? How do I reclaim the disk space allocated or reinstate the Virtual Drive??? Please Help!!!
OK Figure it out.. ;-}
I followed instuctions, but can not create virtula.hdr file. computer error: the pathname for virtual disk must be fully qualified. I am running windows 7 ultimate. what am I doing wrong.
Another idea for the use of my dropbox I guess. keeping all my college files secure. there is probably plenty of easier ways of doing this, but yeah. I’ve just realised I set the hard drive as 20 gig. thus, useless on dropbox. epic fail, much.
nevermind, it’s now at 2 gig. As long as I can allocate the drive on the other pc, i think I’m good to go.
Pretty simple and direct. I was able to create my virtual drive within 10 minutes. Thank you very much.
Thanks allot dear …. very great tip thanks again!
Why do we need so bad VHD to create I do not see the point every one talk the same most people delete or have problem I think is good for laptop not for desktop I use Win 7 Ultimate I want to able press F8 boot-up my computer with drivers if my computer crash Microsoft should give lesson or post video to people not every one are smart none of you ask or come to this page.
The best answer you found at wikipedia type vhd will tell you all
gr8 man:)
cool:):):)
I want to increase harddisk size but not to use the existing harddisk space .. Do anyone have any idea to increase the size of my harddisk
I’m using Win 7 Home so it doesn’t allow network backups. Following this tutorial I created a VHD on a network share and voilà I can backup to this “drive” brillant. Thanks for this Tutorial.
Something you can do with a virtual drive is rip the image of a game CD (eg xbox) and load it on the virtual drive. You can then play the game without the CD. If the game requires more than one, KoTOR for example has four I believe, you can make separate drives and load each image in a separate drive and play without using any CD’s!
Something else I would like to try but have not yet is to make a virtual drive and use ReadyBoost to add it to the RAM memory. Theoretically, I should be able to reach the max useable RAM for Windows 7. Does anyone know if this would work?
nevermind, I realized that the hard drive is not nearly as fast as real RAM memory..
* edit, to load images you need a virtual CD drive, not hard drive, sorry
okay, how do I get my virtual drive to show up after re-booting?
Question: if one were running an applicaiton with tens of thousands of records wouldn’t it run faster with the data on a vitual hard drive rather than an acutal one?
Could you backup your computer on this Virtual Hard drive and then restore it from the hard drive if needed?
Hey guys..I’m having a problem with my window 7 VHD..
I did not create it, but it was on my D:/ already
now it’s eating up all my space..178GB
which means I can barely use my D:
but I don’t know what would happened if I delete the VHD?
Would all my stuff be gone or something??
Really need help…
and Thanks
haha
I love how no one is addressing the problem that the drive disappears after reboot.
It happens on mine too can’t do a darned thing to stop it disappearing. If anyone knows how – drop me a line please!
go to computer management after reboot and go to disk management. click on action then click on attach VHD. hit browse then look for the place where you saved the the vhd file for example in your C: etc the file should be (something).vhd if you haven’t kept this file then whatever u saved on that drive will have been deleted also keep sure that u don’t tick the read only box as u will not be able to make changes to the drive. hope this helps
Hi,
I used the above instructions to create virtual drive in Win 7, Worked Great. However, I cannot locate the virtualdrive wizard that was supposed to be attached. How do I locate it? Any help will be appreciated. Thanks, Nick
Thanks a lot. Very helpful.
The drive disappears after reboot ?
how can i solve this probleme
thanks
i solve the problem
Hi Appu, John Graves, D Confused, Matthew, anj, & eng adel,
Yes, I was also confused about, that the VHD drive disappearad after a reboot, but I was wrong! The VHD did not disappear in fact, it was only disactivated after the reboot. So after the restart, the VHD must only be mounted (activated) again. This mounting can be done from the GUI inself, but can also be done using cmd command as follows:
(Note, that the part between ” ” is my personally chosen drive, folder, and name of file. The extension .vhd is compulsory though.)
C:\User\MyName>diskpart (press enter)
DISKPART> set vdisk file=”I:\VM\Virtual_disk.vhd” (press enter)
DISKPART> attach vdisk (press enter)
DISKPART>exit (press enter)
Note, now the VHD has appeared again, and will be hidden, when you reboot again.
I hope, that somebody of the text above can properly express a batch- file, that will startup after reboot.
My idea with my VHD was at first to store my pagefile (virtual memory) on the VHD-drive, but it appeared not possible, unfortunately!
Cheers,
sweidre
I use it on my laptop as a DVD ROM, insted of buying external DVD ROM. Some applications will only work or only install from DVD/CD ROM
Install VHD on laptop.
Share you DVD ROM on another PC. Copy content from another PC to laptop VHD. Then run or install software.
I have maked a HVD on my laptop. I jst red this information after that i followed the same way finally i got success.. Thanks alot…
I have maked a VHD on my laptop. I jst red this information after that i followed the same way finally i got success.. Thanks alot…
After running Win98 for 11 years so that I could run QBasic OS & programs in a Window, I finally caved in and now have Win7. If I create a VHD can I just install QB45 in that and will it communicate with the printer? Or do I need to download a VirtualBox of which, confusingly, there appear to be many? I would be grateful for any advice.
I tried to create a vhd, on my windows 7, an i gt an error msg, Vhds are only supported on NTFS volumes, and must b both uncompressed and unencrypted, idk if im over ooking sumthing really obvious or am i out of space, i hve never messed with a vhd, wld greatly appriciate the help.
When i create it! When i reboot my computer they dissapere! HELP!!
Help I have the same problem: I have created a VHD and saved some fies on it and now its gone and i cant find it!! please help me :(((((
for the boot – disspapear VHD, this is how to address it.
go to services
locate Virtual Disk
click Properties
on the General Tab change the Startup Type to Automatic and make sure the Services Status is Started
I did it but nothing happend :((( @adrian
What’s the use of encrypting the VHD when i can access it any time i want
“What’s the use of encrypting the VHD when i can access it any time i want”
You answered your own question in your question..sort of.
You can access it anytime you want.. No one else, unless of course they are logged into your computer.
Worked awesome :)
I had XP on my computer until it crashed and I was unable to recover ANY data on the HD. I now have Win7 but I want to try and restore all my drivers and software for XP to see if I can get it running the way it was before the 7 install. Could I do that with a virtual drive? Can I install XP on the virtual drive and boot from it?
I just installed a 40GB SSD and made it a virtual drive… does anyone know if “ReadyBoost” would significantly increase performance or is there a better way of doing this???
Please Help!!!
I am trying to run a 32-bit program on a 64-bit system. will this work? or do I need to do somthing else.
The programs are LOTUS123 & gwbasic to start with.
32-bit programs generally work natively on a 64-bit operating system without the need for any modification. If you’re experiencing errors running 32bit software though, try using corflags to force the application to run in 32bit mode.
http://msdn.microsoft.com/en-us/library/ms164699%28v=vs.80%29.aspx
how do i encrypt it
Quick and simple while really useful. I really appreciate it.
Thank you!
What if I do not assign a drive letter, what happens to the virtual drive?
if you do not assign a drive letter or path you will not beable to access the drive. You can create a folder on your c drive and leave it empty and assign the vhd to that folder. When i create a backup of my computer on an internal disk i remove the drive letter and leave no path. this serves the purpose of keeping it less prone to attack.
thanks
I wanted to creat a seperate drive so I don’t have to use FM2012 dvd everytime I want to play the game.
Am I able to then put a copy of the game within a new VHD wihtout having to use the original?
Thanks
thanks it works…….
how to create a virtual CD?