Jump to content
  • 0

NIC driver for Windows PE

rudi schoeble


We use ShadowProtect to do P2V conversions and test our backup & restore procedures. This involves booting a new VM using a Windows PE ISO image which then connects to a network share containing our backup image files and restores them to the new VM drives.

It works fine, however copying the backup image files is very slow. Once the VM is restored and Xentools is installed copying the same images is considerably faster. I suspect the NIC driver that the Windows PE environment uses may be the issue. The PE environment does provide the opportunity to load custom NIC drivers and I'd like to try the driver used with Xentools as a test, however I can't find a .inf file that the WIndows PE environment is looking for.

Any ideas on where or how I could obtain the NIC driver .inf file used by Xentools?


  • Like 1
Link to comment
  • Answers 64
  • Created
  • Last Reply

Top Posters For This Question

Recommended Posts

  • 0

Found a simply way to get an GB-Nic. This is a patch for XenServer 6.2 to allow Intel e1000 NICs instead of the awful Realtek 8139 ones it includes by default.

To apply this patch you'll need to copy it to your server (e.g. via scp) and back up your current /opt/xensource/libexec/qemu-dm-wrapper like so:

# cp /opt/xensource/libexec/qemu-dm-wrapper ~/qemu-dm-wrapper.original

Then patch your qemu-dm-wrapper:

# patch /opt/xensource/libexec/qemu-dm-wrapper < qemu-dm-wrapper-e1000.patch

If that goes smoothly you can create a new VM and have the MAC address of your NIC(s) start with 00:11:11 and they will automagically get assigned e1000 NICs instead!

I like this website for generating random addresses: http://www.miniwebtool.com/mac-address-generator/


An here the link for the patch :



Good luck !


Link to comment
  • 0

I also found this post by Ben Chalmers and it worked a treat - throughput in WinPE on XenGuest is now awesome! .


I just manually mounted the WinPE image and ran the commands to install the drivers and import the registry entries.





rem Sample script for installing XenServer PV Drivers to a Windows PE Image
rem Using the Microsoft Windows 8 ADK
rem usage: ADK8.bat <wim file> <driver folder> [x86|x64]
rem this presupposes you have a WIM file generated, perhaps using
rem copype.cmd, but not mounted

echo "Wim File: %1"
echo "Drivers: %2"
echo "Arch: %3"

rem Create a folder to mount the wim file to, then mount it
mkdir mountpe
dism /Mount-Image /ImageFile:"%1" /index:1 /MountDir:"mountpe"

rem Add the driver files

dism /add-driver /image:"mountpe" /Driver:"%2\xenbus\%3\xenbus.inf"
dism /add-driver /image:"mountpe" /Driver:"%2\xenvbd\%3\xenvbd.inf"
dism /add-driver /image:"mountpe" /Driver:"%2\xennet\%3\xennet.inf"
dism /add-driver /image:"mountpe" /Driver:"%2\xenvif\%3\xenvif.inf"

rem Make the registry changes needed to set up filters and unplug
rem the emulated devices

reg load HKLM\pemount mountpe\Windows\System32\config\SYSTEM
reg ADD HKLM\pemount\ControlSet001\Services\xenbus\Parameters /v ActiveDevice /t REG_SZ /d "PCI\VEN_5853&DEV_0002&SUBSYS_00025853&REV_02"
reg ADD HKLM\pemount\ControlSet001\Services\xenfilt /v WindowsPEMode /t REG_DWORD /d 1
reg ADD HKLM\pemount\ControlSet001\Services\xenfilt\UNPLUG /v DISKS /t REG_MULTI_SZ /d xenvbd
reg ADD HKLM\pemount\ControlSet001\Services\xenfilt\UNPLUG /v NICS /t REG_MULTI_SZ /d xenvif\0xennet
reg ADD HKLM\pemount\ControlSet001\Services\xennet /v Count /t REG_DWORD /d 1
reg ADD HKLM\pemount\ControlSet001\Services\xenvif /v Count /t REG_DWORD /d 1
reg ADD HKLM\pemount\ControlSet001\Services\xenvbd /v Count /t REG_DWORD /d 1
reg ADD HKLM\pemount\ControlSet001\Control\class\{4D36E96A-E325-11CE-BFC1-08002BE10318} /v UpperFilters /t REG_MULTI_SZ /d XENFILT
reg ADD HKLM\pemount\ControlSet001\Control\class\{4D36E97D-E325-11CE-BFC1-08002BE10318} /v UpperFilters /t REG_MULTI_SZ /d XENFILT
reg unload HKLM\pemount

