18
08/09
Installing Windows 7 with a PXE boot server
What?
This is a guide on how to install Windows 7 using a syslinux-based PXE server.
Why?
Since I got a ThinkPad X61 Tablet and no X6 Tablet Ultrabase or any other external DVD drive I have to install every operating system on this laptop with USB flash drives or, and this is the prettier way, over my home network. To accomplish this I’ve set up a PXE server for all the Linuxes I use. But I still had to use CD’s and DVD’s for installing Windows.
There are some ways to install Windows XP through PXE but the problem with these solutions is that you will need a Windows Server machine for this. You could also use a Linux machine with a PXE server running and boot into a memdisk with the installation disc image loaded. But the PXE booted memdisk will only take up to 500MB of data and every (not modified) XP image is larger than this.
With the release of Windows Vista Microsoft released a new version of their Preinstallation Environment which is said to work better on Linux PXE servers. There are some howtos about this on the net but I never tried this.
Now with the upcoming release of Windows 7 there will be another new version of Windows PE. This guide will show how to accomplish the task of using Windows PE 3.0 with a syslinux-based PXE environment.
What will you need?
- A working PXE boot server with syslinux (there are plenty of howtos, just google them). If you plan to use a Linux server as I did, I would recommend to use tftpd-hpa because it supports path remappings. Without these remappings the TFTP server won’t find the correct paths in your filesystem, because some paths are hardcoded.
- An image of your Windows 7 Installation disc (I’ve just used the images I downloaded from MSDN)
- The Windows Automated Installation Kit (AIK) for Windows 7 (Download)
- A working Windows-based computer (I have used an installation of Windows XP in VirtualBox)
How?
- Run the Windows AIK Setup on your Windows computer.
- Start the Deployment tools command prompt.
- Run the following shell script. It will prepare your Windows bootloader for usage with PXE. There are some variables set in the lines 5-17. You can change them to your favor.
@echo off cls REM Variables echo Setting variables ... REM the path to your WAIK installation set WAIKPath=%ProgramFiles%\Windows AIK echo Set WAIK directory to %WAIKPath%. REM possible values are: x86, amd64 and ia64 set ARCH=x86 echo Set architecture to %ARCH%. set PEPath=C:\winpe_%ARCH% echo Set temporary working directory for Windows PE to %PEPath%. set TFTPPath=C:\tftp\Boot echo Set TFTP boot directory to %TFTPPath%. REM Don't change this one! set BCDStore=%TFTPPath%\BCD echo Set BCD store to %BCDStore%. echo All variables set! echo. REM Environment check echo Checking for clean environment... if not exist "%WAIKPATH%" set NoWAIK=1 && goto :end if not exist "%WAIKPath%\Tools\PETools\%ARCH%" set NoARCH=1 && goto :end if exist %PEPath% echo Temporary working directory not empty! Need to remove && rd %PEPath% /S if exist %PEPath% echo Temporary working directory still not empty! Trying again ... && cd "%WAIKPath%\Tools\%ARCH%" && imagex /unmount %PEPath%\mount && rd %PEPath% /S /Q if exist %PEPath% set NotClean=1 && goto :end if exist %TFTPPath% echo TFTP boot directory not empty! Need to remove && rd %TFTPPath% /S if exist %TFTPPath% set NotClean=1 && goto :end if exist %BCDStore% echo BCD store existing! Need to remove && del /P %BCDStore% if exist %BCDStore% set NotClean=1 && goto :end echo. REM WORK! echo Starting real work now ... cd "%WAIKPath%\Tools\PETools" echo Copying PE-Files ... call copype %ARCH% %PEPath% echo Mounting Windows PE image ... imagex /mountrw %PEPath%\winpe.wim 1 %PEPath%\mount md %TFTPPath% > NUL copy %PEPath%\mount\Windows\Boot\PXE\*.* %TFTPPath% > NUL copy "%WAIKPath%\Tools\PETools\%ARCH%\boot\boot.sdi" %TFTPPath% > NUL copy %PEPath%\winpe.wim %TFTPPath% > NUL cd %PEPath%\mount\Windows\System32 bcdedit -createstore %BCDStore% bcdedit -store %BCDStore% -create {ramdiskoptions} /d "Ramdisk options" bcdedit -store %BCDStore% -set {ramdiskoptions} ramdisksdidevice Boot bcdedit -store %BCDStore% -set {ramdiskoptions} ramdisksdipath \Boot\boot.sdi for /f "Tokens=3" %%i in ('bcdedit /store %BCDStore% /create /d "Windows 7 Install Image" /application osloader') do set GUID=%%i bcdedit -store %BCDStore% -set %GUID% systemroot \Windows bcdedit -store %BCDStore% -set %GUID% detecthal Yes bcdedit -store %BCDStore% -set %GUID% winpe Yes bcdedit -store %BCDStore% -set %GUID% osdevice ramdisk=[boot]\Boot\boot.wim,{ramdiskoptions} bcdedit -store %BCDStore% -set %GUID% device ramdisk=[boot]\Boot\boot.wim,{ramdiskoptions} bcdedit -store %BCDStore% -create {bootmgr} /d "Windows 7 Boot Manager" bcdedit -store %BCDStore% -set {bootmgr} timeout 30 bcdedit -store %BCDStore% -set {bootmgr} displayorder %GUID% bcdedit -store %BCDStore% pause goto :exit :end if %NoWAIK%=1 echo "Your WAIK directory was not found. Execution aborted." && pause && goto :exit if %NoARCH%=1 echo "Your Architecture doesn't seem to be right. Or at least it is not known by your WAIK installation. Execution aborted." && pause && goto :exit if %NotClean%=1 echo "Your environment was not clean. Execution aborted." && pause && goto :exit :exit - If nothing went wrong you should have some files in the directory which is set in the TFTPPath variable. Copy these files into a subdirectory of your TFTP servers boot directory. In my case this is /var/lib/tftpboot.
If you’re not using tftpd-hpa you should place all files into a subdirectory called “Boot”. This is very essential.
If you’re using tftpd-hpa you can place it in any subdirectory you want to, because you can remap the paths. I chose /var/lib/tftpboot/windows/7.For the remapping we need to do some extra steps:- Create a remapping file called /var/lib/tftpdboot/tftpd.remap with the following content (change paths to your needs):
re ^pxeboot\.n12 windows/7/pxeboot.n12 re ^pxeboot\.com windows/7/pxeboot.com re ^pxeboot\.0 windows/7/pxeboot.n12 re ^bootmgr\.exe windows/7/bootmgr.exe r ^\\Boot\\ windows/7/ r ^\\boot\\ windows/7/ r ^Boot/ windows/7/ r ^/Boot/ windows/7/ r ^boot/ windows/7/ r ^/boot/ windows/7/ r ^\\ windows/7/ rg \\ /
- Edit your tftpd-hpa configuration in /etc/default/tftpd-hpa to parse the remappings:
#Defaults for tftpd-hpa RUN_DAEMON="yes" OPTIONS="-l -m /var/lib/tftpboot/tftpd.remap -s /var/lib/tftpboot -vvv"
The -vvv part is optional, but highy recommended to get the most verbose output in /var/log/syslog.
- Create a remapping file called /var/lib/tftpdboot/tftpd.remap with the following content (change paths to your needs):
- Now you’ll need to create some symbolic links in your Windows boot directory.
ln -s pxeboot.n12 startrom.0 ln -s winpe.wim boot.wim
- To map the Image in your pxelinux menu just edit your pxelinux config and add the following lines:
LABEL win7 MENU LABEL Windows 7 KERNEL Boot/startrom.0 - Because the boot image is just a Windows PE image with a minimal shell you’ll need to make your installation source accessible over your network. For this I’ve just created a guest-readable samba share on the same server where my PXE server resides.
You’ll need to copy the content of the sources directory on your installation media into this share. - The configuration is done. Let’s try to install Windows 7. Start your target computer, boot into your PXE menu and choose the Windows 7 menu point. When the system is completely booted you should get the mentioned Windows shell. To connect to your installation share and start the stup just type the following commands (where the text in squared brackets should be replaced with the appropriate data):
net use y: \\[IP of your share server]\[name of your share] y: setup.exe
That’s all the installation of windows 7 should start now.
Additional notes:
- It is not possible to run a x86 Windows PE and start an amd64 installation from this. If you plan to install an amd64 System but only got an x86 system to do the configuration (or vice versa) you might run into errors. In this case just configure the installation source for the architecture you’re currently using. At the end you can just copy the winpe.wim you would like to use from %ProgramFiles%\Windows AIK\Tools\PETools\%ARCH% into your source and overwrite the old one.
You can also place both files in your source directory and just change the symlink to the right file. This is the way I did it. The last option is to create a second entry in the PE boot loader with bcdedit. But this caused my boot loader to have two entries, both named “Ramdisk options” but pointing to different images (x86 and amd64). This could be confusing if you don’t remember which entry entry is for x86 or amd64. - If you plan to use a Windows based PXE server for the installation I recommend tftpd32. I have not tried this way but the most how-to’s for installing Windows Vista by PXE recommend this one. You need to set pxeboot.com as boot file, you can skip the steps 5 and 6 and you’ll have to rename the winpe.wim to boot.wim.
- Maybe it’s possible to load the Installation image of Windows 7 directly. It’s located in the sources directory of your installation media and is named install.wim. But you’ll definitely need much RAM for this, because both images, x86 and amd64, are over 2GB in size. I was not able to try this because my laptop only got 2GB RAM, so the boot loader blocked loading of an image of this size. But I’m not sure if the error message derived from my amount of RAM or if there was another error while using this image.
- This guide should work for Windows Vista as well or at least the steps should be very similar.
Thanks to…
- Joshua Flanagan for his excelent guides [1] [2] to accomplish this with Windows Vista and tftpd32.
- Gernot Stöckl for some ideas I derived from his Wiki.
Any comments, additions and corrections are greatly appreciated.
bonbonboi
2009/08/30
13:49
Thanks babe for that tutorial.
Drifter
2009/10/23
13:15
I tried to load 7′s install.wim directly as per your suggestion. Even with four RAM sticks of 1GB each I get an error saying that the NBP is too big to fit in the free base memory.
Anyone got an idea how to make the loader aware of all the RAM out there?
Chris
2009/10/25
21:45
Thank you very much for writing this tutorial. I haven’t tried it out yet, but I’m going to!
What I would like to add is that it is possible to install both Win XP and Win 2000 using a Linux PXE server! Check out http://oss.netfarm.it/guides/ris-linux.php for details!
skaven
2009/10/26
09:35
As I said I’m not sure if the error derived from the amount of RAM. Maybe the install.wim just doesn’t work for this. I recommend using a Win PE-Image to boot. If you want to load the installer directly it should be possible to start a script to mount the installation share and start the installer in Windows PE’s command shell just after booting. Just take a closer look at the image customization features of the WAIK.
Travus
2009/11/04
20:10
ok i have the 32bit one up and running
do i need to make a another remap file to point to the 64bit winPE.
at this point the boot.txt is win7
and the label is win7
how to i make it use the new image files to boot to win7x64 winpe
skaven
2009/11/04
22:56
No, you cant’t write another remap file, because is the rampping is global and the paths hardlinked in the windows-bootloader are the same. So you can only make a second entry to your PE loader (the windows boot loader). To do this just execute the lines 51 to 56 in the script twice, but change /d-Switch in the first line of the second entry and the Paths to the winpe.wim (i.e. to winpe.x64.wim).
Matthew
2009/11/10
02:51
This won’t work with the tftp package in RHEL 5. At one point Windows tries to request \boot.ini And then crashed out saying it can’t find \Boot\BCD (with out ever actually trying to request that file – the last thing it asked for was \boot.ini).
It would appear tftpd-hpa rewrite capabilities are required to make this work. Symlinks can fix a lot of sins, but switching \ for / isn’t one of them.
skaven
2009/11/10
07:32
Please check the man-page of the package. I found a package called tftp-server which states the -m Option for the remap file. But I don’t know if this is an official package, since the package lists for RHEL not accessible for me. I just found this by extracting the following RPM: http://rpm.pbone.net/index.php3/stat/4/idpl/3330279/com/tftp-server-0.43-1.i386.rpm.html
Matthew
2009/11/25
23:30
Yes – the official RHEL tftp package does infact support the ‘-m’ flag to tell it to use a remap file.
There is no /etc/default/tftp type file. I just created the remap file in /etc/ and edited the appropriate xinet.d file.
Now to get 32 and 64 bit PE working and then work out how to automatically launch the setup. Even with the manual step, its a step forward to not need the actual media anymore.
zloidemon
2009/12/08
00:39
hi… this is not work
I can not understand the problem. many wrote that it is a problem in the bcdedit, but not one of the documents is not working. and where to get the boot.ini for pxelinux?
Dec 8 05:12:58 server in.tftpd[69518]: RRQ from 192.168.3.3 filename \boot.ini remapped to windows/7/boot.ini
Dec 8 05:12:58 server in.tftpd[69518]: sending NAK (1, File not found) to 192.168.3.3
Dec 8 05:13:36 server in.tftpd[69596]: RRQ from 192.168.3.3 filename \Boot\Fonts\wgl4_boot.ttf remapped to windows/7/Fonts/wgl4_boot.ttf
Dec 8 05:13:36 server in.tftpd[69596]: sending NAK (1, File not found) to 192.168.3.3
and Windows Boot Manager error
File: \Boot\BCD
Status: 0xc0000001
Info: An error occured while attempting to read the boot configuration data.
sorry bad english… Thanks
skaven
2009/12/08
07:35
Looks like wrong file paths. Are you sure, that your path and directory structure is correct? Additional, please check your wim-file configuration with “bcdedit /enum”. And if you’re running your DNS and/or DHCP on another host than your PXE host, please try to run everything on the same host. Different hosts could, as far as i remember, cause some problems.
zloidemon
2009/12/08
07:45
I run pxelinux on a server with freebsd. did all of your how to….
how to use bcdedit /enum in your script.
server# pwd/mnt/tftp
server# ls -laF windows/*
total 229716
drwxr-x--- 2 tftpd tftpd 512 Dec 8 05:10 ./
drwxr-x--- 3 tftpd tftpd 512 Dec 7 15:46 ../
-rwxr-xr-x 1 admin wheel 262144 Dec 8 05:09 BCD*
-rwxr-xr-x 1 admin wheel 1024 Dec 8 05:09 BCD.LOG*
-rwxr-xr-x 1 admin wheel 1347 Dec 7 22:10 WdsConfig.inf*
-rwxr-xr-x 1 admin wheel 79 Dec 7 22:10 abortpxe.com*
-rwxr-xr-x 1 admin wheel 3170304 Dec 8 05:09 boot.sdi*
-rwxr-xr-x 1 admin wheel 523328 Dec 8 05:09 bootmgr.exe*
-rwxr-xr-x 1 admin wheel 26076 Dec 7 22:10 hdlscom1.com*
-rwxr-xr-x 1 admin wheel 26060 Dec 7 22:10 hdlscom1.n12*
-rwxr-xr-x 1 admin wheel 26076 Dec 7 22:10 hdlscom2.com*
-rwxr-xr-x 1 admin wheel 26060 Dec 7 22:10 hdlscom2.n12*
-rwxr-xr-x 1 admin wheel 25772 Dec 7 22:10 pxeboot.com*
-rwxr-xr-x 1 admin wheel 25772 Dec 8 05:09 pxeboot.n12*
lrwxr-xr-x 1 root tftpd 11 Dec 7 22:12 startrom.0@ -> pxeboot.n12
-rwxr-xr-x 1 admin wheel 62476 Dec 8 04:05 syslinux_3.71+dfsg-5_i386.deb*
-rwxr-xr-x 1 admin wheel 31124 Dec 7 22:10 wdsnbp.com*
-rwxr-xr-x 1 admin wheel 116684552 Dec 8 05:09 winpe.wim*
-rwxr-xr-x 1 admin wheel 114088185 Dec 7 22:11 x86.wim*
server# cat /usr/local/etc/t
tftpd-remap.conf trafshow trafshow.dist
server# cat /usr/local/etc/tftpd-remap.conf
re ^pxeboot\.n12 windows/7/pxeboot.n12
re ^pxeboot\.com windows/7/pxeboot.com
re ^pxeboot\.0 windows/7/pxeboot.n12
re ^bootmgr\.exe windows/7/bootmgr.exe
r ^\\Boot\\ windows/7/
r ^\\boot\\ windows/7/
r ^Boot/ windows/7/
r ^/Boot/ windows/7/
r ^boot/ windows/7/
r ^/boot/ windows/7/
r ^\\ windows/7/
rg \\ /
server#cat /etc/rc.conf|grep tftp
tftpd_enable="YES"
tftpd_datadir="/mnt/tftp"
this is my pxelinux
LABEL win7
KERNEL Boot/startrom.0
jan
2010/01/23
22:21
works great, thanks for the tutorial!
Eriq
2010/02/02
18:14
I’m having a bear of a time getting this to work. I set everything up per the instructions, but it seems like the remapping isn’t working.
I get the following on the client PC when I try booting:
File: \Boot\BCD
Status: 0xc000000f
Info: An error occurred while attempting to read the boot configuration data.
All I get in my log is the following:
Feb 2 10:08:39 pxeserver in.tftpd[8170]: tftp: client does not accept options
I see above that there are issues with running the tftp and dhcp from different servers – which I am doing (and do not have the authority to change). Could this be the issue? Is there a workaround?
skaven
2010/02/02
18:24
Yes, that is exactly the error message I got when I tried to run the DNS on my router and the PXE on my server. The bootloader of Windows 7 tries to get some data from the PXE host on port 53, which is the port for DNS requests. Naturally the DNS server (in my case my router) catched up all requests from the install host. There is a workaround for this. If you have access to your DNS host, you can create a forwarding rule to your PXE host for all requests on port 53 coming from your install host. In my case I “simply” created an iptables forwarding rule on my linux-running router for this and everything worked.
Eriq
2010/02/02
19:30
Just to clarify, when you refer to the “install host”, is that the system you’re trying to boot via PXE, or the PXE server itself?
skaven
2010/02/02
20:58
The system you want to install to.
Eriq
2010/02/03
19:03
Thanks – I actually found another method that seems to be working fine. I made a couple of 200mb hard disk images and can boot them via memdisk:
http://www.etherboot.org/wiki/winpe_memdisk
I just had to pass the following parameters in my pxelinux menu:
Label winpe_x86MENU LABEL WinPE 3.0 x86
kernel memdisk
initrd /images/winpe.dd raw ro harddisk=1
Label winpe_amd64
MENU LABEL WinPE 3.0 x64
kernel memdisk
initrd /images/winpe_64.dd raw ro harddisk=1
They boot up just fine and I can install Vista and Windows 7 diskless now.
cruejones
2010/02/04
18:59
everything seems to work but the BCD “boot.wim,{ramdiskoptions}” caused tftp to fail with unknown option error. If I create the BCD without the {ramdiskoptions} as below:
bcdedit -store %BCDStore% -set %GUID% osdevice ramdisk=[boot]\Boot\boot.wim
56 bcdedit -store %BCDStore% -set %GUID% device ramdisk=[boot]\Boot\boot.wim
boot.wim will load via tftp but fail to mount the ramdisk.
Any help is much appreciated.
Thanks
thedude
2010/02/22
22:30
Thank you so much for an excellent HOWTO!! This is a real time-saver for me. AWESOME!!
Paja
2010/02/23
15:48
thanks,it helps a lot,i learned a bit about “for” cmd,in czech language settings(probably the only difference) i needed to set tokens=2 on line 51 (it sets guid to output of bcdedit,right?)…for others,after line 51,echo %GUID%,if it is not that long nonsense,adjust tokens number until it do(this is the easiest way)
skaven
2010/02/23
16:10
Yes, maybe the output doesn’t look the same in other languages. I didn’t even tried it with german systems, in fact I just tried it with english systems. So I wasn’t aware of this. Thanks for the remark. Oh and yes, it sets GUID to the output.
droopy191
2010/03/06
23:41
Thanks a lot for this HOWTO
Note that if you are not running an english version of windows, you may need to adapt line 51 to get the script working.
The output of ‘bcdedit /store %BCDStore% /create /d “Windows 7 Install Image” /application osloader’ is depending on the language of the OS. Example in French,
“L’entrée {3658f806-2968-11df-bba7-0022156d34a7} a été correctement créée.”
So you have do change “Tokens=3″ to “Tokens=2″
cheung
2010/05/23
01:26
Hello,I have read the tutorial.but I get some problem.
How can I know my OS’s language tokens?
skaven
2010/06/03
00:01
Just check the help for the “for”-command and check what “Tokens” causes. Then type the command in the brackets by hand and you’ll see what you have to set. As mentioned before the command sets the %GUID%-variable, so you have to check at which point in the output your GUID is in your language.
ninjabilly
2010/06/07
06:06
can you provide an example of the code you used to forward the dns.
Eric Wheeler
2010/07/15
05:47
You can have multiple .wim boot images in separate directories on the PXE server by updating the BCD in \Boot (actually, I use /tftpboot/winpe3 using tftpd.remap). The bootloader will only load a single BCD, but you *can* have multiple wim’s within that BCD—without updating symlinks as suggested above.
Here’s a snapshot of what it looks like in the windows bootloader:
http://www.portlandlinuxsupport.com/src/pxeboot/2010-07-14–PXE-WinPE3-BCD-multiboot.png
This shows my WinPE 3.0 x64, WinPE 3.0 x32 and a rescue image with all my tools on it. Use this script to add additional boot entries to the BCD after following the directions above.
=== editbcd.bat ==
@echo off
rem This file adds a PXE-booted OS to a BCD loaded by bootmgr.exe
rem Usage: me.bat \some\path\to\BCD “Title of OS” “\pxe\dir\to\the\boot.wim”
rem This is where my BCDEDIT.EXE lives:
e:
cd E:\winpe_x86\mount\Windows\System32
set BCDStore=%1
set TITLE=%2
set PXEDIR=%3
rem This is this is where all the PXE-boot files *except* the .WMI live. The .WMI lives in %PXEDIR%
set SDIDIR=winpe3
echo Creating a bootloader named ‘%TITlE%’ to be loaded via pxe via path ‘\%PXEDIR%’
echo.
echo Creating ramdisk for %TITLE%
for /f “Tokens=3″ %%i in (‘bcdedit /store %BCDStore% /create /d %TITLE% /device’) do set RDGUID=%%i
echo Using Ramdisk GUID=%RDGUID%
bcdedit -store %BCDStore% -set %RDGUID% ramdisksdidevice Boot
bcdedit -store %BCDStore% -set %RDGUID% ramdisksdipath “\%SDIDIR%\boot.sdi”
echo.
echo Creating OSLOADER for %TITLE%
for /f “Tokens=3″ %%i in (‘bcdedit /store %BCDStore% /create /d %TITLE% /application osloader’) do set GUID=%%i
echo GUID=%GUID%
echo Added OSLOADER GUID=%GUID%
bcdedit -store %BCDStore% -set %GUID% systemroot \Windows
bcdedit -store %BCDStore% -set %GUID% detecthal Yes
bcdedit -store %BCDStore% -set %GUID% winpe Yes
bcdedit -store %BCDStore% -set %GUID% osdevice ramdisk=[boot]\%PXEDIR%\boot.wim,%RDGUID%
bcdedit -store %BCDStore% -set %GUID% device ramdisk=[boot]\%PXEDIR%\boot.wim,%RDGUID%
echo.
echo Adding the boot manager.
bcdedit -store %BCDStore% -create {bootmgr} /d “Windows 7 Boot Manager”
bcdedit -store %BCDStore% -set {bootmgr} timeout 30
bcdedit -store %BCDStore% -set {bootmgr} displayorder %GUID% /addlast
===
== This is my tftpd.remap ==
[root@openServer tftpboot]# cat tftpd.remap
re ^bootmgr\.exe winpe3/bootmgr.exe
r ^\\Boot\\ winpe3/
r ^\\boot\\ winpe3/
r ^Boot/ winpe3/
r ^/Boot/ winpe3/
r ^boot/ winpe3/
r ^/boot/ winpe3/
rg \\ /
==
=== My directory tree in the PXE server
[root@openServer tftpboot]# ls -lR winpe windows7*
windows7:
total 111416
lrwxrwxrwx 1 root root 9 Jul 11 21:36 boot.wim -> winpe.wim
-rwxr–r– 1 ewheeler ewheeler 114088185 Jul 11 21:45 winpe.wim
windows7-64:
total 131952
lrwxrwxrwx 1 root root 9 Jul 14 15:58 boot.wim -> winpe.wim
-rwxr–r– 1 ewheeler ewheeler 135115506 Jul 13 2009 winpe.wim
windows7-rescue:
total 423600
lrwxrwxrwx 1 root root 9 Jul 14 15:58 boot.wim -> winpe.wim
-r-xr-xr-x 1 root root 433760935 Jul 14 15:54 winpe.wim
winpe:
total 164936
-rw-r–r– 1 root root 79 Sep 18 2006 abortpxe.com
-rw-r–r– 1 root root 12288 Feb 1 2008 BCD
-rw-r–r– 1 root root 417896 Nov 2 2006 bootmgr.exe
-rw-r–r– 1 root root 3170304 Sep 18 2006 boot.sdi
-rw-r–r– 1 root root 1073334 Jan 31 2008 floppy.IMZ
-rw-r–r– 1 root root 25372 Sep 20 2006 hdlscom1.com
-rw-r–r– 1 root root 25356 Sep 20 2006 hdlscom1.n12
-rw-r–r– 1 root root 25372 Sep 20 2006 hdlscom2.com
-rw-r–r– 1 root root 25356 Sep 20 2006 hdlscom2.n12
-rw-r–r– 1 root root 25068 Sep 20 2006 pxeboot.com
-rw-r–r– 1 root root 25068 Sep 20 2006 pxeboot.n12
-rw-r–r– 1 root root 333 Sep 18 2006 WdsConfig.inf
-rw-r–r– 1 root root 27596 Oct 10 2006 wdsnbp.com
-rw-r–r– 1 root root 164002999 Nov 2 2006 winpe.wim
===
=== My BCD Dump ===
Notice the multiple Ram Disks. It seems that the boot manager names the boot options based on the “/DEVICE” description, not the “Boot Loader” option. I name them the same with the script above.
================================
E:\winpe_x86\mount\Windows\System32>bcdedit.exe -store \\192.168.102.101\data\bcd -enum all
Windows Boot Manager
——————–
identifier {bootmgr}
description Windows 7 Boot Manager
displayorder {7aaf54a8-8fbf-11df-8205-080027e83707}
{8184fa58-8fbf-11df-8205-080027e83707}
{a6f9a7e8-8fbf-11df-8205-080027e83707}
timeout 30
Windows Boot Loader
——————-
identifier {7aaf54a8-8fbf-11df-8205-080027e83707}
device ramdisk=[boot]\windows7\boot.wim,{7a76cab8-8fbf-11df-8205-080027e83707}
description WinPE 3.0 (Win7) 32-bit Command Line Only
osdevice ramdisk=[boot]\windows7\boot.wim,{7a76cab8-8fbf-11df-8205-080027e83707}
systemroot \Windows
detecthal Yes
winpe Yes
Windows Boot Loader
——————-
identifier {8184fa58-8fbf-11df-8205-080027e83707}
device ramdisk=[boot]\windows7-64\boot.wim,{814c7068-8fbf-11df-8205-080027e83707}
description WinPE 3.0 (Win7) 64-bit Command Line Only
osdevice ramdisk=[boot]\windows7-64\boot.wim,{814c7068-8fbf-11df-8205-080027e83707}
systemroot \Windows
detecthal Yes
winpe Yes
Windows Boot Loader
——————-
identifier {a6f9a7e8-8fbf-11df-8205-080027e83707}
device ramdisk=[boot]\windows7-rescue\boot.wim,{a6b4e478-8fbf-11df-8205-080027e83707}
description WinPE 3.0 (Win7) 32-bit Multi-tool Rescue Image
osdevice ramdisk=[boot]\windows7-rescue\boot.wim,{a6b4e478-8fbf-11df-8205-080027e83707}
systemroot \Windows
detecthal Yes
winpe Yes
Device options
————–
identifier {7a76cab8-8fbf-11df-8205-080027e83707}
description WinPE 3.0 (Win7) 32-bit Command Line Only
ramdisksdidevice boot
ramdisksdipath \winpe3\boot.sdi
Device options
————–
identifier {814c7068-8fbf-11df-8205-080027e83707}
description WinPE 3.0 (Win7) 64-bit Command Line Only
ramdisksdidevice boot
ramdisksdipath \winpe3\boot.sdi
Device options
————–
identifier {a6b4e478-8fbf-11df-8205-080027e83707}
description WinPE 3.0 (Win7) 32-bit Multi-tool Rescue Image
ramdisksdidevice boot
ramdisksdipath \winpe3\boot.sdi
================================
W7 PXE boot med syslinux » Nahaz's Internets
2010/07/20
15:41
[...] doomclaw.de/index.php/2009/08/18/installing-windows-7-with-a-pxe-boot-server/ [...]
korkin25
2010/09/20
02:32
Hi,
I have tried it, but…
I have:
dhcpd.conf:
subnet 192.168.10.0 netmask 255.255.255.0 {
host alena {
fixed-address 192.168.10.71;
hardware ethernet 00:26:18:87:9c:9d;
filename “/tftpboot/pxeboot.com”;
server-name “nas.home”;
}
}
root@nas:/# cat /etc/default/tftpd-hpa
# /etc/default/tftpd-hpa
TFTP_USERNAME=”tftp”
TFTP_DIRECTORY=”/tftpboot”
TFTP_ADDRESS=”0.0.0.0:69″
TFTP_OPTIONS=”–secure -c -p -l -m /var/lib/tftp/tftpd.remap -vvv”
I try to boot and see:
Sep 20 03:56:32 nas dhcpd: Listening on LPF/eth2/00:1c:c0:71:5a:0a/192.168.10.0/24
Sep 20 03:56:32 nas dhcpd: Sending on LPF/eth2/00:1c:c0:71:5a:0a/192.168.10.0/24
Sep 20 03:56:32 nas dhcpd: Sending on Socket/fallback/fallback-net
Sep 20 03:56:32 nas dhcpd: DHCPDISCOVER from 00:26:18:87:9c:9d via eth2
Sep 20 03:56:32 nas dhcpd: DHCPOFFER on 192.168.10.71 to 00:26:18:87:9c:9d via eth2
Sep 20 03:56:34 nas dhcpd: DHCPREQUEST for 192.168.10.71 (192.168.10.100) from 00:26:18:87:9c:9d via eth2
Sep 20 03:56:34 nas dhcpd: DHCPACK on 192.168.10.71 to 00:26:18:87:9c:9d via eth2
Sep 20 03:56:34 nas in.tftpd[4463]: remap: input: /pxeboot.com
Sep 20 03:56:34 nas in.tftpd[4463]: remap: done
Sep 20 03:56:34 nas in.tftpd[4463]: RRQ from 192.168.10.71 filename /pxeboot.com
Sep 20 03:56:34 nas in.tftpd[4463]: tftp: client does not accept options
Sep 20 03:56:34 nas in.tftpd[4464]: remap: input: /pxeboot.com
Sep 20 03:56:34 nas in.tftpd[4464]: remap: done
Sep 20 03:56:34 nas in.tftpd[4464]: RRQ from 192.168.10.71 filename /pxeboot.com
On the PC “TFTP download failed. Press any key to reboot”
I have tried to add 066 option with ip address of tftpserver, but no success…
Thank you.
Combat
2010/09/28
03:29
On the PC “TFTP download failed. Press any key to reboot”
-I have the same but i have tftp-server not tftpd-hpa, at mine is the line:
server_args inspite OPTIONS… that has no matter…
but i think remap doesn’t work at my case
any suggestions?
skaven
2010/09/28
07:10
That message seems to be an error from your PXE-ROM. Not from the Windows-Bootloader. The remapping is only needed after you actually loaded the Windows-Image and the Bottloader within this image kicks in. If you get this message before you get to the syslinux-menu, then this is an error from the PXE-ROM which means that your general tftp-config is not correct.
But you should really consider using tftpd-hpa because you will need the remapping as soon as you got the Windows 7 image loading.
PXE boot CD/DVD ISO images... - Page 2
2010/11/02
00:28
[...] Windows XP, Vista and 7. For Windows XP i used this guide: RIS for Linux and for Vista and 7 this: Installing Windows 7 with a PXE boot server and this for unattended installations: [Unattended] Successful Windows 7 Automated Network [...]
RIS Problem
2010/12/03
18:17
[...] Maybe you are also interested to install Vista/Windows 7 over the network from a Linux server: Basics and Unattended. Both guides are for Windows 7, but work also with [...]
moi
2011/01/04
18:36
I am having an issue when running the command:
for /f “Tokens=3″ %%i in (‘bcdedit /store %BCDStore% /create /d “Windows 7 Install Image” /application osloader’) do set GUID=%%i
It gives me “%%i was unexpected at this time”. Any ideas?
skaven
2011/01/05
07:57
This error is normally displayed, when you run the command directly from command line instead within a script. To run the command directly you will have to use ‘%i’ instead of ‘%%i’.
moi
2011/01/05
08:51
thanks Skaven! I was indeed running the commands from the shell. I will retry later today. Thanks again!
Kabassanov
2011/01/13
20:56
%%i was unexpected at this time”. Any ideas?
You have to be carefull because tokens are (at least) langage dependent. For example, in French versions the GUID is the 2nd and not the 3th token. you have to modify the script or the following bcdedit commands will fail.
There is also something strange with the mounted image… I can’t see any commit after all modifications have been done…
shpokas
2011/02/06
22:40
awesome!
Need application on server to allow Network boot of windows pc's force boot img load
2011/04/06
13:23
[...] want to install Windows over the network (deployed from a Linux server) you should have a look at this and this for Windows Vista/7, I have already used those HowTos and they work fine. For older [...]
Jeff McAffee
2011/05/12
22:25
Thanks for the info!
I was able to get this to work successfully with a few modifications.
Instead of installing dhcp (or dnsmasq) on the server I was able to use my router because it’s running DD-WRT.
Under the Services tab:
Enable DNSMasq (if it is not already enabled).
In the options box, enter:
dhcp-boot=pxelinux.0,[TFTP-HOST-NAME],[TFTP-SERVER-IP]
Replace [TFTP-HOST-NAME],[TFTP-SERVER-IP] with the actual values for your PXE server. In my case, the line looked like:
dhcp-boot=pxelinux.0,hermes,192.168.1.101
At this point, I was able to find the PXE server during boot up but I was getting an error during the PXE boot about Forbidden directory.
From what I could find online, this is a bug in tftpd-hpa. Everything says that using the -s (–secure) option will fix it, but even with the -s option in the tftpd-hpa configuration, I was still getting this error.
To work around this, I installed xinetd and made these changes:
For the tftpd-hpa configuration in /etc/default/tftpd-hpa:
RUN_DAEMON = “no”
I then created a xinet conf file for tftp (/etc/xinetd.d/tftp) containing:
service tftp
{
protocol = udf
port = 69
socket_type = dgram
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s -m /var/lib/tftpboot/tftpd.remap -vvv /var/lib/tftpboot
disable = no
}
Now to restart xinet:
sudo /etc/init.d/xinetd restart
What’s happening here is that instead of running tftp in stand-alone mode, I have xinet start it when needed.
One other note, I found that I needed to make sure the /var/lib/tftpboot dir (and all child dirs) had a+r permissions:
sudo chmod -R a+r /var/lib/tftpboot
Hopefully this will help others (and prevent bruised foreheads due to keyboard impacts).
Network Booting – Part iii | Greg Williams
2011/07/17
22:43
[...] following batch script can then be used to prepare a Windows PE image (copied from here). Please note it must be run from an AIK cmd prompt (Start -> All Programs -> Microsoft [...]
Justin
2012/02/12
19:38
This was a great help. Thanks so much!