Change to gpxelinux.0



  • [SIZE=4]As a part of my studies in IT Technology, I have been working on how to get an FOG server on the cloud. One of many problems was if the client was behind a firewall and NAT, secondly, speed, as FOG server uses tftp, but I have figured out how to change to http for a big speed boost, this is tested on VM’s and even on VM’s on Microsoft Azure. [/SIZE]

    [SIZE=4]So here is my 2 cent on how to do it.[/SIZE]

    [COLOR=black][FONT=Arial][SIZE=4]On Ubuntu 12.04lts server with FOG 0.32[/SIZE][/FONT][/COLOR]

    [COLOR=black][FONT=Arial][SIZE=4]Start by chmod -R 777 /tftpboot/ (case sensetiv)[/SIZE][/FONT][/COLOR]
    [COLOR=black][FONT=Arial][SIZE=4]This will give RW access to the /tftpboot dir.[/SIZE][/FONT][/COLOR]
    [COLOR=black][FONT=Arial][SIZE=4](change to chmod -R 755 /tftpboot after guide)[/SIZE][/FONT][/COLOR]

    [COLOR=black][FONT=Arial][SIZE=4]1 -6 can be done in FileZilla or directly on server[/SIZE][/FONT][/COLOR]

    [LIST=1]
    [][COLOR=black][SIZE=4]Download and extract syslinux - [url]https://www.kernel.org/pub/linux/utils/boot/syslinux/[/url][/SIZE][/COLOR]
    [
    ][COLOR=black][SIZE=4]Copy /gpxe/gpxelinux.0 to /tftpboot[/SIZE][/COLOR]
    [][COLOR=black][SIZE=4]Rename /tftpboot/vesamenu.c32 to /tftpboot/vesamenu.c32.ol[/SIZE] [/COLOR]
    [
    ][COLOR=black][SIZE=4]Copy /com32/menu/vesamenu.c32 to /tftpboot [/SIZE][/COLOR]
    [][COLOR=black][SIZE=4]Copy /memdisk/memdisk and replace /tftpboot/fog/images/memdisk and to /tftpboot[/SIZE][/COLOR]
    [
    ][COLOR=black][SIZE=4]Create a new folder named backup and move pxelinux.0 and vesamenu.c32.old to this folder[/SIZE][/COLOR]
    [][COLOR=black][SIZE=4]Edit /etc/dhcp/dhcpd.conf, replacing pxelinux.0 with gpxelinux.0 [COLOR=#e84c22][I][B](IF FOG server is DHCP server)[/B][/I][/COLOR][/SIZE][/COLOR]
    [
    ][COLOR=black][SIZE=4][FONT=Arial]Go to cd /var/www/ and type[/FONT][/SIZE][/COLOR]
    [/LIST]
    [COLOR=black][FONT=Arial][SIZE=4]ln -s /tftpboot/fog fogboot [/SIZE][/FONT][/COLOR]

    [COLOR=black][FONT=Arial][SIZE=4]ln –s /tftpboot pxe[/SIZE][/FONT][/COLOR]
    [COLOR=black][FONT=Arial][SIZE=4] ln[/SIZE][/FONT][/COLOR]

    [COLOR=black][FONT=Arial][SIZE=4]ls -l should now show[/SIZE][/FONT][/COLOR]

    [COLOR=black][FONT=Arial][SIZE=4]drwxr-xr-x. 12 apache apache 4096 Dec 31 18:27 fog[/SIZE][/FONT][/COLOR]
    [COLOR=black][FONT=Arial][SIZE=4]lrwxrwxrwx. 1 root root 13 Jan 28 18:31 fogboot -> /tftpboot/fog[/SIZE][/FONT][/COLOR]
    [COLOR=black][FONT=Arial][SIZE=4]-rw-r–r--. 1 root root 45 Dec 31 18:27 index.php[/SIZE][/FONT][/COLOR]
    [COLOR=black][FONT=Arial][SIZE=4]Lrwxrwxrwx. 1root root 9 jan 28 15:57 pxe -> /tftpboot[/SIZE][/FONT][/COLOR]

    [LIST]
    [][COLOR=black]SIZE=4pxelinux.0 seems to be strict on the configuration file, and complains about the newline characters in the config file so edit /tftpboot/pxelinux.cfg/default to remove any newlines[I][B] (\n)[/B][/I][/SIZE][/COLOR]
    [
    ][SIZE=4]Change the IP’s to http in /tftpboot/pxelinux.cfg/default[/SIZE]
    [/LIST]
    [FONT=Arial][SIZE=4] LABEL fog.reg[/SIZE][/FONT]
    [FONT=Arial][SIZE=4] kernel fog/kernel/bzImage[/SIZE][/FONT]
    [FONT=Arial][SIZE=4] append initrd=[url]http://Myfogserver.com/fogboot/images/init.gz[/url] root=/dev/ram0 rw ramdisk_size=127000 ip=dhcp dns=8.8.8.8 mode=autoreg web=137.135.203.249/fog/ loglevel=4[/SIZE][/FONT]
    [FONT=Arial][SIZE=4] MENU LABEL Quick Host Registration and Inventory[/SIZE][/FONT]
    [FONT=Arial][SIZE=4] TEXT HELP[/SIZE][/FONT]
    [FONT=Arial][SIZE=4] Automatically register the client computer,[/SIZE][/FONT]
    [FONT=Arial][SIZE=4] and perform a hardware inventory.[/SIZE][/FONT]
    [FONT=Arial][SIZE=4] ENDTEXT[/SIZE][/FONT]

    [FONT=Arial][SIZE=4](example, after append initrd you can use URL or ip to your server)[/SIZE][/FONT]

    [COLOR=black][FONT=Arial][SIZE=4][I][B]Reboot[/B][/I], to restart services. [/SIZE][/FONT][/COLOR]

    [COLOR=black][FONT=Arial][SIZE=4]Check by typing :[URL=‘http://%22Your_fog-server%22.com/fogboot/kernel/bzimage’][B]http://[/B][I][B]“Your_fog-server”.com/fogboot/kernel/bzimage[/B][/I][/URL][I][B] (handle can be swapped with IP)[/B][/I][/SIZE][/FONT][/COLOR]
    [COLOR=black][FONT=Arial][SIZE=4]And make sure it can download the bzimage [I][B](No need to download it)[/B][/I][/SIZE][/FONT][/COLOR]

    [COLOR=black][FONT=Arial][SIZE=4][URL=‘http://%22your_fog-server%22.com/pxe/gpxelinux.0’][I][B]http://“your_fog-server”.com/pxe/gpxelinux.0[/B][/I][/URL] [I][B](handle can be swapped with IP)[/B][/I][/SIZE][/FONT][/COLOR]
    [COLOR=black][FONT=Arial][SIZE=4]And make sure it can download the gpxelinux.0 [I][B](no need to download it)[/B][/I][/SIZE][/FONT][/COLOR]

    [FONT=Arial][SIZE=4]In the web interface you will also need to change to[/SIZE][/FONT]
    [FONT=Arial][SIZE=4] Http[/SIZE][/FONT]

    [FONT=Arial][SIZE=4][B]Tftp server[/B][/SIZE][/FONT]

    [FONT=Arial][SIZE=4]Fog_tftp_pxe_kernel to [url]http://myfogserver.com/fogboot/kernel/bzImage[/url] (change URL to match, or use IP)[/SIZE][/FONT]

    [FONT=Arial][SIZE=4]Fog_pxe_boot_image to [url]http://myfogserver.com/fogboot/images/init.gz[/url] (change URL to match, or use IP) [/SIZE][/FONT]

    [COLOR=black][FONT=Arial][SIZE=4]chmod -R 755 /tftpboot/ (case sensetiv)[/SIZE][/FONT][/COLOR]
    [COLOR=black][FONT=Arial][SIZE=4]To change rights again[/SIZE][/FONT][/COLOR]

    [COLOR=black][FONT=Arial][SIZE=4]I hope this was usefull to someone, and if you have questions I will do my best to answer them.[/SIZE][/FONT][/COLOR]

    [COLOR=black][FONT=Arial][SIZE=4]/Jimmy S. Hansen[/SIZE][/FONT][/COLOR]


  • Developer

    if you are interested in this stuff, you really need to look at the development going on in fog 0.33b.



  • I did not look that way no. But as far as i understand, you actually don’t need to use gpxe since the latest version of pxe already supports http transfer, so it could look like step 1-6 of my guide is not a must.
    If i have a spare moment I will look further into IPXE vs PXE vs GPXE


  • Senior Developer

    Jimmy Hansen,

    Have you, by chance, looked into using iPXE for these same actions?

    I make this suggestion as gpxe is no longer actively maintained. iPXE is the spawn after gpxe. It uses many of the same protocols and scripts, only replaced #!gpxe with #!ipxe and is actively maintained.



  • Hope you will have luck with it.



  • Going to give this a Try, thanks for posting.


 

330
Online

41.5k
Users

11.9k
Topics

113.2k
Posts