Showing posts with label Network Management. Show all posts
Showing posts with label Network Management. Show all posts

Sunday, October 14, 2012

Retrieve credential values stored in WiFi device

Introduction

When setup a WiFi network using network appliances, an account credential is always required to logon to network services provided by ISP (Internet Service Provider).  For example, using modem router to access ISP’s broadband internet service. 

The ISP account credentials is usually enter once during configuration at first time and it should persist in the device’s RAM is ready to work for next power on.  Compare ISP account credential with the other account credentials like your email account or desktop OS account that use every day, the user tend to forget or lost the ISP account credential easily.  This happens when we upgrade to new WiFI device or hard reset the device due to some technical issues.

This article introduces some software tools to attempt recover the account credential values store in WiFi device.

Retrieve configuration file from WiFi device

Most WiFI devices allow user to backup the configuration in a file.  Read the user guides of the WiFi device to find out if it has the configuration backup option.

For example, most D-Link WiFi device supports configuration backup via HTTP URL.  Enter URL like:

http://192.168.1.1/config.bin

in browser to download the configuration file.  Most configuration are compressed and encrypted.  Some tools is needed to decode the information stored in the configuration file.

Router Pass View

RouterPassView is a software tool to decode the configuration file retrieved from WiFI router.  Please note that not all WiFi device is supported, refer to the web site for a list of supported device.

It is easy to use RouterPassView.  Download and launch the software, open the configuration file in the software and the configuration information should show in text format:

image

Monday, August 27, 2012

Turn a Windows 7 desktop to Wifi AP via Microsoft Virtual Wifi miniport adapter

Introduction

Windows 7 introduces a new virtual driver for WiFi network that create a virtual WiFi AP to share network / Internet connection for any WiFi device.  The network adapter is named as Microsoft Virtual Wifi miniport adapter.

Before Windows 7, Adhoc wireless connection is a common WiFi connection that may only connect to one WiFi device only.  The Windows Virtual WiFi connection may connect to up 8 WiFi devices.

Check support of Virtual Wifi

The virtual network adapter should install automatically in Device Manager once your WiFi adapter is activated:

image

A new Wireless Network Connection (e.g.: Wireless Network Connection 2 in the following example) should configure as well:

image

Everything is ready up to this stage, continue the configuration to turn on the virtual WiFi AP and start sharing your network connection.

Please note that there is no GUI tools to configure virtual WIFI connection.  All commands should type in command line console under Administrator privilege.

Configure Virtual WiFi connection

Choose a SSID to identify your virtual WIFI AP and set a password for it.  Type the following command in command line console running as administrator to start configure:

C:\Windows\system32>netsh wlan set hostednetwork mode=allow ssid=MyWifi key=password keyUsage=persistent
The hosted network mode has been set to allow.
The SSID of the hosted network has been successfully changed.
The user key passphrase of the hosted network has been successfully changed.

Make sure the physical Wifi adapter is enabled before start the Virtual WiFi connection:

C:\Windows\system32>netsh wlan start hostednetwork
The hosted network started.

The Virtual WiFi connection (MyWifi, in this example) is active:

image

The Virtual WiFi connection is ready to accept connection now.  Use any other WiFi device (Smartphone, other notebook, PC) to check if the MyWifi connection appears the WiFi connection list.

Please note that the virtual WiFi connection does not connect to any Internet connection yet.  All WiFi connection to MyWifi is isolated in the MyWifi network only.

Share Internet connection to Virtual WiFi connection

Enable Internet Connection Sharing for virtual WiFi connection allow Internet traffic be served for virtual WiFi client.  First, identify the network connection with Internet access:

image

Open properties page of the Network Connection with internet access and set the following:

  1. “Allow other network users to connect through this computer’s Internet connection.
  2. Set Home networking connection to “Wireless Network Connection 2” (The connection should be Virtual WiFi Connection).
  3. Click OK to commit changes.

image

The Virtual WiFi connection should have access to Internet now:

image

Other WiFi device connect to virtual WiFi connection should be able to access the Internet immediately.

Virtual Wifi AP not started after reboot

The Windows 7 Virtual WiFi connection is not persisted when machine reboot.  You should start the virtual WiFi connection each time machine has rebooted:

C:\>netsh wlan show hostednetwork

Hosted network settings
-----------------------
    Mode                   : Allowed
    SSID name              : "MyWifi"
    Max number of clients  : 8
    Authentication         : WPA2-Personal
    Cipher                 : CCMP

