Custom Windows 8.1 Image – Part 6

[This is Part 6 of 7]

Check out other parts:

Final steps on the ADK Machine

Now that you have the captured image (MyImage.wim) on the USB, I found it useful to mount the image, do couple of things, and then unmount it again.

Tip: Why this is important to mount the image, do things and unmounts it again? Well, I encountered a problem last year that when I deployed my custom image to end users, the installation wizard prompt me for a license key!! And sometimes the whole installation wizard exit with an error. After opening a case with Microsoft, the solution was to mount the image, inject something called Global Volume License Key GVLK to the image wim file, and then unmount it. This is needed because I know that my clients will activate using my internal KMS or Active Directory (using the new AD activation method) and we need to inject a publicly available key to the windows file to tell it not to prompt for a license key during the installation as it shall connect to KMS or AD for activation. This is why the following step is important.


Now, let us get back to the ADK Machine and review the folder structure again. On the C drive of the ADK Machine, we have created the following folder structure under the C:\ drive:

  • Downloads  [contains the ADK Installation files]
  • Software\Windows 8.1 Installation [contains the Windows 8.1 original installation files]
  • Workplace
    • Mount
    • ImageWorkplace

Remember also, that on the ADK Machine, we have created a Virtual Machine Snapshot after installing the ADK Tools on it.

Now, let us do the following on the ADK Machine:

  • Copy the Windows 8.1 installation files from C:\Software\Windows 8.1 Installation to C:\Worlplace\ImageWorkplace
  • Copy the MyImage.wim that we have generated from the Reference Machine to C:\ drive of the ADK Machine.
  • Rename C:\MyImage.wim on the ADK Machine to install.wim.
  • Replace C:\Worlplace\ImageWorkplace\sources\install.wim with C:\install.wim
  • Go to Start and run Deployment and Imaging Tools Environment CMD as an Administrator and type:

Dism /mount-image /imagefile:C:\Workplace\ImageWorkPlace\sources\install.wim /index:1 /mountdir:C:\WorkPlace\Mount

  • Browse to C:\WorkPlace\Mount and you can see the expanded files here.
  • If you plan to activate Windows 8.1 in your environment using KMS or Active Directory Activation, then you have to inject a Global Volume License Key to the image. Choose one of the licensing key that match your needs from here In my case, I will be using the Windows 8.1 Enterprise key, so while in the Deployment and Imaging Tools Environment CMD , I will run:

Dism /image:C:\Workplace\Mount /Get-CurrentEdition /Set-ProductKey:MHF9N-XY6XB-WVXMC-BTDCT-MKKG7

Tip: You can get a list of the metro apps on your image, by running:Dism.exe /Image:C:\WorkPlace\Mount /Get-Provisionedappxpackages ,and you can remove any metro app package by running:Dism.exe /Image:C:\WorkPlace\mount /Remove-Provisionedappxpackage /PackageName:XXX, where XXX is the Package name you get from the Get-Provisionedappxpackages.

  • Now let us unmount the image and commit changes by running:

Dism /unmount-image /mountdir:C:\Mount /commit

Tip: If you face any problem in mounting and unmounting the image, revert the ADK Machine to the snapshot that we took before which is a clean ADK Machine with ADK Tools installed. I ran into situation while mounting and unmounting images over and over again on the ADK Machine and getting errors about unmounting operation failing because some open files or so. Reverting the machine to a clean snapshot solves the issue everytime.

  • Now, to create an ISO image, run
    Oscdimg -u2  -m  -b“C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\” C:\Worlplace\ImageWorkplace  C:\MyImage.iso

    Note: There is space after the -b switch.

  • Now, you got an ISO file named MyImage.ISO on the root drive of the ADK Machine!. Congrats.

Check out my YouTube Windows 8 Advertisement 2 minute Video :

8 comments on “Custom Windows 8.1 Image – Part 6

  1. Pingback: Custom Windows 8.1 Image – Part 2 | Ammar Hasayen - Blog

  2. Pingback: Custom Windows 8.1 Image – Part 1 | Ammar Hasayen - Blog

  3. Pingback: Custom Windows 8.1 Image – Part 3 | Ammar Hasayen - Blog

  4. Pingback: Custom Windows 8.1 Image – Part 4 | Ammar Hasayen - Blog

  5. Pingback: Custom Windows 8.1 Image – Part 5 | Ammar Hasayen - Blog

  6. Pingback: Custom Windows 8.1 Image – Part 7 | Ammar Hasayen - Blog

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s