Jump to content
grumpybutfun

[GUIDE] Installing a PXE Server on unRAID

80 posts in this topic Last Reply

Recommended Posts

Installing a PXE Server on unRAID

 

fWZNZsy.png

 

Examples of things you can do:

 

openELEC - You can network boot a machine into openELEC without a hard drive using your PXE Server. Each machine has it's own configuration that is also store / kept / maintained on the unRAID Server by default.

 

Linux Live CDs - You can network boot straight into Ubuntu, Linux Mint, Fedora, etc.

 

Clonezilla - You can network boot into Clonezilla and back up your PCs via NFS or Samba to your unRAID Server.

 

c33Q5Ps.png

 

ieEbXu6.png

 

1. SSH into your unRAID Server.

 

2. Create the following directory if it doesn't exist already:

 

mkdir  /boot/config/custom

 

3. Change to that directory

 

cd /boot/config/custom

 

4. Download dnsmasq-2.57-i486-1.txz

 

wget http://ftp.slackware.com/pub/slackware/slackware-13.37/slackware/n/dnsmasq-2.57-i486-1.txz

 

5. Edit your go file

 

nano /boot/config/go

 

Add the following lines before it starts emhttp

 

installpkg /boot/config/custom/dnsmasq-2.57-i486-1.txz
cp /boot/config/custom/dnsmasq.conf /etc
chmod +x /etc/rc.d/rc.dnsmasq
/etc/rc.d/rc.dnsmasq start

 

6. Create the following file

 

nano /boot/config/custom/dnsmasq.conf

 

Add the following to it and customize it for your Network and where you want to put your tftp folder. I used my cache drive.

 

port=0
log-dhcp
enable-tftp
tftp-root=/mnt/cache/tftp # <--- Place where your menus, cfgs, etc. will go
dhcp-range=192.168.1.0,proxy # <--- Enter the correct IP for your network
pxe-service=X86PC,"Booting...",pxelinux

 

7. Using the unRAID webGUI create a share called tftp on your cache drive (I made mine cache only).

 

8. Download and copy the following file into the root of your cache drive (/mnt/cache)

 

Customizable PXE Server Menu <--- Download Link

 

9. untar tftp.tar

 

tar xvf tftp.tar

 

10. Start the PXE Server by rebooting your unRAID Server or cut and paste the commands in the go file from step 5 above.

 

Important Notes...

 

You will need to use your brain and use the menu examples and learn the menu structure. I included this as a guide of how to PXE Boot into all kinds of things from openELEC, Linux Mint, Arch Linux, Clonezilla, etc.

 

I did not include the files and images. You will need to add those yourself. For example, go download Clonezilla and add the correct files to the images directory in a Clonezilla folder.

 

You can boot PXE Boot ISOs files. For an example of how to do this... Look at my Arch Linux Menu to see how.

 

Again... YOU have to think for yourself and Use the menus I included as a guide so you can configure your PXE Server to work with you. Feel free to delete the menu options you do not want or need.

 

Things you need to know

 

The default Main Menu is located in /mnt/cache/tftp/pxelinux.cfg and it's called default.

 

You can create a default menu based on machines MAC Address. To learn more / how to do this... PXELINUX

 

The Main Menu takes you to various other menus. The other menus are located in /mnt/cache/tftp/menus.

 

If you want to change the name, background image, change the menu resolution, etc. edit /mnt/cache/tftp/pxe.conf

 

When you boot into the PXE Server... It's root is /mnt/cache/tftp/

 

If you are using ESXi, Xen, KVM, VMWare... Your VMs can boot into the PXE Server and you can install VMs this way instead of using ISOs.

 

pfSense or routers might need to be configured for tftp to work. Simply point tftp to your unRAID Server.

 

There are a ton of websites that have various menus, examples, etc. Also, most Linux Distros have guides on how to boot a Live CD or Netinstall and even Full Installs that working 100% over the network using NFS and PXE (no hard drive needed).

 