Hosted network status
---------------------
    Status                 : Not started


C:\>netsh wlan start hostednetwork
The hosted network started.

Stop virtual WiFi connection

Run the command to stop connection:

C:\>netsh wlan stop hostednetwork
The hosted network stopped.

Uninstall virtual WiFi adapter

It is not necessary to uninstall virtual WiFi adapter as the uninstall is not permanent.  The virtual WiFi adapter will be installed once your reboot machine.  If you mean to uninstall the virtual WiFi adapter for current session, try this:

C:\>netsh wlan set hostednetwork mode=disallow
The hosted network mode has been set to disallow.

Side Effect: Unable to access network share after update Microsoft Virtual WiFi Miniport Adapter

There is a side effect if Microsoft Virtual Wifi Miniport Adapter has been updated.  The network share may not be accessed and “0x8004005 Unspecified error” may prompt:

image

This is due to the “Client for Microsoft Networks” service is missing from the network connection.  Reinstall service “Client for Microsoft Networks” will solve the error:

Untitled

Wednesday, May 02, 2012

Migrate Windows 7 instance to iSCSI target

Introduction

It is straight forward to install a fresh new Windows 7 instance on iSCSI target.  However, there few tricks to migrate a Windows 7 instance to iSCSI target.  Migrating an existing Windows 7 instance is a time consuming process especially for large partition size.  Doing it right will save lot of time.

Prepare Windows 7 disk volume for migration

If a Windows 7 instance has larger partition size, e.g.: Few hundred Giga bytes or Tera bytes, migrate this instance will spend lot of time transfer Windows 7 instance to iSCSI target.  Before start migrate the instance, try shrink or extend the volume size suitable for usage in near future.  Use Extend Volume… and Shrink Volume… function in Disk Management to perform the task:

image

Update Windows 7 network driver

The iSCSI operation rely heavily on the network device.  Update the network driver to latest version is not always necessary but it is advisable to do so.  Some booting process of iSCSI operation may slow down due to network driver’s problem.

Disable LightWeight Filter (LWF)

Disable LightWeight Filter (LWF) is a crucial step to make sure the migration work.  This step must perform or else the SAN boot will fail in later stage.

A Microsoft knowledge article KB967042: Windows may fail to boot from an iSCSI drive if networking hardware is changed describe the cause and solution for the problem.

There is a quick solution to disable LWF by changing some registry setting:

  1. Identify the description of Network Adapter use for iSCSI network operation in later stage:

    image
  2. Start RegEdit in administrator account.
  3. Open HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ Class\{4D36E972-E325-11CE-BFC1-08002BE10318}. There are many subkeys underneath, find and open the subkey where the DriverDesc match the NIC’s description. e.g.: 0013

    image
  4. Open the subkey Linkage and edit FilterList value:

    image
  5. There are usually two lines in FilterList:
    {0B47BB2C-86FB-4699-8906-E08465757D92}-{B5F4D659-7DAA-4565-8E41-BE220ED60542}-0000
    {0B47BB2C-86FB-4699-8906-E08465757D92}-{B70D6460-3635-4D42-B866-B8AB1A24454C}-0000
  6. Delete the line that refer to LWF driver’s UUID: {B70D6460-3635-4D42-B866-B8AB1A24454C}.  In this case:
    {0B47BB2C-86FB-4699-8906-E08465757D92}-{B5F4D659-7DAA-4565-8E41-BE220ED60542}-0000
    {0B47BB2C-86FB-4699-8906-E08465757D92}-{B70D6460-3635-4D42-B866-B8AB1A24454C}-0000

Migrate Windows 7 disk image to iSCSI target

Next, the Windows 7 is ready to image and transfer to iSCSI target.  Boot into Linux and use command line utilities like fdisk and dd to image the Windows 7 partition.

First, decide the partition size:

# fdisk -lu /dev/sdb

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xdf70df70

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *     2099200   309299199   153600000    7  HPFS/NTFS
/dev/sdb2       718899200  1953521663   617311232    f  W95 Ext'd (LBA)
/dev/sdb5       718901248  1333301247   307200000    7  HPFS/NTFS
/dev/sdb6      1333303296  1435703295    51200000    7  HPFS/NTFS
/dev/sdb7      1435705344  1953521663   258908160    7  HPFS/NTFS

In above example, the windows 7 partition is /dev/sdb1.  The sector start from 209920 and end at 309299199.  However, sector from 1 to 2099199 is necessary too as it contain the MBR code to make Windows 7 boots properly.  The total size to of Windows 7 image should start from sector 1 to 309299199.  Each sector has size 512 bytes.

