{"id":15059116,"url":"https://github.com/beta-tester/rpi-pxe-server","last_synced_at":"2025-05-16T11:05:30.249Z","repository":{"id":44592257,"uuid":"51686946","full_name":"beta-tester/RPi-PXE-Server","owner":"beta-tester","description":"setup a Raspberry Pi as an PXE-Server","archived":false,"fork":false,"pushed_at":"2025-05-05T21:40:03.000Z","size":1485,"stargazers_count":316,"open_issues_count":3,"forks_count":61,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-05-16T11:05:20.923Z","etag":null,"topics":["arch-linux","debian","dnsmasq","fedora","ipxe","kali","kaspersky-rescue-disk","lighttpd","network-boot","nfs","parrot","pxe","pxe-boot","pxelinux","raspberry","suse","tails","tftp","ubuntu","vblade"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beta-tester.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-02-14T08:41:37.000Z","updated_at":"2025-05-05T21:40:06.000Z","dependencies_parsed_at":"2023-01-31T09:46:16.401Z","dependency_job_id":"8d9499e1-e804-4647-9f18-91dd4ab201ca","html_url":"https://github.com/beta-tester/RPi-PXE-Server","commit_stats":{"total_commits":595,"total_committers":2,"mean_commits":297.5,"dds":0.001680672268907557,"last_synced_commit":"cb700641ed01f55edcecf20ba4ad7b4c9abdccf2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beta-tester%2FRPi-PXE-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beta-tester%2FRPi-PXE-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beta-tester%2FRPi-PXE-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beta-tester%2FRPi-PXE-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beta-tester","download_url":"https://codeload.github.com/beta-tester/RPi-PXE-Server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254518384,"owners_count":22084374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arch-linux","debian","dnsmasq","fedora","ipxe","kali","kaspersky-rescue-disk","lighttpd","network-boot","nfs","parrot","pxe","pxe-boot","pxelinux","raspberry","suse","tails","tftp","ubuntu","vblade"],"created_at":"2024-09-24T22:37:48.923Z","updated_at":"2025-05-16T11:05:25.241Z","avatar_url":"https://github.com/beta-tester.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# install-pxe-server\nsetup a Raspberry Pi as a PXE-Server.\u003cbr /\u003e\nit is a private project i have made for myself.\u003cbr /\u003e\ni did not keep an eye on network security.\n\n**the script will override some existing configurations**\u003cbr /\u003e\n(a backup of the changed configuration files will be stored to **backup.tar.xz** in the script folder)\u003cbr /\u003e\n(to extract all versions of all files to /tmp: `tar --backup=numbered -xavf backup.tar.xz -C /tmp`, some files will be hidden)\n\n**USE IT AT YOUR OWN RISK.**\n\n## what is it good for?\nthe scripts installs necessary packages to let your RPi act as a DHCP, TFTP, Samba, NFS, HTML, NTP, VBLADE, PXE server.\nand it will download LiveDVD ISOs you can boot your PXE client (Desktop PC) to.\n\nthe script can easily be modified to add additional ISOs or update ISOs if updated ones are available.\n\nit also is able to act as server for NETWORK BOOTING for a Raspberry Pi 3 (see **note4**)\n\nfor more advanced setup, watch branch **testing** of this project\n\n**Please give me a '_Star_', if you find that project useful.**\n\n### overview schematic:\n```\n      ╔══════════╗   ╔═══╗       ╔══════╗╔═════════╗\nWAN───╢DSL router╟───╢ s ║       ║RPi-  ╠╣USB-stick║\n      ╚══════════╝   ║ w ║       ║PXE-  ║╚═════════╝\n                     ║ i ║       ║server║\n       ╔══════╗      ║ t ╟───eth0╢      ║\n       ║ RPi3 ╟──────╢ c ║       ║      ║\n       ╚══════╝   ┌──╢ h ╟──┐    ║      ║\n                  │  ╚═══╝  │    ╚══════╝\n               ╔══╧══╗   ╔══╧══╗\n               ║ PC1 ║   ║ PC2 ║\n               ╚═════╝   ╚═════╝\n```\n\n## requirements\n### hardware:\n- Raspberry Pi (with LAN)\n- SD card (big enough to hold entire ISO images of desired Live DVDs), (e.g. 64GByte)\n- USB memory stick (optional, to store preloaded iso images), (e.g. 64GByte)\n- working network environment with a connection to internet\n\noptional, if your SD card is too small or you don't want to have all the server content on the SD card, you can use the USB memory stick to hold all content. for that you have to do small tiny changes on the '**p2-include-var-sh**' script, by changing '**DST_ROOT=/srv**' to something else.\n\n### software:\n- **Raspberry Pi OS Bullseye** or **Raspberry Pi OS Bullseye Lite**, https://www.raspberrypi.org/downloads/raspbian/)\n\n## installation:\nassuming,\n- your Raspberry Pi is running Raspberry Pi OS Bullseye (or Lite),\n- and has a proper connection to the internet via LAN (eth0).\n- and your SD card can hold all the iso images (16GB when you use unmodified script)\n\nand optional:\n- you have plugged an USB-memory-stick that is mounted at /media/server (SRC_MOUNT=/media/server)\n- and the following folder structure on the USB memory stick:\n```\n\u003cmount_point\u003e\n└── backup\n    ├── img\n    └── iso\n\nmkdir -p \u003cmount_point\u003e/backup/img\nmkdir -p \u003cmount_point\u003e/backup/iso\n```\n\noptional structure for win-pe pxe boot\n```\n\u003cmount_point\u003e\n└── backup\n    └── tftp\n        ├── Boot\n        └── EFI\n\nmkdir -p \u003cmount_point\u003e/backup/tftp/Boot\nmkdir -p \u003cmount_point\u003e/backup/tftp/EFI\n```\nreplace **\u003cmount_point\u003e** with the path, where you mounted your USB stick.\n\n1. run `bash run.sh` the first time, to install necessary packages\u003cbr /\u003e\n(use **_bash_** and do not run it from **_sudo_**)\n2. reboot your RPi with `sudo reboot`\n3. run `bash run.sh` the second time to setup everything required for PXE server.\n4. reboot your RPi with `sudo reboot`\n5. run `bash run.sh` the third time to copy/download iso images of LiveDVDs, mount and export them and setup PXE menu according installed images.\u003cbr /\u003e\n6. reboot your RPi with `sudo reboot`\n\ndone.\n\n## update:\nto update your images, update the url in the **p2-include-url** and **c2-custom-url** file\u003cbr /\u003e\nand re-run `bash run.sh`.\nthis will download all updated iso files and menu entries.\n\n## modifying the script:\n### p2-include-var / c2-custom-var\nincludes all important variables like source and destination directories, ip-addresses, and so on.\ne.g.: by changing '**DST_ROOT=/srv**' you can tell the script to download and store all iso to an external storage, instead of storing to the internal SD card.\n\n### p2-include-url / c2-custom-url\nincludes all url and name of images\n```\ne.g.\nDEBIAN_X64=debian-x64\nDEBIAN_X64_URL=https://...\n```\n\n### p2-include-menu / c2-custom-menu\nincludes all pxe-menu entries and kernel parameters\nin the script, for each image there is a pxe-menu entry enclosed by\u003cbr /\u003e\n`#========== BEGIN ==========`\u003cbr /\u003e\nand\u003cbr /\u003e\n`#=========== END ===========`\u003cbr /\u003e\ncomments.\n\n### p2-include-handle / c2-custom-handle\nincludes all handler to control what image to download and expose to the pxe-server\u003cbr /\u003e\nif you don't want some iso images getting downloaded and mounted, you can disable images from handling '#'.\u003cbr /\u003e\nor '-' to uninstall the previous downloaded image and undo all mounting stuff for that image to free disk space.\u003cbr /\u003e\ne.g.:\n```\nhandle_item  '+'  iso   UBUNTU_X64;\nhandle_item  '-'  iso   UBUNTU_LTS_X64;\nhandle_item  '#'  iso   UBUNTU_DAILY_X64         timestamping;\n...\n```\n**_action:_**\n\n   **'+'** = add image to PXE service\n         download if not there\n         update if new version is available\n\n   **'-'** = remove image from PXE service\n         free resources on server\n         if backup exist, keep updating backup\n\n   **'#'** = skip image handling\n         keep everything untouched\n         does not updating backup\n         good, when timestamping option is set but want to keep the current version and you don't want to download each daily update\n\n**_type:_**\n\n   **iso**     = iso image (ISO, UDF, ISO_HYBRID)\n\n   **img**     = hard drive image (MPT, GPT)\n\n   **kernel**  = kernel\n\n   **zip_img** = zip file containing a hard drive image (zip -\u003e img -\u003e MTP/GPT)\n\n   **rpi_pxe** = only if you want to pxe boot a RPi3.\n               copies files from its selected image boot \u0026 root partition to PXE server directories\n               requires an already mounted hard drive image (img or zip_img)\n               note: Action '-' does nothing for rpi_pxe. It is not implemented.\n                     You have to free resources for rpi_pxe by hand\n\nnote:\n   do not put the $ in fornt of the VARIABLE name !!!\n   the handle_item functions do need the NAME of the VARIABLE (without _URL)\n\n## what else you should know, when you make modification to the script...\nthere are three important locations for the pxe boot and the pxe menu that must fit. otherwise the pxe menu and the following boot process can not find required files.\n1. the ISO or NFS path relative to the pxe boot menu root path\u003cbr /\u003e\n(on disk `/srv/tftp/menu-bios/iso`, `/srv/tftp/menu-bios/iso` as symbolic link).\n2. the ISO or NFS path relative to the nfs root path\u003cbr /\u003e\n(on disk `/srv/iso`, `/srv/nfs`).\n3. the ISO, IMG or NFS path located at /var/www/html\u003cbr /\u003e\n(on disk `/var/www/html/srv/iso`, `/var/www/html/srv/img`, `/var/www/html/srv/nfs`).\n```\n/\n├── srv\n|   ├── img    (the real physical location of IMG files)\n|   ├── iso    (the real physical location of ISO files)\n|   ├── nfs    (the real physical location of NFS files or mountpoints)\n|   |\n|   └── tftp       (TFTP root)\n|       |\n|       └── menu-bios  (PXE boot menu root for BIOS)\n|           ├── iso    (only a symbolic link to ISO files)\n|           └── nfs    (only a symbolic link to NFS files)\n|\n└── var\n    └── www\n        └── html     (HTML root)\n            └── srv  (only a symbolic link to /srv)\n                ├── img  (only a symbolic link to IMG files)\n                ├── iso  (only a symbolic link to ISO files)\n                └── nfs  (only a symbolic link to NFS files)\n```\n\nif you make any changes to your script and/or file structure on disk, keep an eye to changes you made and adapt everything to match\npxe menu entries to file structure on disk.\n\nwhat the root of TFTP and PXE boot menu are, is defined in the **_dnsmasq_** configuration file `/etc/dnsmasq.d/pxe-server`.\u003cbr /\u003e\nthe root for NFS is defined in `/etc/exports`.\u003cbr /\u003e\nthe root for HTML is defined in the **_lighttpd_** configuration file `/etc/lighttpd/lighttpd.conf`.\n\n\n## note2:\nsome of the PXE-menu entries has additional parameters, that lets the Live systems boot with German language (keyboard layout).\nif you don't like or want, remove those additional parameters just behind the ' --' in the menu entries\n\nto easily change the language to your favorite ones, there are variables in the **c2-custom-var** file to set those variables with your values.\n```\nCUSTOM_COUNTRY=DE\nCUSTOM_KEYMAP=de-latin1-nodeadkeys\nCUSTOM_KMAP=qwertz/de-latin1\nCUSTOM_LANGUAGE=de\nCUSTOM_LAYOUTCODE=de\nCUSTOM_LOCALE=de_DE.UTF-8\nCUSTOM_TIMEZONE=Europe/Berlin\nCUSTOM_VARIANT=German\n```\n\n## note3:\nit is prepared for BIOS, UEFI 32bit and UEFI 64bit boot, but UEFI is not tested yet by me, because of lack of hardware for UEFI boot.\u003cbr /\u003e\nIPv4 UEFI 64bit boot with SecureBoot enabled is tested and working on my computer (with Asus board and latest Fedora, Debian and Ubuntu distro).\u003cbr /\u003e\nbut tested with an other computer it wont work - it depends on the UEFI firmware.\n\n## note4: NETWORK BOOTING for Raspberry Pi 3 client\nthe server is prepared for to boot a Raspberry Pi 3 client via network.\nin the script ```p2-include-var```, there is a ```RPI_SN0=--------``` line, change the ```--------``` to the serial number of the RPi3-**client**, that will boot from network later on.\u003cbr /\u003e\nskip the leading '00000000'. take only the last 8 digits!\u003cbr /\u003e\ne.g.\n```\npi@raspberry-$ cat /proc/cpuinfo | grep Serial\nSerial          : 0000000087654321\n```\nthen take ```RPI_SN0=87654321```.\u003cbr /\u003e\nif you have more than one RPi3-client for network booting you have to add them by hand to the ```/srv/tftp``` folder on the PXE-server.\n\nthe script will download Raspberry Pi OS Lite and prepare it for the RPi3-client with the given serial number.\n\nby default, a RPi3-client is not enabled for network booting. you have to enable it once.\n\nfor more information,\n\nsee: [Network Booting](https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/net.md)\u003cbr/\u003e\nsee: [Network Boot Your Raspberry Pi](https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/net_tutorial.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeta-tester%2Frpi-pxe-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeta-tester%2Frpi-pxe-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeta-tester%2Frpi-pxe-server/lists"}