• Export to OpenOffice
  • Export to PDF

SAN Boot Windows ( iSCSI )

Updated: 2016-09-24 | 19:45 EDT

Synopsis
So I built this PXE server to eliminate my need for CD/DVD base installation media. That got me to thinking about SAN boot and how I could eliminate the need for a physical hard drive on some of my physical computers. I knew of 2 SAN boot options, Fiber Channel and iSCSI. I definitely can't afford the equipment necessary for Fiber Channel, so iSCSI was my choice. Here is how I installed and boot Windows using an iSCSI target disk.

In this tutorial I will be showing how to install Windows to an iSCSI target disk and how to boot to the iSCSI target disk via a PXE server.

Prerequisites

  • PXE Server
  • Samba/CIFS File Server
  • iSCSI Target Server (I will be using Ubuntu in this example)
  • iPXE Image (instructions below)
  • A working Windows 7, 8, or 10 operating system
  • Use the latest WADK. In my tests it is backwards compatible with WIndows 7, Windows 8 , and Windows 10.
  • Windows installation media for the version you are installing
  • Possibly a physical hard drive (For Windows 7 setup I needed a physical disk to proceed)

Build the iSCSI Target Server

First make a virtual disk. I am putting my iscsi disk images in /tftpboot/iscsi. The command below will make a 20GB virtual disk image:

sudo dd if=/dev/zero of=/tftpboot/iscsi/windows7.img bs=1M count=20000

Next, install and enable the iSCSI target software:

sudo apt-get install iscsitarget
sudo nano /etc/default/iscsitarget

make the following change

       Change
       ISCSITARGET_ENABLE=false
       To
       ISCSITARGET_ENABLE=true

Next we will define our iSCSI target. Everything in this file should be commented out. If for some reason it isn't, comment everything and put your own information using the following template. You can include more than one target, just duplicate the entry with a different IQN and virtual disk

sudo nano nano /etc/iet/ietd.conf
   Target iqn.2014-07.com.it-joe:windows
      IncomingUser <username> <password> ##Leave blank if you want no authentication
      OutgoingUser
      Lun 0 Path=/tftpboot/iscsi/windows.img,Type=fileio
      Alias Windows

Now you should be ready to start the iSCSI Target Server:

sudo /etc/init.d/iscsitarget start

Windows Preinstallation Environment

Next we need to build a Windows Preinstallation Enironment(WinPE) boot image. Assuming you have either WAIK or WADK installed on your Windows machine, here are the steps to create your WinPE boot image

Open the Deployment and Imaging Tools Environment

Clicking Start, and type deployment. Right-click Deployment and Imaging Tools Environment and select run as administrator. Then Create a working copy of the WinPE files based on the architecture you need.

32-bit

C:\> copype x86 C:\WinPE_x86

64-bit

C:\> copype amd64 C:\Winpe_amd64

Make a bootable iso for the architecture you are using

C:\> MakeWinPEMedia /ISO C:\WinPE_amd64 C:\WinPE_amd64\winpe4_amd64.iso

iPXE Setup

Now we will use iPXE to connect to the iSCSI target and boot to our Windows Preinstallation Environment(winpe). Begin by going to rom-o-matic.eu to generate an iPXE image.

  • Select: “Advanced, for experienced users”
  • Choose an output format: “Linux kernel (SYSLINUX/GRUB/LILO) loadable image (.lkrn)
  • Choose a NIC type: “all-drivers”

Then keep all the default options checked and add the following config options plus any others you think would be useful.

  •  PXE_STACK, PXE stack in iPXE - you want this
  •  DOWNLOAD_PROTO_NFS, Network File System Protoco
  •  SANBOOT_PROTO_ISCSI, iSCSI protocol

Copy the ipxe.lkrn file that is generated to the / of your tftp server. If you followed my previous tutorials than that would be /tftpboot/ . Now that our ipxe.lkrn file is in place we just need to make an entry into our PXE menu and create an ipxe script. First lets make our ipxe script.