# dd if=/dev/sdb of=win7.img bs=512 count=309299199

The block size of 512 bytes of above example may be slow to image the partition.  Try switch the bs and count value may accelerate the imaging process:

# dd if=/dev/sdb of=win7.img bs=309299199 count=512

Transfer win7.img to iSCSI target and perform necessary setup.  The Windows 7 instance has successfully migrate to iSCSI target.  The iSCSI target is ready to SAN boot now.

Boot iSCSI target

Once the iSCSI target is setup, use iPXE or gPXE to SAN boot the iSCSI target:

dhcp net0
        sanboot iscsi:nas.example.com::::iqn.example.com:windows-7

Reference

  1. Diskless Windows 7 iSCSI boot from OpenSolaris 2009.06 ZFS Server. URL: http://blog.zorinaq.com/?e=41
  2. Transferring the disk image to a SAN target. URL: http://www.etherboot.org/wiki/sanboot/transfer

Sunday, April 22, 2012

Install Windows XP on iSCSI target

Introduction

Unlike Windows 7 installer, Windows XP installer doesn’t support sanboot iSCSI target access.  This is the most tricky part to install Windows XP on iSCSI target.  Other problem is identify a matched network driver as all traffic will transmit over network.

Prepare a iSCSI target

First, setup a new iSCSI target for the Windows XP instance.  The minimum disk size is 2GB.  For illustration purpose, the iSCSI target in this article is

iscsi:nas.example.com::::iqn.example.com:winxp

Setup iSCSI target

Next, the iSCSI target should be formatted to NTFS file system and mark active with Windows XP utilities and tools.  These tasks may perform in existing Windows XP system or virtual machine.

To connect to iSCSI target disk in Windows XP, download Microsoft iSCSI Software Initiator Software.  Install the software in Windows XP and connect the iSCSI target:

1

Start Control Panel | Administrative Tools | Computer Management | Disk Management, the new iSCSI target disk should appear in the disk array:

2

Setup a new primary partition on the disk:

3

Assign a drive letter to the partition:

5

and format to NTFS file system:

4

Remember to mark the partition active:

6

The new iSCSI disk E:\ is ready to use now.

Prepare Windows XP setup files

To prepare windows installation from iSCSI target disk itself, use winnt32.exe in the installation CD or ISO file:

Assume drive D:\ contain the Windows XP installer:

D:\I386>winnt32 /syspart:E /tempdrive:E /makelocalsource /noreboot

The command prepare a Windows XP installation in drive E.

The next screen prompt for Installation Type.  Chose New Installation (Advanced).

7

Follow the screen instruction to complete the initial setup.

Integrate iSCSI components

After finish Windows XP installer setup, the iSCSI target disk contain the necessary Windows XP setup files and it it ready to start setup soon.  However, the Windows XP installer do not have iSCSI initiator and sanboot service nor it has matched NIC network driver.  It still not ready yet for iSCSI booting.  Our next task is integrate iSCSI initiator, sanboot service and network driver into the Windows XP installation.

First, download a third party tools IntegrateDrv to perform integration.  Extract the tools and run the command in console to perform integration:

IntegrateDrv.exe /driver=..\Drivers\PRO100\win32\NDIS5x /driver=..\Drivers\iScsiPrt\x86 /driver=..\Drivers\sanbootconf /driver=..\Drivers\nicbootconf /target=E:\

The above command install a network driver from Intel Pro100.  IntegrateDrv provides very limited network driver.  It is usually not suitable for most situation.  You should supply a matched network driver in the integration.  Most problem happen in later boot up stage are mostly related to unmatched or incompatible network driver.  Perform this step with care to make sure the iSCSI boot up success in next stage.

A network configuration may prompt to specify IP address, network mask and default gateway IP at the end of integration.  You may ignore it if there is a DHCP service in the network:

image

If everything goes well, the iSCSI target is ready to boot up and perform actual Windows XP installation.  Remember to disconnect or logoff the iSCSI target disk before perform installation:

image

Boot iSCSI target to install Windows XP

The iSCSI target disk integrated with necessary iSCSI component may now boot from target computer to perform Windows XP installation now.  From iPXE prompt during network boot up, execute these:

dhcp net0
sanboot iscsi:nas.example.com::::iqn.example.com:winxp

