Boot from Ubuntu 16.04 live iso failed

  • Server
    • FOG Version: 1.4.4
    • OS: Ubuntu 16.04.2 X64
    • Service Version: not relevent
    • OS: not relevent

    I want to boot from a Ubuntu 16.04 live iso but I have failed so far.
    I have followed the instructions here: link text and here : link text but still I can not get Ubuntu to boot.

    When I choose Ubuntu in the advanced menu: I get ok for loading “vmlinuz” and “initrd” then I get a blank screen with cursor blinking and nothing happens afterwards.

    Here is the content of my advanced menu:

    item --gap -- ---------------- iPXE boot menu ----------------
    item ubuntu Ubuntu 16.04 x64
    item hiren Hiren Boot CD
    item shell ipxe shell
    item return return to previous menu
    choose --default return --timeout 5000 target && goto ${target}
    kernel http://${fog-ip}/tftpboot/ubuntu16/vmlinuz.efi
    initrd http://${fog-ip}/tftpboot/ubuntu16/initrd.lz
    imgargs root=/dev/nfs boot=casper netboot=nfs nfsroot=${fog-ip}:${fog-ip}:/images/mounts/ubuntu16 locale=en_US.UTF-8 keyboard-configuration/layoutcode=us mirror/country=USip}:/images/mounts/ubuntu16
    boot || goto failed
    goto start
    initrd http://${fog-ip}/fog/service/ipxe/hiren/hir.iso
    chain memdisk iso raw ||
    goto MENU
    initrd http://${fog-ip}/${fog-webroot}/iso/ubnt.iso
    chain memdisk iso ||
    goto MENU
    chain http://${fog-ip}/${fog-webroot}/service/ipxe/boot.php?mac=${net0/mac} ||
    goto MENU

    The menu item that I’m working on is “ubuntu” I have been trying other methods at the same time so there are other menu items as well.
    In the ubuntu Menu item I tried the instructions from Fitzzz (Booting Ubuntu 16.04 ISO from FOG) but as APPEND command was not recognized I had to do changes in commands a bit.

    So far I have only managed to boot Hiren and only in mini windows mode. the linux environment does not boot in Hiren.
    I’m new to this and most probably naive but I assume it should not be super hard to have couple of live images ready to boot from FOG using PXE.
    I have read the wiki and many posts in 24 hours but seems to be nothing is organized and different instructions say different things.
    Thanks for your input in advance 🙂

  • Senior Developer

    @amir3161 Are you still interested in this? I’ve lost track of this issue. Or maybe you figured it out yourself?

  • Senior Developer

    @amir3161 Unfortunately it’s not possible to provide a general tutorial on how to include boot ISOs as every ISO is a bit different. Some may boot as ISO using the memdisk helper and others need to be extracted and need fiddling with the parameter till it works. When you extract the Hirens ISO check out the file HBCD/menu-custom.lst. It’s a huge list of how different systems can be booted (using GRUB instead of iPXE though). See, they are all different.

    I can confirm the error you posted as picture and I partly figured out what’s going wrong. But I don’t know how to fix it yet. I am sure we’ll figure it out at some point but I need to do other things now so I just report my findings so far. The picture below explains pretty much everything:
    After some fiddling with this I thought I might just compare the md5 hashes of the squashfs images (one within the booted ISO and the other one I extracted from the ISO on my host system). They should match as they are the same files. Turns out md5sum can’t even read to the end of the file and fails in the booted live system. dmesg reveals that the memdisk/mtdblock device (ISO in RAM) seems to be too small.

    Note to myself: Try PXE booting with pxelinux or grub to see if those show the same issue…

  • @Wayne-Workman I have checked the md5 checksum of the iso file and it matches the one on the website. Do you still think I need to re download?

  • @amir3161 I’m going to say re-download the ISO and do the checksum afterwards too. “Can’t read superblock” is a typical message from mounting a corrupt file system.

  • @Sebastian-Roth One again spot on Sebastian 🙂
    I can now boot from the iso but this is not the end of it yet! When it goes through the boot process I get this error :

    0_1500816145758_Screen Shot 2017-07-23 at 15.19.10.jpg
    This happens if I choose the Linux rescue environment . If I choose mini windows xp, everything works fine!
    Any suggestion for this one ?
    I also have a general question: How do I know how to treat a iso file to be able to boot from it on FOG? There is a wiki page for some (which I think is not updated in a while).
    Is there any instructions to follow or it changes every now and then?

  • Senior Developer

    @amir3161 Yeah this is a bit tricky. Newer FOG versions are pretty much taking over apache as it does rewrite/forward requests to make the FOG API work.

    That said there is still room for what you want to do if you put your files straight into /var/www subdirectories (but not /var/www/html sub dirs!). For example you can have /var/www/isos/hirens.iso and should be able to download via http://${fog-ip}/isos/hirens.iso from a remote PC.

    Be aware that getting a directory listing (URL http://${fog-ip}/isos/) won’t work as the rewrite engine is kicking in again. This is because DirectoryIndex is set and apache forwards your directory request to /isos/index.html internally. As this file does not exist the rewrite rules forward to the FOG API and from there to the management interface again.

  • @Sebastian-Roth good point. I just tested it. I can access the iso file from the FOG server machine :
    but from other machines if I do : I get to the FOG
    server management page. Seems like no matter what I type after the ip address it forwards me to the FOG login page.
    I have checked the permissions for the iso folder and changed it to “-R 777” (I’m not sure if this is a good practice!) but still the same.

  • Senior Developer

    @amir3161 said in Boot from Ubuntu 16.04 live iso failed:


    Are you able to access this URL from your browser and download the ISO file (just for testing)?

  • @george1421 Finally got it working for the Ubuntu! using the instruction you provided!

    Regarding Hiren I still have problem. I have changed permissions as @Tom-Elliott suggested but for the /var/www/html/iso/hiren/ (hirens.iso is in this folder)
    Now it gets stuck with this message:

    Loading  boot sector... booting ...

    Btw for the reference and in case someone needs it later I will post what I did here in another post.

  • Senior Developer

    How about example from iPXE themselves?

  • @Tom-Elliott Thanks Tom. Did that but nothing changed! 😞

  • Moderator

    OK I did a quick search of the forums here is what I have.

    For hirens by @Avaryan

    item hiren Hiren's Boot CD 15.2
    item return Return to Previous Menu
    choose --default return --timeout 15000 target && goto ${target}
    initrd http://${fog-ip}/iso/Hiren15.2.iso
    chain memdisk iso raw ||

    For ubuntu/kubuntu by @kmstory Note that you will need to place the ubuntu extracted images in /images/ubuntu on the fog server to access them via nfs.

    kernel nfs://${next-server}/images/xubuntu/casper/vmlinuz.efi
    initrd nfs://${next-server}/images/xubuntu/casper/initrd.lz
    imgargs vmlinuz.efi acpi=off root=/dev/nfs boot=casper netboot=nfs nfsroot=${next-server}:/images/xubuntu locale=en_US.UTF-8 keyboard-configuration/layoutcode=us mirror/country=US

    Misc other iso images by @x23piracy

  • Senior Developer

    @amir3161 said in Boot from Ubuntu 16.04 live iso failed:

    kernel tftp://${fog-ip}/tftpboot/ubuntu16/vmlinuz.efi
    initrd tftp://${fog-ip}/tftpboot/ubuntu16/initrd.lz
    imgargs root=/dev/nfs boot=casper netboot=nfs nfsroot=${fog-ip}:${fog-ip}:/images/mounts/ubuntu16 locale=en_US.UTF-8 keyboard-configuration/layoutcode=us mirror/country=US
    boot || goto failed
    goto start

    Don’t forget you need to have the files web readable too. Right now they’re purely “read” but when iPXE goes to “start” them, it needs to execute too.

    You could try:

    chown -R www-data:www-data /var/www/html/os
    chmod -R +x /var/www/html/os

  • Thanks george for the quick response.
    So I have done what you mentioned:

    1. I did move the hiren iso file to /var/www/html/iso/ and changed entry in the MENU to this:
    initrd http://${fog-ip}/iso/hirens.iso
    chain memdisk iso raw ||
    goto MENU

    Now when I choose hiren I get this message:
    MEMDISK: bootstrap too large to load.

    It was booting before at least to windows not it does not. DO I need to change something ins the “chain memdisk iso raw ||” line?

    1. For the Ubutu entry:

    A. I changed the protocol to tftp:

    kernel tftp://${fog-ip}/tftpboot/ubuntu16/vmlinuz.efi
    initrd tftp://${fog-ip}/tftpboot/ubuntu16/initrd.lz
    imgargs root=/dev/nfs boot=casper netboot=nfs nfsroot=${fog-ip}:${fog-ip}:/images/mounts/ubuntu16  locale=en_US.UTF-8 keyboard-configuration/layoutcode=us mirror/country=US
    boot || goto failed
    goto start

    The result was that I get this error message:

    vmlinuz.efi is in /tftpboot/ubuntu16/

    B. I tried to use the http instead so I created: /var/www/html/os/ubuntu16 and extracted the ubuntu iso here.(after reading many posts I’m still not sure that I must use the iso file or extract it into this folder!) so here is the folder content:
    Andhere is the MENU entry for it :

    kernel http://${fog-ip}/os/ubuntu16/vmlinuz.efi
    initrd http://${fog-ip}/os/ubuntu16/initrd.lz
    imgargs root=/dev/nfs boot=casper netboot=nfs nfsroot=${fog-ip}:${fog-ip}:/images/mounts/ubuntu16  locale=en_US.UTF-8 keyboard-configuration/layoutcode=us mirror/country=US
    boot || goto failed
    goto start

    I still get the blank page when I choose to boot from the ubuntu entry.

    What about the imgargs line? do I need to change the nfsroot path in this line? and what should it be in this case?

  • Moderator

    Well I can give you a few suggestions here.

    1. For ubuntu menu, this line will not work: kernel http://${fog-ip}/tftpboot/ubuntu16/vmlinuz.efi The issue is /tftpboot is not accessible via the web server if you are using the http protocol. You need to make sure your protocol is in line with your location you place your files.
    2. http://${fog-ip}/fog/service/ipxe/hiren/hir.iso and anything else like http://${fog-ip}/${fog-webroot} if you place files in the FOG web gui path, plan on them getting clobbered the next update you install.

    What I would suggest is this.

    If you have an iso file make a new directory on the web server just for your iso files outside of the fog path. For example using the fog linux console the fog web gui path is /var/www/html/fog/… If it was me I would place my iso files in /var/www/html/iso Then you would reference those iso files on the http side with http://${fog-ip}/iso/hirens.iso and so on.

    For these lines

    kernel http://${fog-ip}/tftpboot/ubuntu16/vmlinuz.efi
    initrd http://${fog-ip}/tftpboot/ubuntu16/initrd.lz

    You have your protocol / file location mixed. You can either change the protocol to tftp or change your file locations

    kernel tftp://${fog-ip}/tftpboot/ubuntu16/vmlinuz.efi
    initrd tftp://${fog-ip}/tftpboot/ubuntu16/initrd.lz

    or http and move the files to /var/www/html/os/ubuntu16

    kernel http://${fog-ip}/os/ubuntu16/vmlinuz.efi
    initrd http://${fog-ip}/os/ubuntu16/initrd.lz