Windows iPXE Script

sudo nano win.ipxe
      #!ipxe
      dhcp
      set keep-san 1
      sanhook iscsi:192.168.0.50::::iqn.2014-07.com.it-joe:windows
      set boot-url tftp://192.168.0.50
      initrd ${boot-url}/distros/windows/winpe_amd64.iso
      kernel ${boot-url}/memdisk iso raw
      boot

PXE Menu

sudo nano /tftpboot/prelinux.cfg/default
      LABEL Windows Install
      MENU LABEL Windows Install
      KERNEL ipxe.lkrn
      INITRD win.ipxe

Samba Server Configuration

Our final step before installing Windows to our iSCSI disk is to server up the Windows installation files via Samba/CIFS. If you need more information on how to setup a Samba server see my Network File Server tutorial.

First I will make a directory to mount my Windows installation media.

sudo mkdir /mnt/cdrom

Then I will mount the installation media. I am using iso files. If you have an installation DVD rather than ISO you will just need to know the mount point for the next step.

sudo mount -o loop WindowsInstallationMedia.iso /mnt/cdrom

Now we will copy the installation files to a permanent directory on our Samba server

sudo cp -R /mnt/cdrom/* /tftpboot/distros/windows/win7

Last but not least, edit the /etc/samba/smb.conf file. Here is what I have added:

sudo nano /etc/samba/smb.conf
   [win7]
   path = /tftpboot/distros/windows/win7
   comment = Windows 7 Installation DVD
   valid users = "username" (User must have a samba password "smbpasswd -a 'Username'")
   writeable = no
   browseable = yes
   read only = yes

   [win8]
   path = /tftpboot/distros/windows/win8
   comment = Windows 8 Installation DVD
   valid users = "username" (User must have a samba password "smbpasswd -a 'Username'")
   writeable = no
   browseable = yes
   read only = yes

   [win10]
   path = /tftpboot/distros/windows/win10
   comment = Windows 10 Installation DVD
   valid users = "username" (User must have a samba password "smbpasswd -a 'Username'")
   writeable = no
   browseable = yes
   read only = yes

Restart the samba service

sudo service smbd restart

Installing an OS on iSCSI target disk

Choose your operating system by clicking on the tab

  • Windows 10
  • Windows 8
  • Windows 7
This has been tested using VMware Virtual Machines. I have not tried on physical hardware.

Windows 10

PXE Setup

Before we start the install I am going to setup the post install pxe entry and ipxe script so we can reboot and finish the installation with out having to shutdown the system. Do not boot to this pxe entry for the first part of the installation.

sudo nano /tftpboot/iscsi/win.iscsi
      
      #!ipxe
      dhcp
      set gateway 0.0.0.0
      set keep-san 1
      sanboot iscsi:192.168.0.50::::iqn.2014-07.com.it-joe:windows
      boot
sudo nano /tftpboot/prelinux.cfg/default
      LABEL Windows 10
      MENU LABEL Windows 10
      KERNEL ipxe.lkrn
      INITRD iscsi/win10.iscsi

Installation

Now, go ahead and boot to the “Windows Install” PXE boot option you created. This will boot to WinPE where you will proceed to mount you samba share and execute the setup.exe on the share. I noticed the physical hard drive requirement for Windows 10 was hit or miss. When installing to a virtual machine I didn't need to have a physical(virtual) hard drive. However, when installing on a physical machine, I needed the physical drive or winpe would boot loop.

After navigating to Z: and executing setup.exe, continue with the Windows installation as normal. As long as you have a physical drive present, you should have no issues installing to the iSCSI drive. The Physical drive can be removed after the installation is complete.

After the installation is complete your system will reboot and you will want to choose the “Windows 10” boot entry we created above.

I did not see this screen during my testing with Windows 10. However, if you do get to this point I assume these steps will still apply:

Hit F8 and you should be presented with this screen:

Hit F7 to disable driver signature enforcement.

  • Export to OpenOffice
  • Export to PDF
  • Show pagesource