The iSCSI target disk should boot up to perform familiar Windows XP installation.  Follow the screen instruction to finish the installation.  During installation, the installer may prompt for unsigned driver for both iSCSI initiator and network driver, press Yes to continue the installation:

After finish installation, use the above sanboot command to start the Windows XP instance for normal daily usage.

Reference

  1. Installing Windows XP \ 2003 directly to an iSCSI target. URL: http://ipxe.org/appnote/xp_2003_direct_install
  2. Integrate mass-storage text-mode or PNP drivers into windows 2000 \ XP \ 2003 setup. URL: http://iknowu.dnsalias.com/files/public/integratedrv/IntegrateDrv.htm

Thursday, March 08, 2012

LDAP: Introduction to OpenLDAP

OpenLDAP is an open-source suite of LDAP (Lightweight Directory Access Protocol) application  and development tools.  It is a key tool to realize single sign on operation in network environment.

Installation

These packages are required for OpenLDAP to function properly:

  1. yum install openldap-servers
  2. yum install openldap-clients

Start OpenLDAP service

The init script file for OpenLDAP is slapd.

# service slapd start
Starting slapd (via systemctl):                            [  OK  ]

Check status of OpenLDAP service:

# service slapd status
slapd.service - LSB: starts and stopd OpenLDAP server daemon
          Loaded: loaded (/etc/rc.d/init.d/slapd)
          Active: active (running) since Thu, 08 Mar 2012 13:42:27 +0800; 1min 0s ago
         Process: 1669 ExecStop=/etc/rc.d/init.d/slapd stop (code=exited, status=0/SUCCESS)
         Process: 1692 ExecStart=/etc/rc.d/init.d/slapd start (code=exited, status=0/SUCCESS)
        Main PID: 1722 (slapd)
          CGroup: name=systemd:/system/slapd.service
                  â 1722 /usr/sbin/slapd -h  ldap:/// ldapi:/// -u ldap

Configuration - cn=config

OpenLDAP use statically configured slapd.conf prior to version 2.3.  A new run-time configuration and zero down-time configuration, cn=config introduced since version 2.3.  A most notable cn=config is the configuration parameters may entered via ldapmodify or LDIF files.  The changes has immediate effect without restart slapd service.

Configuration - Add cn=config admin password

The cn=config in a fresh OpenLDAP installation doesn’t has admin password.  Administrator may not change OpenLDAP configuration parameters without admin password.  The first task after a fresh OpenLDAP installation is add cn=config admin password.

Generate slapd SSHA password:

# slappasswd -h {SSHA}
New password:
Re-enter new password:
{SSHA}m8MhPiaG0TWmP/Ro2VcRopBqTbTm1UX1

We will use the new generated password “{SSHA}m8MhPiaG0TWmP/Ro2VcRopBqTbTm1UX1 ” in next step.

Next, determine the DN  (Distinguished Name) for the database that contains the RootDN password.  The RootPW (root password) may not present in fresh installation:

# ldapsearch -LLL -Y EXTERNAL -H ldapi:/// -b olcDatabase={0}config,cn=config dn olcRootDN olcRootPW
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
dn: olcDatabase={0}config,cn=config
olcRootDN: cn=config

Next, add olcRootPW to olcDatabase={0}config,cn=config using shell-accessible tool ldapmodify with LDIF text:

# ldapmodify -Y EXTERNAL -H ldapi:///
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
dn: olcDatabase={0}config,cn=config
add: olcRootPW
olcRootPW: {SSHA}m8MhPiaG0TWmP/Ro2VcRopBqTbTm1UX1

modifying entry "olcDatabase={0}config,cn=config"

In the above example, as soon as empty line received, the LDIF text will be processed immediately.  Press Ctrl-D to end ldapmodify shell when done.

GUI tools for LDAP directory

Apache Directory Studio is a GUI LDAP browser and client to manage LDAP directory.  It save lot of time and effort to use ldapmodify managing the directory entries.

image

Manage cn=config using Apache Directory Studio

Create LDAP connection in the studio:

image

Enter authentication information for the connection:

image

Enter cn=config to BaseDN text box:

image

Commit the changes by pressing OK button.  You may open the connection and start browsing the OpenLDAP configuration parameters.

Configuration: olcDatabase

You may start configure a new LDAP directory once OpenLDAP service is up and running.  The olcSuffix parameter let you specify a unique identifier for the directory.  olcRootDN specify the supervisor for the directory.

A olcRootPW may be added to secure the directory from anonymous changes.

image

Browse OpenLDAP directory as Manager

