Is it possible to setup a universal ISO pxe boot server?

Red Squirrel

No Lifer
May 24, 2003
69,689
13,318
126
www.betteroff.ca
I setup a separate vlan for when I work on people's PCs, or even my own, and I want to have a PXE environment where I can pick an ISO from a menu and then boot it. Then I can drop various ISOs from Linux distros to utility ISOs like Acronis or system rescue, Windows OS installs etc...

Is there a way to do this? I googled and did not find much, any method I found seemed to be specific to a type of OS. Like for Linux there are specific boot files to copy etc. I want it to be universal so that as long as the ISO is bootable, it boots. I could also add Acronis and other ISOs in there to make it easier to image machines. I'm pretty sure someone here had a solution like this but I can't recall the name of the software needed. I presume the way it would work is that it loads a virtual cdrom drive then boots the ISO via that drive.

Would be neat to be able to install windows or boot live CDs right from the network without even needing CDs or anything.
 

XavierMace

Diamond Member
Apr 20, 2013
4,307
450
126
My WDS server also installs ESXi, so yes it's possible. Not sure it's worth the effort for disks you might be only using once though.
 

Red Squirrel

No Lifer
May 24, 2003
69,689
13,318
126
www.betteroff.ca

Does that require hardware modification of each machine? They seem to suggest that. I need this to work natively, I want to be able to plug any machine and boot off pxe, select the iso, then boot off it. That way I can throw in all the windows, boot utilities etc ISOs in there. Idealy it would be nice to setup a hierarchy of menus.

Edit: oh reading up further into it it looks like it can be done natively, going to check this out further.
 

mxnerd

Diamond Member
Jul 6, 2007
6,799
1,103
126
Yeah, look like it can boot natively. Haven't tried it yet myself.
 

Red Squirrel

No Lifer
May 24, 2003
69,689
13,318
126
www.betteroff.ca
Ugn I hate building stuff from source, it never works for me. So ipxe is out. Going to have to look at FOG. Getting this error when I try to build ipxe:


Code:
  [BUILD] bin/acpi.o
In file included from include/ipxe/uaccess.h:27,
                 from core/acpi.c:28:
./config/ioapi.h:17:32: error: config/local/ioapi.h: No such file or directory
In file included from include/ipxe/acpi.h:20,
                 from core/acpi.c:29:
./config/general.h:200:34: error: config/local/general.h: No such file or directory
make: *** [bin/acpi.o] Error 1

Not finding much on Google either.

I did get the pxe boot process to work somewhat though. There is a ipxe file you can get separately and you specify in DHCP server and I got it to boot that file. It does not do anything on it's own but I presume if I got it to install then I would have a config file in /etc and what not I can configure.
 

Red Squirrel

No Lifer
May 24, 2003
69,689
13,318
126
www.betteroff.ca
As a proof of concept I got it working with gparted using the pxelinux.0 way as I'm finding more tutorials on that than anything else. It seems that each individual distro/OS needs to actually support pxe and have the appropriate files/version that you download for this purpose. So not really practical as I need to follow the tutorial for each individual distro I'd like to put on there. Was hoping it would be more cut and dry where once I do one, I can do any. But for now this is just a "nice to have" thing so worse case scenario I'll just put a couple more important utils and call it a day. Still need to figure out how to make a menu as it seems it boots to default entry no matter what and I never get a list.

I'll have to do more research on getting ipxe to compile as if I can get it to compile that looks like it might do what I want where I can just load ISOs directly. But it errors out at the make command.
 
Last edited:

mxnerd

Diamond Member
Jul 6, 2007
6,799
1,103
126
Don't have time to test yet. But from the website's docs (too simplistic, and no step by step instruction) it seems a bit complex, which you have found out.

Found a link on the site pointing to a sample of menu files.
https://gist.github.com/robinsmidsrod/2234639

Don't have much time tomorrow, probably have to wait a few days.
 

Red Squirrel

No Lifer
May 24, 2003
69,689
13,318
126
www.betteroff.ca
Yeah more I read into this the more I see how convoluted it is, and all the tutorials only tell you half the details. May very well not be worth the effort. I was hoping it could be as simple as dropping ISOs in a folder structure and it auto generates a menu or something.

I found a way that creates a memory disk ISO but I just tried it with win10 and it fails to boot, like it just sits at a black screen. Probably because it's so big it has to load that into memory via tftp and times out.

It's a bit simpler to stick to booting specific Linux distros that support PXE, so I might do just that once I can get the menus to actually work. It seems it always boots straight into the default one.

Though the other issue is having a tftp server (which is not very secure) open on that server is not ideal, since that vlan will see all sorts of machines, possibly virus infected ones. So maybe I should just take the KISS approach and stick to CDs afterall and keep that server HTTP only, which is basically where I will download misc utils, programs etc. It also will have SMB so I can store acronis images.

I might still look at FOG though when I get more time.
 

