Help with ERPXE install on Raspberry Pi

burton666
Posts: 5
Joined: 01 Nov 2013, 12:52

Help with ERPXE install on Raspberry Pi

Postby burton666 » 01 Nov 2013, 13:03

Hi I have tried several different tutorials but never got any of them to work.
Is there any tutorials of how to use rasbian + erpxe (or similar ) to set up a PXE server which can boot Windows 7 installer, Debian, Hiren's etc.

I tried a program called Serva on my windows machine and it worked perfectly and it used my router as DHCP server. But I want to use the Pi for this instead so that I can take it with me if I am fixing a computer away from home. So that I just could plug in the pi to any router and then pxe boot any computers in that network.

I have tried following the tutorial for ERPXE (http://erpxe.org/Debian_installation_instructions)
But I start getting errors directly.

I downloaded the erpxe.tar.gz and unpacked it to the root as described in the tutorial.
Next step says: run "apt-get install tftpd-hpa" which give me this:

[....] Starting HPA's tftpd: in.tftpdinvoke-rc.d: initscript tftpd-hpa, action "start" failed.
dpkg: error processing tftpd-hpa (--configure):
subprocess installed post-installation script returned error exit status 71
Errors were encountered while processing:
tftpd-hpa
E: Sub-process /usr/bin/dpkg returned an error code (1)

I think I found a solution for the first error.

edit /etc/default/tftpd-hpa

and add --ipv4 to the last line so it looks like this:

TFTP_OPTIONS="-m /tftpboot/erpxe.remap -vvvvv -s --ipv4"
then run "sudo apt-get install -f"

then tftboot seems to start.

Ok, so next error I get is from: this command "update-rc.d tftpd-hpa defaults"
which gives me this:

update-rc.d: using dependency based boot sequencing
update-rc.d: warning: default stop runlevel arguments (0 1 6) do not match tftpd-hpa Default-Stop values (1)

"apt-get install apache2" OK
"update-rc.d apache2 defaults" OK (I think)
"cp /tftpboot/doc/setup/erpxe-httpd.conf /etc/apache2/conf.d/" ERROR

cp: cannot stat `/tftpboot/doc/setup/erpxe-httpd.conf': No such file or directory
commguy
Posts: 57
Joined: 20 Aug 2013, 06:38
Contact:

Re: Help with ERPXE install on Raspberry Pi

Postby commguy » 01 Nov 2013, 18:55

erpxe-httpd.conf is missing, you can manually add the file and place the following code in it.

Code: Select all

# place this file under "/etc/httpd/conf.d/"

<Directory "/tftpboot/er/shares/">
Options Indexes FollowSymLinks
</Directory>

AliasMatch (?i)^/er(.*) /tftpboot/er/shares$1


or you can

Code: Select all

ln -s /tftpboot/er/shares /var/www/er


which makes the file unnessessary

Good luck with your Pi. Mine has been fantastic.
commguy
Posts: 57
Joined: 20 Aug 2013, 06:38
Contact:

Re: Help with ERPXE install on Raspberry Pi

Postby commguy » 01 Nov 2013, 19:00

By the way, if you check out

http://erpxe.net/viewtopic.php?f=8&t=126

You can see what I did to get mine going. I tried to be as detailed as possible. Maybe that will help you.

EDIT: I take it back, I can't find my writeup now. I guess I posted it somewhere else. If I find it I'll post it.
burton666
Posts: 5
Joined: 01 Nov 2013, 12:52

Re: Help with ERPXE install on Raspberry Pi

Postby burton666 » 03 Nov 2013, 10:54

If you have the time in the future to (re-) install erpxe on a raspberry pi and could record all the steps I would be very grateful.
commguy
Posts: 57
Joined: 20 Aug 2013, 06:38
Contact:

Re: Help with ERPXE install on Raspberry Pi

Postby commguy » 13 Nov 2013, 03:00

Sorry for the late reply, Been out of the office for the last week. I'll try to run thru the install this weekend and post a walkthru. Maybe after the admins have a chance to clean it up it'll end up on the instructions page.
burton666
Posts: 5
Joined: 01 Nov 2013, 12:52

Re: Help with ERPXE install on Raspberry Pi

Postby burton666 » 17 Nov 2013, 19:58

Ok, Thanks I will be checking out this thread every day until the tutorial arrives :)
commguy
Posts: 57
Joined: 20 Aug 2013, 06:38
Contact:

Re: Help with ERPXE install on Raspberry Pi

Postby commguy » 18 Nov 2013, 19:41

Still working on it. I'll also include a couple of files I modified to make the dhcp server work and dig up my start up scripts for sound if you are going headless. Should be done in a couple of days.
commguy
Posts: 57
Joined: 20 Aug 2013, 06:38
Contact:

Re: Help with ERPXE install on Raspberry Pi

Postby commguy » 21 Nov 2013, 02:53

Didn't want to leave anyone hanging. Had a little setback with some hardware issues, got it worked out and I'm a little over half way thru the guide. Should have it done tonight.
commguy
Posts: 57
Joined: 20 Aug 2013, 06:38
Contact:

Re: Help with ERPXE install on Raspberry Pi

Postby commguy » 21 Nov 2013, 05:51

As Promised, Hope this helps.

Raspbian ERPXE Server

For the most part we will be following the standard install instructions for Raspbian and the Debian instructions for ERPXE. There will be some variations to the software that I will point out that will get your PXEPI server up and running.

Note: not all SDCards are made equal. Check yours against the list here http://elinux.org/RPi_SD_cards#Performance

to be sure yours will work with your Rpi.

I used a Sandisk 8GB class 2 because it was cheap, it works great but doesn't have the greatest read speed. Since I wanted to keep my tftpboot folder separate in the event my SDCard failed I could rebuild my PXE install quickly without losing all of the work I did getting my ERPXE software the way I wanted it, I found a sandisk cruizer fit 32GB for under $20 on Amazon and mounted it as the tftpboot folder on my Pi. The transfer speed seems to average around 20MB/s read and 5MB/s write according to the data on this site http://usbspeed.nirsoft.net/?g=32gb and the total bus speed on the RPi is around 30MB/s.

Raspbian Install

By far the most time consuming part of this how to. This may take 1-4 hours to complete depending on speed of your SDcard and internet connection.

The easiest way to install Raspbian is with the rpi installer. Download a copy from http://www.raspbian.org/RaspbianInstaller. And follow the install guide. Fairly straightforward and not much guesswork as they've done a pretty good job of including all the options commonly used. For the sake of being thorough I will list the steps and options I chose to make this system work.

Step 1: Format SD Card.
You will want an SD card with at least 4gb of free space. I recommend 8 as a safe minimum due to the size of some of the tools you may wish to install on your Pi.

Using your favorite software distibution's formatting tool. Format you SD card with a single FAT32 (MSDOS) partion

Step 2: Installer
Now you want to unzip the installer you downloaded earlier to the newly formatted SD card and unmount the card once the files are transferred.

Step 3: Raspbian Setup
Plug your SD Card into your Raspberry Pi along with a network cable, video and keyboard. Apply power and wait for the first screen to appear. Follow the instructions that appear to set up your system. Remember to manually type in mirrordirector.raspbian.org and /raspbian/ on their respecting screens as you will get errors with the defaults.

Also keep in mind that you will see an error that states no kernel modules found and are not necessary for install on this type of system so you can continue without it. For more info see the respective section on the raspbian.org website.

After you set up the root and user passwords and finish partitioning, the installer will automatically install the base system. Once finished it will be time to select packages for install.

At this point the only packages you will want to install are SSH Server and Standard system utilities DO NOT INSTALL ANY OTHER PACKAGES. All necessary packages will be installed in the ERPXE installation section of this guide.

ERPXE

If you are using a usb drive as your /tftpboot/ folder, be sure to mount it as /tftpboot/ and set to automatically mount at boot before continuing.

The following are modified instructions from the Debian install on the ERPXE wiki which should work with all current Raspbian and Debian builds

Log in as root or after login sudo bash

Download erpxe.current.tar.gz at http://www.erpxe.com/download/.
At the time of writing the latest version is 1.2, the easiest way to get it is with wget. From the command line issue the following
cd /
wget http://sourceforge.net/projects/erpxe/f ... 1.2.tar.gz
Extract ERPXE to root "/" directory
tar -xvzf erpxe.current.tar.gz
Install a TFTP Service

Raspberry Pi uses a custom kernel. this package doesn't like this for some reason and it causes issues. After looking over the bug report on debian and the work around you found I found that this works
first set up the tftpd-hpa file

This step is very IMPORTANT! if the erpxe.remap configuration is missing most plugins will not work.
Edit "/etc/default/tftpd-hpa"
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot/"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="-m /tftpboot/erpxe.remap -vvvvv -s --ipv4"
service tftpd-hpa restart

This will make sure the package installs properly (I still get invalid option -- 'i' for some reason but it seems to work fine.)

apt-get update (you should only need to issue this command once during this install)
apt-get install tftpd-hpa
there are two packages tftp-hpa and tftpd-hpa make sure you install the correct one or the next command WILL fail.

Set tftpd-hpa directory to /tftpboot/ if prompted
update-rc.d tftpd-hpa defaults
Config TFTP service

Add HTTP support
apt-get install apache2
update-rc.d apache2 defaults
cp /tftpboot/bin/setup/erpxe-httpd.conf /etc/apache2/conf.d/
Add NFS support
apt-get install nfs-kernel-server rpcbind
-update-rc.d nfs-kernel-server defaults
The next step will overwrite your original /etc/exports !!!
cat /tftpboot/bin/setup/erpxe-exports > /etc/exports
Add SAMBA support
apt-get install samba samba-common-bin
update-rc.d samba defaults

since samba requires a unix user to create a samba users lets create a user with no shell and no home directory. (if you know a better way to do this feel free to let me know)

useradd --no-create-home -s /dev/null erpxe

(smbadduser erpxe) – this command apparently no longer works
The next step will overwrite your original /etc/samba/smb.conf !!!
cat /tftpboot/bin/setup/erpxe-smb.conf > /etc/samba/smb.conf
Set password for user erpxe to "erpxe":
smbpasswd -a erpxe
Set password for user "root" to your password:
smbpasswd -a root


Now your PXEPi server is set up. However, if you are planning to use it as a dhcp server as well you will need to set up an additional package.

Set interfaces for static IP

edit “/etc/network/interfaces”

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo eth0
iface lo inet loopback
allow-hotplug eth0
# The primary network interface

iface eth0 inet static
address 10.0.0.1
netmask 255.255.255.0
broadcast 10.0.0.255
network 10.0.0.0




Install DHCP

apt-get install isc-dhcp-server

if you get errors just ignore them for now

edit “/etc/default/isc-dhcp-server”

find “INTERFACES=” and make sure it says: INTERFACES="eth0”

0set up dhcpd.conf

cat /tftpboot/bin/setup/erpxe-dhcpd.conf > /etc/dhcp/dhcpd.conf

reboot and enjoy
Last edited by commguy on 11 Dec 2013, 18:15, edited 5 times in total.
commguy
Posts: 57
Joined: 20 Aug 2013, 06:38
Contact:

Re: Help with ERPXE install on Raspberry Pi

Postby commguy » 22 Nov 2013, 02:41

You know I was just thinking and I bet your problem was (at least initially) inadvertently installing tftp-hpa instead of tftpd-hpa. I did that at one point and spent almost 2 days trying to figure it out before I realized it.

Return to “Troubleshooting and Problems”

Who is online

Users browsing this forum: No registered users and 5 guests

cron