Define a new OpenLDAP connection using RootDN to access a fresh LDAP directory:

image

Connect to the LDAP directory shows an empty directory:

image

Add an initial entry to LDAP directory

Use “New Context Entry…” to create an initial entry to LDAP directory:

image

First, define a new object using dcObject and organizationUnit classes:

image

Next, enter a DN for the object:

image

Supply a ou value to identify the entry:image

The following diagram shows the newly created object:

image

Flooding the LDAP directory

You may start enter the LDAP objects to the directory:

image

Reference

  1. OpenLDAP. URL: http://www.saruman.biz/wiki/index.php/OpenLDAP

Friday, December 02, 2011

iPXE: Boot iPXE Linux kernel via PXELinux

iPXE Linux kernel (ipxe.lkrn) may chain loaded by PXELinux:

default boot

label boot
        kernel ipxe.lkrn

Both iPXE firmware (undionly.kpxe) or iPXE kernel image (ipxe.lkrn) has same functions.  All usage of iPXE commands / scripts remain the same for both firmware and kernel.

Problem with Dell Vostro notebook

All the time I use PC with iPXE firmware (undionly.kpxe) with WinPE and SanBoot without problem.  If I boot Dell Vostro notebook with the same booting steps as PC, the WinPE or SanBoot doesn’t work at all.  The reason remain unknown.  Here are my booting steps:

Scenario A

  1. Switch on machine
  2. DHCP –> undionly.kpxe (undionly.0)
  3. Chain to load WinPE image
  4. Show blank screen after WinPE image

Scenario B

  1. Switch on machine
  2. DHCP –> undionly.kpxe (undionly.0)
  3. sanboot iSCSI target
  4. Machine hang while booting

Both scenario A and B works fine on PC but doesn’t work on Dell Vostro notebook.

I suspect the problem is related to:

  1. iPXE firmware
  2. Notebook network card’s firmware doesn’t work well with iPXE firmware.

Dell Vostro notebook work with iPXE kernel

While trying to find solution solving the mystery problem with Dell Vostro notebook, I found that iPXE kernel works.  I may load WinPE image or SanBoot a Windows ISCSI target with iPXE kernel chain loaded by PXELinux.

  1. Prepare ipxe.lkrn
    -bash-4.1$ git clone git://git.ipxe.org/ipxe.git
    -bash-4.1$ cd ipxe
    -
    bash-4.1$ make src/bin/ipxe.lkrn
  2. Copy src/bin/ipxe.lkrn to TFTP boot directory.
    # cp src/bin/ipxe.lkrn /var/lib/tftpboot
  3. Update dhcp configuration file: /etc/dhcp/dhcpd.conf to prevent infinite iPXE boot when ipxe.lkrn boot:
            if exists user-class and option user-class = "iPXE" {
                    filename "http://<ip-address>/boot.ipxe";
            } else {
                    filename "pxelinux.0";
            }
  4. Load ipxe.lkrn after PXELinux boot:
    # cat pxelinux.cfg/default
    default boot
    
    label boot
            kernel ipxe.lkrn
  5. iPXE kernel will query DHCP server again, DHCP will send boot.ipxe script file via HTTP to the machine:
    #!ipxe
    set 209:string pxelinux.cfg/boot
    set 210:string http://<ip-address>/
    chain ${210:string}pxelinux.0
  6. boot.ipxe will chain load pxelinux.0 with new configuration file: pxelinux.cfg/boot:
    # cat pxelinux.cfg/boot
    default menu.c32
    prompt 0
    
    LABEL boot_local
            menu label ^Boot Local System
            menu default
            localboot 0
            timeout 50
    
    LABEL boot_san
            menu label Boot ^Storage Area Network
            com32 syslinux/gpxecmd.c32
            append sanboot iscsi:<iscsi-host>::::iqn.example.com:win7
    
    LABEL WINDOWS_PE
            menu label ^Windows Preinstallation Exnvironment
            kernel windows.pe/pxeboot.0
  7. Both SanBoot and Window PE image works with Dell Vostro notebook now.

WAIK: Add Microsoft iSCSI service to WinPE

Microsoft iSCSI service allow user to connect to iSCSI target on SAN device.  The default WINPE image doesn’t support iSCSI service.  This topic shows how to add iSCSI service to WinPE image.  Once added, you may connect to iSCSI target after boot into WinPE environment.