Example of an openELEC menu by MAC Address so it directly boots into it (MAC Address in this example is: 00:26:2d:ab:9d:2e

 

1. Create the following file in /mnt/cache/tftp/pxelinux.cfg/

 

NOTE: You have to add 01 before using the rest of the MAC Address. <--- 01-xx-xx-xx-xx-xx-xx

 

nano /mnt/cache/tftp/pxelinux.cfg/01-00-26-2d-ab-9d-2e

Add the following...

 

DEFAULT openELEC Bedroom
PROMPT 0
LABEL openELEC Bedroom
KERNEL images/openELEC/KERNEL
APPEND ip=dhcp boot=NFS=192.168.1.2:/mnt/user/tftp/images/openELEC disk=NFS=192.168.1.2:/mnt/user/tftp/images/openELEC/storage overlay quiet

 

NOTE: Set the IP Address and path according to your system. I also share my tftp via NFS which is why it shows /mnt/user/tftp.... instead of /mnt/cache/tftp in the example above.

 

2. Set Permissions

 

chown nobody:users /mnt/cache/tftp/pxelinux.cfg/01-00-26-2d-ab-9d-2e && chmod 777 /mnt/cache/tftp/pxelinux.cfg/01-00-26-2d-ab-9d-2e

 

3. Start your openELEC PC and it should directly boot into openELEC

Share this post


Link to post

Thanks grumpy.

 

I could use this today, as I often boot to various live CDs and bootable thumbdrives from my desktop computer. How would I boot from my desktop pc using PXE? I looked at my mobo, and it does not have PXE in any of the settings or boot options. I assume a bootable thumbdrive that can boot to PXE...

 

I will also take a look at my Zotac ID80 to see if I can PXE boot....

 

 

Thanks again,

 

H.

Share this post


Link to post

Thanks grumpy.

 

I could use this today, as I often boot to various live CDs and bootable thumbdrives from my desktop computer. How would I boot from my desktop pc using PXE? I looked at my mobo, and it does not have PXE in any of the settings or boot options. I assume a bootable thumbdrive that can boot to PXE...

 

I will also take a look at my Zotac ID80 to see if I can PXE boot....

 

 

Thanks again,

 

H.

 

it might not be called PXE :-)

in BIOS it might simply be called network boot or something like it and you would choose the order of boot devices where network boot will be first option.

Share this post


Link to post

it might not be called PXE :-)

in BIOS it might simply be called network boot or something like it and you would choose the order of boot devices where network boot will be first option.

 

Sadly no luck; I lookead at all the boot options.... its a Gigabyte EX58-UD5.... I may have found a custom bios, but I am afraid it may break up my Hackintosh functionality.

 

 

Share this post


Link to post

Sadly no luck; I lookead at all the boot options.... its a Gigabyte EX58-UD5.... I may have found a custom bios, but I am afraid it may break up my Hackintosh functionality.

The manual says it should be there, Legacy LAN as a boot option. Perhaps you may have to use the other network port?

Share this post


Link to post

Sometimes elsewhere in the BIOS you have to enable the boot feature.  On my Gigabyte mobo I had to enable "LAN Boot" in a completely different menu, before it would show up under the boot options.

Share this post


Link to post

Thanks for this.  I currently have a Windows Deployment Server running on one of my 2008 R2 servers, but I would like to boot other things besides Windows installers.

Share this post


Link to post

Sadly no luck; I lookead at all the boot options.... its a Gigabyte EX58-UD5.... I may have found a custom bios, but I am afraid it may break up my Hackintosh functionality.

The manual says it should be there, Legacy LAN as a boot option. Perhaps you may have to use the other network port?

 

Slap!! That was the sound of my hand hitting the side of my head....! It is called Onboard LAN Boot ROM... I assume this is it.

 

Now please... say I have the PXE setup in unRAID and running... when booting, I pick the Onboard LAN Boot ROM Choice... what happens next? Will it search my network and magically detect the unRAID PXE stuff? and then gives me the syslinux menu choices?

 

On a side note, if I install Mint, or Regular Ubuntu on the unRAID, what type of install is it? Is it as if I were to boot a Live CD version, where things are not really saved (without invoking persistence)? Or would it work as a standard OS.... Same thing with OpenELEC, would it save all my artwork, thumbnails, settings, add-ons, etc. This was stated in OP, I just had to re-read and absorb.

 

