Need Help: PXE Booting OpenELEC from unRAID


Recommended Posts

Hi All

 

unRAID v5rc12a

 

I'm hoping sonmeone can help me (cough...PeterB..cough cough) since it seems some of you are doing this successfully and I am running into a few issues.  Here is what I have done so far and how far I got...

 

I pretty much followed this blog:  http://stuffbyjeroen.blogspot.com/2011/07/using-unraid-server-to-pxe-boot.html

 

- I created a share in unRAID called "PXE" and exported NFS/Public

- I created the following folder structure in the PXE share and have the following files:

 

  /mnt/user/PXE

        /tftpboot

            chain.c32

            mboot.c32

            memdisk

            menu.c32

            pxelinux.0

        /tftpboot/pxelinux.cfg

            C0A801C5 <--- the boot file for my openelec machine (contents are shown below)

        /tftpboot/openelec

            KERNEL

            SYSTEM

        /tftpboot/openelec/storage

 

The contents of the C0A801C5 are as follows:

 

DEFAULT OpenElec.tv

PROMPT 0

 

LABEL OpenElec.tv

      KERNEL openelec/KERNEL

      APPEND ip=dhcp boot=NFS=192.168.1.10:/mnt/user/PXE/tftpboot/openelec disk=NFS=192.168.1.10:/mnt/user/PXE/tftpboot/openelec/storage overlay

 

Per the blog linked above, I copied tftp-hpa-0.48-i486-1.tgz to the /boot/packages folder in unRAID and ran:

 

installpkg /boot/extra/tftp-hpa-0.48-i486-1.tgz

 

I then ran and also put this line in my GO script:

 

/usr/sbin/in.tftpd -l -s /mnt/user/PXE/tftpboot

 

I use ClearOS as my firewall/router and added the following line to the /etc/dnsmasq.conf file:

 

dhcp-boot=pxelinux.0,unRAID,192.168.1.10

 

Finally, I chmod'd all files under /mnt/user/PXE/tftpboot to 777:

 

