Raspbian ERPXE Server by CommGuy

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"

restart the tftpd-hpa service:

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

and restart service:

update-rc.d rpcbind enable


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

dhcpd.conf needs to be modified to reflect the network setup used or some services will not work.


reboot and enjoy