Red Squirrel

No Lifer
May 24, 2003
69,689
13,318
126
www.betteroff.ca
Progress!

Example config that shows a menu:

Code:
default menu.c32
prompt 0
timeout 300
ONTIMEOUT local

MENU TITLE PXE Menu

LABEL Pmajic
        MENU LABEL Pmajic
        kernel images/pmagic/bzImage
        append noapic initrd=images/pmagic/initrd.gz root=/dev/ram0 init=/linuxrc ramdisk_size=100000

LABEL CentOS 5 x86 NO KS eth0
        MENU LABEL CentOS 5 x86 NO KS eth0
        KERNEL images/centos/5/x86/vmlinuz
        APPEND ks initrd=images/centos/5/x86_64/initrd.img ramdisk_size=100000 ksdevice=eth1 ip=dhcp url --url http://xxx.xxx.xxx.xxx/mirrors/CentOS-5-i386/


 
LABEL GPARTED_0.28.1-1-i686
            MENU LABEL GParted Live (0.28.1-1-i686)
            kernel data/gparted/vmlinuz
            append initrd=data/gparted/initrd.img boot=live config components union=overlay username=user noswap noeject ip= vga=788 fetch=http://10.8.8.5/pxedata/gparted/0.28.1-1-i686/filesystem.squashfs



LABEL GPARTED_0.28.1-1-i686_2
            MENU LABEL GParted Live (0.28.1-1-i686) entry 2
            kernel nbi_img/vmlinuz
            append initrd=nbi_img/initrd.img boot=live config components union=overlay username=user noswap noeject ip= vga=788 fetch=http://10.8.8.5/pxedata/gparted/0.28.1-1-i686/filesystem.squashfs



The default menu.c32 is the line I had wrong. I thought that parameter was for the default choice within the menu, so I had it set to a label name. But I guess that actually tells it to load a special menu program to then read the file.

So yeah I need to decide how I want to organize all my kernel files etc (I only have the gparted one working currently as the others are just copy and paste from tutorials) and then I think I will just set this up for specific utilities, rather than OSes. So I will have to read tutorials for setting up each utility individually but once I have it setup I won't really have to touch it much.
 

mxnerd

Diamond Member
Jul 6, 2007
6,799
1,103
126
I'm a Windows guy. This is the first time I'm serious about using Linux and the experience is just disastrous. Doing even simple things requires a lot of command lines. Can't even get ISC DHCP server going, it seems the server was started but just won't hand out IP leases.

And don't know why ubuntu, mint & xubuntu all kept giving me system error messages.

Giving up. I think I'll just use YUMI USB Multiboot Creator. https://www.pendrivelinux.com/yumi-multiboot-usb-creator/
 
Last edited:

Red Squirrel

No Lifer
May 24, 2003
69,689
13,318
126
www.betteroff.ca
Linux rocks for servers, you get used to command line, but the beauty is that you don't need any GUI to administrate it, which makes it 10x easier to do remotely, thanks to SSH. Not too sure why you're having issues with DHCP though, but one thing I did find annoying is that it did not have a base config, had to google to find out that I have to copy it from another folder. I was trying to see if I can still keep pfsense as DHCP server but decided to make the PXE server do it, as that seems to be the standard way to go.

For desktop it's come a long way but I do agree I find it still falls short. Desktop is one area where one should not need command line or to edit config files at all, and while you can mostly get away without any of those things it seems the GUI is still limited compared to Windows in some cases. Like as a basic example in Windows you can change cursor themes quite easily, you can even change individual cursors. In Linux, you get like 3 choices, and you can only change the whole theme not individual ones. Lot of small things like that still need a lot of work. I sometimes find I'm limiting myself by using it as my main machine, but any time I have to deal with Windows and it's annoyances, or just knowing all the spying crap in win10 and the general direction MS is going, it makes me glad I'm on Linux.
 

lxskllr

No Lifer
Nov 30, 2004
59,065
9,468
126
Like as a basic example in Windows you can change cursor themes quite easily, you can even change individual cursors. In Linux, you get like 3 choices, and you can only change the whole theme not individual ones.
Make your own theme. Download a theme so you can see how it's setup, copy/paste/rename the bits you want, and call it squirrelcursor or something. Should be easy. I don't even know how you'd do that on windows.
 
Feb 25, 2011
16,980
1,616
126
Does that require hardware modification of each machine? They seem to suggest that. I need this to work natively, I want to be able to plug any machine and boot off pxe, select the iso, then boot off it. That way I can throw in all the windows, boot utilities etc ISOs in there. Idealy it would be nice to setup a hierarchy of menus.

Edit: oh reading up further into it it looks like it can be done natively, going to check this out further.

You can do this, although on many systems you will need to first enter the BIOS and enable network boot. You will also need to set up a tftp server, unpack the ISOs, etc.

You may be interested in this: https://fogproject.org/

