iSCSI (Install Windows to Target)

Windows can be installed directly to an iSCSI Target. The instructions in this page detail the steps required to install Windows NT6.* - for Windows XP/2003 (and possibly other Windows NT5.* Operating Systems) see here.

The following sections are covered in this page -

Requirements

Set Up The iSCSI Target

Before installing Windows the iSCSI Target software will need to be installed and configured (see here).

After configuring the iSCSI Target there are two distinct stages involved in installing Windows NT6.* directly to an iSCSI Target -

Connection Authentication

NOTE - as previously mentioned in the iSCSI (Windows Targets) page of this guide, some Targets will only allow authenticated connections - Client/Host system identifiers may need to be specified for connections to be made. pyTarget for example will only allow connections from a Client/Host whose IQN has been added to a filter list. Microsoft iSCSI Software Target 3.3 also requires Client/Host identification.

A simple workaround is to add an iPXE command to set the Client IQN prior to the SANHOOK or SANBOOT command being issued. E.g. add Host name iqn.client to any filter list, and add the following iPXE command to the iPXE script/menu/command-line -

E.g.

Stage 1

You will need the unique identifier (the IQN) of your iSCSI Target - E.g. iqn.iSCSI-target1.

WinPE is required to start the installation process. In the example below a WinPE .ISO will be booted from the Server using memdisk (path to the WinPE ISO is \iso\WinPE.iso). wimboot can be used as an alternative to memdisk (see here for a sample script), as can chain-loading pxeboot.0 (see here for a sample script).

Sample iPXE script for stage 1 (DHCP)

Sample iPXE script for stage 1 (Proxy DHCP)

Breaking down the entries in the script above -

The following screenshot shows the output from the above script -

Once WinPE has loaded, run diskpart to prepare the iSCSI Target for setup. Run the List Disk command to show available hard disks. On the screenshot below the iSCSI Target was not accessible - the reason for this was due to the custom WinPE not having initialized the network....

...after running the wpeutil InitializeNetwork command (in a command-prompt) and re-running List Disk in DiskPart, the iSCSI Target was visible -

Having identified the iSCSI Target by it's size as Disk 1, run the command sel disk 1 to give the disk focus.

NOTE - it's important to ensure that the correct disk is selected as otherwise you may end up carrying out subsequent commands on the wrong disk!

Double check it is the correct disk by running the detail disk command -

After ensuring that the correct disk was selected, create a primary type partition spanning the whole disk by running the create part pri

Mark\set the partition as active by running the active command -

Finally (quick) format the disk using NTFS with volume label SANBOOT by running the command format fs=ntfs label=SANBOOT quick -

Now exit diskpart and run setup.exe from your Windows source files directory. The following screenshot(s) show the process for installing Windows 7 - screenshots for other Windows NT6.* systems will differ.

Select the required settings and click on the Next button -
Click on the Install now button -
Accept the License terms and click on the Next button -
Do NOT select the Upgrade option. Click on the Custom (advanced) option -
Select the iSCSI Target disk from the list and click on the Next button -
Wait for this stage of the Windows Setup process to complete and the system will reboot.

Stage 2

Sample iPXE script for stage 2 (Proxy DHCP)

Breaking down the entries in the script above -

The following screenshot shows the output from the above script -
Windows setup will complete as normal, albeit on the iSCSI Target -

Configure Windows as required - e.g. set username, computername, etc.

The screenshot below was taken from a running Windows 7 system booted from an iSCSI Target -

iSCSI URI Syntax

The format for iSCSI URI's is - iscsi:[servername]:[protocol]:[port]:[LUN]:[targetname]

Where -

If default settings are used for the protocol, port and LUN fields then these fields can be left blank. The following entries for example will all function (assuming the Target IP address is 192.168.1.1 and that this IP address is correctly set as the dhcp-server variable when iPXE is booted) -

iPXE settings

Remember to ensure that the required files are copied to your Tiny PXE Server root directory -

Set iscsi-target environment variable in C:\pxesrv\files\ipxe_menu.txt (create this file if required) -

Add the following to the menu section of C:\pxesrv\files\ipxe_menu.txt -

Add the following to the menu options section of C:\pxesrv\files\ipxe_menu.txt -

E.g. -

NOTE - remember to change any references to ${dhcp-server} to ${next-server} if using ProxyDHCP.

Click on one of the following for config.ini settings (edit to reflect your own setup) -

iPXE Scripts

iPXE menus are essentially scripts. It's also possible to specify individual scripts for each stage of the iSCSI installation process by using the altfilename option in config.ini. For example, create a script in the TFTP root directory C:\pxesrv\files\iscsi1.ipxe > add altfilename=iscsi1.ipxe to config.ini. NOTE - remember to change any references to ${dhcp-server} to ${next-server} if using ProxyDHCP.

Stage 1 - Sample iPXE script for Stage 1 -

Stage 2 - Either enter a path to a script as in the instructions above, or set the iSCSI Target in Option 17 (Root Path). Settings required for opt17 in config.ini

And/or in the Tiny PXE Server GUI -

Document date - 28th February 2017(DRAFT)