Defrag Tools #163 - Virtual Hard Disk (VHD) - Sysinternals Disk2VHD

Sign in to queue

Description

In this episode of Defrag Tools, Chad Beeder and Andrew Richards discuss Virtual Hard Disk (VHD) files. We first dive into what a VHD is, how you can boot from a VHD by configuring bcdedit settings, and we see how they look in Disk Management. We then use Sysinternals Disk2VHD - a quick and easy way to make a VHD from a Physical drive. We also discuss the Volume Shadow Copy Service.

Additional Resources:
Sysinternals Disk2VHD
Scott Hanselmen - Guide to Installing and Booting off a VHD

Timeline:
[00:00] Building 20 and the Channel 9 Studio
[02:12] bcdedit - Booting from partition (physical disk) - osdevice|device: partition=C:
[04:37] "Choose an operating system" - Physical and Virtual boot devices
[06:48] VHD files - *.vhd and *.vhdx
[07:45] Fixed Size and Dynamic Size (file grows to the specified size with use)
[09:27] Disk Management - diskmgmt.msc or Win-X-K
[10:35] bcdedit - Booting from virtual hard disk - osdevice|device: vhd=[D:]\vhd\win10.vhd
[11:55] Larry Larsen visits (briefly)!
[12:45] Windows 10 lets you open the VHD; mounts to the next drive letter. Use Eject to dismount.
[13:37] Disk Management - look like a normal drive (note the different icon)
[14:37] How to install Windows to a VHD - Scott Hanselmen blog
[15:13] Windows USB/DVD Download Tool
[16:18] Use diskpart or Disk Management to make the VHD file
[16:55] Use diskpart to attach (mount) the VHD file during Setup
[17:55] Why the Boot from VHD approach?
[19:50] Downloading Sysinternals Disk2VHD
[19:50] VHD downside - if they don't get booted often, you need to apply lots of update
[19:50] Windows 7 and 8.1 Convenience Rollups
[23:18] Running Sysinternals Disk2VHD
[25:13] Volume Shadow Copy Service
[28:12] (Andrew: Can't find the article I wrote on bcdedit settings - sorry)
[28:41] Windows XP Mode in Windows 7 -- was just a VHD running virtually
[30:47] Questions? Email us at defragtools@microsoft.com

Embed

Download

The Discussion

  • User profile image
    Magic​Andre1981

    [14:37] How to install Windows to a VHD

     

    this is too ugly. I always comvert the WIM into a VHD with this script Convert-WindowsImage.ps1 (https://gallery.technet.microsoft.com/scriptcenter/Convert-WindowsImageps1-0fe23a8f). Now I add the VHD to boot menu with this Freeware tool: http://neosmart.net/EasyBCD/

     

    [19:50] VHD downside - if they don't get booted often, you need to apply lots of update

    since Win8, DISM can Mount VHDs, so you can Mount them add add the update packages to the VHD without booting it.

  • User profile image
    Allan

    So how do you upgrade an existing Windows 8 booting from a vhdx? I keep getting an error stating something like installing Windows 10 on a vhd is not supported.

  • User profile image
    Jaso

    Hi guys, great show as usual. Also, nice to see Larry make a guest appearance!

    I hope this isn't a stupid question, though I have a small query in relation to licensing. If I create a VHD of my host box (using Disk2VHD) then boot to that machine in it's virtualised state, do I need two licences? I would suspect, yes, though not sure how licensing applies in this context? Thanks again.

  • User profile image
    DonaldA

    Allen,

    I could not update Windows 8 to 8.1 or 8.1 to 10 or even do the Insider previews when booting to .vhd. So I would do the update in Hyper-V.
    It is a lot more work but can be done.

  • User profile image
    DonaldA

    If you have Windows 10 and UEFI then you can use the following shortcut to add to the boot menu:

    Attach .vhd(x), note the drive letter assigned, if D:\,
    then in elevated command prompt enter:   Bcdboot D:\Windows 

    Then reboot.

     

  • User profile image
    DonaldA

    Currently I'm only dual booting Win7 and Win 8.1 on one system and Win10 on another so I have had no problems.
    Are the dangers of dual booting discussed in this article true?
    http://betanews.com/2016/03/03/windows-10-fast-startup

    I would appreciate any help with that.

  • User profile image
    Allan

    Great thanks, I'll try it. It's actually not a big deal, since I'm dual booting it with Windows Server running Hyper-V.

  • User profile image
    ChadBeeder

    @Jaso

    You can look up the license terms for various Microsoft products and licenses here.

    The license terms for Windows 10 retail keys say:

    "Use in a virtualized environment. This license allows you to install only one instance of the software for use on one device, whether that device is physical or virtual. If you want to use the software on more than one virtual device, you must obtain a separate license for each instance."

  • User profile image
    Jaso

    Many thanks for that, Chad. I appreciate your time. I suspect, given that wording, that I can't then, despite being only able to use one instance at any one time. I get the reasoning though, it's just a bit of a downer! Thanks again. Loving the shows - hope you guys can continue making these series for years to come.

  • User profile image
    pcgeek86

    How come upgrading Windows in Native VHD Boot still doesn't work? I've been native VHD booting since Windows 7, and I have to do a fresh rebuild every time. I filed this feedback years ago, but it constantly gets ignored. I'm not going to give up the benefits of Native VHD Boot, but it's a lot of extra work to reboot into another Windows instance, boot up my VM in Hyper-V, perform the upgrade, and then reboot back into the main Windows instance.

    Cheers,
    Trevor Sullivan
    Microsoft MVP: Cloud & Data Center Management

  • User profile image
    Magic​Andre1981

    @pcgeek86: run the VHD in a Hyper-V VM and update the VHD here

Add Your 2 Cents