chomd 777 /mnt/user/PXE/tftpboot/*

 

My test PXE instance is an ESXi VM with no virtual HD so it automatically defaults to PXE.  PXE finds the TFTP server without issue and loads the boot file for the VM and the kernel.  The screen shots below show how far I get and the error that is eventually displayed.

 

1-1_zpsea6712fc.png

 

2-1_zpsb866631b.png

 

3-1_zps0a0f7cae.png

 

4_zps82fd0ab2.png

 

Is it failing to find the SYSTEM file due to the NFS share not being mounted successfully?

 

Any help would be greatly appreciated!

 

John

Link to comment
  • Replies 58
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Hi John, sorry to be a little slow to respond, was plagued by a long power outage yesterday (Tuesday) and also needed to recover one of my desktop machines which had been in the process of installing an Ubuntu upgrade over Saturday night/Sunday morning when the power went off for five minutes.  The partial upgrade left the machine where it wouldn't boot old or new systems or, indeed, any of the recovery images.

 

Anyway, this doesn't help you.

 

First of all, let me say that I'm not familiar with the environment you're attempting to build.  Instead of using an external dhcp server and separate tftp server, I am using dnsmasq, which is available as an unMenu package, and provides both dhcp and tftp services in one integrated daemon on the unRAID server.

 

To the best of my knowledge, I don't need (or they're hidden from me)  chain.c32, mboot.c32, memdisk or menu.c32.

In the dnsmasq.conf file I simply specify "dhcp-boot=pxelinux.0".

 

My pxelinux.cfg directory then contains separate files for each machine to be booted, named after the mac address (01-c8-60-00-bc-f0-fb) of the target machine.  Those files look very similar to the example you provide:

DEFAULT OpenElec.tv
PROMPT 0

LABEL OpenElec.tv
       KERNEL openelec/KERNEL
       APPEND ip=dhcp boot=NFS=10.2.0.100:/mnt/cache/dnsmasq/openelec disk=NFS=10.2.0.100:/mnt/cache/dnsmasq/openelec/storage overlay quiet

 

My openelec 'disk' contains 'KERNEL' and 'SYSTEM' files, with 755 permissions, and a 'storage' directory with 775 permissions.

The 'storage' directory contains a sub-directory for each of the target clients (again, named by mac address), containing the working files/folders.

 

This all looks very similar to your directory/file structure, except for the ".c32" files

 

Now, this still doesn't help you very much, but explains why I can't directly relate my configuration to yours.

 

Given that your system can be seen to be loading the kernel, then executing it, there can only be two further things which require to mount - one is for openelec/SYSTEM (which, I presume, is the image for memory disk) and the storage folder, which is the working application storage area.  Which one is failing?  You're probably correct that it is SYSTEM which is failing.

 

If I rename 'SYSTEM' so that it cannot be found, I get a different error message:

*** Error in prepare_sysroot: final check: Could not find system. ***

followed by the System halt at 6.46 seconds.  It's interesting to note that the openelec logo is already on screen at this point - I don't see that in your screen dumps.  Also, I'm not aware of the "Loading kernel" message, with progress dots, which you show.  However, a missing file is not the same as a mount failure!

 

If I rename my storage share/folder, I get the error:

*** Error in mount_storage: mount_common: Could not mount 10.2.0.100:/mnt/cache/dnsmasq/openelec/storage ***

 

followed by the system halt at 21.3 seconds.

 

 

So, I believe, as you do, that your problem is a failure to mount openelec in order to read the SYSTEM image ... but we still don't know why.

 

I presume that you can mount the openelec share, via nfs, on another client.

 

My guess is that your "tftp: client does not accept options" error message is significant and tftp is, therefore, not able to pass all the information from the 'APPEND' line in pxelinux.cfg.  I notice that Jeroen uses a completely different set of APPEND parameters.  Also, I read that tftp-hpa has a  /etc/conf.d/in.tftpd file.  Do you have that configuration file, and what's in it?

 

All I can suggest is that you try a different tftp server!

 

I guess that it is possible that your PXE boot ROM (and the equivalent in your virtual machine) fail to implement 'options'?  Can you give more details of the hardware in your settop openelec box?  I'm using the Asus E45M1-i Deluxe mobo.

 

I'm sorry that I'm not able to give you a solution!

Link to comment

I just tried modifying my pxelinux.cfg/xx-xx-xx-xx-xx-xx-xx file, to make:

APPEND ip=dhcp boot=NFS=10.2.0.100:/mnt/cache/dnsmasq/openele disk=NFS=10.2.0.100:/mnt/cache/dnsmasq/openelec/storage overlay quiet

Note the missing 'c' on the end of openelec.

 

Now I get the same error message as you see, but ..... here's the odd thing, the message is presented a little differently:

*** Error in mount_flash: mount_common: Could not mount 10.2.0.100:/mnt/cache/dnsmasq/openele ***

 

Notice that a full path is given, whereas your example only shows "/openelec".  Now, this could just be that you're booting a different build (I'm on 3.01), which presents the message in a different way, or it could be that your system is not receiving the "192.168.1.10:/mnt/user/PXE/tftpboot" part.  This would certainly result in the failure that you're seeing!

Link to comment

Thank you Peter for taking the time to help me.  I really appreciate it!

 

So, let me ask this...

 

If I mimic what you are doing and use dnsmasq on my unraid box, do I no longer need to install the TFTP server as shown in the first few lines here:  http://stuffbyjeroen.blogspot.com/2011/07/using-unraid-server-to-pxe-boot.html

 

If I read correctly in the other thread, installing/enabling dnsmasq alone enables TFTP.

 

Unfortunately, I am still left with the need to avoid having unraid hand out IP addresses since I already have a DHCP server (ClearOS) in place.  Can I do what darkside had done and bascially turn on proxy dhcp:

 

I will write a howto when i figured out how to get the newest DNSmasq Version running on my unraid.

 

For everybody who cant wait, here you can see what is in my DNSmasq Config, to be honest i dont figured it out myself but it was part of a Article in a German Computer Magazine:

 

port=0
log-dhcp
enable-tftp
tftp-root=/mnt/user/tftp
dhcp-range=192.168.2.0,proxy
pxe-prompt="Press F8 for Menu",5
pxe-service=X86PC,"Start from HDD",0
pxe-service=X86PC,"Start desinfect",ct/pxelinux

 

It enables TFTP and sets it root directory to the user share i have created for it (in my case a cache only share).

The DHCP Range needs to be adjusted to your need, also DNSmasq runs in proxy mode.

Hope that helps anybody.

 

John

Link to comment

Thank you Peter for taking the time to help me.  I really appreciate it!

 

I have to believe that what you have set up now should work - it's just not clear why the client doesn't get the full path to the openelec share (or why it can't mount it).  What version of OpenELEC are you trying to run?  If I try the same version, I could prove whether the full pathname should be displayed.

 

So, let me ask this...

 

If I mimic what you are doing and use dnsmasq on my unraid box, do I no longer need to install the TFTP server as shown in the first few lines here:  http://stuffbyjeroen.blogspot.com/2011/07/using-unraid-server-to-pxe-boot.html

 

If I read correctly in the other thread, installing/enabling dnsmasq alone enables TFTP.

 

Correct.  dnsmasq includes its own tftp server, enabled by the configuration: enable-tftp

 

Unfortunately, I am still left with the need to avoid having unraid hand out IP addresses since I already have a DHCP server (ClearOS) in place.  Can I do what darkside had done and bascially turn on proxy dhcp:

 

Yes, this is exactly what I do - I still rely on my router for dhcp.  My reason for this is that the router probably spends more hours running than unRAID does, and it will start up more quickly after a power cut.

 

I will write a howto when i figured out how to get the newest DNSmasq Version running on my unraid.

 

For everybody who cant wait, here you can see what is in my DNSmasq Config, to be honest i dont figured it out myself but it was part of a Article in a German Computer Magazine:

 

port=0
log-dhcp
enable-tftp
tftp-root=/mnt/user/tftp
dhcp-range=192.168.2.0,proxy
pxe-prompt="Press F8 for Menu",5
pxe-service=X86PC,"Start from HDD",0
pxe-service=X86PC,"Start desinfect",ct/pxelinux

 

It enables TFTP and sets it root directory to the user share i have created for it (in my case a cache only share).

The DHCP Range needs to be adjusted to your need, also DNSmasq runs in proxy mode.

Hope that helps anybody.

 

John

 

For what it's worth, here is my dnsmasq.conf.  I'm sure that not all of the lines are essential, but this is what is working for me:

port=0
dhcp-range=10.2.0.255,proxy
dhcp-option-force=208,f1:00:74:7e
dhcp-option-force=209,configs/common
dhcp-option-force=210,/mnt/cache/dnsmasq/
dhcp-option-force=211,30i
dhcp-boot=pxelinux.0
dhcp-option=encap:175, 1, 5b         # priority code
dhcp-option=encap:175, 176, 1b       # no-proxydhcp 
dhcp-option=encap:175, 177, string   # bus-id 
dhcp-option=encap:175, 189, 1b       # BIOS drive code
dhcp-option=encap:175, 190, user     # iSCSI username
dhcp-option=encap:175, 191, pass     # iSCSI password
pxe-prompt="Press F8 for Menu",0
pxe-service=x86PC, "Install Linux", pxelinux 
enable-tftp
tftp-root=/mnt/cache/dnsmasq

 

Note the zero value timeout on pxe-prompt - I don't want to wait for a response because my only option is to run OpenELEC.

 

Link to comment

Well, I got it working!  :)

 

Actually, my guess is that it was working all along...just not in a VM.  Once I tried my settop Fusion box again, it booted right in.  I only tried it once and probably when I was still learning and had the arguments in the bootloader correctly misconfigured.

 

I have to say...this is pretty damn cool.

 

Any tips/tricks Peter?  You had mentioned having separate storage folders for each of your openelec boxes.  What is this?  I thought having a single storage would be nice for library purposes.

 

One thing I will need to start to look at is booting PXE over wireless.  However, I think I read that this can only be done with iPXE???

 

John

 

 

Link to comment

Well, I got it working!  :)

 

Actually, my guess is that it was working all along...just not in a VM.  Once I tried my settop Fusion box again, it booted right in.  I only tried it once and probably when I was still learning and had the arguments in the bootloader correctly misconfigured.

 

Ah, okay - well done!  I guess that network booting a VM is a bit of a strange concept - still, I guess that it ought to work.  Presumably you no longer get the in.tftpd error?  Perhaps the virtual PXE boot rom isn't complete?

 

I have to say...this is pretty damn cool.

 

Indeed, I love it - the media centre hardware is just so simple now, all maintained from the server.  I've even been thinking about the possibility of using PXE boot for my desktop machines!

 

Any tips/tricks Peter?  You had mentioned having separate storage folders for each of your openelec boxes.  What is this?  I thought having a single storage would be nice for library purposes.

For the most part, the contents of the storage directory tree is identical for each machine, and can be created by a straight copy.  All the 'visible' directories on storage are empty, but the hidden directories contain settings and preferences - unless you have identical hardware on each system, you almost certainly need each OpenELEC box configured slightly differently.  For instance,one of mine uses audio over hdmi, but can't handle dts.  The other uses audio over s/pdif and does accept dts.

 

However, you can edit the storage/.xbmc/userdata/advancedsettings.xml file to enable the shared media database (sql) and thumbnails and sources (directories).  Here is my advancedsettings file:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Pete's modified version -->
<advancedsettings>
  <videodatabase>
    <type>mysql</type>
    <host>tower</host>
    <port>3306</port>
    <user>xbmc</user>
    <pass>xbmc</pass>
  </videodatabase>
  <pathsubstitution>
    <substitute>
      <from>special://masterprofile/Thumbnails/</from>
      <to>nfs://tower/mnt/user/xbmc/thumbnails/</to>
    </substitute>
    <substitute>
      <from>special://masterprofile/sources.xml</from>
      <to>nfs://tower/mnt/user/xbmc/sources.xml</to>
    </substitute>
  </pathsubstitution>
</advancedsettings>

 

Now, all the media-related information is centralised and shared.  Even the played/stopped information is stored on the database so that if you stop watching a movie part way through, on one system, you can go to another system and it will resume from where you stopped on the first.

 

Have fun!

 

One thing I will need to start to look at is booting PXE over wireless.  However, I think I read that this can only be done with iPXE???

 

I haven't tried it but, as far as I can see, the problem is finding a wireless interface which has a PXE boot ROM.  Apparently there are a couple.  iPXE is a possibility (as an open source implementation of PXE), but you would still need to put it in non-volatile storage on the client, in which case you might as well put your OpenELEC image on the storage.  The easiest way to get PXE over a wireless connection is to use a wireless bridge, connected by wire to your client.

Link to comment

Hey Peter...

 

Have you had any issues stopping the array while an openelec system is active?  I get constant "retry unmounting disks".  I'm not sure if the issue is caused by KERNEL/SYSTEM being open for reading, the "storage" folder being written to, or just the tftp server running in general.  I haven't had a chance to troubleshoot yet.

 

John

Link to comment

My pxelinux.cfg directory then contains separate files for each machine to be booted, named after the mac address (01-c8-60-00-bc-f0-fb) of the target machine.  Those files look very similar to the example you provide:

DEFAULT OpenElec.tv
PROMPT 0

LABEL OpenElec.tv
       KERNEL openelec/KERNEL
       APPEND ip=dhcp boot=NFS=10.2.0.100:/mnt/cache/dnsmasq/openelec disk=NFS=10.2.0.100:/mnt/cache/dnsmasq/openelec/storage overlay quiet

 

FYI for anyone else reading this thread but this drove me nuts...

 

I could not use the MAC address as name of my boot file for specific systems.  They just wouldn't find it.  I had to use the identifier supplied by PXE...usually "C0A801xx".  Then I realized that PXE was putting a "01" in the beginning of the MAC.

 

So, rather than naming the file "uu-vv-ww-xx-yy-zz" I had to name it "01-uu-vv-ww-xx-yy-zz".  once I did this, PXE found the appropriate file and booted without issue.

 

John

Link to comment

So, rather than naming the file "uu-vv-ww-xx-yy-zz" I had to name it "01-uu-vv-ww-xx-yy-zz".

 

... as documented here.

 

:-[

 

What do you think about colaborating to put a plugin together Peter?  Should be easy enough to do and may save some others a little bit of grief.

 

John

Link to comment
What do you think about colaborating to put a plugin together Peter?  Should be easy enough to do and may save some others a little bit of grief.

 

I guess that we could do, if there is interest from others.  For me, the combination of OpenELEC and unRAID, set up like this, is strong competition for Plex Client/Media Server.

 

The starting point, for me, would be to convert dnsmasq to a plugin - I don't see the need to complicate matters by using a separate tftp server, as you have done.  We could pull in the pxelinux.0 file to save others from having to search for it, then add configuration guidance.  Just specify the MySQL plugin as a dependency.

 

Okay, I'll give it a bit more thought!

Link to comment

What do you think about colaborating to put a plugin together Peter?  Should be easy enough to do and may save some others a little bit of grief.

 

I don't see the need to complicate matters by using a separate tftp server, as you have done.

 

I think my fear was that it would interfere with my existing DHCP/DNS server.

 

FYI...SimpleFeatures has a DNS Server plugin that install dnsmasq 2.57 (the latest version).  I would definltely check with speeding_ant first but we could use his plugin as a starting point.  Of course, we would need to be mindful of people who are already running his plugin.

 

John

Link to comment

I really love the idea of doing this as I setup pxe at work so know how handy it can be. However I'm not sure I can tell the wife media center is down because I'm adding a drive/fixing/etc to unraid, at least if it has its own drive streaming media still works. Still tempted though :-) :-)

 

Sent from my GT-I9300 using Tapatalk 2

 

 

Link to comment

I really love the idea of doing this as I setup pxe at work so know how handy it can be. However I'm not sure I can tell the wife media center is down because I'm adding a drive/fixing/etc to unraid, at least if it has its own drive streaming media still works. Still tempted though :-) :-)

 

Sent from my GT-I9300 using Tapatalk 2

 

That's one of the reasons I never did this. (Not due to wife). If I were working on my unRAID Server, it meant I had no music!  So I installed it on an SSD.  However I'm still intrigued to do it this way. Perhaps have a dual boot environment with a fall back install on the local hard drive.

Link to comment

That's one of the reasons I never did this. (Not due to wife). If I were working on my unRAID Server, it meant I had no music!  So I installed it on an SSD.  However I'm still intrigued to do it this way. Perhaps have a dual boot environment with a fall back install on the local hard drive.

 

Ah... but usually if my unRAID server is down for the count due to upgrades/maintenance, all streaming stops anyway. I don't have anything stored locally for any client. It's the age-old issue with centralized vs distributed systems. In a truly centralized environment like mine, there is no benefit to having a client running if no content can be served. So I've been enjoying this thread and the direction it has taken. It even inspired me to blow away my XBMC + Windows HTPC experiment and use OpenElec off a thumbdrive. This weekend I will be using this thread as a guide to getting network boot running. Keep at it guys.

 

This year is going to be exciting for media streaming, because with Raspberry Pi the whole build-your-own-PC learning curve goes away, the price is MUCH lower, and the tools are more mature. One more iteration of a slightly more powerful Raspberry type device to handle 1080p smoothly over network with audio is all I'm waiting for.

Link to comment

When I said streaming I mean online steaming e.g. YouTube, bbc iplayer, icefilms, streaming radio etc not to mention live tv via dvb-t so I just don't know, my inner geek says do it :-)

 

I think it definitely would have to be a plugin to stop the issue where the array can't shut down due to open files/processes from tftp

 

Sent from my GT-I9300 using Tapatalk 2

 

Link to comment

When I said streaming I mean online steaming e.g. YouTube, bbc iplayer, icefilms, streaming radio etc not to mention live tv via dvb-t so I just don't know, my inner geek says do it :-)

 

That is a horse of a different color, true. If you're doing stuff from the interwebz, then adding the server as a requirement for the client to boot isn't so cool.

 

I think it definitely would have to be a plugin to stop the issue where the array can't shut down due to open files/processes from tftp

 

Clearly this will be a requirement for me long term. Hanging unRAID for reboot is painful.

Link to comment
if my unRAID server is down for the count due to upgrades/maintenance, all streaming stops anyway. I don't have anything stored locally for any client. It's the age-old issue with centralized vs distributed systems. In a truly centralized environment like mine, there is no benefit to having a client running if no content can be served.

 

 

In my case, I rsync one of the music drives to the local htpc. This way, I can always play music if I choose.  unRAID is redundant, , but it's not a real backup.  It affords me a second copy of the data should a disaster occur.  Speaking from experience. This saved much of my music collection.

Link to comment

In my case, I rsync one of the music drives to the local htpc. This way, I can always play music if I choose.  unRAID is redundant, , but it's not a real backup.  It affords me a second copy of the data should a disaster occur.  Speaking from experience. This saved much of my music collection.

 

This is why I like to have 2 servers. :)

Link to comment

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.