{"id":143,"date":"2009-03-15T22:43:10","date_gmt":"2009-03-16T03:43:10","guid":{"rendered":"http:\/\/otac.isa-geek.net\/blog\/?p=143"},"modified":"2009-03-15T22:48:59","modified_gmt":"2009-03-16T03:48:59","slug":"ubuntu-netboot-addendumlive-session-over-pxe","status":"publish","type":"post","link":"https:\/\/otac.isa-geek.net\/blog\/?p=143","title":{"rendered":"Ubuntu Netboot addendum&#8230;live session over PXE."},"content":{"rendered":"<p>I posted a while back on the usefulness of using the PXE Netboot client available in most modern PCs, to <a href=\"http:\/\/otac.isa-geek.net\/blog\/2008\/02\/09\/137-installing-ubuntu-on-a-thinkpad-laptop-sans-cdrom-drive\">boot up a Ubuntu install session over the network<\/a>. I found this particularly useful, since I have a laptop with no DVD\/CD, so the install CD option is really a non-starter. However, I recently started wondering if it was possible to boot a full live Ubuntu session over PXE Netboot, basically creating full diskless workstations using open-source tech. I did a bit of research, and found that the folks on the Ubuntu documentation wiki, have already made some great strides in that regard (<a href=\"https:\/\/wiki.ubuntu.com\/LiveCDNetboot\">https:\/\/wiki.ubuntu.com\/LiveCDNetboot<\/a>). I&#8217;ve modified their instructions slightly for my environment, and to get a bit more flexibility. In my previous post on <a href=\"http:\/\/otac.isa-geek.net\/blog\/2008\/02\/09\/137-installing-ubuntu-on-a-thinkpad-laptop-sans-cdrom-drive\">using PXE to netboot<\/a>, I highlighted the setup for hcpd3, tftd and pxe that would allow a PXE client to boot up with the Ubuntu installer. I&#8217;ve added some modifications to that, creating an option for booting using the 8.10 (Intrepid) Live CD image.<\/p>\n<p>The first change I made was to mount and copy the livecd image for <a href=\"http:\/\/releases.ubuntu.com\/8.10\/ubuntu-8.10-desktop-i386.iso\">Intrepid Ibex (Ubuntu 8.10)<\/a>,\u00a0 on the filesystem using a standard loopback:<\/p>\n<p><strong>$ sudo mkdir \/mnt\/ubuntu8-iso<\/strong><\/p>\n<p><strong>$ sudo mount -o loop ubuntu-8.10-desktop-i386.iso \/mnt\/ubuntu8-iso<\/strong><\/p>\n<p><strong>$ ls -CF \/mnt\/ubuntu8-iso<br \/>\nautorun.inf\u00a0 install\/\u00a0\u00a0\u00a0 pics\/\u00a0\u00a0\u00a0\u00a0 README.diskdefines\u00a0 wubi.exe<br \/>\ncasper\/\u00a0\u00a0\u00a0\u00a0\u00a0 isolinux\/\u00a0\u00a0 pool\/\u00a0\u00a0\u00a0\u00a0 ubuntu@<br \/>\ndists\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 md5sum.txt\u00a0 preseed\/\u00a0 umenu.exe<\/strong><\/p>\n<p>I made a copy of the mounted image in the \/var\/lib\/tftpboot directory to use as the source for mounting in my PXE-based live sessions:<\/p>\n<p><strong>$ cd \/var\/lib\/tftpboot<\/strong><\/p>\n<p><strong>$ sudo mkdir ubuntu8-iso<\/strong><\/p>\n<p><strong>$ sudo cp -R\u00a0 \/mnt\/ubuntu8-iso\/* ubuntu8-iso\/<\/strong><\/p>\n<p><strong>$ cd \/var\/lib\/tftpboot<\/strong><\/p>\n<p>The livecd boot mechanism requires that the boot image filesystem be available to the PXE client after the PXE boot process has begun; to enable this. an NFS export is made that shares the filesystem for mounting at boot itme on the client. The first step was to edit the \/etc\/exports file with the path to the image fileystem:<\/p>\n<p><strong>$\u00a0 sudo vi \/etc\/exports<\/strong><\/p>\n<p>and adding the following line (your server and path may vary):<\/p>\n<p><strong>\/var\/lib\/tftpboot\/ubuntu8-iso 192.168.2.1\/24(ro,no_root_squash,async)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #share the image filesystem to all IP&#8217;s in the subnet, read-only, don&#8217;t use the squash filesystem<\/strong><\/p>\n<p>I then restarted the nfs service to export the new share:<\/p>\n<p><strong>$ sudo \/etc\/init.d\/nfs-kernel-server reload<\/strong><\/p>\n<p>Theoretically, it should be possible to do this share using a samba mount as well, which may be preferable in situations where NFS is unavailable or undesirable.<\/p>\n<p>The next step was to modify the default PXE config file to include a menu option for booting up from the livecd image. I changed working directory to the \/var\/lib\/tftpboot\/pxelinux.cfg directory, and edited the file default.<\/p>\n<p><strong>$ cd \/var\/lib\/tftpboot\/pxelinux.cfg<\/strong><\/p>\n<p><strong>$ vi default<\/strong><\/p>\n<p><strong>I then added a new option for the livecd as follows:<\/strong><\/p>\n<p><strong>DEFAULT livecd<br \/>\nLABEL livecd<br \/>\nkernel ubuntu8-iso\/casper\/vmlinuz<br \/>\nappend break=init<br \/>\nappend boot=casper netboot=nfs nfsroot=192.168.2.2:\/var\/lib\/tftpboot\/ubuntu8-iso initrd=ubuntu8-iso\/casper\/initrd.gz splash &#8212;<\/strong><\/p>\n<p>Having already configured my laptop to pick up the PXE service, all that was necessary was to boot it up in LAN agent mode, at which point the default Ubuntu boot screen turned up. Since my default was now set to livecd, hitting enter, started the boot process. There was one snafu, which seems particular to Intrepid; the boot process hangs after the diagnostics indicate that X-Windows should be starting. Some investigation on the Launchpad bug list suggested that <a href=\"https:\/\/bugs.launchpad.net\/ubuntu\/+source\/network-manager\/+bug\/268005\">bug 268005<\/a> (basically, network availability at boot time) was the problem. The simplest workaround, was to press <strong>alt+sysrq+e<\/strong>, all at the same time. This terminated all the processes which were running\/hanging, and allowed the X-server to come up, giving a full live cd Ubuntu session. I&#8217;m sure that software or configuration work-around exists, hopefully it will make it&#8217;s way to the bug tracker soon. None the less, this worked out pretty well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I posted a while back on the usefulness of using the PXE Netboot client available in most modern PCs, to boot up a Ubuntu install session over the network. I found this particularly useful, since I have a laptop with no DVD\/CD, so the install CD option is really a non-starter. However, I recently started [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,45,44],"tags":[],"class_list":["post-143","post","type-post","status-publish","format-standard","hentry","category-linux","category-pxe","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/otac.isa-geek.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/143","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/otac.isa-geek.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/otac.isa-geek.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/otac.isa-geek.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/otac.isa-geek.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=143"}],"version-history":[{"count":14,"href":"https:\/\/otac.isa-geek.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/143\/revisions"}],"predecessor-version":[{"id":156,"href":"https:\/\/otac.isa-geek.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/143\/revisions\/156"}],"wp:attachment":[{"href":"https:\/\/otac.isa-geek.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/otac.isa-geek.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/otac.isa-geek.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}