VHD can be used for many different purposes. For example, in this article I explained how to expand Windows 8 tablet or ultrabook storage by adding folders on a removable Micro SD cards to Windows Libraries.
One limitation of Windows VHD implementation is that there is no option to automatically mount VHD image on system startup. Luckily this can be easily achieved via vdisk utility and Scheduled Tasks.
- Create a plain text file with following text:
select vdisk file="D:\VirtualDisk.vhd"
D:\Virtual Disk.vhd - path to your VHD disk image
E - drive letter you want to your VHD drive to be mounted to.
- Save the file somewhere on your system. i.e. C:\cripts\Attach VHD.txt
- Launch Windows Task Scheduler > Actions > Create Task
- Configurre the new task:
- General Tab
- Provide Name and optionally Description
- Check - Run whether user is logged on or not
- Check - Run with highest privileges
- Triggers Tab
- Add new trigger "At Startup". Leave other options as they are.
- Actions Tab
- Add New action
- Action: Start a program
- Program/script: diskpart
- Add arguments: /s "C:\Scripts\Attach VHD.txt"
Where: "C:\Scripts\Attach VHD.txt" - path to the text file you saved in step 2.
- Conditions Tab
- Remove checkbox from "Start the task only if the computer is on AC power"
- If required modify other options and click OK.
- Provide your Windows credentials if prompted.
Now your VHD disk should be mounted automatically every time the computer boots. You can test if mounting works by un-mounting your VHD image and running the task manually.