Capture your new laptop as a custom ISO with users and programs

Discussion in 'Windows OS and Software' started by slimmolG, Jan 13, 2018.

  1. slimmolG

    slimmolG Notebook Consultant

    Likes Received:
    Trophy Points:
    What if you wanted to capture your brand new laptop as a custom bootable Windows 10 ISO already preset with your user settings and pre-installed software?

    I performed this capture as an experiment while writing crib notes for accuracy, then fleshed them out further so a computer novice friend (and nearly anybody who can type and click) could follow along. The guide was validated using Windows 10 Pro v1703 on my EVOC Clevo P650HS-G, and some steps include USB-->USB transfers since my laptop is an offline machine. The ISO creation protocol works for Pro and Home, but Hyper-V is not included and can't be installed in Win10-Home; free alternative hypervisors exist.

    You can go from a power up, to a custom.ISO, to validating your custom.ISO on your laptop in a virtual machine in less than an hour, not including download times. All without allowing your new laptop on the internet... as long as you have a second computer and USB drive :)

    Download this guide as a text file:
    Fix Control Center Application error in VM

    Phase 1
    Get your laptop out of the shipping box, power it up, and install Macrium Reflect free edition; no, seriously, do this. Follow the guide by @Phoenix (but don't move any libraries, folders, etc.) and save an MRIMG or two on an external device or two.

    Phase 2
    Create a custom ISO with your user settings and pre-installed software.
    ** It's nowhere near as long or complicated as it looks **

    Build Process:
    A) Setup drive(s), apply labels, make folders
    B) Download/extract Windows ISO template
    C) Create bootable WinPE flash drive
    D) Download/install ADK Deployment Tool
    E) Clean partition
    F) Create custom install.wim
    G) Replace downloaded ISO install.wim
    H) Create new bootable custom.ISO

    Test Process:
    I) Enable/setup Hyper-V
    J) Install/run custom.ISO in the VM
    K) Boot/install custom.ISO on your SSD

    Phase 3
    L) Teleport back to the start using the initial Macrium MRIMG files

    Capture your new laptop as a custom.ISO
    Your laptop and a flash drive,
    An Official Windows 10 v1703+ ISO,
    The Windows Deployment tools (free from MS).​
    Your complete Windows installation must be 100% on a single partition or it fails.​

    Phase 1
    *) Save a couple Macrium Reflect MRIMG backups

    Phase 2
    A- Setup or partition source machine drives
    - partition your primary SSD
    - and keep your 2nd SSD as a safe storage reserve​
    1) Press Win + R
    2) type "diskmgmt.msc", hit enter
    Right-click D: (your 2nd drive)
    select "Change Drive Letter..."
    select "Change"
    assign letter "E" or higher, OK.​
    Right click E:, select properties,
    label E: as Drive2, Storage, or whatever​
    Right-click on C:, select "Shrink Volume"
    Reduce the volume of C: by >=65GB
    ideally ~split volume, e.g. 500-->200/300​
    Right-click new Unallocated box graphic
    select New Simple Volume
    specify size >=65GB = shrink amount
    assign drive letter D:
    Label volume as "Data", finish wizard.​
    Right-click C:, select properties
    Label C: as "Windows"​
    Label all other drives at this point for clarity.​
    3) Exit disk manager
    4) On Data(D:)
    Create a folder named "Scratch"
    Create a folder named "Iso_files"
    Create a folder named "Hyper-V"​
    5) Restart your laptop.

    * Alternatively, use two drives for the setup
    - It's a little faster. That's it.​
    1) Letter and label SSDs as Windows(C:) and Data(D:)
    Right-click drives in Windows Explorer
    click properties, type in the names​
    2) Label other drives now for clarity
    3) On Data(D:)
    Create a folder named "Scratch"
    Create a folder named "Iso_files"
    Create a folder named "Hyper-V"​

    B- Download/extract Win10 ISO for the custom build template
    -Match your download to your installed OS version​
    1) Download ISO from
    (alternatively, use the download tool at​
    Select Win10 version from drop-down list
    e.g. Win10 1703 CU Download>Standard​
    Scroll down, select language/version:
    select the English, x64 link on farthest right
    =Win10_1703_English_x64.iso (4,232,730 kb)​
    You can verify this download via MD5, SHA1, SHA256 checksums:
    Download>install HashCalc (or HashMyFiles, etc.)
    Browse to Win10 ISO in Data box
    Click Calculate, wait 1.5-2 min for sums​


    Win10 ISO CRC/MD5/SHA1/256 checksum dump:
    use browser search to easily find all three calculated sums.

    Microsoft SHA1 Hash Archive:
    you can query using the calculated SHA1 sum

    2) Save downloaded ISO to USB, move to the source laptop
    Copy ISO to Data(D:)​
    3) Mount the moved ISO by double clicking
    4) Copy all of the files to D:\Iso_files
    note that the folder D:\Iso_files\Sources now exists​
    5) Unmount the ISO by Right-click>Eject
    The official ISO file isn't used later, but keep it handy.​

    C- Create bootable Win10PE from the Win10 1703+ ISO
    1) Quick-format a small flash drive (even 0.5 GB is fine)
    Right-click, select format>Quick-format>start​
    2) Browse to D:\Iso_files
    3) Copy all of the contents EXCEPT the "sources" folder to the USB drive
    4) Create a folder named "sources" on the USB drive
    5) Browse to D:\Iso-files\sources and find "boot.wim"
    6) Copy "boot.wim" to your empty USB "sources" folder
    = Finished!
    = drive has 0.32 GB of files​
    7) Label the USB WinPE drive
    Right-click, select Rename = DISM-W10PE
    - serves as reminder of the build method.
    - DISKPART and DISM work, that's all you need.​

    * Nothing stops you from using the remainder of your flash drive.
    * Make a folder called "Other files" and use it!​

    D- Install Windows Deployment Tools feature
    1) Download Windows Assessment and Deployment Kit (ADK) for Windows 10
    - URL is in my downloads section
    - direct install is more time/data efficient (see note below)​
    2) Match the ADK version to your Windows version, e.g. use ADK 1703 for a Win 1703
    Perhaps unnecessary, but logical​
    3) Download and run the installer file
    Select download for use on another machine
    Opt out of Microsoft data collection
    Save toolkit (3.05 GB) to USB drive​
    4) Move USB drive to source computer
    5) Run ADK setup file
    Click through screens, Opt out of data collection
    Select ONLY the necessary Deployment Tools feature (67.5 MB)
    Click Install
    - Windows may not find the .msi file:
    - Browse to /Windows Kits/10/ADK/Installers if asked​
    6) Restart laptop
    -Finalizes all of the changes made so far.​

    ** Direct Install Note:
    If your custom.ISO source machine is allowed on the internet:
    a) Run the installer
    b) Unselect everything except for the Deployment Tools
    c) Directly install only the Deployment Tools feature
    d) Restart​

    E- Clean source machine partition using Extended Disk Cleanup
    -Clean up a little, a lot, or everything as you prefer.
    -follow below for the "new laptop ISO"​
    1) Open an elevated command prompt
    Press Win+X > Powershell (Admin)
    type "cmd", hit enter​
    2) Run the following command:
    "cmd.exe /c cleanmgr /sageset:1 & cleanmgr /sagerun:1"
    - the exact sage# isn't important as long as they match​
    3) Don't close the command window yet
    4) Select everything in the cleanup options popup window EXCEPT:
    :the 'green arrow' Windows update/upgrade files
    (the 'green arrow' files should go into the custom.ISO)
    * Note: "sagesets" won't cleanup Windows setup files (e.g. ~BT, etc.)
    To fully clean up after an upgrade, or install in the VM:
    type "cleanmgr /autoclean", hit enter​
    5) Clean recent files history
    In File Explorer:
    click File tab > select "Change folder and search options"
    click the "Clear" button under Privacy
    close File Explorer​

    * STOP clicking things!
    * Your system is ready for imaging!
    * Turn off your laptop.
    F- Create custom install.wim file
    1) Boot source machine using DISM-W10PE from step-B (or other WinPE)
    Plug in USB stick, reboot while hitting F7
    Choose USB drive from the options​
    2) Press Shift+F10 at Language/Time/Currency Screen to open command prompt
    type "diskpart", hit enter
    type "list vol", hit enter
    Inspect the list and note volume letters:
    -letters ~may vary, but labels are static
    -use the volume letters showing labels for:
    Windows = source drive to copy from
    Data = drive location to save .wim file​
    type "exit", hit enter to exit diskpart (but not cmd)​
    3) Enter the following command to create the .wim file:
    Exact characters and spacing! No brackets!​

    [dism /capture-image /imagefile:D:\install.wim /CaptureDir:C:\ /ScratchDir:D:\scratch /name:"W10Pro-slimmolG" /Description:"EVOCp650,W10P plus user, noMods" /compress:maximum /checkintegrity /verify /bootable]

    -The Deployment Tool information displays
    -The cursor blinks for 30 seconds
    -The Saving Image information displays​

    **custom install.wim (~10GB) is created in 9.5-10.0 minutes​

    4) After .wim file creation, exit cmd window
    5) Close Install Media window
    click Yes to cancel install and allow reboot​
    6) Verify your captured source system info:
    Press Win+X > Powershell (Admin)
    Enter the below command without brackets:​
    [dism /get-wiminfo /wimfile:"d:\install.wim" /Index:1]

    Capture Command Notes:
    /imagefile:D:\install.wim = save location drive letter and file info
    /capturedir:C:\ = Windows source drive letter info
    /ScratchDir:D:\Scratch = drive\folder location to let dism find Scratch space
    /name:"Anyname" = Necessary argument, but the actual name isn't important. It labels the image created in .wim
    /Description:"YourChoice" = Optional argument; can omit whole segment, but adding a descriptive comment helps identify the final ISO.

    G- Replace downloaded ISO install.wim with custom version
    1) Browse to your custom install.wim on Data(D:)
    2) Copy your custom install.wim to the Sources folder in ISO_files (D:\Iso_files\Sources)
    - This will replace the original install.wim from the downloaded ISO​
    3) Rename your backup copy of D:\install.wim to "FactoryFresh-install.wim"
    - Note that it must be changed back to install.wim to reuse​

    H- Create the bootable custom.ISO
    1) Run Deployment and Imaging Tools from ADK as an administrator
    On the start menu, find Windows Kits/Deployment and Imaging Tools
    Right-click>More>Run as Administrator​
    2) Type "cd\" and hit enter to shorten the long path
    3) Run the following command:
    Exact characters and spacing! No brackets!​

    [oscdimg.exe -m -o -u2 -udfver102 -bootdata:2#p0,e,bd:\iso_files\boot\,e,bd:\iso_files\efi\microsoft\boot\efisys.bin d:\iso_files d:\sweetnewfile.iso]

    *sweetnewfile.ISO is made in ~1 minute
    -BIOS bootable via the [] bootdata.
    -UEFI bootable via the [efisys.bin] bootdata.​

    d:\iso_files = REPLACE all three instances if your copied official ISO files are elsewhere.
    You now have:
    A) custom.ISO file on D:\
    B) custom.wim file on D:\
    C) extracted official ISO files in D:\Iso_files
    D) an empty folder at D:\Scratch
    E) a still empty folder at D:\Hyper-V

    Test your custom.ISO for functionality
    I- Enable Hyper-V virtual machine manager
    -perform after step-B to include Hyper-V in your ISO​
    1) Run Powershell as administrator
    Press Win+X, click on the admin link​
    2) Type the following command at the prompt:
    "Enable-WindowsOptionalFeature -Online -FeatureName:Microsoft-Hyper-V -All"
    A few, then more circles appear, then it finishes​
    3) Enter Y to allow reboot
    Windows integrates Hyper-V, updates settings, auto-reboots​

    *Note: Win10-Home does not include Hyper-V. Use 3rd-party hypervisor.​

    J- Create/start virtual machine running custom.ISO
    1) Open Hyper-V Manager via start menu
    2) Adjust Server settings:
    Select 'desktop' under Manager in left panel
    Click Hyper-V Settings in upper right Actions panel
    Ensure Enhanced Session Modes are enabled:
    :in the new upper Server panel
    :in the new lower User panel​
    3) Add new virtual machine
    Right-click the server node (the little 'desktop' again)
    Select New>Virtual Machine
    Store location change to D:\Hyper-V
    Assign startup memory= 4,096 MB (8,192 MB is better, if laptop has 16GB)
    **Unselect Dynamic memory option**​
    Networking=not connected
    Create VHDx, size=45 GB
    *~10 GB ISO expands to ~27 GB in VHDx
    * WinSetup balks at 35 GB and recommends 44 GB
    (Enhanced Sessions Mode has some virtual bulk)​
    Install OS from ISO:
    Browse to your sweetnewfile.ISO​
    Click Finish.​
    4) Adjust VM settings
    Right-click VirtMach01, select Settings
    In Security panel, uncheck Secure Boot option
    In Integration Services panel, add check to Guest Services
    In Checkpoints panel, set to Standard​
    click Apply, and OK to close window​
    5) Run virtual machine
    Double-click VirtMach01 to open VMconnect window
    click "Start" within window
    When asked, press a KEY to boot.
    If text is a little fuzzy, adjust VMconnect View>Zoom​
    6) Install Windows (this will install your custom version)
    Select languages, etc., hit next, hit Install Now
    Select "I don't have a product key"
    Select CustomInstall, Next, etc.
    ~5 minutes of installation until restart notice appears
    customized Win10 starts in a 4:3 VMconnect window
    The VMconnect resolution+resources dialogue box now appears...​

    DO NOT immediately click the Connect button.
    Let installation initialize devices>get ready>Login screen.
    or simply let the installation auto-signin>desktop.​
    NOW select Show Options at the bottom of the connect dialogue
    check "Save my settings..."​
    click CONNECT
    VMconnect flashes>resizes>restarts>login screen.
    Sign-in to your new prepared virtual machine
    VM install notes:
    * If you forgot to uncheck Dynamic memory, auto-restart will fail.
    If you allocated a tiny amount of memory, the same...
    but, you can manually Turn off VMconnect at blue screen and Restart VM.​

    * If you immediately Connect when you see the 'resolution' dialogue
    you will have blue screen Remote Desktop Services problems​

    * After ~0-1.5 minutes a Control Center Application dialogue pops up
    Just okay it, and ignore. It's an irrelevant "HotKey in VM" issue.
    7) Create a checkpoint for your virtual machine
    Click Action>Checkpoint on the VMconnect toolbar
    - a checkpoint will appear in the Hyper-V manager​
    Why are checkpoints useful?
    1st: Checkpoint>make changes>install programs>etc.>Checkpoint2
    2nd: Now Right-click>Apply to switch between two checkpoints in seconds (yes, seconds)​

    * If you StartMenu>Restart your guest OS (i.e "in the window"), you will see RDS error upon restart
    * If you Shut Down via the VMconnect menu it will be fine:
    The initial "good resolution" VMconnect shuts down.
    VMconnect flashes.
    4:3 VMconnect window shuts down OS, goes to black.​
    You now have:
    A version of your new laptop, running on your new laptop!
    Feel free to poke around in the guest OS (i.e. the custom.ISO installed in Hyper-V), your physical laptop system is safe from all your poking. Enable/disable whatever you like, surf the registry, finally get around to deleting that pesky system32 folder...

    K- Install your custom.ISO on your source machine SSD
    * Warning for partitioned drives:
    * If you imaged C=full disk, and then decided to partition, reinstall still restores C=full disk.
    * Therefore, ensure novel partitions are backed up externally.​

    1) Your custom.ISO is already bootable!
    Grab and quick-format a flash drive
    Right-click, select format
    default=NTFS, 4,096 bytes, Quick Format​
    Double-click sweetnewfile.ISO on (D:) to mount it
    Copy all of the contents to the USB drive
    = Finished.​
    Reboot while hitting F7
    Install your custom Windows10​
    Alternate method using Rufus:
    Download Rufus onto a flash drive, transfer it to Data(D:)
    Open Rufus, point it to your sweetnewfile.ISO
    -See the Rufus guide by @Phoenix for more info​
    Skip these notes if you can partition without trouble, and already have a Win10 ISO and WinPE USB drive.

    My primary drive initially couldn't be split due to a system restore file sitting right in the middle of C:
    -Resolved by disabling Restore
    -Remove hibernation now too if you don't use it.
    1) Disable System Restore:
    Control Panel>System>System Protection
    click "Configure" button
    click radio button to Disable sys prot.​
    2) Disable Hibernation
    Press Win+R for command prompt
    type "powercfg /h OFF", hit enter
    Note: no confirmation is given.​
    3) Trim SSD
    Press Win+X > PowerShell (Admin)
    type "Optimize-Volume -DriveLetter C -ReTrim -Verbose"​

    There are a several ways to get your Win10 ISO from Microsoft:

    1) Option 1- Use the ISO downloading tool from
    Download the tool and run the .exe, install isn't needed.
    Select your ISO from many download options.​

    2) Option 2- Download directly from Microsoft
    Your download choice will be selected by Microsoft
    Go to the Windows ISO download page
    Download what Microsoft lets you, i.e. 1709 right now​

    3) Option 3- Download preferred ISO from a list of choices
    Go to the Windows ISO download page
    *Change the User Agent String in Chrome/Opera by:
    opening developer tools = ctrl+shift+i
    click "3-dot" drop down box within developer tools
    select More Tools>Network Conditions
    uncheck Select Automatically
    Select a "custom" non-windows choice like Linux, Mac​
    refresh browser to reload current webpage
    Current page reloads as a Linux/Mac/etc machine page
    Choose from new options on webpage and download​
    *Closing the webpage restores automatic detection.
    *Calculate/record/check the hashes if you like​
    4) Save downloaded ISO to USB, move to the source laptop
    Copy to Data(D:)​
    5) Mount the downloaded ISO by double clicking
    6) Copy all of the files to D:\Iso_files
    7) Unmount the ISO by Right-click>Eject
    The official ISO isn't used later, but keep it handy.​

    There are several alternative methods to obtain an "official" WinPE via:
    -Use your full ADK download from step-D
    -Direct download of Windows Install Media
    -Use WinPE implemented in a Macrium Reflect rescue disk​

    >If you download the full ADK suite you can make an "official" WinPE10"
    1) Open ADK setup as in step-D and install WinPE feature
    2) Quick-format a USB drive
    Right-click, select format>Quick-format>start​
    3) Run Deployment and Imaging Tools from ADK as an administrator
    On the start menu, find Windows Kits/Deployment and Imaging Tools
    Right-click>More>Run as Administrator
    type "copype amd64 D:\WinPE_amd64", hit enter​
    4) Identify your USB drive letter
    type "diskpart", hit enter
    type "list vol", hit enter
    -note the letter of your USB drive
    type exit​
    5) Create the WinPE USB drive
    * Replace "F:" with your USB drive volume letter if different!
    type "MakeWinPEMedia /UFD D:\WinPE_amd64 F:"
    hit enter
    Type "Y" to proceed with format.
    Program displays:
    Setting the boot code on F:
    Copying files to F:...
    6) Your flash drive is now:
    :labeled as WinPE
    :populated with 266 MB of files​

    >Re-download the entire WinPE dataset from Microsoft:
    1) Download the Windows 10 media creation tool
    2) Right-click, Run As Administrator
    Choose 64-bit
    Create installation media for another PC​
    3) Insert USB flash drive
    4) Select media choice of "USB Flash Drive"
    Flash drive now has lots of files (3.55 GB)...​

    >Make and use a Macrium Reflect rescue disk
    1) Click "Other Tasks" on the file menu
    select "Rescue Disk"
    follow wizard...​
    2) While booting to the MR rescue disk you MUST:
    - NOT CLOSE the MR application, or your computer restarts!
    - minimize the MR application
    - use the command prompt for DISKPART/DISM​
    Links current as of 01/2018​
    (*)This guide on pastebin:
    (*) Download the free version of Macrium Reflect 7
    (B) Download Windows Assessment and Deployment Kit (ADK) for Windows 10
    (C) Download Win10 1703
    (C) Download HashCalc
    (C) Win10 ISO CRC/MD5/SHA1/256 checksum dump:
    (D) Download Windows 10 Media Creation tool

    Microsoft's DISM command-line options/explanations

    Microsoft's Oscdimg command-line options/explanations

    The following two tutorials provide in-depth coverage of specific aspects of this guide, with additional info for actually building the ISO within a VM. Both tutorials contain DISM/Ocsdimg command line examples for comparison.

    EchoRelay's Final Thoughts from IT tutorial:

    Kari Finn's TenForums tutorial:
    Phase 3:
    L- Use your MR rescue disk to run MR in WinPE
    * Warning for partitioned drives:
    * Your pre-partioning MRIMG of C=full disk, will restore C=full disk,
    * therefore, ensure any novel partitions are backed up externally​

    1) Pop in your Macrium Reflect rescue disk from Phase 1
    Follow the guide by @Phoenix to refresh your memory​
    2) Browse to your MRIMG file
    3) Bam! Experiment over... You're back at the start!

    Lather, rinse, repeat as desired.

    And good luck Dave, your hour starts... now!
    Edit: Dave made it in 1.25 hr but blamed it on the "anti-intuitive' effects of too many energy drinks (sure... lol)
    Last edited: Jan 18, 2018
    Vasudev and hmscott like this.
  2. hmscott

    hmscott Notebook Nobel Laureate

    Likes Received:
    Trophy Points:
    I have been making multi-boot OS laptops and desktops / servers - with any bootable partition being usable as host or guest. And, this includes taking snapshots of configuration I've built so I can support them away from the datacenter.

    It's tough enough to get the average user to do a full metal backup of a drive / set of partitions to be able to restore back to it, going several steps further allowing them to boot into it as VM's as you (apparently) and I do, seems a bit to much to hope for.

    Since I do Linux / VM's professionally, I don't provide help or assistance publicly.

    So, I hope you can stick with this and help support people past the hiccup's and conceptual steps to success, as I think it's the way to go moving forward, even for individuals. :)
    Last edited: Jan 13, 2018
    Vasudev likes this.
  3. slimmolG

    slimmolG Notebook Consultant

    Likes Received:
    Trophy Points:
    Yes, I was surprised how useful it can be to run in a VM. It took a lot of trial and error troubleshooting, but once I figured out the RDS error issues and RAM provisioning problems it was a snap!

    Last edited: Jan 19, 2018
    Vasudev likes this.
  4. slimmolG

    slimmolG Notebook Consultant

    Likes Received:
    Trophy Points:
    Fix Control Center Application error in VM

    Running your new custom.ISO in a Hyper-V virtual machine produces a "System needs to be restarted again for Control Center Application" dialogue box ~1.5 minutes after you see the guest desktop. Don't worry, the ISO is fine and the issue will not appear when installing to an SSD.
    The simple solution = Click okay. That's it.

    That new popular spelling for "Information" is popping up everywhere:

    The actual solution = Turn off HotKeyTray in Task Manager:
    Note this isn't permanent, and it will revert when you turn off the VM (unless you click to save a checkpoint first, so just click it... why not?)

    1) Win+X>select Task Manager
    click More Details in the lower left​
    2) Select Startup tab
    3) Right-click HKeyTray(5) and disable
    -one setting disables all HK subheading components​
    -the guest OS is fine without HotKey​
    4) Save a checkpoint.

    * The host machine Task Manager will show HKeyTray(32 bit), Hotkey Filter Clipboard Service, HotKey service(32bit), and ComboKeyTray(32bit) are running, but the guest OS doesn't run HKeyTray(32bit) or the ComboKeyTray(32bit).
    * The host TaskManager entry for HkeyTray has 5 subheadings under the startup tab: two for ComboKeyTray, one for GetSMBIOS, one for HKeyTray, and one for HkeyTray2. The guest Task Manager will only show entries for HKeyTray and HKeyTray2.

Share This Page