Add iSCSI service files to WinPE image

  1. Start WAIK deployment Tools command prompt in privilege mode
  2. Mount an WinPE image file in RW mode:
    imagex /mountrw winpe.wim 1 mount
  3. Copy the following files into mounted winpe’s “<mount>\windows\system32” folder:
    Windows\System32\iscsicli.exe
    Windows\System32\iscsicpl.exe
    Windows\System32\iscsicpl.dll
    Windows\System32\iscsidsc.dll
    Windows\System32\iscsied.dll
    Windows\System32\iscsiexe.dll
    Windows\System32\iscsilog.dll
    Windows\System32\iscsium.dll
    Windows\System32\iscsiwmi.dll
    Windows\System32\Drivers\msiscsi.sys
    Windows\System32\en-us\iscsicli.exe.mui
    Windows\System32\en-us\iscsicpl.dll.mui
    Windows\System32\en-us\iscsicpl.exe.mui
    Windows\System32\en-us\iscsidsc.dll.mui
    Windows\System32\en-us\iscsiexe.dll.mui
    Windows\System32\en-us\iscsilog.dll.mui

Update WinPE registry hive

  1. Start RegEdit.exe in privilege mode
  2. Select “HKEY_LOCAL_MACHINE”, and click File | Load Hive… to load hive file: <mount>\windows\system32\config\SYSTEM.  Use PE_Sys as hive key name.
  3. Select “HKEY_LOCAL_MACHINE”, and click File | Load Hive… to load hive file: <mount>\windows\system32\config\SOFTWARE. Use PE_Soft as hive key name.
  4. The HKEY_LOCAL_MACHINE should have 2 hive loaded as follow:
    Windows 7 x64 WAIK-2011-12-02-11-57-28
  5. Create a iscsi.reg file with the following content:
    Windows Registry Editor Version 5.00
     
    [HKEY_LOCAL_MACHINE\PE_Soft\Microsoft\Windows NT\CurrentVersion\Svchost]
    "Godzilla"=hex(7):4d,00,53,00,69,00,53,00,43,00,53,00,49,00,00,00,00,00
     
    [HKEY_LOCAL_MACHINE\PE_Soft\Microsoft\Windows NT\CurrentVersion\iSCSI]
     
    [HKEY_LOCAL_MACHINE\PE_Soft\Microsoft\Windows NT\CurrentVersion\iSCSI\Discovery]
    "AllowiSNSFirewallException"=dword:00000001
     
    [HKEY_LOCAL_MACHINE\PE_Soft\Microsoft\Windows NT\CurrentVersion\iSCSI\Discovery\Authentication Cache]
     
    [HKEY_LOCAL_MACHINE\PE_Soft\Microsoft\Windows NT\CurrentVersion\iSCSI\Discovery\Send Targets]
     
    [HKEY_LOCAL_MACHINE\PE_Soft\Microsoft\Windows NT\CurrentVersion\iSCSI\Discovery\Static Targets]
     
    [HKEY_LOCAL_MACHINE\PE_Soft\Microsoft\Windows NT\CurrentVersion\iSCSI\Discovery\Tunnel Address]
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Enum\Root\LEGACY_MSISCSI]
    "NextInstance"=dword:00000001
     
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Enum\Root\LEGACY_MSISCSI\0000]
    "Service"="MSiSCSI"
    "Legacy"=dword:00000001
    "ConfigFlags"=dword:00000000
    "Class"="LegacyDriver"
    "ClassGUID"="{8ECC055D-047F-11D1-A537-0000F8753ED1}"
    "DeviceDesc"="@%SystemRoot%\\system32\\iscsidsc.dll,-5000"
     
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Enum\Root\ISCSIPRT]
     
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Enum\Root\ISCSIPRT\0000]
    "ClassGUID"="{4d36e97b-e325-11ce-bfc1-08002be10318}"
    "Class"="SCSIAdapter"
    "HardwareID"=hex(7):52,00,4f,00,4f,00,54,00,5c,00,69,00,53,00,43,00,53,00,49,\
      00,50,00,72,00,74,00,00,00,00,00
    "ConfigFlags"=dword:00000000
    "Driver"="{4d36e97b-e325-11ce-bfc1-08002be10318}\\0000"
    "Mfg"="@iscsi.inf,%msft%;Microsoft"
    "Service"="iScsiPrt"
    "DeviceDesc"="@iscsi.inf,%iscsiprt%;Microsoft iSCSI Initiator"
    "Capabilities"=dword:00000000
     
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Enum\Root\ISCSIPRT\0000\Device Parameters]
     
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Enum\Root\ISCSIPRT\0000\Device Parameters\StorPort]
     
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Enum\Root\ISCSIPRT\0000\LogConf]
     
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Enum\Root\ISCSIPRT\0000\Control]
    "ActiveService"="iScsiPrt"
     
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Services\iScsiPrt]
    "DisplayName"="iScsiPort Driver"
    "ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\
      52,00,49,00,56,00,45,00,52,00,53,00,5c,00,6d,00,73,00,69,00,73,00,63,00,73,\
      00,69,00,2e,00,73,00,79,00,73,00,00,00
    "ErrorControl"=dword:00000001
    "Start"=dword:00000000
    "Type"=dword:00000001
     
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Services\iScsiPrt\Parameters]
    "BusType"=dword:00000009
     
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Services\iScsiPrt\Enum]
    "0"="Root\\ISCSIPRT\\0000"
    "Count"=dword:00000001
    "NextInstance"=dword:00000001
     
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Services\MSiSCSI]
    "DisplayName"="@%SystemRoot%\\system32\\iscsidsc.dll,-5000"
    "Group"="iSCSI"
    "ImagePath"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,72,00,6f,00,6f,00,\
      74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,\
      00,76,00,63,00,68,00,6f,00,73,00,74,00,2e,00,65,00,78,00,65,00,20,00,2d,00,\
      6b,00,20,00,6e,00,65,00,74,00,73,00,76,00,63,00,73,00,00,00
    "Description"="@%SystemRoot%\\system32\\iscsidsc.dll,-5001"
    "ObjectName"="LocalSystem"
    "ErrorControl"=dword:00000001
    "Start"=dword:00000002
    "Type"=dword:00000020
    "ServiceSidType"=dword:00000001
    "RequiredPrivileges"=hex(7):53,00,65,00,41,00,75,00,64,00,69,00,74,00,50,00,72,\
      00,69,00,76,00,69,00,6c,00,65,00,67,00,65,00,00,00,53,00,65,00,43,00,68,00,\
      61,00,6e,00,67,00,65,00,4e,00,6f,00,74,00,69,00,66,00,79,00,50,00,72,00,69,\
      00,76,00,69,00,6c,00,65,00,67,00,65,00,00,00,53,00,65,00,43,00,72,00,65,00,\
      61,00,74,00,65,00,47,00,6c,00,6f,00,62,00,61,00,6c,00,50,00,72,00,69,00,76,\
      00,69,00,6c,00,65,00,67,00,65,00,00,00,53,00,65,00,43,00,72,00,65,00,61,00,\
      74,00,65,00,50,00,65,00,72,00,6d,00,61,00,6e,00,65,00,6e,00,74,00,50,00,72,\
      00,69,00,76,00,69,00,6c,00,65,00,67,00,65,00,00,00,53,00,65,00,49,00,6d,00,\
      70,00,65,00,72,00,73,00,6f,00,6e,00,61,00,74,00,65,00,50,00,72,00,69,00,76,\
      00,69,00,6c,00,65,00,67,00,65,00,00,00,53,00,65,00,54,00,63,00,62,00,50,00,\
      72,00,69,00,76,00,69,00,6c,00,65,00,67,00,65,00,00,00,00,00
    "FailureActionsOnNonCrashFailures"=dword:00000001
    "FailureActions"=hex:50,46,00,00,01,00,00,00,01,00,00,00,03,00,00,00,14,00,00,\
      00,01,00,00,00,c0,d4,01,00,01,00,00,00,e0,93,04,00,00,00,00,00,00,00,00,00
    "RebootMessage"="See Note 3 below"
    "FailureCommand"="customScript.cmd"
     
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Services\MSiSCSI\Parameters]
    "ServiceDll"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,72,00,6f,00,6f,\
      00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,\
      69,00,73,00,63,00,73,00,69,00,65,00,78,00,65,00,2e,00,64,00,6c,00,6c,00,00,\
      00
    "ServiceDllUnloadOnStop"=dword:00000001
     
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Services\MSiSCSI\Enum]
    "0"="Root\\LEGACY_MSISCSI\\0000"
    "Count"=dword:00000001
    "NextInstance"=dword:00000001
    
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Services\MSiSCSI]
    "ImagePath"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,72,00,6f,00,6f,00,\
      74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,\
      00,76,00,63,00,68,00,6f,00,73,00,74,00,2e,00,65,00,78,00,65,00,20,00,2d,00,\
      6b,00,20,00,47,00,6f,00,64,00,7a,00,69,00,6c,00,6c,00,61,00,00,00
     
    Windows Registry Editor Version 5.00
     
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Control\Class\{4D36E97B-E325-11CE-BFC1-08002BE10318}]
    "LegacyAdapterDetection"=dword:00000000
    "Class"="SCSIAdapter"
    "ClassDesc"="@%SystemRoot%\\System32\\SysClass.Dll,-3005"
    @="@%SystemRoot%\\System32\\SysClass.Dll,-3005"
    "IconPath"=hex(7):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\
      74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,\
      00,65,00,74,00,75,00,70,00,61,00,70,00,69,00,2e,00,64,00,6c,00,6c,00,2c,00,\
      2d,00,31,00,30,00,00,00,00,00
    "Installer32"="SysClass.Dll,ScsiClassInstaller"
     
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Control\Class\{4D36E97B-E325-11CE-BFC1-08002BE10318}\0000]
    "InfPath"="iscsi.inf"
    "InfSection"="iScsiPort_Install_Control"
    "ProviderName"="Microsoft"
    "DriverDateData"=hex:00,80,8c,a3,c5,94,c6,01
    "DriverDate"="6-21-2006"
    "DriverVersion"="6.0.6000.16386"
    "MatchingDeviceId"="root\\iscsiprt"
    "DriverDesc"="Microsoft iSCSI Initiator"
    "EnumPropPages32"="iscsipp.dll,iSCSIPropPageProvider"
     
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Control\Class\{4D36E97B-E325-11CE-BFC1-08002BE10318}\0000\Parameters]
    "TCPConnectTime"=dword:0000000f
    "TCPDisconnectTime"=dword:0000000f
    "WMIRequestTimeout"=dword:0000001e
    "DelayBetweenReconnect"=dword:00000005
    "MaxPendingRequests"=dword:000000ff
    "EnableNOPOut"=dword:00000000
    "MaxTransferLength"=dword:00040000
    "MaxBurstLength"=dword:00040000
    "FirstBurstLength"=dword:00010000
    "MaxRecvDataSegmentLength"=dword:00010000
    "MaxConnectionRetries"=dword:ffffffff
    "MaxRequestHoldTime"=dword:0000003c
    "LinkDownTime"=dword:0000000f
    "IPSecConfigTimeout"=dword:0000003c
    "InitialR2T"=dword:00000000
    "ImmediateData"=dword:00000001
    "ErrorRecoveryLevel"=dword:00000002
    "PortalRetryCount"=dword:00000005
    "NetworkReadyRetryCount"=dword:0000000a
    "SrbTimeoutDelta"=dword:0000000f
     
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Control\Class\{4D36E97B-E325-11CE-BFC1-08002BE10318}\0000\PersistentTargets]
    @=""
     
    [HKEY_LOCAL_MACHINE\PE_Sys\ControlSet001\Control\Class\{4D36E97B-E325-11CE-BFC1-08002BE10318}\Properties]
    "DeviceType"=dword:00000004
    "DeviceCharacteristics"=dword:00000100
    "Security"=hex:01,00,04,90,00,00,00,00,00,00,00,00,00,00,00,00,14,00,00,00,02,\
      00,34,00,02,00,00,00,00,00,14,00,ff,01,1f,10,01,01,00,00,00,00,00,05,12,00,\
      00,00,00,00,18,00,ff,01,1f,10,01,02,00,00,00,00,00,05,20,00,00,00,20,02,00,\
      00
  6. Import iscsi.reg into registry.  It should update both PE_Sys and PE_Soft hive.
  7. Unload both PE_Sys and PE_Soft hive by using File | Unload Hive… in registry editor.
  8. Unmount and commit the WinPE mount:
    imagex /unmount /commit mount
  9. The WinPE image file is now ready with iSCSI service.

Start iSCSI service in WinPE environment

  1. Boot the WinPE image either by using ISO or PXE
  2. To start iSCSI service:
    X:\windows\system32>net start msiscsi
    The Microsoft iSCSI Initiator Service service is starting.
    The Microsoft iSCSI Initiator Service service was started successfully.
  3. type iscsicpl to start iSCSI GUI windows:

    Windows 7-2011-12-02-12-12-55
  4. The iSCSI initiator is now active to connect to iSCSI target.

Reference

  1. WinPE v3.0 and Microsoft iSCSI Initiator. URL: http://www.gregorystrike.com/2010/01/08/winpe-v3-0-and-microsoft-iscsi-initiator/