This is a cool thing to add to unRAID...

 

 

 

Share this post


Link to post

Now please... say I have the PXE setup in unRAID and running... when booting, I pick the Onboard LAN Boot ROM Choice... what happens next? Will it search my network and magically detect the unRAID PXE stuff? and then gives me the syslinux menu choices?

 

Yes you will boot up into the PXE Server Menu.

 

You will still need to load the appropriate images / files (like Ubuntu for example) since I did not include them. If you look at the menu I provide... It's pretty straight forward what files are needed and where they go and every major Linux Distro has a wiki on how to do this not including all the various blogs and forums that spell it out for you.

 

On a side note, if I install Mint, or Regular Ubuntu on the unRAID, what type of install is it? Is it as if I were to boot a Live CD version, where things are not really saved (without invoking persistence)? Or would it work as a standard OS....

 

In my PXE Menu System I provide... They are installers or Live CDs (except for openELEC).

 

However, you can easily make / use a full blown Linux Distro using a PXE Server and NFS. Almost all of them have wikis on how to set up their Distro. Which is VERY fast. Even with a full blown Linux Distro with a GUI Desktop and every plugin on this site loaded (expect for the usenet indexer)... It would still take up less than 1GB of ram. You do not write a lot of "data" to the NFS drive so most everything is just reading from your unRAID (streaming movies, surfing the web, typing an email in the email client) or internet traffic.

 

With a couple of kernel changes... You can also boot Windows and add "drives" using iSCSI or AoE and do not need a hard drive in your Windows PC either. That is a story for another day though.

 

Same thing with OpenELEC, would it save all my artwork, thumbnails, settings, add-ons, etc.

 

openELEC will work like that. However, if I were you... I would create a default menu based on the MAC Address of your machines that boots into openELEC so it doesn't pop up a menu or require you to do anything.

 

My hope is that as people do this... They share their "settings" for the various menus / utilities / Linux Distros / etc. they create and share it with the rest of us.

 

 

Share this post


Link to post

Hi grumpy, thanks for another brilliant guide. :-)

 

Have got Clonezilla working, but am stumped on CentOS. Could you possibly share a little more about how you had your server configured - in terms of share/file/folder structure?

 

For example in the CentOS menu file you kindly provided I believe it references an NFS share - what is this share used for? As I'm able to get the installer to start but it says it's unable to find to installation files - finding it a little confusing since I thought the installer was already running! I'm guessing this NFS share plays a role that isn't required for Clonezilla, as I see no mention of it in the corresponding menu file.

 

Any hints would be much appreciated!

 

Sent from my Nexus 7 using Tapatalk

 

 

Share this post


Link to post

Thank you grumpy.... I am starting this tonight.... the Openelec thing sounds cool...  8)  8) Cant really tell if it will be an advantage over the local hard drive... but it will be fun to try. I only have 2 htpc's so upgrade and all are not time consuming...  But I do tweak the Aeon Nox skin a lot...

 

Thanks again.

 

 

Share this post


Link to post

Thank you grumpy.... I am starting this tonight.... the Openelec thing sounds cool...  8)  8) Cant really tell if it will be an advantage over the local hard drive... but it will be fun to try. I only have 2 htpc's so upgrade and all are not time consuming...  But I do tweak the Aeon Nox skin a lot...

 

Take a look at the first post... I provided some more information for you around directly booting a machine based on the MAC Address. I use openELEC in my example. I will probably update that when I get home because if I recall correctly you don't even need NFS but I will verify when I get home and update if needed.

Share this post


Link to post

Have got Clonezilla working.

 

That is great to hear.

 

but am stumped on CentOS. Could you possibly share a little more about how you had your server configured - in terms of share/file/folder structure?

 

For example in the CentOS menu file you kindly provided I believe it references an NFS share - what is this share used for? As I'm able to get the installer to start but it says it's unable to find to installation files - finding it a little confusing since I thought the installer was already running! I'm guessing this NFS share plays a role that isn't required for Clonezilla, as I see no mention of it in the corresponding menu file.

 