rem Unmount the wim file, and commit the changes

dism /unmount-image /mountdir:mountpe /commit

rem To generate a CD Image
rem makewinpemedia /ISO . c:\work\pe8.iso

  • Like 2
Link to comment
  • 0

The batch files hosted on github only seem to work with XenServer 6.2.  For those of you that need to get this working for XenServer 6.0.2, I've figured out the key to getting the drivers to work.  The drivers expect a certain key to exist in the enum tree of the winpe registry.  I was able to figure it out by comparing what installwinpe.exe does with a vanilla winpe with just the drivers installed. First create xen_enum.reg with the contents:


Windows Registry Editor Version 5.00




Then collect the latest xenserver 6.0.2 drivers.  You can get them from the Windows\System32\DriverStore\FileRepository dir of a system with the tools installed.  Note that you need the 32-bit drivers (at least for winpe 3.0, not sure about other versions).  Grab all the xen* dirs from that directory and put them in a directory with the xen_enum.reg file you created. 


Then install the drivers into your winpe image with something like this:





REM mount the image

mkdir mountpe
dism /Mount-Image /ImageFile:"boot.wim" /index:1 /MountDir:"mountpe"



REM install the drivers

dism /add-driver /image:"mountpe" /Driver:"c:\xen_drivers" /recurse

REM update the registry
reg load HKLM\pemount mountpe\Windows\System32\config\SYSTEM
reg import c:\xen_drivers\xen_enum.reg
reg unload HKLM\pemount


REM unmount the wim file

dism /unmount-wim /Mountdir:"mountpe" /commit



I hope this helps someone else because it drove me crazy for a long time.

Link to comment
  • 0

I have managed to amend the StorageCraft Recovery Environment builder boot.vim to create a ShadowProtect Recover Environment ISO that has improved Xenserver network speed. The default NIC has only 5MB but with the drivers injected as described in Blaine's blog URL http://blogs.citrix.com/2015/03/03/how-to-create-a-winpe-boot-disc-with-xenserver-paravirtualized-network-driver-installed/, I'm able to get 25-30MB on a GB network from the NAS.


The changes are really straight forward and the amendments to the blog are in RED below.



·         The installation bundle is extracted in the local path E:\Citrix\

·         The driver path after extraction is E:\Citrix\6_5_PE_install\installer\pe

·         The ADK8.bat in the install bundle scripts directory has the following pre-configured destination for the resultant WinPE                   ISO c:\pedisc\pe8-%3.iso. The path needs to be created or the script edited to place the ISO in a path that does exist.

·         The WinPE build directory is c:\windows8-x86 (created in step 5 below)

·         The StorageCraft Recovery Environment builder is installed


Step-By-Step Process

1.     Download  and install the Windows Assessment and Deployment Kit (ADK) for Windows® 8

2.     Download the XenServer 6.5 PE install bundle

3.     Extract the install bundle ZIP file.

4.     Start the ADK Environment as Administrator using “Run as Administrator”

5.     Create the WinPE build environment issuing the command:

        C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation                                         Environment\copype.cmd x86 C:\windows8-x86

6.     Copy directories 



C:\Users\%username%\AppData\Local\StorageCraft\ReBuilder\Target\sources (Replaces the default boot.wim with the storagecraft one)

                  To C:\windows8-x86\media

7.     Run the ADK8.bat issuing the following command:

                  Usage: ADK8.bat <wim file> <driver folder> [x86|x64]

                  E:\Citrix\6_5_PE_install\installer\pe\scripts\ADK8.bat C:\windows8-x86\media\sources\boot.wim                                                         E:\Citrix\6_5_PE_install\installer\pe x86

          8. Copy ISO to ISO storage repository

          9. Boot VM using newly created ISO

            10. Verify that PV driver is loaded by issuing the ipconfig /all command and looking for “XenServer PV Network Device” in the                             description field of the network adapter.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...