PXE

From SME Server
Revision as of 02:51, 7 October 2010 by Jader (talk | contribs) (→‎SME AS DHCP SERVER: created tip box... couldn't find warning box... will search later)
Jump to navigationJump to search

PXE Booting for SME Server

Objective

Getting a computer with good hardware to boot without using the local drives (NO cd/dvd, hdd, usb, floppy etc. required) to the SME network (PXE) and perform imaging or other tasks.

This document is a compilation of this forum thread made by BUD

If this do not help you to create a new PXE boot server, please open a new thread on forum and ask for help, and after get help, update here or send details what need to be changed to my gmail account: jader DOT marasca and I'll update for you.


Ingredients

   * SME DHCP Server
   * SME TFTP Server Contrib
   * SME Thinclient Contrib
   * PXELINUX
   * Thinclient Setup
   * Floppy image creator 


Recipe

   * Make the SME Server your DHCP Server
   * Download and Install the SME TFTP Contrib
   * Download and Install the SME Thinclient Contrib
   * Download and Install SYSLINUX Files and Configure SME PXE Server Files
   * PXE Example Files, Puppy Linux How To
   * Using PXE to Install SME and Password Protect Menu Option Example

Step by step guide

SME AS DHCP SERVER

Using Putty SSH into your SME Server and at the Login Prompt Enter “admin “ then your Password.
You will now be in the SME Server Setup Menu.
Choose Server Config and make sure your SME Server has "DHCP Enabled" and you have set a IP Range.
?? To have SME DHCP Lease Time Periods click on this Link  DHCP Lease Time ??


Information.png Tip:
WARNING: You should just have ONE DHCP server on your network (or know why/how to have more than one). If you already have other device as DHCP server, you should disable it or ask guidance for someone else about how to avoid conflict!


TFTP SME CONTRIB

Using Putty SSH into your SME Server and at the Login Prompt Enter “root “ then your Password.
You will now be in the SME Server Shell.

Install the SME TFTP Server Contrib as per: http://wiki.contribs.org/Tftp_server

SME THINCLIENT CONTRIB

Using Putty SSH into your SME Server and at the Login Prompt Enter “root “ then your Password. You will now be in the SME Server Shell Menu: Install the SME Server Thinclient Contrib as per: http://wiki.contribs.org/Thinclient

Once the SME Server Contribs have been installed use your browser (IE or Firefox) and goto https://yoursmeserverip/server-manager Choose the ”Thin Clients“ on left side column "Menu Option" In the Thin Client Configuration make sure that “Your PXE Boot Server "is ENABLED In the Thin Client Configuration make sure that “Your TFTP Server" is Self In the Thin Client Configuration make sure that “The default Distribution" is default

Click on the “APPLY” button

Under “ Distributions “ you should have the following:

Distribution Base Directory Type default Manual Remove... Modify...

Logout of the SME Server “ server-manager “ Web Console

SYSLINUX INSTALLATION and SME PXE CONFIGURATION:

There no real installing PXELINUX, only copying the right files from the SYSLINUX Archive to the right place in the SME Server:

First, make note of where your TFTP servers root directory is. For SME Server, it’s most often ”/tftpboot “. I suggest building a directory structure like the following:

tftpboot = SME Server TFTP Root Directory

tftpboot/com32 = Directory

tftpboot/graphics = Directory (This is where we place our Screen jpg, gif, png images)

tftpboot/images = Directory (This Directory will be used for our PXE Boot Images)

tftpboot/pxelinux.cfg (this is an actual folder/directory, THIS IS NOT A FILE)

Download the latest SYSLINUX release ( http://syslinux.zytor.com/ ) and unpack it. We only need a few files from the package. From the SYSLINUX archive:

   * Place the pxelinux.0 “ File “ in your SME TFTP Folder from the SYSLINUX Archive eg: “ tftpboot/pxelinux.0 “ (pxelinux.0 is a File)
   * Place the memdisk/memdisk File from the SYSLINUX Archive in the SME TFTP images Folder  eg: “ tftpboot/images/ “
   * Place the com32/*.c32 Files from the SYSLINUX Archive in the SME TFTP com32 Folder  eg: “ tftpboot/com32/ “


Now you need to create and configure the SME PXE menu. Create a new plaintext File called “ default ”at tftpboot/pxelinux.cfg/default ( default is a File that we have created and placed inside the tftpboot/pxelinux.cfg/ folder) |---tftpboot | |-----com32 | | | |-----graphics | | | |-----pxelinux.cfg (Place the default File in here) | | | |-----images Again, “ pxelinux.cfg “ is not a file, but a Directory, and the file you want to create is called default with no extension. Here’s an example of something simple to use in the default File: PXE EXAMPLE FILES: This is the “ default “ Example File NB: Note the “ menu background graphics/main.jpg ” file is a background image file. This could be with your Company Logo etc. The File should be 6340 x 480 pixels and can be a jpg, bmp, or png file. Just make sure you use the correct extension in the menu eg: main.bmp or main.png etc. menu title --== SME Linux, PXE Main Menu ==-- menu background graphics/main.jpg menu tabmsgrow 22 menu cmdlinerow 22 menu endrow 24

menu color title 1;34;49 #eea0a0ff #cc333355 std menu color sel 7;37;40 #ff000000 #bb9999aa all menu color border 30;44 #ffffffff #00000000 std menu color pwdheader 31;47 #eeff1010 #20ffffff std menu color hotkey 35;40 #90ffff00 #00000000 std menu color hotsel 35;40 #90000000 #bb9999aa all menu color timeout_msg 35;40 #90ffffff #00000000 none menu color timeout 31;47 #eeff1010 #00000000 none


prompt 0 noescape 1 allowoptions 0 timeout 300

default com32/vesamenu.c32

label toolsmenu

menu label ^System Tools Menu
kernel com32/vesamenu.c32
append pxelinux.cfg/tools

label memorymenu

menu label ^Memory Test Menu
kernel com32/vesamenu.c32
append pxelinux.cfg/memorytest

label randomutil

menu label ^Random Utilities Menu
kernel com32/vesamenu.c32
append images/random_utils

label linuxmenu

menu label ^Linux Boot Disks Menu
kernel com32/vesamenu.c32
append pxelinux.cfg/linux_boot_disks

label ntfstoolmenu

menu label ^NTFS Tools Menu
kernel com32/vesamenu.c32
append pxelinux.cfg/ntfstools

label bootmanag

menu label B^OOT Managers Menu
kernel com32/vesamenu.c32
append images/boot_managers/boot_managers

label sysinfo

menu label S^ystem Information Menu
kernel com32/vesamenu.c32
append images/system_information/system_information

label recovery

menu label R^ECOVERY Menu
kernel com32/vesamenu.c32
append images/recovery/recovery

label hddmenu

menu label ^Hard Disk Drive Menu
kernel com32/vesamenu.c32
append pxelinux.cfg/hdd

Now you need to create and configure the SME PXE sub menus. Create new plaintext Files called “ tools ” , “ memorytest ” , “ ntfstools ” , “ recovery ” at tftpboot/pxelinux.cfg/ (The Plaintext files are all placed inside the tftpboot/pxelinux.cfg/ folder) ie: Your “ images “ folder should look like this: |---tftpboot | |-----com32 | | | |-----graphics | | | |-----pxelinux.cfg (Pace the default, tools, memorytest, ntfstools) | (and recovery Files you created inside here) | | | |-----images | | | |----tools | | | |----memorytest | | | |----ntfstools | | |--------offlinent | | | |----recovery

Here’s some examples of something simple to use in the Created Files: This is the “ tools “ Menu Option Example File |---tftpboot | |-----com32 | | | |-----graphics | | | |-----pxelinux.cfg (directory) | | | |-----images | | | |----tools | | | |----memorytest | | | |----ntfstools | | |--------offlinent | | | |----recovery Here’s some examples of something for the Tools Menu menu title --== SME Linux, PXE Tools Menu ==-- menu background graphics/main.jpg menu tabmsgrow 22 menu cmdlinerow 22 menu endrow 24

menu color title 1;34;49 #eea0a0ff #cc333355 std menu color sel 7;37;40 #ff000000 #bb9999aa all menu color border 30;44 #ffffffff #00000000 std menu color pwdheader 31;47 #eeff1010 #20ffffff std menu color hotkey 35;40 #90ffff00 #00000000 std menu color hotsel 35;40 #90000000 #bb9999aa all menu color timeout_msg 35;40 #90ffffff #00000000 none menu color timeout 31;47 #eeff1010 #00000000 none

prompt 0 noescape 1 allowoptions 0 timeout 0

default com32/vesamenu.c32

label main

menu label Back to ^Main Menu
kernel com32/vesamenu.c32
append pxelinux.cfg/default

label dban

menu label ^Darik's Boot-n-Nuke disk wiper
kernel images/memdisk
append initrd=images/tools/wiping/dban.ima

label memtest86

menu label ^Memtest86 - Machine RAM tester
kernel images/memory_test/memtest86

label memtests

menu label ^Memory Test Menu
kernel com32/vesamenu.c32
append images/tools/memtest

label hdt

menu label ^Hardware Detection Tool
kernel images/memdisk
append initrd=images/tools/hdt.img

label diags

menu label D^IAGS Tool
kernel images/memdisk
append initrd=images/tools/diags.img

The Following Applications must be copied Inside the “ tools “ folder: dban.ima, memtest86, memtest, hdt.img, diags.img This is the “ memorytest “ Menu Option Example File |---tftpboot | |-----com32 | | | |-----graphics | | | |-----pxelinux.cfg (directory) | | | |-----images | | | |----tools | | | |----memorytest | | | |----ntfstools | | |--------offlinent | | | |----recovery Here’s some examples of something simple for the Memory Test Menu menu title --== SME Linux, MEMORY Tests MENU ==-- menu background graphics/main.jpg menu tabmsgrow 22 menu cmdlinerow 22 menu endrow 24

menu color title 1;34;49 #eeffa0a0 #cc553333 std menu color sel 7;37;40 #ff000000 #bb9999aa all menu color border 30;44 #ffffffff #00000000 std menu color pwdheader 31;47 #eeff1010 #20ffffff std menu color hotkey 35;40 #90ffff00 #00000000 std menu color hotsel 35;40 #90000000 #bb9999aa all menu color timeout_msg 35;40 #90ffffff #00000000 none menu color timeout 31;47 #eeff1010 #00000000 none

prompt 0 noescape 1 allowoptions 1 timeout 0

default com32/vesamenu.c32

label main

menu label Back to ^Main Menu
kernel com32/vesamenu.c32
append pxelinux.cfg/default

label docmem1

   menu label ^DocMem RAM Diagnostic v. 1.45a
   kernel images/memdisk
   append initrd=images/memorytest/docmem1.igz

label docmem2

   menu label DocMem ^RAM Diagnostic v. 2.1b
   kernel images/memdisk
   append initrd=images/memorytest/docmem2.igz

label memtest86+

   menu label Memtest^86+
   kernel images/memorytest/memtest86+/memtest86+-1.65

label memtest86

   menu label Memtest8^6
   kernel images/memdisk
   append ininrd=images/memorytest/memtest.igz

label tm4

   menu label ^TestMem4
   kernel images/memdisk
   append images=images/memorytest/tm4.igz

label windiag

   menu label ^Windows Memory Diagnostic
   kernel images/memdisk
   append initrd=images/memorytest/windiag.igz

The Following Applications must be copied Inside the “ memorytest “ folder: docmem1.igz, docmem2.igz, memtest86+-1.65, memtest.igz, tm4.igz, windiag.igz This is the “ ntfstools “ Menu Option Example File with a sub-menu You also need to create a sub folder inside the “ ntfstools “ folder called “ offlinent “ |---tftpboot | |-----com32 | | | |-----graphics | | | |-----pxelinux.cfg (directory) | | | |-----images | | | |----tools | | | |----memorytest | | | |----ntfstools | | |--------offlinent (initrd.cgz, vmlinuz, scsi.cgz) | | | |----recovery


menu title --== SME Linux, NTFS TOOLS MENU ==-- menu background graphics/main.jpg menu tabmsgrow 22 menu cmdlinerow 22 menu endrow 24

menu color title 1;34;49 #eeffa0a0 #cc553333 std menu color sel 7;37;40 #ff000000 #bb9999aa all menu color border 30;44 #ffffffff #00000000 std menu color pwdheader 31;47 #eeff1010 #20ffffff std menu color hotkey 35;40 #90ffff00 #00000000 std menu color hotsel 35;40 #90000000 #bb9999aa all menu color timeout_msg 35;40 #90ffffff #00000000 none menu color timeout 31;47 #eeff1010 #00000000 none

prompt 0 noescape 1 allowoptions 1 timeout 0

default com32/vesamenu.c32

label main

menu label Back to ^Main Menu
kernel com32/vesamenu.c32
append pxelinux.cfg/default

label ntfs4dos

   menu label ^NTFS4DOS
   kernel images/memdisk
   append initrd=images/ntfstools/ntfs4dos.img

label offline

   menu label ^Offline NT/2000/XP/Vista/7 Password Changer\Windows Password Reset
   menu passwd paint
   kernel images/ntfstools/offlinent/cd100627/vmlinuz
   append initrd=images/ntfstools/offlinent/cd100627/initrd.cgz,images/ntfstools/offlinent/cd100627/scsi.cgz


The Following Applications must be copied Inside the “ ntfstools “ folder: ntfs4dos.img For the Offline Password Reset Application do the Following: Download the Offline NT Password & Registry Editor Latest CD Image Zip File. Unzip the ISO File and using a ISO Tool such as UltraISO, Extract and Copy the Following Files from the ISO File (eg: cd100627.iso) to the “ images/ntfstools/offlinent/ “ folder: initrd.cgz, vmlinuz, scsi.cgz

This is the “ recovery “ Menu Option Example File You also need to create two sub folders inside the “ recovery “ folder called: “ systemrescue and riplinux |---tftpboot | |-----com32 | | | |-----graphics | | | |-----pxelinux.cfg (directory) | | | |-----images | | | |----tools | | | |----memorytest | | | |----ntfstools | | |--------offlinent | | | |----recovery | | |--------systemrescue | | | | | |--------riplinux menu title --== SME Linux, Data Recovery Menu ==-- menu background graphics/main.jpg menu tabmsgrow 22 menu cmdlinerow 22 menu endrow 24

menu color title 1;34;49 #eeffa0a0 #cc553333 std menu color sel 7;37;40 #ff000000 #bb9999aa all menu color border 30;44 #ffffffff #00000000 std menu color pwdheader 31;47 #eeff1010 #20ffffff std menu color hotkey 35;40 #90ffff00 #00000000 std menu color hotsel 35;40 #90000000 #bb9999aa all menu color timeout_msg 35;40 #90ffffff #00000000 none menu color timeout 31;47 #eeff1010 #00000000 none

prompt 0 noescape 1 allowoptions 1 timeout 0

default com32/vesamenu.c32

label main

menu label Back to ^Main Menu
kernel com32/vesamenu.c32
append pxelinux.cfg/default

label systemrescue

menu label ^System Rescue
kernel images/recovery/systemrescue/rescuecd
initrd images/recovery/systemrescue/initram.igz
append setkmap=us netboot=http://192.168.0.10/iso/sysrescue/sysrcd.dat

label riplinux32

menu label ^Rescue Is Possible Linux (32-bit kernel)
kernel images/recovery/riplinux/kernel32
append vga=normal video=640x400 nokeymap initrd=images/recovery/riplinux/rootfs.cgz root=/dev/ram0 rw

label riplinux64

menu label Rescue ^Is Possible Linux (64-bit kernel)
kernel images/recovery/riplinux/kernel64
append vga=normal video=640x400 nokeymap initrd=images/recovery/riplinux/rootfs.cgz root=/dev/ram0 rw

For the System Rescue Application do the Following: Use your SME Server Manager and Create iBay Called “ iso “ Download the latest System Rescue ISO. Using Windows File Manager (or WinSCP or Putty) copy the System Rescue ISO to the “ yoursmeserverip/iso/ “ Folder It should look something like this: YOUR SME SERVER IBAYS (home/e-smith/files/ibays) | |-----your ibay | | | |-----iso (Place your iso’s here) | | | |-----sysrecue.iso | | Using a ISO Tool such as UltraISO, Extract and Copy the Following Files from the systemrescue.iso File to the tftpboot/images/recovery/systemrescue/ Folder: initram.igz, rescuecd Now Using Putty goto the sme linux shell and issue the following command: " mount /home/e-smith/files/ibays/iso/files/sysrescue.iso /home/e-smith/files/ibays/iso/html/sysrescue/ -o loop " You have now mounted the sysrescue.iso and created an html link to the folder. Too Test just use your browser and type in: http://mysmeserverip/iso/ You should see the sysrescue link. Click on it and you should be able to see all the Files and Folders of the System Rescue ISO. ( http://mysmeserverip/iso/sysrescue/ ) More on the System Rescue TFTP PXE Menu label systemrescue

menu label ^System Rescue (This is the Menu)
kernel images/recovery/systemrescue/rescuecd
initrd images/recovery/systemrescue/initram.igz
append setkmap=us netboot=http://192.168.0.10/iso/sysrescue/sysrcd (This is so that the Files can be Loaded from the ISO Html Link you Created as per the above mount statement)

For the RIPLinux Application do the Following: Download the Latest RIPLinux for PXE. Using Windows File Manager (or WinSCP or Putty) copy the System Rescue ISO to the “ yoursmeserverip/iso/systemrescue/ “ Folder Using a ISO Tool such as UltraISO, Extract and Copy the Following Files from the ISO File to the tftpboot/images/recovery/riplinux/ Folder: kernel32, kernel52, rootfs.cgz, inird.gz

That’s all there is to it. If you see the SME PXE menu, the rest is just tweaking. Puppy Linux How To: For the Puppy Linux Application do the Following: Create a folder inside the “ images “ folder called: “ puppy “ |---tftpboot | |-----com32 | | | |-----graphics | | | |-----pxelinux.cfg (directory) | | | |-----images | | | |----tools | | | |----memorytest | | | |----ntfstools | | |--------offlinent | | | |----recovery | | |--------systemrescue | | | | | |--------riplinux | | | |----puppy

This an Example for the Puppy Menu Option. NB: Make sure you place this somewhere in your main menu or another menu label puppy

menu label ^Puppy Linux
kernel images/puppy/vmlinuz
initrd images/puppy/initrd.gz
append boot=live pfix=copy nosmp


Download the Latest Puppy Linux. Now to Prepare the Puppy File do the Following: Found the description here: http://murga-linux.com/puppy/viewtopic.php?search_id=2090301486&t=56580 �1. Create a temporary directory somewhere on your SME Server eg: temp/ 2. Copy the initrd.gz and the lupu-501.sfs you want to embed from the puppy.iso into this temporary directory. 3. Detach this script, “ embed_sfs.sh “ gunzip, and chmod +x the script, in the same temporary directory where you have initrd.gz and lupu-501.sfs (http://murga-linux.com/puppy/viewtopic.php?mode=attach&id=29780) 4. Open terminal (using putty), and then run the script inside the temp directory Code: �./embed_sfs.sh lupu-501.sfs �5. Your original initrd.gz will be kept as initrd.gz.old, and the new initrd.gz will have lupu-501.sfs in it. 6. Now copy the Files to tftpboot/images/puppy/ Folder: initrd.gz, vmlinuz, lupu-501.sfs Using PXE to Install the SME Server Linux CD and Menu Password Protection: For the SME Server Installation Application do the Following: Create a folder inside the “ images “ folder called: “ sme7 “ |---tftpboot | |-----com32 | | | |-----graphics | | | |-----pxelinux.cfg (directory) | | | |-----images | | | |----tools | | | |----memorytest | | | |----ntfstools | | |--------offlinent | | | |----recovery | | |--------systemrescue | | | | | |--------riplinux | | | |----puppy | | | |----sme7


This an Example for the SME Server Install Menu Option. NB: Make sure you place this somewhere in your main menu or another menu label smeinstall

menu label ^SME 7 Install
menu passwd paint
kernel images/sme7/vmlinuz
append initrd=images/sme7/initrd.img


NB: To Password Protect the Menu Option just Place a Password Statement before the Execution of the Application you wish to use eg: menu passwd paint When you choose the SME 7 Install Menu Option you will be asked for a Password Before you can continue. The Password is “paint “ as you have chosen. Be creative and enter a more secure password for your applications. Copy your latest SME Server 7.51 ISO using Windows File Manager (or WinSCP or Putty) to the “ yoursmeserverip/iso/ “ Folder It should look something like this: YOUR SME SERVER IBAYS (home/e-smith/files/ibays) | |-----your ibay | | | |-----iso (Place your iso’s here) | | | |-----sysrecue.iso | | | |-----sme751.iso

Using a ISO Tool such as UltraISO, Extract and Copy the Following Files from the sme751.iso File to the tftpboot/images/sme7/ Folder: initrd.img, init586.img, vmlinuz, vmlz586 Now Using Putty goto the sme linux shell and issue the following command: " mount /home/e-smith/files/ibays/iso/files/sme751.iso /home/e-smith/files/ibays/iso/html/sme/ -o loop " You have now mounted the sme751.iso and created an html link to the folder. Too Test just use your browser and type in: http://mysmeserverip/iso/ You should see the sme link. Click on it and you should be able to see all the Files and Folders of the SME751 ISO. ( http://mysmeserverip/iso/sme/ ) When you choose the SME Installation Menu Option choose HTTP install, and point to your server at the first field to /iso/sme as path. SME should now be able to be installed.

   * Configure your PC / Notebook client bios hardware for PXE boot 


If everything is setup correctly, you should be ready to PXE boot the computer. When you see the Bios Boot Screen of your client PC use the keyboard and Press the “ del ” key or “ F2 “ key or for Dells and some others, hit F12 during boot and choose the integrated NIC. Once you have Cionfigured your PC Bios to boot from the Ethernet Port from you Motherboard / Lan Controller Card (With the Cat5e/UTP Cable Connected) The PC Lan Controller Card should acquire an IP Address from your SME DHCP Server, you should see it grab the pxelinux.cfg/default File and then display the menu you built earlier. Some “ bigger” may not work in pxe and this could be due to the amount of ram required for the application to work correctly. Make sure that the minumum amount of ram onboard is 512MB. I would suggest 1Gig Ram onboard.

   * Adding floppy images 


At this point the only options you get from your menu are to boot from the local drive or see some DMI information from the machine. Interesting and boring at the same time, but the point was to get the basic infrastructure setup. The real reason to set something like this up is so you can feed your machines floppy images without the need for the actual floppies. For us this proves most useful when we’re imaging a room, but opens up a lot of other options if you’re willing to invest the time.

Once you have the basic PXE process in place, it’s extremely easy to start creating and booting ‘virtual’ floppies. All you need to do is create an image of the floppy, similar to making an ISO from a cdrom, and then make an entry for it in your PXE menu.

Again, there’s the Windows way and the Linux way. On Windows, there’s a small program called WinImage (http://www.winimage.com/) that’s terribly handy for creating and modifying disk images. In Linux there are several ways, but the easiest is with the built in ‘dd’ command. Something like…

  1. dd if=/dev/fd0 of=floppy.ima bs=2048

…will copy the floppy to a file called floppy.ima. In WinImage, just insert the floppy and use the menu to capture and create a disk image. You’re certainly free to call the file whatever you want.

Once captured, place the file in the /tftpboot/images folder and add something like the following to your /tftpboot/pxelinux.cfg/default or any other menu file: label vgapaint menu label Bored and want to paint? menu passwd paint kernel images/memdisk append initrd=images/vp386.ima

Boot your client computer to the internal NIC again and wait for the menu. You should see an entry for your new floppy image. Select it and hit enter and your PC will be fed the floppy image through TFTP and boot off it in a virtual A: drive.

The above example, vgapaint, boots a virtual DOS floppy and starts a small DOS based paint program I mostly use for testing. Nothing fancy. You should also notice the line ‘menu passwd paint’ added. When selected, the menu will prompt you for the password contained in the config file before continuing. It helps a bit with security, but don’t rely on it too much as it’s not difficult to get at those passwords (you could just TFTP the menu file itself). Conclusion:

Setting this all up may seem like a frustration, and if you’ve never setup your lab machines for network boot it certainly doesn’t seem like an immediate time saver when you’re running around setting that up. But when it’s all done it’s a terrific platform that can make things easier, save a ton of time, and open up a lot of interesting possibilities. Once fully setup, booting to your imaging software is a snap. And if you partner this with automating the imaging process you can create a zero-touch lab deployment scenario.

References:

   * SYSLINUX: http://syslinux.zytor.com/
   * SYSLINUX Wiki: http://syslinux.zytor.com/wiki/index.php/SYSLINUX
   * WinImage: http://www.winimage.com/
   * WinSCP:  http://winscp.net/eng/index.php
   * PuTTy:  http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
   * Irfanview: http://www.irfanview.net/