Let's have a look below at /mnt/cache/tftp/menus/CentOS.menu...

 

LABEL 2
        MENU LABEL CentOS 6.4(64-bit)
        KERNEL images/CentOS/x86_64/vmlinuz
        APPEND initrd=images/CentOS/x86_64/initrd.img ramdisk_size=100000 ip=dhcp METHOD=nfs:192.168.1.2:/mnt/user/tftp/images/CentOS/x86_65/install.img repo=http://mirror.centos.org/centos/6.4/os/x86_64/ lang=us keymap=us ip=dhcp ksdevice=eth0 noipv6
        TEXT HELP
        Install CentOS 6.4(64-bit)
        ENDTEXT

 

1. Copy initrd.img and install.img to the following folder:

 

/mnt/user/tftp/images/CentOS/x86_64/

 

2. Correct the IP Address of your unRAID and fix the typo I made (I will fix later tonight). You will see I have x86_65 and not x86_64 for the install.img.

 

3. Again I created a share in unRAID and told it to use only the cache drive. I also have it shared using NFS. Because of this, you have a "share" which to unRAID is /mnt/user/tftp. That is why you will see a lot of menus using /mnt/user/tftp instead of /mnt/cache/tftp.

Share this post


Link to post

Another great guide, thanks grumpy. I'll be trying to get this setup later this week when I have some time.

 

Thanks for the positive feedback.

Share this post


Link to post

i wud recommend tinypxe for windows users.

it is just 967kb exe file.  nth rocket science like all the config needed for dnsmasq or dhcp in unraid.

u can configure "user class" and filename

for small floppy sized img, i use grub instead. it worked and im nt changing to pxelinux for good.

for large img/iso file, i use ipxe. chainloading from grub using "user class" option(so ur dhcp server give u ipxe intead of default file). transferring using gigabit speed.

ipxe can boot *.wim file thru wimboot.

 

iPXE is a good option with an easy GUI if you have a Windows machine / Server.

 

However, once you go through the "trouble" of setting it up a PXE Server on unRAID... It works like a champ and uses gigabit too. Mine has worked for years. I only update it when a new Linux Distro / Windows Version comes out. Also, it can boot full ISOs of Distros and even Windows 7/8 no problems.

Share this post


Link to post

Have got Clonezilla working.

 

That is great to hear.

 

but am stumped on CentOS. Could you possibly share a little more about how you had your server configured - in terms of share/file/folder structure?

 

For example in the CentOS menu file you kindly provided I believe it references an NFS share - what is this share used for? As I'm able to get the installer to start but it says it's unable to find to installation files - finding it a little confusing since I thought the installer was already running! I'm guessing this NFS share plays a role that isn't required for Clonezilla, as I see no mention of it in the corresponding menu file.

 

Let's have a look below at /mnt/cache/tftp/menus/CentOS.menu...

 

LABEL 2
        MENU LABEL CentOS 6.4(64-bit)
        KERNEL images/CentOS/x86_64/vmlinuz
        APPEND initrd=images/CentOS/x86_64/initrd.img ramdisk_size=100000 ip=dhcp METHOD=nfs:192.168.1.2:/mnt/user/tftp/images/CentOS/x86_65/install.img repo=http://mirror.centos.org/centos/6.4/os/x86_64/ lang=us keymap=us ip=dhcp ksdevice=eth0 noipv6
        TEXT HELP
        Install CentOS 6.4(64-bit)
        ENDTEXT

 

1. Copy initrd.img and install.img to the following folder:

 

/mnt/user/tftp/images/CentOS/x86_64/

 

2. Correct the IP Address of your unRAID and fix the typo I made (I will fix later tonight). You will see I have x86_65 and not x86_64 for the install.img.

 

3. Again I created a share in unRAID and told it to use only the cache drive. I also have it shared using NFS. Because of this, you have a "share" which to unRAID is /mnt/user/tftp. That is why you will see a lot of menus using /mnt/user/tftp instead of /mnt/cache/tftp.

 

Thanks grumpy, I'd already spotted the typo though forgot to mention it in my original post - thanks for drawing it to the attention of others following in my footsteps!  :P

 