But it just depends. If you're doing hundreds of reimages a week, this is worth your time, but if it's one or two a day, just keep a bunch of thumb drives on a key chain.
 

Red Squirrel

No Lifer
May 24, 2003
69,689
13,318
126
www.betteroff.ca
You can do this, although on many systems you will need to first enter the BIOS and enable network boot. You will also need to set up a tftp server, unpack the ISOs, etc.

You may be interested in this: https://fogproject.org/

But it just depends. If you're doing hundreds of reimages a week, this is worth your time, but if it's one or two a day, just keep a bunch of thumb drives on a key chain.


Yeah I realized it's more involved than I had hopped, so think I will just do it for a few select utilities. It seems it can be done but it's a per OS basis, ex: each OS has it's own way of doing it. Like I got gparted to work, that requires tftp and http, and a special squash FS image. Not all distros will ship with that.

For mint, it seems to require NFS and you have to load the actual ISO's content through it. I have not gotten that one to work yet, it gets to the splash screen, so there is some progress, but then it fails. Have not looked further since then so maybe I missed something.

But basically it seems there is no universal way, it's very depending on if a particular distro/OS has support for it and they will have their own specialized instructions.

So think what I will go for is gparted, and other utilities that support PXE, and maybe a couple distros so I can simply boot into a live distro. Sometimes I just want to grab files off a PC before I format it, so I just go into a regular distro to do it. (ex: if it's a windows 8 machine, it's easier to use Linux to access file system directly than to try to figure out that horrible interface). The for OS installs I'll just keep doing what I already do, which is to use a USB drive that can emulate ISOs. For Linux I tend to just dd the ISO directly to a USB stick. For Windows then I'll use the ISO emulator HDD.


On sorta similar subject, how do you secure tftp so that it's read-only? Or is it by default? I can't seem to find much info on how to configure it. I want to secure it as good as possible, as the whole point of this machine/vlan is to work on people's computers so it's very possible I put a machine on this network that has a virus or worm etc.

I'm glad I got the menu to work though, that on it's own is good progress. :p I've literally never played with PXE before so this is kinda neat to see working.
 

mv2devnull

Golden Member
Apr 13, 2010
1,519
154
106
You will also need to set up a tftp server, unpack the ISOs, etc.
The main thing on tftp server is adding the menu entries & kernels.

One can loop mount an ISO on a server. Then you can see kernel and the rest of the ISO content as a read-only filesystem. The tftp server can access kernel file from that and so can ftp/http/nfs server that shares the rest. No unpacking required.


Single dnsmasq process can provide DHCP server, DNS server, and TFTP server. The trio of ISC DHCP, BIND, and tftpserver has more features though. Same system can support both legay BIOS and EFI mode PXE clients.
 

ahakobyan

Junior Member
Feb 16, 2019
2
0
6
I was hoping it could be as simple as dropping ISOs in a folder structure and it auto generates a menu or something.

Hi,
I've been looking to find a way to build a PXE server that would do exactly what you've described.
Reading this forum post since 2017 I was wondering if you were able to get anywhere close to the initial idea?

Please update on the pxe server, what was the best you were able to get to?

Thank you very much!
 

Red Squirrel

No Lifer
May 24, 2003
69,689
13,318
126
www.betteroff.ca
TBH I never looked at it much further. It's one of those things that would be cool to have, but that I don't need that often so never put that much effort into and kinda forgot about. I have a portable hard drive that basically does it too, you put ISOs on the drive and then you can toggle cdrom mode on it and it has a little LCD to cycle through the ISOs.
 

ahakobyan

Junior Member
Feb 16, 2019
2
0
6
TBH I never looked at it much further. It's one of those things that would be cool to have, but that I don't need that often so never put that much effort into and kinda forgot about. I have a portable hard drive that basically does it too, you put ISOs on the drive and then you can toggle cdrom mode on it and it has a little LCD to cycle through the ISOs.
Thanks for the quick reply.
Yea, i know what you mean, I myself tried it few years ago and gave up, now I was thinking about building one, but giving up for the same reasons.

Could you tell me what you used to build the portable hard drive with ISO files? I might just create one too.

Thanks.
 

Red Squirrel

No Lifer
May 24, 2003
69,689
13,318
126
www.betteroff.ca
Thanks for the quick reply.
Yea, i know what you mean, I myself tried it few years ago and gave up, now I was thinking about building one, but giving up for the same reasons.

Could you tell me what you used to build the portable hard drive with ISO files? I might just create one too.

Thanks.

It was an actual hard drive you could buy. Oddly enough they arn't popular and not even sure if you can still get them but didn't search too deep. I think it's a really neat concept myself.

https://www.newegg.ca/Product/Product.aspx?Item=N82E16811235059

Unfortunately out of stock.
 

sintax0r

Junior Member
Apr 8, 2019
1
0
6
...


No kickstarter accounts allowed.


esquared
Anandtech Forum Director
 
Last edited by a moderator: