RIS for Linux - Boot winpe from the net / Ris Windows Installation
A new pdf guide written from scratch it's available on the main page
This document describes how to setup an opensource (Linux based) alternative to windows ris
You can also use this stuff to install windows from the net
Required software (warning this guide is very old, I've updated links but the software may be not suitable anymore):
- A Linux box - I prefer debian but other distro are also ok
- Python - I'm using version 2.3 but versions >= 2.1 should be ok
- dchp server - Version 3 needed
- atftpd or tftp hpa - a tftp server
- samba - You need version 3, since version 2.x misses some stuff
- PXELinux - Not strictly needed but useful to make a menu, it's a good tool to use most of pxe features.
Required Stuff:
- ris-linux-0.4.tar.gz - All of my stuff
- startrom.n12, SETUPLDR.BIN, BOOTFONT.BIN (optional) and ntdetect.com from windows xp installation directory (you must uncompress _ files)
- [optional] pxelinux 3.07, modified version to avoid vmware pxe bug
ris-linux contains following files:
- binlsrv.py - Binl server for linux, it also works on windows since it's written in python
- decode.py - Decodes Binl packets
- infparser.py - A python script to build drivers database for binlsrv.py, it analyzes the inf directory
- fixloader.py - SETUPLDR.BIN to ntldr converter
- modldr.py - A tool used for client files modifications
- patches/atftpd-filecase.diff - A patch for aftpd to permit case insensitive file lookups
- patches/tftp-hpa-filecase.diff - A patch for hpa-tftp to permit case insensitive file lookups
- fixup-repository.sh - Shell script to fix case of some files needed by the client via tftp
- winnt.sif - A base winnt.sif file to start windows pe from network
- winnt-ris.sif - A base winnt.sif file if you want to install windows from network
TFTP Server
Download atftpd apply the patch, compile and install it, you can configure it using inetd, by adding the following line:
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot
If you are using hpa tftp server apply the respective patch and recompile it. The author suggested me to run hpa tftp server standalone without using inetd, because inetd support is broken and hpa tftp can directly handle tcpwrappers.
Please note that filecase lookup doesn't work (at least for me) when having links in the path, I suppose this is a security measure, or maybe the linked path should be in the chroot. Anyway this is not related to my lookup patch, if you are using hpa ftpd you should known how it works :)
DHCP: bootp
Assuming the tftpd and dhcp/bootp directory is /tftpboot, we need to have following files:
- pxelinux.0 (part of syslinux/pxelinux)
- pxelinux.cfg/default pxelinux default configuration
- startrom.0 - rename startrom.n12 in startrom.0
- winnt.sif - use the one in my archive
- SETUPLDR.BIN - rename it to ntldr and use fixloader.py ntldr
- ntdetect.com from windows xp installation directory
- BOOTFONT.BIN - OPTIONAL - some versions don't have it (I think it's related to locale fonts)
All files should be in the root of tftpd directory.
Take care of case since files must have exactly the case used in this document
pxelinux.cfg/default is a standard syslinux file you can use this simple one:
TIMEOUT 0 PROMPT 1 label xpe kernel startrom.0
DHCP Server configuration
Edit dhcp server configuration, in my distro is /etc/dhcp3/dhcpd.conf
Configure the server this way:
subnet 192.168.129.0 netmask 255.255.255.0 { range dynamic-bootp 192.168.129.100 192.168.129.110; default-lease-time 600; max-lease-time 7200; filename "pxelinux.0"; server-name "attila.of.war"; next-server attila.of.war; }
Replace attila.of.war with your dhcp server name, also use startrom.0 instead of pxelinux.0 if you don't want to use pxelinux.
Samba configuration
Make your build without iso and copy the contents of pebldr directory in a suitable place, a
good choice is to name the directory ris and rename pebldr folder to winpe.
The directory structure should be ris/winpe/i386..., also you need to put a symbolic link
in /tftpboot pointing to winpe directory. If your tftp server doesn't allow symbolic links you
should put the directory on the top of your tftp server root.
An example configuration for samba:
[REMINST] path = /mnt/disk/ris browsable = true read only = No guest ok = Yes
You must set null passwords = true in smb.conf.
You also need to modify server name and path in SetupSourceDevice option of winnt.sif file.
Edit the path in fixup-repository.sh and launch it to fix case of needed files.
Note: you don't need to fix names if you are using my new atftpd patch.
Binl Server
First you need to build device driver cache using infparser.py,
e.g. infparser.py /mnt/disk/ris/winpe/i386/inf, this will create
devlist.cache file that must be in same directory of binlsrv.py.
Now you can launch binlsrv.py, it will load the driver cache and will reply
to client requests.
./binlsrv.py Succesfully loaded 662 devices Binlserver started...
Then start the client and boot from network, at pxelinux prompt enter xpe, the client will start and if all is ok binlsrv.py should receive a driver request:
Recv NCQ len = 48 NCQ Driver request [R] Vid: 0x1022 [R] Pid: 0x2000 [R] rev_u1 = 0x2 [R] rev_u2 = 0x0 [R] rev_u3 = 0x0 [R] rev = 0x10 [R] rev2 = 0x88 [R] subsys = 0x20001022 Checking PCI\VEN_1022&DEV_2000&SUB_20001022 Checking PCI\VEN_1022&DEV_2000 Found PCI\VEN_1022&DEV_2000 in netamd2.inf [S] Packet len = 0xc4 (196) [S] Result code: 0x0 [S] type: 0x2 [S] base offset = 0x24 (36) [S] drv_off = 0x50 (80) [S] srv_off: 0x6a (106) -> 98 from start [S] plen: 0x56 (86) [S] p_off: 0x76 (118) -> 110 from start [S] hid: PCI\VEN_1022&DEV_2000 - Len 0x15 (21) [S] drv: pcntpci5.sys - Len 0xc (12) [S] srv: PCnet - Len 0x5 (5) [S] Len data now -2 = 0x54 (84) [S] Description (REG_EXPAND_SZ [2]) = Scheda Ethernet PCI AMD PCNET Family [S] Characteristics (REG_SZ [1]) = 132 [S] BusType (REG_SZ [1]) = 5 [S] Total Params: 3
Finally if xpe starts but tcpip network will not work, windows shares are ok, any solution?
Windows RIS installation from the net
If you want to use windows remote installation service you should use winnt-ris.sif and rename
it to winnt.sif, you can setup both xpe from pxe and windows installation by renaming
ntldr and winnt.sif and hex-editing the files, I'll add an howto soon for this.
Also make sure you have files in the path specified in winnt.sif.
Note: Right now windows installation from the net works only if bypassing all ris stuff,
so you'll not able to use OSChooser.
A detailed description about configuring this can be found here.
Note: if your card doesn't support network boot you can use a floppy image made with
ROM-O-Matic,
part of iPXE project.
Select Floppy bootable ROM Image (.zdsk) (Using Advanced mode), default options are ok.
Write it with RawriteWin from windows
or using cat image.zdsk > /dev/fd0 from Linux.
There is also a tool shipped with Windows Server
named rbfg.exe that makes similar floppy images but it doesn't support all cards supported
by etherboot.
I've made a driver with support for most common nics, compiled drivers: 3c90x 3c595 eepro100 e1000 ns8390 rtl8139 tg3 tulip pcnet32 via-rhine forcedeth sis900 etherboot.zdsk (old etherboot, not iPXE)
Glossary
Ris: Remote Installation System
Binl: Boot Information Negotiation Layer
PXE: Pre-Boot Execution Environment
DHCP: Dynamic Host Configuration Protocol
tftp: Trivial File Transfer Protocol
ChangeLog
binlsrv.py:
0.9 - Modified a bit the engine, now it supports amd64 entries but it can work differently
0.8 - Server options, more documentation, fixes on RQU packets
0.7 - Internal (not public)
0.6 - Added OFF packet
0.5 - Workaround for broken hosts file
infparser.py:
0.8 - Display a warning instead of bombing for broken infs
0.7 - Fixed manifacturer.nt.5.1 problem
0.6 - Fixed problem with Altima inf