Showing posts with label DISM. Show all posts
Showing posts with label DISM. Show all posts

Tuesday, September 8, 2015

Enable Boot to VHD with Windows 10

Problem:


I am building out a development environment to run in the office.  I decided to update my vhd builds to windows 10 from Windows 8.1.  The last time I did this was with Imagex.  Things have moved on and now Imagex has been depreciated. The new tool is DISM and is part of the OS starting in Windows 8.

Solution:

  1. In your host OS, Create the VHD with disk management (See Technet article)
  2. Now the command to move the WIM image
    • DISM /Apply-Image /ImageFile:D:\Sources\install.wim /Index:1 /ApplyDir:V:\
      where D is the drive mounted with the windows 10 disk and V: is the vhd mount
  3. Change the boot menu to boot to vhd on your c drive.
    • bcdedit /copy {GUID} /d "New Name"
    • bcdedit /set {GUID} osdevice vhd=[C:]\folder\filename.vhd  
    • bcdedit /set {GUID} device vhd=[C:]\folder\filename.vhd
      • Note: I got tripped up on the exact syntax for bcdedit. The brackets around the drive letter are required. If you leave them off you will get a syntax error.
    • bcdedit /default {current}
    • bcdedit /set description "Windows 10 VHD"


Source:

  1. https://technet.microsoft.com/en-us/windows/dn858566.aspx
  2. http://mythoughtsonit.com/2013/02/dism-exe-replaces-imagex-exe/
  3. http://blogs.technet.com/b/jamesone/archive/2009/05/19/boot-from-vhd-the-joy-of-bcdedit-and-a-nice-hyper-v-gotcha-or-two.aspx

Playing with DISM

I was looking for information on DISM tool since I have not used it before.  I have put on my Sys Admin hat to build out some new development environments.  I found this great article by Brian Lewis.  He explains how to use DISM to  capture your current working drive.  This will enable me to capture my current development image and push it onto a vhd for use by our staff.  Brian is using a usb stick to capture the image. 

Here are the steps that I use:
  1. Boot off of a Windows 8/10 install USB stick (See my post on how to create a USB install stick)
  2. At the install Screen hit <shift> <F10> to start a CMD prompt window
  3. To Capture the C: Drive to an external USB drive
    1. Dism /Capture-Image /ImageFile:d:\my-image.wim /CaptureDir:c:\ /Name:”My Image”
  4. To Restore this Image from the external USB drive
    1. Dism /apply-image /imagefile:d:\my-image.wim /index:1 /ApplyDir:c:\

 Source:

http://mythoughtsonit.com/2013/02/dism-exe-replaces-imagex-exe/