Setup a bootable Validation OS installation

Once you've customized your Validation OS image, you can use it to boot a PC. You can either create and use bootable USB media and run Validation OS from RAM, or apply the image directly to the PC's hard drive. This topic covers how to create bootable Windows PE (WinPE) media that you'll use to either:

  • Apply a Validation OS image onto your device
  • Replace the WinPE boot.wim with the Validation OS image to USB-boot into Validation OS

What you need

To setup your environment to create a bootable Validation OS environment, you'll need a technician PC with:

  • The most recent Windows Assessment and Deployment Kit and Windows PE add-on installed
  • Your customized Validation OS .wim image
  • A USB drive that you'll use:
    • To Create bootable WinPE media
    • To store collateral that you can use during your Validation OS deployment

Create a bootable WinPE drive

Regardless of whether you'll be booting Validation OS from a hard drive or applying the image to your device, you'll need to start by creating a bootable WinPE drive.

Create WinPE working files

The first step in creating bootable WinPE media is to create a working set of Windows PE files on your technician PC.

  1. Make sure your PC has the most recent ADK and ADK Windows PE add-on installed.

  2. Start the Deployment and Imaging Tools Environment as an administrator.

  3. Run copype to create a working copy of the Windows PE files.

    copype amd64 C:\WinPE_amd64
    

Create a bootable Windows PE USB drive

Now that you have a set of working files, you can create your bootable USB drive. You'll use this drive to either boot to Windows PE and apply an image, or as the base for bootable Validation OS media.

  1. Attach a USB drive to your technician PC.

  2. If it's not already open, start the Deployment and Imaging Tools Environment as an administrator.

  3. Run diskpart

    diskpart
    
  4. Use Diskpart to format the USB drive so it has two partitions, one partition formatted as FAT32 and one partitioned NTFS:

    List disk
    select disk X    (where X is your USB drive)
    clean
    create partition primary size=2048
    active
    format fs=FAT32 quick label="WinPE"
    assign letter=P
    create partition primary
    format fs=NTFS quick label="Data"
    assign letter=O
    Exit
    
  5. Use MakeWinPEMedia with the /UFD option to format and install Windows PE to the USB flash drive, specifying the USB key's drive letter:

    MakeWinPEMedia /UFD C:\WinPE_amd64 P:
    

    Where P: is the drive letter of the USB drive that you attached in step 1.

    Warning

    This command reformats the partition.

The bootable Windows PE USB drive is ready. You can use it to either:

  • Boot Validation OS from a USB drive
  • Boot to WinPE to apply a Validation OS to a device's hard drive

Option 1: Boot to Validation OS from a USB drive

Copy Validation OS wim to the USB drive

  1. Replace the WinPE boot.wim on the WinPE bootable USB drive with the ValidationOS.wim from the Validation OS ISO.

    xcopy ValidationOS.wim d:\boot\sources
    
  2. Delete the WinPE boot.wim and rename ValidationOS.wim to boot.wim.

    del d:\boot\sources\boot.wim
    ren d:\boot\sources\ValidationOS.wim boot.wim
    

Now that you've created bootable Validation OS media, you can use it to boot your PC.

  1. Insert the bootable media into the PC you want to boot.
  2. Turn on the PC.
  3. Press the key or key combination that will bring up the boot menu. This key or key combination is different depending on your PC manufacturers.
  4. From the boot menu, select the bootable USB PE media.

Option 2: Apply a Validation OS image to a PC

Boot to WinPE

Now that you've created bootable Windows PE media, you can use it to boot your PC.

  1. Insert the media into the PC you want to boot.
  2. Turn on the PC.
  3. Press the key or key combination that will bring up the boot menu. This key or key combination is different depending on your PC manufacturers.
  4. From the boot menu, select the bootable Windows PE media.

Your PC will boot into Windows PE.

Copy collateral

  1. Copy your customized Validation OS image to the WinPE drive

  2. Copy the following text into Notepad and save it to the root of your WinPE USB drive as diskpart-vos.txt.

    rem == CreatePartitions-UEFI-FFU.txt ==
    rem == These commands are used with DiskPart to
    rem    create partitions
    rem    for a UEFI/GPT-based PC.
    rem    Adjust the disk number if
    rem    you're not working with Disk 0 ==
    select disk 0
    clean
    convert gpt
    rem == 1. System partition =========================
    create partition efi size=246
    format quick fs=fat32 label="System"
    assign letter="S"
    rem == 2. Microsoft Reserved (MSR) partition =======
    create partition msr size=16
    rem == 3. Windows partition ========================
    rem ==    a. Create the Windows partition ==========
    create partition primary 
    rem ==    c. Prepare the Windows partition ========= 
    format quick fs=ntfs label="Windows"
    assign letter="W"
    list volume
    exit
    

Apply your image

  1. Before you can apply the Validation OS image to your PC, you'll have to format its hard drive. We'll use the diskpart script we created above. From the WinPE command line:

    Warning

    This will erase any data that's on the PC's hard drive. Prior to running this command, make sure the PC doesn't have anything you need on it.

    diskpart /s d:\diskpart-vos.txt
    
  2. Apply the Validation OS image:

    dism /Apply-Image /ImageFile:ValidationOS.wim /Index:1 /ApplyDir:W:\
    
  3. Create a boot entry for Validation OS:

    bcdboot w:\windows /s S: /f ALL
    
  4. Type Exit and press Enter to reboot your PC. When the PC reboots, you'll see the Validation OS Command prompt.