How to add live cd iso to Fog 1.2 on Ubuntu 12.04
-
I’m excited to write this post, because it’s my first attempt at a tutorial, so please feel free to suggest changes and I’ll do my best to edit and improve it. If it matters, I’m not a padawan, nor am I a jedi master, but somewhere right in the middle. I’m writing this because I failed to find a single tutorial that had all the answers I needed concerning the installation of Fog 1.2 on Ubuntu 12.04 and then ESPECIALLY the adding of additional live cd iso’s into the advanced section of the fog menu. Having benefited so greatly from hundreds of tutorials myself, this is my humble attempt to bring the pieces together for the benefit of others. So, let’s begin…
ASSUMPTIONS:
-
I assume you have a working and updated Ubuntu 12.04 installation with a static IP address. For what it’s worth, I find it significantly easier to have my router (which is my dhcp server) assign a static IP to the machine, but you can do it manually on Ubuntu by configuring the network interface either through the terminal or the gui. Here are examples of both: [url]https://www.liberiangeek.net/2012/04/setup-a-permanent-static-ip-address-in-ubuntu-12-04-precise-pangolin/[/url]
[url]http://askubuntu.com/questions/180925/how-to-setup-static-ip-in-ubuntu-server-12-04[/url]
You can use any desktop environment, it shouldn’t matter. Also, though there were significant changes made to Ubuntu 14.04, this information will be 95% accurate for that distro as well, at least it will get you in the ballpark. -
I assume you have a separate dhcp server (meaning you are not using fog as the dhcp server). *** PLEASE NOTE*** Depending on the specifics of your dhcp server, i.e. type/brand/firmware, it may be necessary to make special configuration changes to enable pxe booting. See the following link for more details: [url]http://fogproject.org/wiki/index.php/Modifying_existing_DHCP_server_to_work_with_FOG[/url]
-
I’m also assuming you have installed Fog 1.2 on your Ubuntu machine. The following link, which has loads of good info worth reading, has a section dedicated to the installation procedure: [url]http://fogproject.org/forum/threads/how-to-setup-ubuntu-server-fog-1-2-0-create-univeral-windows-7-image-using-sysprep-step-by-step.11245/[/url]
-
I assume you have downloaded or otherwise have a copy of your chosen Debian/Ubuntu based linux distro ISO file somewhere in your home folder, i.e. ~/Downloads/linuxmint-17.1-cinnamon-64bit.iso
CHANGES IN UBUNTU:
My example uses the linuxmint-17.1-cinnamon-64bit.iso, but I’m fairly sure these instructions will work for any Debian/Ubuntu based distro.First, lets make a directory inside the web root of Fog.
CODEsudo mkdir /var/www/fog/service/ipxe/mint[/CODE]
I called my directory “mint”, but you can name it anything you want. When I add my next iso, I’m going to create another directory named “ubuntu” because I’ll be using the Ubuntu 14.04 iso, but I digress…Now let’s copy the ISO file into that directory:
CODEsudo cp ~/Downloads/linuxmint-17.1-cinnamon-64bit.iso /var/www/fog/service/ipxe/mint[/CODE]Next, we are going to tell Ubuntu to mount that iso on that same location so that the files contained in the iso will be available for pxe booting. We do this by editing /etc/fstab
CODEsudo nano /etc/fstab[/CODE]Append the following code into /etc/fstab
CODE/var/www/fog/service/ipxe/mint/linuxmint-17.1-cinnamon-64bit.iso /var/www/fog/service/ipxe/mint udf,iso9660 user,loop 0 0[/CODE]Now test the mount point works with:
CODEsudo mount -a[/CODE]A window may open showing the contents of the iso mounted at /var/www/fog/service/ipxe/mint, but if not–run the following code to see the contents of the iso listed
CODEls -lash /var/www/fog/service/ipxe/mint[/CODE]Now we edit /etc/exports to configure the NFS share.
CODEsudo nano /etc/exports[/CODE]append the following mount point info into /etc/exports
CODE/var/www/fog/service/ipxe/mint/ *(rw,sync,no_wdelay,no_root_squash,insecure)[/CODE]and restart the NFS service
CODEsudo /etc/init.d/nfs-kernel-server restart[/CODE]CHANGES IN FOG GUI:
Now log into your fog gui by entering the following into the address bar of your browser:
CODE<your-fog-ip-address>/fog/management/index.php[/CODE]and login with the default username: fog and password: password
in the gui, navigate to the big blue question mark–hover tool tip “fog configuration”, then on the left side menu go to “pxe boot menu”. Then in the page that appears, look for “advanced configuration options”, which when clicked will open a small text box where you will enter your php code to edit the fog boot menu options.
Now, allow me to digress for just a moment and explain that fog 0.32 had a much simpler method of configuring the fog boot menu, and I realize that the new method in fog 1.2 is more complicated. So, I understand the frustration some of you may have with the new method, which involves php code. What you need to know is that the new way leverages the bandwidth available with http and allows for significantly faster network speeds than the former method which used tftp which is tragically slow by modern standards. So, everyone say thank you to the Fog developers for doing their job and improving the product, and get on board with the new and better way of doing things :~)
Here are some links that REALLY helped me get this working. I could not have done this without Tom Elliot, Junkhacker, and fabritrento. In the world of code and IT we always stand on the shoulders of others. A HUGE THANK YOU to those I mentioned, and many others who post on this forum.
[URL=‘http://fogproject.org/forum/threads/live-cd-configurations-for-boot.12044/#post-39436’][FONT=arial][COLOR=#1155cc]http://fogproject.org/forum/threads/live-cd-configurations-for-boot.12044/#post-39436[/COLOR][/FONT][/URL][URL=‘http://fogproject.org/wiki/index.php/Advanced_Boot_Menu_Configuration_options’][FONT=arial][COLOR=#1155cc]http://fogproject.org/wiki/index.php/Advanced_Boot_Menu_Configuration_options[/COLOR][/FONT][/URL]
[URL=‘http://fogproject.org/forum/threads/how-can-i-boot-a-live-image-with-ipxe.11940/#post-38652’][FONT=arial][COLOR=#1155cc]http://fogproject.org/forum/threads/how-can-i-boot-a-live-image-with-ipxe.11940/#post-38652[/COLOR][/FONT][/URL]
[URL=‘http://ipxe.org/’][FONT=arial][COLOR=#1155cc]http://ipxe.org/[/COLOR][/FONT][/URL]
HERE IS MY WORKING PHP CODE:
Paste the following code into the text box (substituting your actual iso files location where necessary) NOTE how the variable “${fog-ip}” picks up your fog server ip address automatically
Also–pay attention to the vmlinuz file found in the casper directory at your mount point–depending on your chosen distro it may be “vmlinuz.efi” rather than straight “vmlinuz”
CODE:MENU
menu
item --gap – ---------------- iPXE boot menu ----------------
item mint 17 Mint 17.1 Cinnamon x64
item shell ipxe shell
item return return to previous menu
choose --default return --timeout 5000 target && goto ${target}:mint
kernel http://${fog-ip}/fog/service/ipxe/mint/casper/vmlinuz
initrd http://${fog-ip}/fog/service/ipxe/mint/casper/initrd.lz
imgargs vmlinuz root=/dev/nfs boot=casper netboot=nfs nfsroot=${fog-ip}:/var/www/fog/service/ipxe/mint/ locale=en_US.UTF-8 keyboard-configuration/layoutcode=us mirror/country=US
boot || goto failed
goto start:shell
shell ||
goto MENU:return
chain http://${fog-ip}/${fog-webroot}/service/ipxe/boot.php?mac=${net0/mac} ||
prompt
goto MENUautoboot[/CODE]
Now, if you want to add something other than a vanilla linux distro, like Hiren’s Boot CD 15.2 for example, you need to take a slightly different path. In this case, you do not need to mount the iso, so there is no need to edit /etc/fstab or /etc/exports. Simply create a directory within fog web root, i.e. /var/www/fog/service/ipxe/hiren–copy the iso into that directory–and add some additional php code to the “advanced configuration options” text box.
Here is what my code looks like with the addition of Hiren’s Boot CD 15.2 NOTE how the first menu section has changed, and for the “hiren” section there is completely different code used to load the unmounted iso directly
menu
item --gap – ---------------- iPXE boot menu ----------------
item mint 17 Mint 17.1 Cinnamon x64
item hiren Hiren Boot CD 15.2
item shell ipxe shell
item return return to previous menu
choose --default return --timeout 5000 target && goto ${target}:mint
kernel http://${fog-ip}/fog/service/ipxe/mint/casper/vmlinuz
initrd http://${fog-ip}/fog/service/ipxe/mint/casper/initrd.lz
imgargs vmlinuz root=/dev/nfs boot=casper netboot=nfs nfsroot=${fog-ip}:/var/www/fog/service/ipxe/mint/ locale=en_US.UTF-8 keyboard-configuration/layoutcode=us mirror/country=US
boot || goto failed
goto start:hiren
initrd http://${fog-ip}/fog/service/ipxe/hiren/hiren-boot-cd-15-2.iso
chain memdisk iso raw ||
goto MENU:shell
shell ||
goto MENU:return
chain http://${fog-ip}/${fog-webroot}/service/ipxe/boot.php?mac=${net0/mac} ||
prompt
goto MENUautoboot[/CODE]
One “gotcha” I noted in the forum was a corrupt iso that failed md5sum checking. The user had everything else right, but a corrupt download. The lesson–do your md5sum checks–before assuming something else is wrong.
If all went well, you should be able to select the “advanced” menu option from the client fog boot menu and choose to boot your chosen linux distro or Hiren’s Boot CD 15.2, which will then load itself into RAM on the client machine and act exactly the same as if you had a live cd or usb on the client (only way faster because it’s running from ram).
ENJOY YOUR FOG SERVER :~) & MAY THE FORCE BE WITH YOU
-
-
Hi all,
(my english it’s not very good, sry for mistackes)
I search every day (and night :)) for this …
Is it possible to add “submenu” into boot PXE?I try to explain.
when i boot on PXE, i’ve the boot menu.
I have Advenced MenuIn this menu, i would like to have 2 submenus
One with “Diagnostic tools”
Other with “install”For example
here, a copy fo my Advenced menu config (everything works properly)
:MENU
menu
item sysrescue3.5 SystemRescue 3.5.0
item ultimate UltimateBootCD 5.3.3
item ubuntu14.04_64 Ubuntu 14.04 64 Bits
item debian7.8_64 Debian 7.8 64 Bits
item ThinkCenterDiag Diag ThinkCenter Lenovo
item shell ipxe shell
item return return to previous menu
choose --default sysrescue3.5 --timeout 5000 target && goto ${target}:sysrescue3.5
initrd [url]http://${fog-ip}/${fog-webroot}/iso/sysrescue3.5.iso[/url]
chain memdisk iso raw ||
goto MENU:ultimate
initrd [url]http://${fog-ip}/${fog-webroot}/iso/Ultimate533.iso[/url]
chain memdisk iso raw ||
goto MENU:ubuntu14.04_64
initrd [url]http://${fog-ip}/${fog-webroot}/iso/install/ubuntu/ubuntu14.04_64.iso[/url]
chain memdisk iso raw ||
goto MENU:debian7.8_64
initrd [url]http://${fog-ip}/${fog-webroot}/iso/install/debian2/debian7.8_64.iso[/url]
chain memdisk iso raw ||
goto MENU:ThinkCenterDiag
initrd [url]http://${fog-ip}/${fog-webroot}/iso/ThinkCenterDiag.iso[/url]
chain memdisk iso raw ||
goto MENU:shell
shell ||
goto MENU:return
chain [url]http://${fog-ip}/${fog-webroot}/service/ipxe/boot.php?mac=${net0/mac}[/url] ||
prompt
goto MENUautoboot
My apologies, i’m on Ubuntu 14 with FOG 1.2
Thx -
This post is deleted! -
Try this:
[code]
:MENU
menu
item diagnosticTools Diagnostic Tools Menu
item installTools Installation Tools Menu
choose --default diagnosticTools target && goto ${target}
:diagnosticTools
menu
item ThinkCenterDiag Diag ThinkCenter Lenovo
item installTools Installation Tools Menu
item shell ipxe shell
item return Return to Main Menu
choose --default ThinkCenterDiag target && goto ${target}
:installTools
menu
item sysrescue3.5 SystemRescue 3.5.0
item ultimate UltimateBootCD 5.3.3
item ubuntu14.04_64 Ubuntu 14.04 64 Bits
item debian7.8_64 Debian 7.8 64 Bits
item diagnosticTools Diagnostic Tools Menu
item return Return to Main Menu
choose --default sysrescue3.5 target && goto ${target}
:sysrescue3.5
initrd http://${fog-ip}/${fog-webroot}/iso/sysrescue3.5.iso
chain memdisk iso raw ||
goto MENU
:ultimate
initrd http://${fog-ip}/${fog-webroot}/iso/Ultimate533.iso
chain memdisk iso raw ||
goto MENU
:ubuntu14.04_64
initrd http://${fog-ip}/${fog-webroot}/iso/install/ubuntu/ubuntu14.04_64.iso
chain memdisk iso raw ||
goto MENU
:debian7.8_64
initrd http://${fog-ip}/${fog-webroot}/iso/install/debian2/debian7.8_64.iso
chain memdisk iso raw ||
goto MENU
:ThinkCenterDiag
initrd http://${fog-ip}/${fog-webroot}/iso/ThinkCenterDiag.iso
chain memdisk iso raw ||
goto MENU
:shell
shell ||
goto MENU
:return
chain http://${fog-ip}/${fog-webroot}/service/ipxe/boot.php?mac=${net0/mac} ||
prompt
goto MENU
autoboot[/code] -
Thanks Guys, try this but have a little bug when i select the Installation tolls menu in advenced menu.
I’ve gotthis :
“”
No default menu
Could not boot: No such file or directory ([url]http://ipxe.org/2d16203b[/url])“”
But now you show me how do this! so i’m trying to do it.
Thx a lot ! -
Try copying again. I’ve edited a bit and tested the code that is in the window above. It should help you out.
-
that what i do: THX a lot guy!
:MENU
menu
item diagnosticTools Diagnostic Tools Menu
item installTools Installation Tools Menu
item return Return to Main Menu
choose --default return target && goto ${target}:diagnosticTools
menu
item ThinkCenterDiag Lenovo Diag ThinkCenter
item sysrescue3.5 SystemRescue 3.5.0
item ultimate UltimateBootCD 5.3.3
item shell ipxe shell
item return Return to Main Menu
choose --default return target && goto ${target}:installTools
menu
item ubuntu14.04_64 Ubuntu 14.04 64 Bits
item debian7.8_64 Debian 7.8 64 Bits
item return Return to Main Menu
choose --default return target && goto ${target}:sysrescue3.5
initrd [url]http://${fog-ip}/${fog-webroot}/iso/sysrescue3.5.iso[/url]
chain memdisk iso raw ||
goto MENU:ultimate
initrd [url]http://${fog-ip}/${fog-webroot}/iso/Ultimate533.iso[/url]
chain memdisk iso raw ||
goto MENU:ubuntu14.04_64
initrd [url]http://${fog-ip}/${fog-webroot}/iso/install/ubuntu/ubuntu14.04_64.iso[/url]
chain memdisk iso raw ||
goto MENU:debian7.8_64
initrd [url]http://${fog-ip}/${fog-webroot}/iso/install/debian2/debian7.8_64.iso[/url]
chain memdisk iso raw ||
goto MENU:ThinkCenterDiag
initrd [url]http://${fog-ip}/${fog-webroot}/iso/ThinkCenterDiag.iso[/url]
chain memdisk iso raw ||
goto MENU -
So this is good then?
-
Yes it’s good! Thx!
-
Tom, it appears you are directly accessing the Ubuntu ISO (in fact all your iso’s) without mounting first. I didn’t realize this was possible. This makes half of my tutorial method uneccessary :~) Do all iso’s work in this manner?
-
Tony,
I am not accessing any iso’s I am simply taking what was put and making it work for what Biet needed. Beyond that, some iso’s can be directly accessed and some need to be broken from the ISO and told to load their respective initrd and kernel. Which need the separation is directly based upon the ISO manufacturer.
-
Hello guys, i can answer to Tony Lillie. It doesn’t work …
Debian or ubuntu need your tutorial for working… (thinkcenter diag also) -
I load HIREN’s and UBCD directly from the ISO and it works
-
Biet is correct. It really depends on the specific iso in question. Many need to be pre-mounted and have certain files (usually vmlinuz, and initrd) specified. Others will work directly from the iso. Fortunately the most common iso’s have been experimented with at this point and if you search the forum you can find the answers you need for your specific iso.
-
Amazing!!
I have tried to do something similar in my FOG server and works fine!
FOG server: 1.2.0 latest SVN installed
Operating System: Ubuntu 13.10 latest updates installed- I have understood very well your tutorial. Congratulations!
- I have added a new menu entry in FOG boot menu (it is very easy I think)
- Reading your notes, I have added a Live Ubuntu CD 14.04.2 i386 and it runned ok on client machine.
Thank you!
-
Awesome!!
-
Thanks great tutorial (an tom for everything)
I’ve finally upgraded from 0.32 and was looking all over for this… It’s a little different but can’t wait to try it -
Trying to boot clonezilla…
Any idea on how to get this going?
Currently this is the closest to booting i have… error message below
:clonezilla-live-2.3.2-22-amd64
kernel http://${fog-ip}/${fog-webroot}/iso/clonezilla/vmlinuz
initrd http://${fog-ip}/${fog-webroot}/iso/clonezilla/initrd.img
imgargs vmlinuz root=/dev/nfs boot=clonezilla netboot=nfs nfsroot=${fog-ip}:/var/www/fog/service/ipxe/clonezilla/ locale=en_US.UTF-8 keyboard-configuration/layoutcode=us mirror/country=US
boot || goto failedcame across this https://gist.github.com/robinsmidsrod/dc0dc70adba8dcd79cdf
not sure if this would help? tried adding the forth line with no luck
#!ipxe
kernel /live/vmlinuz
initrd /live/initrd.img
imgargs vmlinuz boot=live username=user hostname=trusty config quiet union=overlayfs noswap edd=on nomodeset noeject locales= keyboard-layouts= ocs_live_run=“ocs-live-general” ocs_live_extra_param=“” ocs_live_batch=no ip= nomodeset vga=normal nosplash
boot -
me too, with GParted I’ve kernel panic
with Debian 8.1 I can launch install but after it says to me that cdrom is missing -
I’m lost !! I use fog 1.2.0 and I want to add a pxe load of a wim (winpe) image to use MDT config to the menu .
Which file do you edit ? Is it /tftpboot/default.ipxe ? I can’t see the name of the file you edit in this thread !Thx