Sin Min 的个人资料Sin Min's Spaces照片日志列表更多 工具 帮助
9月24日

Booting Up Windows 7 From VHD

Recently I took some time and installed Windows 7 Ultimate into a VHD (yes, a virtual hard disk!) on my Windows 7 netbook. To my surprise, it runs quite smoothly on the 2GB RAM netbook until after a while, I forgot that I was booting from a VHD and not a physical disk. I think the idea of booting from VHD is perfect for me especially when I need to test out new stuff (beta, CTPs, etc.) without worrying to much on the restoration/ clean up later (imagine if I were to do this on my daily use Windows 7) since everything gets written into the VHD file now. Yeah well, I can always use a VM (virtual machine) to do the same thing, but then it will be a virtualized environment. Hey, did I mention the Windows 7 running in the VHD on my netbook is NOT a virtualized environment? Feel free to try out the steps below to get your Windows 7 boot from a VHD as well.

1. Boot up your system with a Windows 7 installation media
2. At the Install Windows screen, press "Shift-F10" to bring up the command line window
3. Enter diskpart
4. Create a new VHD with the following command, change the 20000 to the maximum size in Megabytes you wish to allocate
   create vdisk file="C:\win7vhd.vhd" type=expandable maximum=20000
5. Select and attach the new VHD with the following commands
   select vidisk file="C:\win7vhd.vhd"
   attach vdisk
6. Proceed with the usual Windows setup process and you should be able to see the newly created VHD appearing as a drive. However, ignore the warning "Windows cannot install to this disk" though.