Virtual Hard Disk - Create and Attach VHD

How to Create and Attach a Virtual Hard Disk in Windows 7

   Information
A Virtual Hard Disk is a created VHD file on your hard drive that acts as a separate hard drive disk in Computer. This will show you how to create and attach (mount), or only attach (mount) an existing, a VHD in Windows 7.

Special thanks to Steven (dmex) for pointing out this new feature in Windows 7.

   Tip
You can also use a VHD file created from such programs as Windows Virtual PC.

   Warning
The VHD is only attached for the current session. When you restart the computer, any attached VHD files you have will no longer be attached and appear in Computer. You will have to reattach any VHD file to have it display back in the Computer window again until the next restart.

If you disable the Disk Defragmenter service, then you will get the error below when you try to do anything in Disk Management. If you get this error, then make sure that the Disk Defragmenter service is set to only Manual.

Error.jpg


EXAMPLE: New Virtual Hard Disk (VHD) in Computer
Computer.jpg
Here's How:
1. Open the Control Panel (icons view).
A) Click on the Administrative Tools icon, and click on Computer Management.

B) Go to step 3.
OR

2. Open the Start Menu.
A) In the Search box, type compmgmt.msc and press Enter.
3. If prompted by UAC, click on Yes, then do either step 4 or 5 below.

4. To Attach an Existing VHD File
NOTE: This is for a detached VHD file that you had already created in step 5 below, or from an existing VHD file.
A) In the left pane, right click on Disk Management, and click on Attach VHD. (See screenshot below)
NOTE: You can also click on Disk Management, Action on the menu bar, and Attach VHD.
Attach-1.jpg
B) Click on the Browse button. (See screenshot below)
Attach-2.jpg
C) Navigate to the VHD file location and select it, then click on the Open button. (See screenshot below)
Attach-3.jpg
D) If you want the VHD to be read-only, then check the box, otherwise leave it unchecked. Click on OK. (See screenshot below)
Attach-4.jpg
E) If the existing VHD file is unallocated, go to step 6. (See screenshot below step 6A)
WARNING: Be sure to create a backup copy of the VHD file first to be safe in case of data loss.

F) If the existing VHD file is allocated, go to step 8. (See screenshot below step 8)
5. To Create and Attach a New Virtual Hard Disk (VHD file)
A) In the left pane, right click on Disk Management, and click on Create VHD. (See screenshot below)
NOTE: You can also click on Disk Management, Action on the menu bar, and Create VHD.
Create-1.jpg
B) Click on the Browse button. (See screenshot below)
Create-2.jpg
C) Navigate to the location you would like to store the new VHD file, type in a name for the VHD file, and click on Save. (See screenshot below)
Create-3.jpg
D) Type in the maximum size you want the Virtual Hard Disk to be, and select the size to be MB, GB, or TB (1024 MB = 1 GB, 1024 GB = 1 TB). (See screenshot below)

E) Select (dot) if you want the new VHD size to be Dynamic or Fixed, and click on OK. (See screenshot below)
Create-4.jpg

F) Continue to step 6.
6. To Initialize the Virtual Hard Disk
A) Right click on the new unallocated VHD Disk # and click on Initialize Disk. (See screenshot below)
Disk_Management-1.jpg
B) Select (check) the Disk # from above for the new VHD. Select (dot) if you want the new VHD to have a MBR (Master Boot Record) or GPT (GUID Partition Table) partition, and click on OK. (See screenshot below)
Initialize.jpg
C) Continue to step 7.
7. To Create a New Simple Volume in the VHD
A) Right click on the new unallocated VHD and click on New Simple Volume. (See screenshot below)
Disk_Management-2.jpg
B) Click on the Next button. (See screenshot below)
New_Simple_Volume-1.jpg
C) Type in how much of the maximum disk space (step 5D) you want for the size of this VHD partition, and click on Next. (See screenshot below)
NOTE: If you do not use the maximum space, then you will have a second unallocated VHD partition left with the remaining available disk space.
New_Simple_Volume-2.jpg
D) Select the file system (NTFS or FAT32) you want the VHD partition to be. (See screenshot below)

E) Type in a name for the VHD to be displayed in Computer. (See screenshot below)

F) Check the Perform a quick format box, and click on Next. (See screenshot below)
New_Simple_Volume-3.jpg
G) Click on the Finish button. (See screenshot below)
New_Simple_Volume-4.jpg
8. The VHD is now attached and ready to access like a HDD. (see screenshot below)
Disk_Management-3.jpg
That's it,
Shawn







 
Last edited:
You're out of luck until you purchase yourself a legal genuine Windows 7.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
Evening Brink! I wonder if you can help.

I've got a VHD that mounts at startup

kACHp3A.png


It's got my documents, pictures, and lots of portable apps.

It's also got some some shortcuts (for navigation), that accompany Quick Launch on the Start Menu

8AhUZKg.png


The problem is with shortcuts in Quick Launch etc that point to stuff on the mounted volume.

When it's good (like above) it's looks like the Quick Launch dir, as it should

EN4ptAj.png


...

Lately (since today, upgrading Sandboxie) it's got "Bad Cache Syndrome", re objects on the VHD that are pointed to from Quick Launch, ie

jvgmPaB.png


No biggy, just a quick Restart (kill and re-spawn) Explorer (courtest of a desktop context menu entry, thanks again to Brink!)

wzeJqBA.png


But this "fix" doesn't work anymore. It has no effect.

This is when I discovered your icon cache fix guide (and nearly posted there). A quick effective command I found that I believe achieves the same effect (without needing to restart) is

ie4uinit.exe -ClearIconCache

I wondered what you thought, whether it's worth trying to get the volume mounted before the shell loads or the user logs in, for example, or just whether adding a "automatic delayed operation" to clear the iconcache every time I login is the way to go.... or if I have to give up on my "shared area" being so handy between the native VHD's I boot into.

As always, many thanks Mr. Brink. You've helped lots of folks over the years... big thumbs up!
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Dell
OS
Windows 7 Ultimate 64bit
CPU
2.2
Memory
8Gb
Graphics Card(s)
NVIDIA
Screen Resolution
1280/762
Mouse
built in pad || iphone || MS wireless
Internet Speed
100MB
Antivirus
Avast
Browser
Chrome, Chrome portable
Hello Jonny,

It's certainly worth a try to rebuild the icon cache to see if it something that simple may work first.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
Thanks. The problem re-occurs each login. I think the restart explorer option does work, you just need to wait a moment before doing it. IE, it's annoying, but not a show-stopper :D
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Dell
OS
Windows 7 Ultimate 64bit
CPU
2.2
Memory
8Gb
Graphics Card(s)
NVIDIA
Screen Resolution
1280/762
Mouse
built in pad || iphone || MS wireless
Internet Speed
100MB
Antivirus
Avast
Browser
Chrome, Chrome portable
Back
Top