Coder Social home page Coder Social logo

floofyprotobomb / rpi-pxe-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pimterry/rpi-pxe-server

0.0 0.0 0.0 28 KB

A ready-to-go PXE + TFTP network boot server for Raspberry Pi, with Resin deployment

License: Apache License 2.0

Shell 100.00%

rpi-pxe-server's Introduction

rpi-pxe-server

A ready-to-go PXE + TFTP network boot server for Raspberry Pi, with Resin deployment.

Want to boot a machine from the network, don't want to have to fight with all the configuration and setup yourself, and have a raspberry pi to hand? This is the solution.

Tested with:

Set up

  1. Set up your device, with reliable power, a network cable, and optionally wifi (if you want logging or easy access).
  2. Sign up for free on resin.io, create an application, and provision it, optionally with your wifi credentials.
  3. Set the following environmental variables:
    • RESIN_SUPERVISOR_DELTA: 1 // Enables deltas for updates keeping later changes quick
  4. Clone/fork this repo, and push it to your resin.io application's repository to deploy this setup.
  5. Set up your specific PXE config over samba (to /tftp), SCP (to /data/tftp), or over tftp by:
    1. Uploading your PXE bootable image
    2. Adding your PXE config at pxelinux.cfg/default
  6. You're ready to go: put the device on the same network as the target machine (directly or through a router, as long as DHCP is disabled on the router), tell that target machine to boot from the network, and enjoy.

You can change and push a new Dockerfile to your application if you want to carefully update your device to do this differently, or for quick changes there's an SSH port exposed that allows root login with the default password of 'resin'.

Windows example

For the specific Windows boot process this was tested with, scripts are included. See app/windows/setup-windows-pxe.sh in this repo (in /usr/src/app on the device) for full details.

This script:

  • Builds a Windows PE image from a full Windows image.
  • Mounts the full Windows image within the Samba share to make it accessible.
  • Makes the Windows PE image bootable through PXE.

To run this script:

  1. Copy a Windows iso across to the device, either via samba or scp.
  2. SSH into the device
  3. Run /usr/src/app/windows/setup-windows-pxe.sh <path_to_full_windows_iso>

Once this is complete, any machine attached to the device should now boot into Windows PE, from which you can start the full Windows install process.

Note that it seems Microsoft's iso download process makes it easy to end up with corrupted iso's, which will typicall start up, but refuse to install. To check for this, run md5sum on your iso to get its md5, and google for the hash. Any valid official image should return a huge number of related results.

Security

This setup has pretty much no security - do not connect this device to any untrusted network (e.g. the public internet). Root SSH is set up with a default password, and file sharing services are configure with public read/write access to the image you will be booting from. That's super convenient and effective if the device is only connected to you, but it's trivial complete control of both the device and the machine you're booting from if anybody else can connect.

Technical details

  • Device will run as 192.168.0.1, and provide DHCP for the rest of the 255.255.255.0 range.
  • DHCP and TFTP configuration are done with Dnsmasq, see dnsmasq.conf (/etc/dnsmasq.conf on device)
  • TFTP is preconfigured for BIOS PXE, using files from syslinux and pxelinux (see Dockerfile.template for details).
  • A samba share is available, see smb.conf (/etc/smb.conf on device)
  • Direct SSH access is available to examine and change the device at runtime, or transfer files over SCP.

Potential extensions:

I'm open to PRs for these, but I don't need them myself right now, so they won't happen without help.

  • Preprepared config/scripts for other scenarios.
  • Allow setting a BOOT_IMAGE_URL environmental variable for a URL to get the boot image from.
  • UEFI boots. I don't know much about this, but I know this currently supports only BIOS PXE. I believe most current motherboards support this, sometimes with an option like LAN Boot Rom, but for very new machines/in future this may not be true.

rpi-pxe-server's People

Contributors

pimterry avatar wblondel avatar floofyprotobomb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.