基于debian的pxe网启服务器

Links:
https://help.ubuntu.com/community/PXEInstallMultiDistro

http://oss.netfarm.it/guides/pxe.php

https://www.centos.org/forums/viewtopic.php?f=47&t=49520 ###CENTOS BOOTISSUE

http://drbl.nchc.org.tw/fine-print.php?path=./advanced/01_DRBL/08-drbl-sanboot.faq#08-drbl-sanboot.faq

Basic setup
tftpd-hpa syslinux isc-dhcp-server(optional:if you do not have a dhcp server) tftp-hpa(optional:just to test tftpd)

#TFTP (debian)
apt-get install tftpd-hpa
edit /etc/default/tftpd-hpa,modify TFTP_DIRECTORY to where you want to hold the files or just leave itthen restart tftpd :
/etc/init.d/tftpd-hpa restart

#download debian installer netboot.tar.gz and decompress to tftp directory:

tar zxvf netboot.tar.gz

#ISC-DHCP-SERVER(Debian)

apt-get install isc-dhcp-server

edit /etc/dhcp/dhcpd.conf

example:
default-lease-time 600;
max-lease-time 7200;

allow booting;

# in this example, we serve DHCP requests from 192.168.0.(3 to 253)
# and we have a router at 192.168.0.1
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.3 192.168.0.253;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1; # our router
option domain-name-servers 192.168.0.1; # our router, again
filename “pxelinux.0”; # (this we will provide later)
}

group {
next-server 192.168.0.2; # our Server
host tftpclient {
filename “pxelinux.0”; # (this we will provide later)
}
}

then restart dhcp with /etc/init.d/isc-dhcp-server restart

#boot iso with syslinux memdisk (require fast network and enough memory)

#copy memdisk from syslinux (/usr/lib/syslinux)
an example config
label “type what you want to show”
kernel memdisk
append iso initrd=example.iso

Windows

#
##setup windows aik
download link: http://www.microsoft.com/en-us/download/details.aspx?id=5753

##create windows pe

###create windows 7 x86 pe
copype x86 C:\winPE_x86
copy “C:\Program Files\Windows AIK\Tools\PETools\x86\winpe.wim” C:\winpe_x86\ISO\Sources\Boot.wim
copy “C:\Program Files\Windows AIK\Tools\x86\Imagex.exe” C:\winpe_x86\ISO\
oscdimg -n -bC:\winpe_x86\etfsboot.com C:\winpe_x86\ISO C:\winpe_x86\winpe_x86.iso

###create windows 7 x64 pe
copype amd64 C:\winPE_amd64
copy “C:\Program Files\Windows AIK\Tools\PETools\amd64\winpe.wim” C:\winpe_amd64\ISO\Sources\Boot.wim
copy “C:\Program Files\Windows AIK\Tools\amd64\Imagex.exe” C:\winpe_amd64\ISO\
oscdimg -n -bC:\winpe_amd64\etfsboot.com C:\winpe_amd64\ISO C:\winpe_amd64\winpe_amd64.iso

###create windows 8 x86 pe
copype x86 C:\Win8PE_x86
MakeWinPEMedia /ISO C:\Win8PE_x86 C:\Win8PE_x86\WinPE_x86.iso

###create windows 8 x64 pe
copype amd64 C:\Win8PE_amd64
MakeWinPEMedia /ISO C:\Win8PE_amd64 C:\Win8PE_amd64\Win8PE_amd64.iso

#WSyslinux && IPXE-WIMBOOT

#Download IPXE & wimboot
wget http://boot.ipxe.org/ipxe.iso ###Exact the iso,File ipxe.lkrn will use to boot from syslinux
wget http://git.ipxe.org/releases/wimboot/wimboot-latest.zip ###Exact the file,file wimboot, the kernel to boot windows pe

#Add label to syslinux to boot ipxe
Label IPXE BOOT
Kernel pathtoipxe/ipxe.lkrn
Initrd path-to-wimboot.pxe/wimboot.ipxe

#Add ipxe script to boot windows pe
Example wimboot.ipxe
#!ipxe
dhcp net0 && echo IP address: ${net0/ip} ; echo Subnet mask: ${net0/netmask} ###config network
kernel http://httpserver/path-to-wimboot-kernel/wimboot
initrd http://httpserver/path-to-pedir/bootmgr bootmgr
initrd http://httpserver/path-to-pedir/boot/bcd BCD
initrd http://httpserver/path-to-pedir/boot/boot.sdi boot.sdi
initrd http://httpserver/path-to-pedir/boot/boot.wim boot.wim
boot

#Syslinux boot linux live cd with NFS (ubuntu & linuxmint)

#install nfs-kernel-server

apt-get install nfs-kernel-server

#mount isoimage and export to nfs,edit /etc/exports

/path-to-livecd/ * (ro,sync,no_wdelay,insecure_locks,no_root_squash,insecure)

#restart nfs-kernel-server

/etc/init.d/nfs-kernel-server restart

#add config for syslinux,an example
Label Boot Ubuntu live
Kernel path-to-ubuntu-live-cd/casper/vmlinuz
Append root=/dev/nfs boot=casper netboot=nfs nfsroot=nfs-kernel-server:/path-to-ubuntu-live-cd/ initrd=path-to-ubuntu-live-cd/casper/initrd.lz

#Linux Diskless boot via pxe

Debian DiskLess Boot

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注