How to create a simple PXE server to serve a single version of ShredOS (UEFI mode only, not legacy boot) #148
Replies: 11 comments 4 replies
-
If anybody wants to have a go at adding legacy support to the configuration of /etc/dhcp/dhcp.conf as shown above, then please feel free to add the changes and I will update the above procedure to support both UEFI and legacy PXE booting. |
Beta Was this translation helpful? Give feedback.
-
Regarding PXE booting using tftp-hsa on Debian/Ubuntu. Here's a thread that discussesTFTP Windowsize Option RFC 7440 with links to the patches and a discussion about updating tftp-hsa in Debian/Ubuntu. If anybody wants to apply the RFC 7440 patch to tftp-hsa, I'd be interested in seeing what the speed improvement would be. I'm sort of expecting a five fold increase in speed on a gigabit network. So instead of 4 Mbyes/sec you would see 20 Mbytes/sec so in terms of ShredOS booting over the network you would see it takes 6 seconds to boot rather than 33 seconds. I need to stay focused on completing the nwipe features so if anybody else who has a interest in PXE booting and has some time to try this out, please feel free, and update us with how much of a speed improvement it is. |
Beta Was this translation helpful? Give feedback.
-
Patches for tftp c7 https://git.centos.org/rpms/tftp/blob/c7/f/SOURCES |
Beta Was this translation helpful? Give feedback.
-
I've created a tftp repository tftp-pv applied most of the patches, just need to apply the last three.
|
Beta Was this translation helpful? Give feedback.
-
Just a thought, but in theory it would be relatively easy to add a feature to ShredOS where you can turn it into a PXE server, serving up just ShredOS. So on a network of 100 PC's and assuming they are already networked together, all you would need is one USB stick with ShredOS, then you just PXE boot each PC in turn from a single PC that has the ShredOS USB flash drive. I would need to pull in the tftpd server software that I'm currently building based on the centos patches with RFC 7440 support as the boot time would need to be brought down as much as possible. A PXE server can be a pain to setup sometimes, so if all it took was adding the option "pxe_server=enable" to grub.cfg to turn ShredOS into an instant PXE server, that would pretty useful for some people I guess? it would add next to nothing in terms of increase in size to the ShredOS .img/.iso, so I can't really see any downsides. Does that sound like a useful feature to add to ShredOS at some point? |
Beta Was this translation helpful? Give feedback.
-
Hello, I just followed your procedure to install shredos in PXE. The problem, a recent update this month (Windows) has modified the secure boot in the BIOS (I could not tell you what exactly, Microsoft indicates that the update has done something with the SBAT shim). When booting in PXE I have the following messages:
Server IP address is 192.168.1.85 Following the messages, the screen goes black while the PC button is on. After 5 minutes, the PC restarts under Windows. When I reset the secure boot in the BIOS, the PC boots on SHREDOS correctly (annoying to go to all the PCs to reset the secure boot). Do you have a solution? In addition, I would like to ask you if there is a way for the workstations to directly execute the formatting in DOD Short 3 passes without going through the interface (time saving). Thank you in advance for your help and advice. I don't speak Shakespeare's language well. |
Beta Was this translation helpful? Give feedback.
-
I don't see secure boot happening anytime soon unless I move ShredOS to a Ubuntu based OS. Secure boot could be added but it would mean you had to load the keys into the bios rather than it just seamlessly working like Ubuntu.
Yes, by editing the grub.cfg files as described in the readme.md by appending nwipe_options=" --method=dodshort" to the kernel command line.
Nor me, and I'm English. I've heard Jean Luc Picard can be quite good at it though. |
Beta Was this translation helpful? Give feedback.
-
Hello, |
Beta Was this translation helpful? Give feedback.
-
Hello, |
Beta Was this translation helpful? Give feedback.
-
Thank you for your responsiveness, I will look into this. Have a good evening. |
Beta Was this translation helpful? Give feedback.
-
Putting this into record. Today I integrated ShredOS very simply into my existing iPXE menu system. I downloaded the latest .img file from the github releases in my use here ( The below worked for me where "shredos" is the "shredos" file found within the
I took the kernel options directly from the grub.cfg file which shows up inside the same img file. ShredOS is very easy to boot with iPXE - it's just one big kernel file which presumably has everything it needs without the need for a separate initrd or any other resources. For all I know there's other parameters you could slip into the cmdline to influence the options and reports and who knows what all else. I had a basic need. |
Beta Was this translation helpful? Give feedback.
-
Prerequisite
Overview
The purpose of this procedure is to setup a very simple PXE server that allows client hosts on the network to boot ShredOS in UEFI mode only (not legacy boot) using ShredOS's own bootx64.efi software.
For those not familiar with PXE that means ShredOS is hosted on the PXE server and the client PCs on the network pull ShredOS across the network and load it when PXE booting is selected on the client PCs. To maximise load speed, ideally a gigabit network port on the server, gigabit switch and gigibit client network port is preferable, although older network hardware will work fine, just slow.
Your network cable is important. Don't use some old cat5 cable like I did when making the video below, hence the 4MB/s speed, use cat5e or cat6 cable to achieve maximum speed on a gigabit network. However, having said that, no matter what network spec you have you may not achieve a boot speed of greater than 4MB/s due to a limitation in tftpd code. Redhat have applied a patch to their version of tftpd to improve the speed, but unfortunately I don't think it has been applied upstream. So if you are using Ubuntu you may find your boot speed is limited to 4MB/s. The only alternative is to either rebuild tftpd yourself applying redhats patches or just use redhat as your PXE server. I assume Fedora applies these patches too, but I don't know that for certain. Here's a thread that discussesTFTP Windowsize Option RFC 7440 with links to the patches and a discussion about updating tftp-hsa in Debian/Ubuntu.
The following configuration does not provide a boot menu where you can select different distros or multiple different versions of ShredOS. It boots straight into ShredOS.
I will create a separate discussion showing a similar procedure that uses syslinux or more likely grub2, as I prefer to retain the progress info during the kernel being loaded. Which ever method I go for it will provide a menu system and allows the user to select different distros or versions of ShredOS and boot in both UEFI & legacy.
Software Installation
Locate a suitable server PC, preferably with a Gigabit network connection to maximise boot speed. A raspberry PI4 would meet this spec.
Install ubuntu or a debian based OS.
First, setup the OS with a static IP address, it's assumed that once you have installed ubuntu, you disconnect the internet routers running DHCP servers on the network. This is done just to keep things as simple as possible for the purposes of this procedure.
Then, install the tftp and dhcpd software as follows:
/srv/tftp
exists. It should do as it would have been created when you installed tftpd-hpa, however, if it doesn't exist, then create it as follows:Configure the tftp-hpa server software
Examine the contents of /etc/default/tftpd-hpa using
more
and make alterations so the file looks as follows:, note, the TFTP_DIRECTORY="/srv/tftp" path is the root where the contents of the ShredOS USB stick will get copied to later in the procedure. Make sure that path is as shown below. TFTP_ADDRESS=":69" is the network port address, if you have a firewall, port 69 needs to be open.Open port 69 in the firewall
Start the tftpd server
Setup configuration of the dhcp server
Comment out the following options:
hardware ethernet b8:ca:3a:84:eo:b9;
Bind the dhcp server to a network port
alternatively use the command ip -a to view the network interfaces.
Copy the entire contents of a ShredOS USB stick into /src/tftp/, change /dev/sdx to whatever the correct drive name is for the USB stick. Alternatively use the desktop to mount and copy the USB stick.
Copy the latest bootx64.efi to /srv/tftp/EFI/BOOT/
Restart the tftp server
Start the dhcp server
That's it, check your client PC bios supports PXE booting and that PXE booting is enabled. Power cycle the PC you want to network boot, press whatever the shortcut keys is to bring up the boot menu. Select PXE V4 boot and you should see some text appear and a couple of seconds later the ShredOS progress info as the ShredOS kernel is loaded across the network. Then nwipe should appear. In the video below the text mentions NBP, just in case you were were wondering, it's stands for Network Boot Program which is EFI/BOOT/bootx64.efi in our case.
VID_20230623_195216.2.1.mp4
/etc/dhcp/dhcpd.conf in full
Beta Was this translation helpful? Give feedback.
All reactions