Imagine all of your favorite operating systems in one place, available anywhere on your network, and youβll never need to use your flash drive again. Thatβs the promise of netboot.xyz, a network boot service that lets you install or boot to any operating system simply by booting to the network.
πΊ Watch Video
Disclosures:
- Nothing in this video was sponsored
Donβt forget to β netboot.xyz on GitHub!
Requirements
- docker (and compose)
- docker machine has a static IP
- dhcp server & access to settings (or install your own)
Docker Setup
See this post on how to install docker
and docker compose
Install
create folders netboot_xyz
, netboot_xyz/assets
, netboot_xyz/config
1234
mkdir netboot_xyzcd netboot_xyzmkdir assetsmkdir config
Copy yaml to server or portainer, etc
Container Images
linuxserver.io container image
123456789101112131415161718192021
---version: "2.1"services: netbootxyz: image: lscr.io/linuxserver/netbootxyz:latest container_name: netbootxyz environment: - PUID=1000 #current user - PGID=1000 #current group - TZ=Etc/UTC # - MENU_VERSION=1.9.9 #optional, sets menus version, unset uses latest - PORT_RANGE=30000:30010 #optional - SUBFOLDER=/ #optional volumes: - ./config:/config - ./assets:/assets #optional ports: - 3000:3000 - 69:69/udp - 8080:80 #optional restart: unless-stopped
Official container image
12345678910111213141516
---version: "2.1"services: netbootxyz: image: ghcr.io/netbootxyz/netbootxyz container_name: netbootxyz environment: # - MENU_VERSION=2.0.47 # optional, sets menus version, unset uses latest volumes: - ./config:/config # optional - ./assets:/assets # optional ports: - 3000:3000 - 69:69/udp - 8080:80 #optional restart: unless-stopped
Running
bring up stack
1
docker compose up -d
check to be sure itβs running
123
β netboot_xyz docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES83e6c5192156 lscr.io/linuxserver/netbootxyz:latest "/init" 14 seconds ago Up 12 seconds 0.0.0.0:69->69/udp, :::69->69/udp, 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp, 0.0.0.0:8080->80/tcp, :::8080->80/tcp netbootxyz
should see something like:
Check the logs
123456789101112131415161718192021222324252627282930313233343536
β netboot_xyz docker logs netbootxyz[migrations] started[migrations] no migrations foundβββββββββββββββββββββββββββββββββββββββ βββ βββββββββββ βββββββ βββ ββββββββββββββββββββ βββ ββββββββββββββ βββ βββ ββββββββββββββ βββ ββββββββββββββββββββββββββββ βββββββββββββββββββ βββββββ Brought to you by linuxserver.ioβββββββββββββββββββββββββββββββββββββββTo support the app dev(s) visit:netboot.xyz: https://opencollective.com/netbootxyz/donateTo support LSIO projects visit:https://www.linuxserver.io/donate/βββββββββββββββββββββββββββββββββββββββGID/UIDβββββββββββββββββββββββββββββββββββββββUser UID: 1000User GID: 1000βββββββββββββββββββββββββββββββββββββββ[netbootxyz-init] Downloading Netboot.xyz at 2.0.73[custom-init] No custom files found, skipping...crontab: can't open 'abc': No such file or directorylistening on *:3000[ls.io-init] done.4Lg88gNm_wqDORftAAAB connected time=1699460581160
Configuring
You can now browse to the containerβs homepage
http://192.168.10:3000/
You should see a list of pxe boot menu items and the option to cache the pre boot environment locally
Local Mirror
If you want to serve the files from a local mirror, you can edit the boot.cfg
file from the boot menus
change:
set live_endpoint https://github.com/netbootxyz
to:
set live_endpoint http://192.168.10.125:8080
Keep in mind that you will not be able to boot from any environments you havenβt downloaded.
DHCP Configuration
Since I cannot cover configuring every DHCP service out there, I will cover the basics. Fortunately linuxserver.io has many routers covered as well as the official netboot.xyz docs.
UniFi UDM Pro / SE
Settings > Network > Choose Network > DHCP Service Management > Show Options
Here youβll want to check βNetwork Bootβ and fill in the server IP and the file name
For me, itβs:
Server IP: 192.168.10.125
Filename: netboot.xyz.kpxe
(this is the default BIOS option)
Save.
Preferably we would like to offer a PXE boot per architecture, and UDM supports it however not in the UI. Follow these instructions to do it via CLI
If youβre up to it, hereβs my config:
123456789101112131415161718192021
## Generated automatically by ## Configuration of PXE boot for '# The boot filename, Server name, Server Ip Addressdhcp-boot=netboot.xyz.kpxe,netboot.xyz,192.168.10.125# inspect the vendor class string and match the text to set the tagdhcp-vendorclass=BIOS,PXEClient:Arch:00000dhcp-vendorclass=UEFI32,PXEClient:Arch:00006dhcp-vendorclass=UEFI,PXEClient:Arch:00007dhcp-vendorclass=UEFI64,PXEClient:Arch:00009# Set the boot file name based on the matching tag from the vendor class (above)dhcp-boot=net:UEFI32,netboot.xyz.efi,netboot.xyz,192.168.10.125dhcp-boot=net:BIOS,netboot.xyz.kpxe,netboot.xyz,192.168.10.125dhcp-boot=net:UEFI64,netboot.xyz.efi,netboot.xyz,192.168.10.125dhcp-boot=net:UEFI,netboot.xyz.efi,netboot.xyz,192.168.10.125
Verify
1
cat /run/dnsmasq.conf.d/PXE.conf
Copy file to /run/dnsmasq.conf.d/PXE.conf
on UDM
run
1
kill `cat /run/dnsmasq.pid`
Youβll have to do this on each reboot
If you donβt want to do this, youβll have to change the image file each time.
Booting to network
To boot to the network youβll need a BIOS and NIC that supports it
- enable in BIOS
- enable EFI PXE Boot
- enable Legacy (BIOS) PXE Boot
- Figure out boot override or network boot key
- Power on and boot to network (BIOS of EFI)
See the boot menu, choose OS and go!
Word of caution, there might be some that do not work. This is a moving target. e.g. Ubuntu 23.10 isnβt working for me now, but could soon. Other OS are fine. You may need to try different NICs if you are using virtualization
What about Windows?
Requirements
- Windows 10/11 machine
- Windows ISO
- Windows ADK for Windows 10/11
- Windows PE add-on for the Windows ADK
Install Windows ADK for Windows 10/11.
Install Windows PE add-on for the Windows ADK.
Run Deployment and Imaging Tools Environment
as administrator from the start menu.
Navigate to folder
1
cd "..\Windows Preinstallation Environment\amd64"
Mount the Windows PE boot image.
12
md C:\WinPE_amd64\mountDism /Mount-Image /ImageFile:"en-us\winpe.wim" /index:1 /MountDir:"C:\WinPE_amd64\mount"
Copy files
12
Xcopy "C:\WinPE_amd64\mount\Windows\Boot\EFI\bootmgr.efi" "Media\bootmgr.efi" /YXcopy "C:\WinPE_amd64\mount\Windows\Boot\EFI\bootmgfw.efi" "Media\EFI\Boot\bootx64.efi" /Y
Unmount the WinPE image, committing changes.
1
Dism /Unmount-Image /MountDir:"C:\WinPE_amd64\mount" /commit
Delete the temp folder that was created earlier (so we donβt get an error when copying)
1
rmdir /s C:\WinPE_amd64
Create working files
1
copype amd64 C:\WinPE_amd64
Create a bootable WinPE ISO
1
MakeWinPEMedia /ISO C:\WinPE_amd64 C:\WinPE_amd64\WinPE_amd64.iso
Then copy the contents of WinPE_amd64.iso
to netboot.xyz containerβs /assets/WinPE/x64/
folder (need to create folders first)
Then youβll want to create an SMB share named Windows
in your environment. You can create or download a Windows ISO by visiting Microsoftβs site
Once you have created your Windows ISO, you can then extract the files to the root of the Windows
share you just created above.
Now we need to configure netboot.xyz
In netboot.xyz UI, update boot.cfg
to set win_base_url http://192.168.10.125:8080/WinPE
and save.
Now you can PXE boot to the network (be sure you are using the EFI boot image and your device supports UEFI) and then choose Windows from the netboot.xyz menu.
This should boot to a DOS prompt in the Windows Pre-boot Environment
Type
1
wpeinit
then type
1
net use F: \\<server-ip-address>\<share-name> /user:<server-ip-address>\<username-if-needed> <password-if-needed>
If you want it to prompt for a username and password, remove the user
argument
1
net use F: \\<server-ip-address>\<share-name>
This will map the F:
drive to your Windows
share that the Windows ISO extracted
then type
1
F:\setup.exe
Then hit enter and Windows installer should launch!
Iβd love to also automate the mounting of the share however I havenβt found a clean way to do it yet. If you know, let me know in the comments below and I can add it!
Join the conversation
β Techno Tim (@TechnoTimLive) November 11, 2023Back in my tech support days I thought that if I had PXE network boot at home, that I "made it". We'll, that day has come! This past week I learned all about netboot xyz! I can now boot and install any operating system over the network!
Check it out! https://t.co/PzPmYzKWLH pic.twitter.com/FQr4W4TPtp
Links
ποΈ Check out the new Merch Shop at https://l.technotim.live/shop
βοΈ See all the hardware I recommend at https://l.technotim.live/gear
π Donβt forget to check out the πLaunchpad repo with all of the quick start source files