# PXE Boot server



## andrewm659 (Mar 3, 2020)

I am trying to setup a PXE boot server so that I network install FreeBSD and Linux (redhat & centOS).  I am doing this on FreeBSD 12.1

I am have FreeBSD setup on a server with ZFS-on-root using tftp-hpa.  

My question is - Do I have to have a NFS mount for booting FreeBSD?  Can I make it a mountpoint and call it a day?

Also, I am loosely following this - https://virtualisationworks.wordpress.com/2017/10/20/network-booting-freebsd/

If there is something better that can give me more details I would appreciate it.  Trying to build my own documentation as well.


----------



## msplsh (Mar 3, 2020)

andrewm659 said:


> Can I make it a mountpoint and call it a day?



What's that mean if it doesn't mean NFS mountpoint?

You could have PXE just boot the FreeBSD ISO and call it a day


----------



## andrewm659 (Mar 3, 2020)

How?


----------



## msplsh (Mar 3, 2020)

This is going to sound ridiculous, but instead of using FreeBSD's pxeboot that only uses NFS, you could setup SYSLINUX to load via TFTP during PXE and have it load the disc1 FreeBSD ISO into a RAM disk via TFTP.  I use this strategy for my OpenBSD boxes so I don't have to burn discs or wipe USB keys (which don't install well anyway).


----------



## andrewm659 (Mar 3, 2020)

How do you have it do automated installations? As in I want each installation to have the same disk layout and always be ZFS


----------



## msplsh (Mar 4, 2020)

You're probably going to want to setup NFS then, otherwise you would be having to create install media.


----------



## andrewm659 (Mar 4, 2020)

Right.  So i'm wondering if its worth moving from CentOS 8 to FreeBSD...becasue of native support.   However i'm having issues finding 100% correct instructions that aren't missing pieces I feel.


----------



## T-Daemon (Mar 4, 2020)

andrewm659 said:


> Also, I am loosely following this - https://virtualisationworks.wordpress.com/2017/10/20/network-booting-freebsd/
> 
> If there is something better that can give me more details I would appreciate it. Trying to build my own documentation as well.


Try the handbook, chapter 31.8. Diskless Operation with PXE, and the manual diskless(8). Also there is a documentation at the beginning of the /etc/rc.initdiskless script file.


----------



## andrewm659 (Mar 4, 2020)

However I didn't mention this before but I also want to be able to pxe boot Linux distributions off of there as well.


----------



## msplsh (Mar 4, 2020)

What do you mean by "native support?"

You could use a PXE SYSLINUX loader to present a menu to boot between FreeBSD's NFS pxeboot and whatever Linux setup you want.


----------



## balanga (Mar 4, 2020)

It is possible to use gpxelinux.0 as the pxe bootloader and then chain FreeBSD's pxeboot from one of the PXELINUX menus with the following entry:


```
LABEL FreeBSD-PXE
   MENU LABEL PXE-FreeBSD
   PXE pxeboot
   MENU DEFAULT
```


----------



## andrewm659 (Mar 4, 2020)

Do I need to copy /boot/pxeboot to my tftpboot directory?


----------



## andrewm659 (Mar 4, 2020)

I got it working...DHCP config


----------



## balanga (Mar 4, 2020)

andrewm659 said:


> I got it working...DHCP config


Are booting directly from pxeboot ? Let me know how you get on. I had it working, but booting was agonisingly slow, although I had it working much faster in the past but must have changed something and now it almost unusable.

What version of FreeBSD are you using?


----------



## andrewm659 (Mar 4, 2020)

Using FreeBSD 12.1.

Trying to boot CentOS 8.  And yes it is SOOOOOO SLOW!


----------



## andrewm659 (Mar 4, 2020)

Getting CentOS 7 to PXE boot so far....


----------



## andrewm659 (Mar 4, 2020)

I am able to get CentOS 7 to work just fine.  I would venture to say that the rest of them will be fine.  Its going to be CentOS/RHEL 8.


----------



## andrewm659 (Mar 4, 2020)

Getting CentOS 8 working now.


----------



## andrewm659 (Mar 4, 2020)

So I need to do more testing.  CentOS 8 failed.  But I need to figure out how to get FreeBSD network install working.  I have the ISO extracted to a folder I just need to figure out how to tell the boot process where the rest of the installer is.....


----------



## msplsh (Mar 4, 2020)

Since you haven't answered how you've got it working, I am just guessing you're using PXE SYSLINUX.  By default, you're not going to get a modified FreeBSD ISO that isn't re-imaged working without the NFS mount.  You could set LOADER_TFTP_SUPPORT as described in diskless(8) and rebuilding /usr/src/stand and then put the ISO on TFTP.


----------



## andrewm659 (Mar 4, 2020)

Sorry I didn't answer your question.  But you are correct.  I will look into how to do FreeBSD.


----------



## balanga (Mar 4, 2020)

msplsh said:


> Since you haven't answered how you've got it working, I am just guessing you're using PXE SYSLINUX.  By default, you're not going to get a modified FreeBSD ISO that isn't re-imaged working without the NFS mount.  You could set LOADER_TFTP_SUPPORT as described in diskless(8) and rebuilding /usr/src/stand and then put the ISO on TFTP.



mfsBSD boots up OK without an NFS mount.


----------



## andrewm659 (Mar 10, 2021)

Did you ever get anywhere with this?  I know its been a solid year...


----------



## msplsh (Mar 10, 2021)

Did... who get anywhere with... what?  You're the original poster.


----------



## andrewm659 (Mar 10, 2021)

balanga


----------



## balanga (Mar 10, 2021)

andrewm659 said:


> balanga


My PXE server is far away from me at the moment ....


----------

