3

How to do the multiple OS in a single Pxeboot server.

I want to boot different OS like Fedora, CentOS, RHEL in the client

2

I thought it is good to mention the whole setup I have which may contain interesting tricks.

  • It is possible to make separate directories within tftp root folder:

    $ tree -L 2
    .
    ├── anax_bios_flash.img
    ├── clonezilla_20100623
    │   ├── filesystem.squashfs
    │   ├── initrd.img
    │   ├── parameters.txt
    │   └── vmlinuz
    ├── display_ubuntu
    │   ├── adtext.cfg
    │   ├── f10.txt
    │   ├── f1.txt
    │   ├── f2.txt
    │   ├── f3.txt
    │   ├── f4.txt
    │   ├── f5.txt
    │   ├── f6.txt
    │   ├── f7.txt
    │   ├── f8.txt
    │   ├── f9.txt
    │   ├── menu.cfg
    │   ├── po4a.cfg
    │   ├── prompt.cfg
    │   ├── splash0.png
    │   ├── splash1.png
    │   ├── splash.png
    │   ├── splash.xcf
    │   ├── stdmenu.cfg
    │   ├── text.cfg
    │   └── vesamenu.c32
    ├── etc
    │   └── boot.conf
    ├── FDSTD.144
    ├── hello.boot
    ├── memdisk
    ├── Notes.txt
    ├── openbsd_3.9
    │   ├── bsd
    │   ├── bsd.mp
    │   ├── bsd.rd
    │   └── pxeboot.0
    ├── ploplinux_4.0.0
    │   ├── boot.msg
    │   ├── bzimage
    │   ├── initrfs.gz
    │   ├── memtest
    │   ├── ploplinux
    │   ├── plpbt.bin
    │   ├── plpinstc.com
    │   ├── pluspacks
    │   ├── pxelinux.0
    │   ├── pxelinux.cfg
    │   └── readme.txt
    ├── pmagic_5.5
    │   ├── boot
    │   ├── bzImage
    │   ├── initramfs
    │   └── sample_pxelinux.cfg
    ├── pmagic_6.7
    │   ├── boot
    │   ├── bzImage
    │   └── initramfs
    ├── pxechain.com
    ├── pxelinux.0
    ├── pxelinux.cfg
    │   ├── default
    │   └── default.backup
    ├── slitaz-cooking.iso
    ├── ubuntu_10.04
    │   ├── initrd.gz
    │   └── vmlinuz
    ├── ubuntu_mini.iso
    └── unattended_4.9
        ├── bzImage
        ├── default
        ├── initrd
        ├── menu.c32
        └── pxelinux.0
    
  • Then change pxelinux.cfg/default, pxelinux.cfg/CLIENT_MAC or pxelinux.cfg/PORTION_OF_CLIENT_IP

    For me, I used Ubuntu Netboot as template, So as you can see pxelinux.cfg/default includes display_ubuntu/menu.cfg which by itself includes display_ubuntu/text.cfg which contains the main menu of Ubuntu boot:

    Contents of pxelinux.cfg/default

    include display_ubuntu/menu.cfg
    default display_ubuntu/vesamenu.c32
    prompt 0
    timeout 0
    

    Contents of display_ubuntu/menu.cfg

    menu hshift 7
    menu width 65
    menu margin 5
    
    menu title GNU/Linux Rescue Collection
    
    include display_ubuntu/stdmenu.cfg
    include display_ubuntu/text.cfg
    
    menu begin advanced
        menu title Advanced options
        label mainmenu
            menu label ^Back..
            menu exit
        include display_ubuntu/stdmenu.cfg
        include display_ubuntu/adtext.cfg
    menu end
    
    label help
        menu label ^Help
        config display_ubuntu/prompt.cfg
    

    Contents of display_ubuntu/text.cfg

    DEFAULT partedmagic_6.7
    
    LABEL test_kernel
        MENU LABEL ^Test Kernel
        KERNEL hello.boot
    
    LABEL partedmagic_6.7
        LINUX pmagic_6.7/bzImage
        INITRD pmagic_6.7/initramfs
        APPEND edd=off load_ramdisk=1 prompt_ramdisk=0 rw vga=normal loglevel=9 max_loop=256
    
    LABEL partedmagic_5.5
        MENU LABEL PartedMagic 5.5
        LINUX pmagic_5.5/bzImage
        APPEND initrd=pmagic_5.5/initramfs edd=off noapic load_ramdisk=1 prompt_ramdisk=0 rw vga=791 loglevel=0 max_loop=256
    
    menu begin pmagic_advanced
            menu title PartedMagic 5.5 Advanced
            label mainmenu
                    menu label ^Back..
                    menu exit
            include /pmagic_5.5/boot/syslinux.cfg
    menu end
    
    LABEL clonezilla_20100623
        MENU LABEL ^CloneZilla 2010.06.23
        KERNEL clonezilla_20100623/vmlinuz
        APPEND initrd=clonezilla_20100623/initrd.img boot=live union=aufs noswap noprompt vga=788 ocs_live_keymap=NONE ocs_lang=en_US.UTF-8 fetch=tftp://192.168.10.123/clonezilla_20100623/filesystem.squashfs
    
    LABEL unattended_4.9
        MENU LABEL Unattended 4.9 for ^XP
        KERNEL unattended_4.9/bzImage
        APPEND initrd=unattended_4.9/initrd z_path=\\192.168.10.123\install_4.9
    
    LABEL slitaz
        MENU LABEL ^Slitaz.iso
        TEXT HELP
    Testing boot from iso.
        ENDTEXT 
        KERNEL memdisk
        APPEND initrd=slitaz-cooking.iso
    
    LABEL mini_ubutnu
        MENU LABEL Mini-Ubuntu
        KERNEL memdisk
        APPEND initrd=ubuntu_mini.iso
    
    LABEL freedos_std
        MENU LABEL ^FreeDOS STD
        TEXT HELP
    Testing boot from Floppy IMG.
        ENDTEXT 
        KERNEL memdisk
        APPEND initrd=FDSTD.144
    
    LABEL anax_bios_flash
        MENU LABEL Anax Bios Flash
        KERNEL memdisk
        APPEND initrd=anax_bios_flash.img
    
    LABEL openbsd
        MENU LABEL ^OpenBSD 3.9
        KERNEL openbsd_3.9/pxeboot.0
    
    LABEL plop_4.0.0
        MENU LABEL PlopLinux 4.0.0
        KERNEL ploplinux_4.0.0/bzimage
        APPEND initrd=ploplinux_4.0.0/initrfs.gz vga=1 nfsmount=192.168.10.123:/media/gnu_files/_servers/tftp/ploplinux_4.0.0/ploplinux
    
    LABEL ubuntu_10.04_install
            menu label ^Ubuntu 10.04 net install
            kernel ubuntu_10.04/vmlinuz
            append vga=normal initrd=ubuntu_10.04/initrd.gz -- quiet
    
    LABEL ubuntu_10.04_cli
            menu label Ubuntu 10.04 ^command-line net install
            kernel ubuntu_10.04/vmlinuz
            append tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false vga=normal initrd=ubuntu_10.04/initrd.gz -- quiet
    
    LABEL pxeserver2
            menu label Switch to 2nd PXE server...
            kernel pxechain.com
            append 192.168.10.254::pxelinux.0
    

