This script here helps in creating VHD’s on the fly. Recently I needed to quickly create some VHDX from an ISO that are “arm-able” for some labs.
The tool I used is:
Convert-WindowsImage.ps1 — WIM2VHD for Windows 10 (also Windows 8 and 8.1)
Convert-WindowsImage is the new version of WIM2VHD designed specifically for Windows 8 and above. Written in PowerShell, this command-line tool allows you to rapidly create sysprepped VHDX and VHDX images from setup media for Windows 7/Server 2008 R2, Windows 8/8.1/Server 2012/R2
1.6) Browse to folder where your install media ISO image is stored, select ISO Files bottom right (default is VHDX / VHD), select an ISO image file, click Open: 1.7) By default Secure Boot is selected. Uncheck it (important!): 1.8) Select a network switch to allow VM to have network and Internet connection, click Create Virtual Machine. When the “Create and Attach Virtual Hard Disk” window opens, click “Browse” to name your Virtual Hard Drive file and select the folder where it will be located. In addition, select the options shown below (VHD hard disk format, Dynamic/Expanding). The Dynamic disk option will save space on your physical hard drive.
Here’s the basic script I used…
- 1Basic function
- 2Initialization
- 4Using a Virtual USB Optical Drive (DVD-ROM or Blu-ray ROM)
- In order to create a VHD on Windows 10, do the following: Open Start. Search for Disk Management and click the top result to launch the experience. Click the Action button. Click the Create VHD.
- The Disk Management tool in Windows provides everything you need to create VHD files and work with them. To access it, press Windows Key + R to open the Run dialog, type diskmgmt.msc into it, and press Enter. On Windows 8 or 8.1, you can also right-click in the bottom-left corner of your screen or press Windows Key + X and click Disk Management.
Basic function
iODD's Sample Folder Tree
- create a folder named '_ISO' at root folder.
- This folder tree is an example.
- Any file name and folder name under '_ISO' is acceptable
2531 Keys
Create Iso From Vhd
- Browsing
Jog Dial
Up/Down. - list Up/Down.Jog Dial
push. - Select a file.BackUp
push. - Go to parent folder.
- Menu
Jog Dial
push for 3 seconds. - To enter to Menu mode.BackUp
push. - To exit.
- Long key ( push for 3 seconds )
Jog Dial
lift up. - refresh the file listsJog Dial
get down. - Go to Power Saving StateJog Dial
push. - enter to Menu modeBackUp
push. - Reboot. and detach all virtual drives (VHD, RMD, IMA)
- Startup Keys (during startup)
Jog-Dial
lift up. - Start up with CD-MODEJog-Dial
get down. - Start up with HDD-MODEJog Dial
push. - reset the loading state. Start up with DUAL-MODEBackUp
push. - Start up with Write-Protected mode.
2541 Keys
- Browsing
- Up/Down list -
2
/8
- Select a file -
5
(or6
, for maintaining loading state)
- Up/Down list -
- Menu
Menu
- to enter to Menu. (or Exit).4
- Go to upper list
- Long key ( push for 3 seconds )
1
- Go to Power Saving State3
- reboots iODD4
- refreshes file lists7
- Reboot. and detach all virtual drives (VHD, RMD, IMA)0
- Reboot. and temporarily disable Write-Protection
- There is not Startup key
Go to Power Saving State
- Power Saving State : Spindle motor is stopped and LCD brightness is low.
- CD loading state is saved.
Jog Dial
. down for 3 seconds. (2531).1
. push for 3 seconds. (2541).
Selecting a file
- In order to maintain loading state, you must save the state.
- refer to the above key operations.
- (2531) #2531 Keys
- If Firmware version is 1558 or higher, loading state is automatically saved.
- If not, you must save it manually. (Go to Power Saving State)
- (2541) #2541 Keys
- If Firmware version is lower than 6(7)9-05, button
6
has no function.
- If Firmware version is lower than 6(7)9-05, button
Safely Removal In OS
- If iODD's partition is NTFS, then this function is mandatory when disconnecting iODD from host.
- NTFS does not write Immediately the data to HDD.
- Please do Safely Removal before disconnection.
- If iODD is in write-protected mode and an error message appears, then disable write-protect option. and retry this function.
Initialization
- the firmware is two sorts. (NTFS type, FAT32/exFAT type)
- NTFS firmware version is shipped.
- If you use FAT32 or exFAT Partition, then run FAT Firmware Updater. (FAT32exFATPartition)
- follow the next steps
- assemble the HDD or SSD with iODD
- connect the iODD to PC
- initialize the drive to MBR. (wken:MBR)
- Format the first partition as NTFS. (if the firmware is FAT, then format it as FAT32 or exFAT)
- In FAT32 partition there is 4G byte file size limitation. please use that carefully.
- create '_ISO' folder in root folder. (not case sensitive)
- copy ISO file to '_ISO' folder. (or create VHD RMD IMA files)
- safely remove iODD. ( very Important if NTFS). (safely remove).
- If Power Saving mode is active, then disconnect and reconnect the USB cable.
- If not, then Go to Power Saving State
- If 'Plug Out ...' (or 'Plug Out ...') message appears, reconnect the USB cable.
- The following messages will appear sequentially in LCD
- 'iodd 253(4)1'
- a file name
Initialize All
- If Initialization fails, follow the next steps
- disconnect the USB cable.
- remove the HDD from iODD. and Connect directly it to PC.
- Initialize it to GPT. (msen:GPT)
- redo Initialization (from the first step). (your HDD is initialized as MBR -> GPT -> MBR).
- Open back cover
- Press tact switch
- Connect USB cable
- Wait 7 seconds
- Release tact switch
- Wait 1 minutes
- All done
First Aid
- If it has failure suddenly, try one of the following steps until the error is clear
- (2531). press the Jog Dial and hold. and then connect iODD to PC. (#2531 Keys. refer to Startup Keys)
- try Safely Removal In OS.
- Check Disk for iODD ( for Windows)
- Rename '_ISO' folder name to other name. create new folder named '_ISO'. and copy files to this folder. (not moving)
- Update it with the latest firmware.
- Backup the data of iODD, and Initialize All
- If there is hardware problem
- Reboot the PC
- Please change USB cable
- Connect iODD to the port of PC back panel.
- Try it on another pc
- Please change the HDD.
Using a Virtual USB Optical Drive (DVD-ROM or Blu-ray ROM)
- copy ISO files to '_ISO' folder. (or to subfolder)
- Safely Remove. (Required for NTFS )
- If Power Saving mode is not active , then Go to Power Saving State
- If 'Plug Out ...' (or 'Plug Out ...') message appears, disconnect the iODD.
- Connect iODD to a PC. and power on the PC.
- (Optional) select iODD or USB CD-ROM as the first priority of BOOT order in BIOS.
- If a file has not been selected, then select an ISO file. Selecting a file
- If PC doesn't find boot device, then reboot the PC. (Ctrl-Alt-Del)
Create Iso From Vhdx
Booting Error
- Confirm whether the ISO file is bootable.
- If your PC does not support multi LUN, please select CD-MODE (or ODD-MODE).
- In order to confirm whether the ISO file is able to boot, please try to test it with the validated PC.
- Although it is bootable ISO file, please confirm whether the result with a real USB DVD-ROM is the same
- If the ISO file can be boot with USB DVD-ROM, then use USB Y-CABLE for adding external power.
- If your laptop has own internal DVD-ROM, please disable internal DVD-ROM at BIOS settings. or remove it.
- The older OS than motherboard may not have an appropriate driver to boot.
- ex) It is impossible to install a genuine Windows 7 on Skylake platform using USB DVD-ROM device.
Using a Virtual USB fixed disk drive (Virtual Hard Disk)
- Fixed-size VHD file only is supported. (dynamic VHD and VHDx files are not supported)
- Also fixed VMDK file is supported.
- Create VHD files directly to iODD by 'VHD Tool++'. ('VHD Tool++' can creates a file without fragment)
- You can create VMDK by changing file extension. (VHD -> VMDK).
- If you select a VHD file, then iODD will be rebooted with CD-MODE. and it will be recognized as a USB disk drive.(Selecting a file).
- If you want to change to DUAL-MODE or to change Write Protection option, rename the VHD filename. refer to 'VHD Tool++'
- Max 4 Virtual Drives are supported at the same time ( Successive selection within 3 seconds)
- create a VHD file using a tool. (VHD Tool++).
- If successful, safely remove iODD from OS. (#Safely Removal In OS. Very Important to NTFS.)
- If Power Saving mode is not active, then Go to Power Saving State
- If 'Plug Out ...' (or 'Plug Out ...') message appear, disconnect the iODD.
- Connect iODD to a PC. and power on the PC.
- (Optional) select iODD or USB Device as the first priority of BOOT order in BIOS.
- If a file has not been selected, then select a VHD file. (Selecting a file)
- If PC doesn't find boot device, then reboot the PC. (Ctrl-Alt-Del)
Using a Virtual USB Removable Flash Drive (Virtual USB Flash Drive)
- Almost the same as the above method. (Using a Virtual USB fixed disk drive)
- But the file extension must be changed. 'VHD' -> 'RMD'
Using a Virtual USB Floppy Drive (Virtual FDD)
- This method is not supported on some computers.
- Uncompressed floppy image IMA, IMG, BIF, VFD are supported.
- IMG, BIF, VFD image file extension must be renamed to IMA.
- Almost the same as the above method.