# aptitude install tftpd-hpa
/etc/default/tftpd-hpa
to the form TFTP_USERNAME="tftp" TFTP_DIRECTORY="/srv/tftp" # tftp TFTP_ADDRESS="0.0.0.0:69" TFTP_OPTIONS="--secure -l -v -m /etc/tftpd.remap" # windows style linux style
/etc/tftpd.remap
just such a line rg \\ /
I pulled my hair while tftp otdebezhil.
What on the ThinkPad X201i, that in VirtualBox the download fell off with:
PXE-E32: TFTP Open timeout
Apparently, the PXE agents managed to be incompletely compatible, treated by adding "-r blksize":
TFTP_OPTIONS = "- secure -l -v -r blksize"
# aptitude install samba
/etc/samba/smb.conf
file we will add information about the folder where the Windows installation files will be located. [images] comment = images path = /srv/tftp/images create mask = 0660 directory mask = 0771 writable = yes guest ok=yes
# mkdir /srv/tftp/images # chmod 777 /srv/tftp/images # service samba restart
# cd /tmp # wget https://www.kernel.org/pub/linux/utils/boot/syslinux/4.xx/syslinux-4.02.tar.gz # ESXi # tar -xf syslinux-4.02.tar.gz # cd syslinux-4.02/ # find ./ -name "memdisk" -type f|xargs -I {} cp '{}' /srv/tftp/ # find ./ -name "pxelinux.0"|xargs -I {} cp '{}' /srv/tftp/ # find ./ -name "*.c32"|xargs -I {} cp '{}' /srv/tftp/
# cd /srv/tftp/ # mkdir pxelinux.cfg # cd pxelinux.cfg
# cat > default ui vesamenu.c32 PROMPT 0 menu background background.jpg menu title ServerClub PXE boot menu LABEL bootlocal menu label Boot from first HDD kernel chain.c32 append hd0 0 timeout 120 TEXT HELP The system will boot after the time is up ENDTEXT
# aptitude install isc-dhcp-server
# mv /etc/dhcp/dhcpd.conf{,_orig} # cat > /etc/dhcp/dhcpd.conf option domain-name-servers 8.8.8.8, 8.8.4.4; option ip-forwarding on; default-lease-time 60; min-lease-time 120; max-lease-time 300; authoritative; ddns-update-style interim; log-facility local7; shared-network PXE-Netwotk { subnet 10.0.10.0 netmask 255.255.255.0 { range 10.0.10.10 10.0.10.254; option routers 10.0.10.1; option subnet-mask 255.255.255.0; option domain-name-servers 8.8.8.8, 8.8.4.4; filename "pxelinux.0"; next-server 10.0.10.1; option root-path "10.0.10.1:/srv/tftp/"; } } # service isc-dhcp-server restart
address=10.0.10.0/24 gateway=10.0.10.1 dns-server=8.8.8.8, 8.8.4.4 wins-server="" ntp-server=212.20.50.208 caps-manager="" domain="domain.local" next-server=10.0.10.1 boot-file-name="pxelinux.0" dhcp-option=""
network <ip > <> ip dhcp pool < > bootfile pxelinux.0 next-server <IP tftp> default-router <> option 66 ascii « » dns-server <DNS > option 150 <IP tftp> domain-name < >
# sed -i 's/\#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/g' /etc/sysctl.conf # sysctl -p # iptables -t nat -I POSTROUTING -s 10.0.10.0/24 -o eth0 -j MASQUERADE # sed -i 's/INTERFACES=\"\"/INTERFACES=\"eth1\"/g' /etc/default/isc-dhcp-server # service isc-dhcp-server restart
# aptitude install apache2
# aptitude install nfs-kernel-server
/srv/tftp/pxelinux.cfg/default
file, /srv/tftp/pxelinux.cfg/default
suffered changes. ui vesamenu.c32 PROMPT 0 menu background background.jpg menu title ServerClub PXE boot menu LABEL bootlocal menu label Boot from first HDD kernel chain.c32 append hd0 0 timeout 120 TEXT HELP The system will boot after time is up. ENDTEXT LABEL Windows -> KERNEL vesamenu.c32 APPEND pxelinux.cfg/windows LABEL Linux -> KERNEL vesamenu.c32 APPEND pxelinux.cfg/linux LABEL FreeBSD -> KERNEL vesamenu.c32 APPEND pxelinux.cfg/bsd LABEL VMvare -> KERNEL vesamenu.c32 APPEND pxelinux.cfg/vmware
/srv/tftp/pxelinux.cfg/
root@pxe:/srv/tftp/pxelinux.cfg# ls -l total 32 -rw-r--r-- 1 tftp tftp 475 17 18:04 bsd -rw-r--r-- 1 tftp tftp 881 17 18:00 default -rw-r--r-- 1 tftp tftp 1316 17 18:01 linux -rw-r--r-- 1 tftp tftp 363 17 18:03 vmware -rw-r--r-- 1 tftp tftp 312 18 00:01 windows
PROMPT 0 UI vesamenu.c32 MENU BACKGROUND background.jpg MENU TITLE Windows LABEL <- Main Menu KERNEL vesamenu.c32 APPEND pxelinux.cfg/default LABEL W2K8_x64_R2 & W2K12_x64_R2 (menu inside) kernel Boot/pxeboot.0 LABEL <- Main Menu KERNEL vesamenu.c32 APPEND pxelinux.cfg/default
PROMPT 0 UI vesamenu.c32 MENU BACKGROUND background.jpg MENU TITLE Linux LABEL <- Main Menu KERNEL vesamenu.c32 APPEND pxelinux.cfg/default LABEL Debian-7-x64 kernel debian/7/linux append initrd=debian/7/initrd.gz LABEL Debian-6.0.6-x64 kernel debian/6/linux append initrd=debian/6/initrd.gz LABEL CentOS-7-x64 kernel centos/7/vmlinuz append initrd=centos/7/initrd.img method=http://mirror.mirohost.net/centos/7/os/x86_64/ devfs=nomount ksdevice=link ramdisk_size=100000 LABEL CentOS-6-x64 kernel centos/6/vmlinuz append initrd=centos/6/initrd.img method=http://mirror.mirohost.net/centos/6/os/x86_64/ devfs=nomount ksdevice=link ramdisk_size=100000 LABEL Ubuntu-14.10-x64 kernel ubuntu/14.10/linux append initrd=ubuntu/14.10/initrd.gz expert dmraid=true LABEL Ubuntu-14.04-x64 kernel ubuntu/14.04/linux append initrd=ubuntu/14.04/initrd.gz expert dmraid=true LABEL Ubuntu-12.10-x64 kernel ubuntu/12.10/linux append initrd=ubuntu/12.10/initrd.gz expert dmraid=true LABEL Ubuntu-12.04_4-x64 kernel ubuntu/12.04_4/linux append initrd=ubuntu/12.04_4/initrd.gz expert dmraid=true LABEL <- Main Menu KERNEL vesamenu.c32 APPEND pxelinux.cfg/default
PROMPT 0 UI vesamenu.c32 MENU BACKGROUND background.jpg MENU TITLE BSD LABEL <- Main Menu KERNEL vesamenu.c32 APPEND pxelinux.cfg/default LABEL FreeBSD-10.1-x64 kernel memdisk initrd freebsd/10/mfsbsd-se-10.1-RELEASE-amd64.iso append iso raw LABEL FreeBSD-9.2-x64 kernel memdisk initrd freebsd/9/fbsd92.iso append iso raw LABEL <- Main Menu KERNEL vesamenu.c32 APPEND pxelinux.cfg/default
PROMPT 0 UI vesamenu.c32 MENU BACKGROUND background.jpg MENU TITLE VMware LABEL <- Main Menu KERNEL vesamenu.c32 APPEND pxelinux.cfg/default LABEL VMware-5.5 kernel vmw/5.5/mboot.c32 append -c /vmw/5.5/boot.cfg ks=http://10.0.10.1/vmw5.5/ks.cfg +++ LABEL VMware-5.0 kernel vmw/5.0/mboot.c32 append -c /vmw/5.0/boot.cfg ks=http://10.0.10.1/vmw5.0/ks.cfg +++ LABEL <- Main Menu KERNEL vesamenu.c32 APPEND pxelinux.cfg/default
/srv/tftp
. LABEL FreeBSD-10.1-x64 kernel memdisk initrd freebsd/10/mfsbsd-se-10.1-RELEASE-amd64.iso append iso raw
freebsd/10/
folders in the root of TFTP, while paying attention to the rights ls -l /srv/tftp/freebsd/10/ total 193780 -rw-r--r-- 1 tftp tftp 198430720 17 18:17 mfsbsd-se-10.1-RELEASE-amd64.iso
/srv/tftp/images/
folder, which contains the files for installing the Microsoft OS: ls -l /srv/tftp/images/ total 8 drwxr-xr-x 6 root root 4096 17 22:19 w2k12r2 drwxr-xr-x 7 tftp tftp 4096 17 19:05 w2k8r2
/var/www
we will create folders vmw5.5, vmw5.0, and in folders we will make symlinks on config # cd /var/www # mkdir vmw5.5 # cd vmw5.5/ # ln -s /srv/tftp/vmw/5.5/ks.cfg # mkdir ../vmw5.0 # cd ../vmw5.0/ # ln -s /srv/tftp/vmw/5.0/ks.cfg
ui vesamenu.c32 PROMPT 0 menu background background.jpg menu title ServerClub PXE boot menu LABEL bootlocal menu label Boot from first HDD kernel chain.c32 append hd0 0 timeout 120000 TEXT HELP The system will boot after time is up. ENDTEXT LABEL Windows -> KERNEL vesamenu.c32 APPEND pxelinux.cfg/windows LABEL Linux -> KERNEL vesamenu.c32 APPEND pxelinux.cfg/linux LABEL FreeBSD -> KERNEL vesamenu.c32 APPEND pxelinux.cfg/bsd LABEL VMvare -> KERNEL vesamenu.c32 APPEND pxelinux.cfg/vmware LABEL HDD and RAM utils -> KERNEL vesamenu.c32 APPEND pxelinux.cfg/du
PROMPT 0 UI vesamenu.c32 MENU BACKGROUND background.jpg MENU TITLE HDD and RAM utils LABEL <- Main Menu KERNEL vesamenu.c32 APPEND pxelinux.cfg/default LABEL Memtest86+ kernel memtest/memtest label Clonezilla-live MENU LABEL Clonezilla Live KERNEL clonezilla/vmlinuz APPEND initrd=clonezilla/initrd.img boot=live config noswap nolocales edd=on nomodeset ocs_live_run="ocs-live-general" ocs_live_extra_param="" keyboard-layouts="" ocs_live_batch="no" locales="" vga=788 nosplash noprompt fetch=tftp://10.0.10.1/clonezilla/filesystem.squashfs label SystemRescueCD kernel SystemRescueCD/isolinux/rescue64 append initrd=SystemRescueCD/isolinux/initram.igz dodhcp nfsboot=10.0.10.1:/srv/tftp/SystemRescueCD LABEL MHDD kernel memdisk initrd mhdd/mhdd32ver4.6.iso append iso raw LABEL <- Main Menu KERNEL vesamenu.c32 APPEND pxelinux.cfg/default
# cat >> /etc/exports /srv/tftp/SystemRescueCD/ 10.0.10.1/255.255.255.0(ro,no_subtree_check,all_squash,insecure,anonuid=1000,anongid=1000) # service nfs-kernel-server restart
LABEL LiveCDs -> KERNEL vesamenu.c32 APPEND pxelinux.cfg/livecds
PROMPT 0 UI vesamenu.c32 MENU BACKGROUND background.jpg MENU TITLE LiveCDs LABEL <- Main Menu KERNEL vesamenu.c32 APPEND pxelinux.cfg/default LABEL Debian LiveCD KERNEL Debian7live/vmlinuz APPEND initrd=Debian7live/initrd boot=live fetch=tftp://10.0.10.1/Debian7live/filesystem.squashfs root=/dev/ram0 rw LABEL HirensBootCD MENU LABEL Hiren's Boot CD KERNEL memdisk APPEND iso initrd=hirens/hirens.iso LABEL Trinity Rescue Kit CD kernel trk/kernel.trk append initrd=trk/initrd.trk ramdisk_size=65536 root=/dev/ram0 vga=788 splash=verbose pci=conf1 trkmenu timeout 100 trknfs=10.0.10.1:/srv/tftp/trk ip=dhcp LABEL SystemRescueCD kernel SystemRescueCD/isolinux/rescue64 append initrd=SystemRescueCD/isolinux/initram.igz dodhcp nfsboot=10.0.10.1:/srv/tftp/SystemRescueCD LABEL Plop Live KERNEL plop/bzImage APPEND initrd=plop/initramfs.gz vga=normal nfsmount=10.0.10.1:/srv/tftp/plop LABEL <- Main Menu KERNEL vesamenu.c32 APPEND pxelinux.cfg/default
/etc/exports
you need to add the lines: /srv/tftp/trk/ 10.0.10.1/255.255.255.0(ro,no_subtree_check,all_squash,insecure,anonuid=1000,anongid=1000) /srv/tftp/plop/ 10.0.10.1/255.255.255.0(ro,no_subtree_check,all_squash,insecure,anonuid=1000,anongid=1000)
ui vesamenu.c32 PROMPT 0 menu background background.jpg menu title ServerClub PXE boot menu LABEL bootlocal menu label Boot from first HDD kernel chain.c32 append hd0 0 timeout 120000 TEXT HELP The system will boot after time is up. ENDTEXT LABEL Windows -> KERNEL vesamenu.c32 APPEND pxelinux.cfg/windows LABEL Linux -> KERNEL vesamenu.c32 APPEND pxelinux.cfg/linux LABEL FreeBSD -> KERNEL vesamenu.c32 APPEND pxelinux.cfg/bsd LABEL VMvare -> KERNEL vesamenu.c32 APPEND pxelinux.cfg/vmware LABEL HDD and RAM utils -> KERNEL vesamenu.c32 APPEND pxelinux.cfg/du LABEL LiveCDs -> KERNEL vesamenu.c32 APPEND pxelinux.cfg/livecds LABEL Antiviruses -> KERNEL vesamenu.c32 APPEND pxelinux.cfg/av
PROMPT 0 UI vesamenu.c32 MENU BACKGROUND background.jpg MENU TITLE Antivirues LABEL <- Main Menu KERNEL vesamenu.c32 APPEND pxelinux.cfg/default LABEL Kaspersky Antivirus KERNEL kav/rescue APPEND initrd=kav/rescue.igz root=live rootfstype=auto vga=791 init=/init kav_lang=ru udev liveimg doscsi nomodeset LABEL Kaspersky Antivirus (text mode) KERNEL kav/rescue APPEND initrd=kav/rescue.igz root=live rootfstype=auto vga=791 init=/init kav_lang=ru udev liveimg nox kavshell noresume doscsi nomodeset label AVG menu label AVG Rescue CD kernel avg/vmlinuz append max_loop=255 vga=791 initrd=avg/initrd.lzm init=linuxrc reboot=bios label AVG nofb menu label AVG Rescue CD with Disabled Framebuffer kernel avg/vmlinuz append max_loop=255 video=vesafb:off initrd=avg/initrd.lzm init=linuxrc reboot=bios label AVG vgask menu label AVG Rescue CD with Resolution Selection kernel avg/vmlinuz append max_loop=255 initrd=avg/initrd.lzm init=linuxrc vga=ask reboot=bios LABEL <- Main Menu KERNEL vesamenu.c32 APPEND pxelinux.cfg/default
Source: https://habr.com/ru/post/250549/
All Articles