Install distro via PXE?

I’m lost on what to do/try next and hope someone can tell me how to do this correctly.
I’m guessing that something is happening after the install completes when using the DVD method that isn’t happening using PXE.

I am trying to get FreePBX 13 distro to install over PXE and testing with VMWare Workstation 12.
I installed the distro on a VM using the standard method using the ISO and it is working great and is my control VM.
Next, I setup a new Centos7 VM to be a PXE server and I can successfully install FreePBX on a new VM.

My first attempt didn’t have menu support that the traditional install had but I was able to copy the isolinux.cfg from the ISO and paste it into the pxelinux.cfg/default file, make the modifications to use ftp and now I get the menu options and FreePBX appears to install correctly compared to control VM.

I login to Web UI, create new account and the apply config is shown and upon clicking it I get error below.

exit: 1
Whoops\Exception\ErrorException: fileowner(): stat failed for /etc/dahdi/system.conf in file /var/www/html/admin/modules/dahdiconfig/includes/dahdi_cards.class.php on line 126
Stack trace:

  1. Whoops\Exception\ErrorException->() /var/www/html/admin/modules/dahdiconfig/includes/dahdi_cards.class.php:126
  2. Whoops\Run->handleError() :0
  3. fileowner() /var/www/html/admin/modules/dahdiconfig/includes/dahdi_cards.class.php:126
  4. dahdi_cards->__construct() /var/www/html/admin/modules/dahdiconfig/functions.inc.php:21
  5. dahdiconfig_conf->dahdiconfig_conf() /var/lib/asterisk/bin/retrieve_conf:516

I have narrowed this down to a problem with kickstart-sourcefiles not being copied during VM install. It appears KS is trying to mount the CDROM to move the files and I am not sure how to change this.

I was searching for this all over the net without any clear information.

So I decide to describe here how I was able to do it.
First, you will need a functional PXE server. (I will not cover how to do this here, cause there is plenty of other source where you can find how to setup a PXE server.

This method works for me, it is with the ISO download version 10.13.66-64bit.
I used a net install with HTTP.

1 - Download the ISO from the freepbx website
2 - Mount the ISO on your PXE server where your web server can access to it. Ex : mount -o loop FreePBX-64bit-10.13.66.iso /var/www/html/freepbx
3 - Copy files need for your PXE boot:
– cp -a /var/www/html/freepbx/images /tftpboot/freepbx
– cp -a /var/www/html/freepbx/isolinux/* /tftpboot/freepbx
4 - Copy the kickstart files somewhere else accessible by your web server
– cp -a /var/www/html/freepbx/kickstart* /var/www/html/kickstart
5 - Create an edit boot file into : nano /tftpboot/freepbx/pxelinux.cfg/default
– The content should looks like :

default vesamenu.c32
#prompt 1
timeout 600

menu background splash.jpg
menu title Welcome to FreePBX 10.13.66
menu color border 0 #ff000000 #00000000
menu color disabled 1 #ff000000 #ffcddca5 none
menu color sel 7 #ff444444 #ffffffff
menu color title 0 #ff000000 #00000000 none
menu color tabmsg 0 #ff000000 #00000000 none
menu color unsel 0 #ff000000 #00000000 none
menu color hotsel 0 #ff000000 #00000000 none
menu color hotkey 7 #ffffffff #00000000 none
menu color scrollbar 0 #ffffffff #00000000 none
menu color cmdline 0 #ff000000 #00000000 none
menu color cmdmark 0 #ff000000 #00000000 none

label -
menu label FreePBX 10.13.66 with Asterisk 13
menu disable

label freepbx-asterisk13
menu label Full Install
menu indent 4
kernel /images/pxeboot/vmlinuz
append initrd=/images/pxeboot/initrd.img textvga=normal ramdisk_size=32768 ks=http://10.12.0.82/kickstart/kickstart-raid-asterisk13.cfg ksdevice=link

Notice that I only used the first menu with the full install, you can also adjust the other menu if you needed.

6 - Modified the kickstart file so it will works correctly after booting
– nano /var/www/html/kickstart/kickstart-raid-asterisk13.cfg

Change the block :

use the CDROM

cdrom

For :

url --url=“http:///freepbx/”

Notice that if you want to use other setup, fix the right kickstart file accordingly

And voilà ! Enjoy FreePBX pxe install distro !

The proper way to do Linux PBX is using a tool like Cobbler which imports the ISO and does everything for you. It’s what we use to factory install everything and allows it all to be 100℅ headless.

1 Like

Hi Tony,

I tried to import into cobbler and got the following error:

cobbler import --path=/var/distro-trees/AsteriskNOW-1013-current-32 --name=AsteriskNOW-1013-current-32 --arch=i386 --breed=redhat --os-version=rhel6
task started: 2018-01-11_175027_import
task started (id=Media import, time=Thu Jan 11 17:50:27 2018)
Found a candidate signature: breed=redhat, version=rhel6
No signature matched in /var/www/cobbler/ks_mirror/AsteriskNOW-1013-current-32-i386
!!! TASK FAILED !!!

Please can you share what you added to /var/lib/cobbler/distro_signatures.json or how you put FreePBX into Cobbler? Thanks!