windows-diskimage-builder/README.md

2.1 KiB

A windows Disk image builder tool to the Disk Image Builder project. This Windows tool runs on any Windows machine and generate VHD/QCOW2 image directly from an ISO without needing to standup a VM on Hypervisor. This tool uses windows native commands like ImageX, DISM, and Diskpart to generate disk images which can work for both VMs and Baremetal Servers. This is made possible by injecting user provided drivers using DISM while building the image.

Creates a Image file, Includes cloudbase-init package by default. User can create image by adding custom drivers, VirIO Drivers by providing suitable ISO or inf files. Enable Roles like Hyperv , TFTP etc., Use below formats to run script.

Runs on Windows 8, 8.1 and 2012 R2

Requires Powershell 3.0 or above and wim file from ISO Source folder. ISO is not required. Only Wim file is enough to generate and apply wim to vhd.

Please download and install qemu binary for getting qcow2 format of image from the link --> http://qemu.weilnetz.de/w64/ Also set it to system path.

Basic Usage .\diskimagebuilder.ps1 -SourceFile \install.wim -VHDFile \VHDFilename -VHDSize

Enabling Feature like TFTP .\diskimagebuilder.ps1 -SourceFile \install.wim -VHDFile \VHDFilename -VHDSize -feature TFTP

Add Drivers to images. It auto adds all drivers present in the drivers folder .\diskimagebuilder.ps1 -SourceFile \install.wim -VHDFile \VHDFilename -VHDSize -DriversPath

Add Unattend answer file .\diskimagebuilder.ps1 -SourceFile \install.wim -VHDFile \VHDFilename -VHDSize -UnattendPath \unattend.xml

Add VirtIO Drivers .\diskimagebuilder.ps1 -SourceFile \install.wim -VHDFile \VHDFilename -VHDSize -VirtIOPath \virtio.iso

All Commands Usage .\diskimagebuilder.ps1 -SourceFile \install.wim -VHDFile \VHDFilename -VHDSize -feature -UnattendPath \unattend.xml -DriversPath -CloudbaseInitMsiUrl < your cloudbaseinit msi url> -baudrate -OutputFormat vhd/qcow2 (Default will be vhd)