User Tools

Site Tools


diskimagescript-usage

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
diskimagescript-usage [2014/08/21 18:39]
anashwan Created wiki page for the Windows diskimage creation PowerShell script.
diskimagescript-usage [2014/08/26 19:14]
anashwan Updated Wiki
Line 2: Line 2:
 # Using the Diskimage-Builder PowerShell script # Using the Diskimage-Builder PowerShell script
  
-This page thoroughly documents the use of [this](https://github.com/slokesh184/windows-diskimage-builder/blob/master/windows-diskimage-builder/diskimagebuilder.ps1) PowerShell script to obtain valid _vdh/qcow2_ Windows disks from an installation _.iso_ image.+This page thoroughly documents the use of [this](https://github.com/slokesh184/windows-diskimage-builder/blob/master/windows-diskimage-builder/diskimagebuilder.ps1) PowerShell script to obtain valid _vdh/vhdx/qcow2_ Windows disks from an installation _.iso_ image.
  
 ## Prerequisites: ## Prerequisites:
Line 56: Line 56:
 ``` ```
  
-### Creating a _.vhd_:+### Creating a _.vhd_ or _.vhdx_: 
 + 
 +* **Note**: For _.vhdx_ output, simply provide a VHDFile name with the _.vhdx_ extension.
 ``` ```
 PS> cd $HOME\windows-diskimage-builder\windows-diskimage-builder PS> cd $HOME\windows-diskimage-builder\windows-diskimage-builder
Line 69: Line 71:
 ### Creating a _.qcow2_: ### Creating a _.qcow2_:
 ``` ```
-PS> .\diskimagebuilder.ps1 -SourceFile $wimfilePath -VHDFile $HOME\resultingDiskImage.vhd -VHDSize 16 -OutputFormat qcow2+PS> .\diskimagebuilder.ps1 -SourceFile $wimfilePath -VHDFile $HOME\resultingDiskImage.vhd -VHDSize 16 -OutputFormat qcow2 -VirtIOPath C:\Absolute\Path\To\VirtIO.iso
 ``` ```
 * **Notes:** * **Notes:**
 +  * If operating on _qcow2_'s; applyiong the drivers from the VirtIO _.iso_ is **absolutely necessary**
   * Even when creating a _.qcow2_, the name of the resulting file **must have the .vhd extension**, lest _DiskPart_ will fail at processing it.   * Even when creating a _.qcow2_, the name of the resulting file **must have the .vhd extension**, lest _DiskPart_ will fail at processing it.
   * After the execution of the script, the result will indeed be a _.qcow2_ as the script puts the proper extension towards the end of its execution.   * After the execution of the script, the result will indeed be a _.qcow2_ as the script puts the proper extension towards the end of its execution.
Line 83: Line 86:
 ## Script parameters and options: ## Script parameters and options:
  
-* -SourceFile C:\Path\To\Wim\File.wim+* **-SourceFile** C:\Path\To\Wim\File.wim
   * absolute path to the .wim file which will be used as input.   * absolute path to the .wim file which will be used as input.
-* -VHDFile C:\Path\To\Output\File.vhd+* **-VHDFile** C:\Path\To\Output\File.vhd
   * absolute path to the script's output file;   * absolute path to the script's output file;
   * must have the .vhd extension initially, even when creating a _qcow2_.   * must have the .vhd extension initially, even when creating a _qcow2_.
   * if _qcow2_ is selected, output's extention is changed to ".qcow2" automatically.   * if _qcow2_ is selected, output's extention is changed to ".qcow2" automatically.
   * represents the **exact** path to the output file, **which must NOT exist beforehand**.   * represents the **exact** path to the output file, **which must NOT exist beforehand**.
-* -VHDSize 16+* **-VHDSize** 16
   * maximum size in GB of the resulting vhd/qcow2 image   * maximum size in GB of the resulting vhd/qcow2 image
   * for most Windows installations, I reccommend at the very least 12, prefferably 16.   * for most Windows installations, I reccommend at the very least 12, prefferably 16.
   * all output disks are resizeable, so initial size of output may be a lot less than this value.   * all output disks are resizeable, so initial size of output may be a lot less than this value.
-* -CloudbaseInitMsiUrl http://someplace.net/someothercloudbaseinit.msi+* **-CloudbaseInitMsiUrl** http://someplace.net/someothercloudbaseinit.msi
   * link to the CloudBaseInit.msi that is to be added to the image.   * link to the CloudBaseInit.msi that is to be added to the image.
   * default is http://www.cloudbase.it/downloads/CloudbaseInitSetup_Beta.msi   * default is http://www.cloudbase.it/downloads/CloudbaseInitSetup_Beta.msi
   * the .msi together with a .cmd to execute it are put in the resulting disk under Disk:\Windows\Setup\Scripts   * the .msi together with a .cmd to execute it are put in the resulting disk under Disk:\Windows\Setup\Scripts
-* -UnattendedPath C:\Absolute\Path\To\Unattended.xml+* **-UnattendedPath** C:\Absolute\Path\To\Unattended.xml
   * path to the .xml file which is to be used in unattended mode.   * path to the .xml file which is to be used in unattended mode.
   * default is the Unattended.mxl that can be found right beside the script.   * default is the Unattended.mxl that can be found right beside the script.
   * the .xml file is placed directly in the root directory of the created image.   * the .xml file is placed directly in the root directory of the created image.
-* -DriversPath+* **-DriversPath** C:\Absolute\Path\To\Drivers\Folder
   * path to a folder containing drivers that are to be added to the disk.   * path to a folder containing drivers that are to be added to the disk.
   * default is none, in which case no additional drivers will be added to the disk image.   * default is none, in which case no additional drivers will be added to the disk image.
-* -VirtIOPath C:\Absolute\Path\To\VirtIO.iso+* **-VirtIOPath** C:\Absolute\Path\To\VirtIO.iso
   * path to a VirtIO _.iso_ from which VirtIO drivers mean to be installed.   * path to a VirtIO _.iso_ from which VirtIO drivers mean to be installed.
   * default is none, in which case no additional drivers will be installed to the disk image.   * default is none, in which case no additional drivers will be installed to the disk image.
-* -Feature feature+* **-Feature feature**
   * feature to be enabled in the final disk image (ex: TFTP, IIS-WebServer, etc...)   * feature to be enabled in the final disk image (ex: TFTP, IIS-WebServer, etc...)
   * this script only specifically enables one feature per image, the default being none.   * this script only specifically enables one feature per image, the default being none.
   * the feature are enabled in the image by _DISM.exe_, for a full list of features, please review [this webpage](http://blogs.technet.com/b/joscon/archive/2010/08/26/adding-features-with-dism.aspx).   * the feature are enabled in the image by _DISM.exe_, for a full list of features, please review [this webpage](http://blogs.technet.com/b/joscon/archive/2010/08/26/adding-features-with-dism.aspx).
-* -DiskLayout UEFI+* **-DiskLayout** UEFI
   * the layout of the resulting disk, used if booting the disk in UEFI mode is desired.   * the layout of the resulting disk, used if booting the disk in UEFI mode is desired.
   * default value is BIOS.   * default value is BIOS.
-* -Index 3+* **-Index** 3
   * index of the _.wim_ supplied as input, if applicable.   * index of the _.wim_ supplied as input, if applicable.
   * default value is 1 and it will work in the vast majority of cases.   * default value is 1 and it will work in the vast majority of cases.
-* -SerialBaudRate 8400+* **-SerialBaudRate** 8400
   * baudrate of the serial port that is to be added to the disk.   * baudrate of the serial port that is to be added to the disk.
   * default is 9600 and will work fine in the vast majority of cases.   * default is 9600 and will work fine in the vast majority of cases.
 </markdown> </markdown>
diskimagescript-usage.txt · Last modified: 2014/08/26 19:14 by anashwan