I've managed to get it working now, it seems the error I was getting was because there are no files at the repo address in the menu file. I replaced

 

repo=http://mirror.centos.org/centos/6.4/os/x86_64/

with

repo=http://mirror.centos.org/centos/6/os/x86_64/

 

and it all worked!  ;D Not sure if there is an advantage/disadvantage to just going with 6 rather than 6.5, as it seems both were viable options.

 

Hopefully now I've got one going I should be able to work out the rest.  Thanks so much for providing this guide! Has been a job on my 'to do' list for a while, and your guide has made it a relatively painless experience!  ;)

Share this post


Link to post

Got PXE running on the server last night and could boot to the menu from desktop, but then ran out of time.  Will start working on getting images setup next time I have some free time.

 

BTW, not sure if it's specific to my server or if it's not an installed package in stock unRAID, but nano doesn't exist on my system.  I tried to install it, but couldn't make it work.  Anyway, I just created the file with vi and then edited it with mc.

 

Thanks again grumpy!

Share this post


Link to post

Got PXE running on the server last night and could boot to the menu from desktop, but then ran out of time.  Will start working on getting images setup next time I have some free time.

 

Great to hear.

 

BTW, not sure if it's specific to my server or if it's not an installed package in stock unRAID, but nano doesn't exist on my system.  I tried to install it, but couldn't make it work.  Anyway, I just created the file with vi and then edited it with mc.

 

How to install Nano in unRAID

 

1. Login via SSH to unRAID

 

2. Change directories to the following

 

cd /boot/config/custom

 

3. Download Nano

 

wget ftp://ftp.slackware.com/pub/slackware//slackware-13.1/slackware/ap/nano-2.2.4-i486-1.txz

 

4. Install Nano

 

installpkg nano-2.2.4-i486-1.txz

 

5. Edit go

 

nano /boot/config/go

 

6. Add the following anywhere before the emhttp line

 

installpkg /boot/config/custom/nano-2.2.4-i486-1.txz

 

Now you have nano installed and should be after any reboot.

Share this post


Link to post

I've managed to get it working now, it seems the error I was getting was because there are no files at the repo address in the menu file. I replaced

 

repo=http://mirror.centos.org/centos/6.4/os/x86_64/

with

repo=http://mirror.centos.org/centos/6/os/x86_64/

 

and it all worked!  ;D Not sure if there is an advantage/disadvantage to just going with 6 rather than 6.5, as it seems both were viable options.

 

Looks like you have CentOS 6.0 set up and not version 6.5.

 

I just checked, it should be this if you want the latest version:

 

http://mirror.centos.org/centos/6.5/os/x86_64/

 

Cut and paste your http link and mine and you will see what I am talking about.

 

Share this post


Link to post

How to install Nano in unRAID

 

1. Login via SSH to unRAID

 

2. Change directories to the following

 

cd /boot/config/custom

 

3. Download Nano

 

wget ftp://ftp.slackware.com/pub/slackware//slackware-13.1/slackware/ap/nano-2.2.4-i486-1.txz

 

4. Install Nano

 

installpkg nano-2.2.4-i486-1.txz

 

5. Edit go

 

nano /boot/config/go

 

6. Add the following anywhere before the emhttp line

 

installpkg /boot/config/custom/nano-2.2.4-i486-1.txz

 

Now you have nano installed and should be after any reboot.

 

That's exactly what I did minus adding it to the go script (had I got it working I would have added it).  I suspect I used the wrong version.  Probably the slackware 13.37 or 14.0 version.  I simply googled nano slackware and tried the package.  It gave a dependency error when I tried to run it.  Don't remember off the top of my head which library it needed.  I'm still learning, but I should have known I needed the package for 13.1.

 

The lack of a package manager bites again, lol. 

Share this post


Link to post

Might have a use for this….

 

Is it possible to have the boot menu but for it to default to a certain option after a timeout…

Would like to be able to do this on my Openelec box…basically present the boot options and if nothing is selected after say 5 seconds default to Openelec…

 

Also is it possible to boot from the network but still access the local drive… Say boot Openelec over the network but still use the local disk for cache and artwork etc…

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.