Generate a Factory OS Image

Once you've configured a workspace for the device type you plan on producing images for, use BuildWSKImage to build the image (~15-35 minutes).

Build the image

  1. Start the Windows System Kit Build Environment (example, E:\SetImagGenEnv.cmd) as an administrator.

  2. Update the WSKWorkspaceRoot environment variable to point to the workspace for the image you want to build.

    %WSKWorkspaceRoot%\SetWSKWorkspaceRoot.cmd
    

    Note

    The %WSKWorkspaceRoot% variable that you'll see throughout this lab is automatically set when you run prepwskworkspace. If you close and reopen the Windows System Kit environment, you can set the workspace root by navigating to your workspace folder and running SetWSKWorkspaceRoot.cmd.

  3. Build the image (15-35 minutes). You'll get an .ffu or virtual hard disk file, depending on the workspace you prepared.

    BuildWSKImage %WSKWorkspaceRoot%\FactoryOS_Development_AMD64_UEFI_SpacesGPT_VM.xml
    

    Note

    The name of the .xml file you specify in this step may be different, depending on the options you chose when you created your workspace. You can view the full path and filename of your OEMInput.xml file by running echo %WSKOEMInputFileName from the WSK environment.

By default, the output is be placed in same location as your workspace appended with '.output', for example, if your workspace is in C:\Workspace, the output will be in C:\Workspace.output\FactoryOS_AMD64_UEFI_VM_ValidationImage.vhdx.

Important

If you try to generate an image in the destination folder that already includes an .FFU images or virtual hard disks with the same name, image creation will fail with the following error:

imageapp : ERROR : ThreadId18164 OutputFile C:\FactoryOS.Output\FactoryOS_Development_AMD64_UEFI_SpacesGPT_Hardware.ffu already exists.

Prior to generating an image, either:

  • Specify the Overwrite parameter in your BuildWSKImage command to automatically overwrite an image in the output folder
  • Make sure that your output folder doesn't already contain a generated image of the same name.

BuildWSKImage Syntax

BuildWSKImage [OEMInput] [Destination] [Overwrite]
Parameter Description
OEMInput Optional. Path to your image configuration file.
Destination Optional. Target directory for the output. By default, the script creates a folder besides your WSKWorkspace folder, with ".output" appended to the name.
Overwrite Optional. Overwrites the output file. If you don't specify this parameter and a image file already exists in your output folder, image creation will fail.

Deploy your image