Notes:

  • hello.boot is a just tiny kernel, I used it for initial PXE tests.
  • memdisk is used as kernel to load (over PXE):

    Raw floppy images: anax_bios_flash.img and FDSTD.144

    CD ISO images: slitaz-cooking.iso and ubuntu_mini.iso

  • pxechain.com used to chain load other PXE server.

    pxechain.com is available within syslinux-common package starting from trusty (Thanks to @muru) or syslinux project archive under different filename pxechn.c32.

  • All listed Linux distributions are loaded by same pxelinux.0 located on tftp root folder. The exception is with OpenBSD (which has BSD kernel), pxelinux.0 loads openbsd_3.9/pxeboot.0, the PXE bootstrap coming with OpenBSD. It has its own configuration at etc/boot.conf. (This method is called chain loading)

    Contents of etc/boot.conf

    set image openbsd_3.9/bsd
    
  • You can use include instead of listing the whole menu in a single file, or may be chain menus to to keep the original advanced menus/options of each distribution.

| improve this answer | |
  • Can we have a menu entry redirect to another server? I have only seen local images listed so far. – muru Jul 7 '14 at 16:53
  • @muru, yes, I didn't look for such thing before. I've update the answer. (Server chaining using pxechain.com). Thank you I learned new thing from you. – user.dz Jul 7 '14 at 18:16
  • Can't say you learned anything from. I just thought to mention it because pxechain.com, while available in the syslinux-common package of wheezy and trusty, is not available in that package for precise. I hoped you might know of an alternative. Guess I'll upgrade to trusty. – muru Jul 7 '14 at 18:25
  • 1
    @muru, No you don't have to upgrade. syslinux is independent project. You can just download trusty package or upstream package from syslinux project site, Extract it and copy needed files. – user.dz Jul 7 '14 at 18:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.