Difference between revisions of "WDSLINUX"

From Syslinux Wiki
Jump to: navigation, search
(How To Setup Windows Deployment Services with PXELinux)
(Correctness, accuracy, consistency, clarity and wiki formatting. Additional improvements are still needed.)
 
Line 1: Line 1:
 +
[[Category:Examples]]
 
[[Category:PXELINUX]]
 
[[Category:PXELINUX]]
 
[[Category:WDS]]
 
[[Category:WDS]]
 
+
__NOEDITSECTION__
 
'''Creating a PXE Boot menu for deploying Linux with Windows Deployment Services (WDS)'''
 
'''Creating a PXE Boot menu for deploying Linux with Windows Deployment Services (WDS)'''
  
= Requirements =
+
See also:
* PXELinux - part of syslinux [[PXELINUX]] - [[Download]]
+
* [[RIS]], WDS' predecessor
* Windows Deployment Services already setup (setting up WDS is outside of the scope of this article)
+
* [[pxechn.c32]]
** NOTE: $WDS-ROOT will reference the WDS root folder location in this case D:\RemoteInstall\
+
  
= How To Setup Windows Deployment Services with PXELinux =
+
== Requirements ==
* Download syslinux from http://www.kernel.org/pub/linux/utils/boot/syslinux/
+
<!--
* Extract core\pxelinux.0 com32\menu\vesamenu.c32 and com32\modules\chain.c32 from the syslinux download and put it on your WDS server in $WDS-ROOT\Boot\x86\ and $WDS-ROOT\Boot\x64\(substitute WDS-ROOT for where your WDS root folder is)
+
--><!--
** Depending on the version, you may also need additional modules such as ldlinux.c32, libcom32.c32 and libmenu.c32See also [[Common_Problems#ELF|ELF missing dependencies]]
+
--><!--
* In the $WDS-ROOT\Boot\$ARCH folders Rename pxelinux.0 to pxelinux.com
+
--><!--
* Create a folder named pxelinux.cfg (in the $WDS-ROOT\Boot\x86\ and $WDS-ROOT\Boot\x64\ folder)
+
-->
* In the pxelinux.cfg folder create a text file named default and add the following to it (you can substitute MyMenuBackgroundPicture640x480.jpg for any image you want as your menu background)
+
* [[PXELINUX]]
 +
* Windows Deployment Services already set up. <!--
 +
-->Setting up WDS is outside the scope of this article
 +
** NOTE: <!--
 +
--><code>''$WDS-ROOT''</code> will reference the WDS root folder location <!--
 +
-->(e.g. <tt>D:\RemoteInstall\</tt>)
 +
* <u>In this article</u>, the following directory tree (and files) will be used:
 +
<!--
 +
--><!-- "&#x2193;" means downwards arrow "↓"
 +
--><!-- "&#x21D2;" means rightwards double arrow "⇒"
 +
-->
 +
{|
 +
|
 +
''$WDS-ROOT''\Boot\''$ARCH''\
 +
''        ''          |
 +
''        ''          |
 +
''        ''          &#x2193;
 +
''$WDS-ROOT''\
 +
''        ''|_ Boot\
 +
''        ''      |_ x86\
 +
''        ''      |    |_ pxelinux.0    &#x21D2;  pxelinux.com
 +
''        ''      |    |_ abortpxe.com  &#x21D2;  abortpxe.0
 +
''        ''      |    |_ pxeboot.n12  &#x21D2;  pxeboot.0
 +
''        ''      |    |_ *.c32
 +
''        ''      |    |_ ...
 +
  ''        ''      |     |_ Linux\
 +
''        ''      |    |_ pxelinux.cfg\
 +
''        ''      |                    |_ default
 +
''        ''      |
 +
''        ''      |_ x64\
 +
''        ''            |_ pxelinux.0   &#x21D2;  pxelinux.com
 +
''        ''            |_ abortpxe.com  &#x21D2;  abortpxe.0
 +
''        ''            |_ pxeboot.n12  &#x21D2;  pxeboot.0
 +
''        ''            |_ *.c32
 +
''        ''            |_ ...
 +
''        ''            |_ Linux\
 +
''        ''            |_ pxelinux.cfg\
 +
''        ''                            |_ default
 +
|}
  
 +
== How To Setup Windows Deployment Services with PXELinux ==
 +
<!--
 +
--><!--
 +
--><!--
 +
--><!--
 +
-->
 +
<ul>
 +
<li> [[Download]] Syslinux </li>
 +
<li> Extract
 +
<ul>
 +
<li> core\pxelinux.0 </li>
 +
<li> com32\menu\vesamenu.c32 </li>
 +
<li> com32\modules\chain.c32 </li>
 +
<li> {{V|5.00+}} and the necessary [[library modules]]</li>
 +
</ul>
 +
from the Syslinux download and put them on your WDS server in (respective)
 +
<code>''$WDS-ROOT''\Boot\''$ARCH''\</code> folders
 +
<ul>
 +
<li>
 +
substitute <code>''WDS-ROOT''</code> for where your WDS root folder is
 +
</li>
 +
<li>
 +
substitute <code>''$ARCH''</code> with respective
 +
<code>x86</code> and/or
 +
<code>x64</code> folders (architectures)
 +
</li>
 +
<li>
 +
Depending on the version,
 +
you may also need additional modules such as
 +
ldlinux.c32, libcom32.c32 and libmenu.c32.
 +
See also [[Common_Problems#ELF|ELF missing dependencies]]
 +
</li>
 +
</li>
 +
</ul>
 +
<li>
 +
In the <code>''$WDS-ROOT''\Boot\''$ARCH''\</code> folders,
 +
rename <code>pxelinux.0</code> to <code>pxelinux.com</code>
 +
</li>
 +
<li>
 +
Create a folder named <code>pxelinux.cfg</code>
 +
(in the
 +
<code>''$WDS-ROOT''\Boot\''$ARCH''\</code> folders)
 +
</li>
 +
<li>
 +
In the <code>pxelinux.cfg</code> folder,
 +
create a text file named <code>default</code> and
 +
add the following to it
 +
(you can substitute
 +
''MyMenuBackgroundPicture640x480.jpg''
 +
for any image you want as your menu background)
 +
{|
 +
|
 
<pre>
 
<pre>
 
  DEFAULT      vesamenu.c32
 
  DEFAULT      vesamenu.c32
Line 28: Line 118:
 
  MENU TABMSGROW 21
 
  MENU TABMSGROW 21
 
  MENU TIMEOUTROW 26
 
  MENU TIMEOUTROW 26
  MENU COLOR BORDER 30;44 #20ffffff #00000000 none
+
  MENU COLOR BORDER 30;44 #20ffffff #00000000 none
  MENU COLOR SCROLLBAR 30;44 #20ffffff #00000000 none
+
  MENU COLOR SCROLLBAR 30;44 #20ffffff #00000000 none
  MENU COLOR TITLE 0 #ffffffff #00000000 none
+
  MENU COLOR TITLE 0 #ffffffff #00000000 none
  MENU COLOR SEL   30;47 #40000000 #20ffffff
+
  MENU COLOR SEL   30;47 #40000000 #20ffffff
 
  MENU BACKGROUND MyMenuBackgroundPicture640x480.jpg
 
  MENU BACKGROUND MyMenuBackgroundPicture640x480.jpg
 
  MENU TITLE PXE Boot Menu
 
  MENU TITLE PXE Boot Menu
  #---
+
   
 
  LABEL wds
 
  LABEL wds
 
  MENU LABEL Windows Deployment Services
 
  MENU LABEL Windows Deployment Services
 
  KERNEL pxeboot.0
 
  KERNEL pxeboot.0
  #---
+
   
  LABEL Abort
+
  LABEL abort
 
  MENU LABEL AbortPXE
 
  MENU LABEL AbortPXE
  Kernel abortpxe.0
+
  KERNEL abortpxe.0
  #---
+
   
 
  LABEL local  
 
  LABEL local  
 
  MENU DEFAULT
 
  MENU DEFAULT
 
  MENU LABEL Boot from Harddisk
 
  MENU LABEL Boot from Harddisk
 
  LOCALBOOT 0
 
  LOCALBOOT 0
  Type 0x80
+
  # Type 0x80
 
</pre>
 
</pre>
 +
|}
 +
</li>
 +
<li>
 +
Make a copy of <code>pxeboot.n12</code> and name it <code>pxeboot.0</code>
 +
</li>
 +
<li>
 +
Make a copy of <code>abortpxe.com</code> and rename it <code>abortpxe.0</code>
 +
</li>
 +
<li>
 +
Create a folder named <code>Linux</code>
 +
(in the <code>''$WDS-ROOT''\Boot\''$ARCH''\</code> folders)
 +
</li>
 +
<ul>
 +
<li> Open the Windows Deployment Services Console, </li>
 +
<li> Right Click on your Server and Select Properties, </li>
 +
<li>
 +
From the Boot Tab, change the default boot program for your architecute
 +
(x86 and x64 as well) to
 +
<code>''$WDS-ROOT''\Boot\x86\pxelinux.com</code> and
 +
<code>''$WDS-ROOT''\Boot\x64\pxelinux.com</code> respectively
 +
</li>
 +
<ul>
 +
<li>
 +
'''NOTE:''' In the WDS included in Windows Server 2008 R2, the UI has changed
 +
and you have to use the command line in order to set the default boot program.
 +
Thus, to change the boot program to <code>pxelinux.com</code>,
 +
the <code>wdsutil</code> command line tool has to be used
 +
(for x86 and/or x64, respectively):
 +
{|
 +
|
 +
<pre>
 +
wdsutil /set-server /bootprogram:boot\x86\pxelinux.com /architecture:x86
 +
wdsutil /set-server /N12bootprogram:boot\x86\pxelinux.com /architecture:x86
 +
</pre>
 +
<pre>
 +
wdsutil /set-server /bootprogram:boot\x64\pxelinux.com /architecture:x64
 +
wdsutil /set-server /N12bootprogram:boot\x64\pxelinux.com /architecture:x64
 +
</pre>
 +
|}
 +
</li>
 +
</ul>
 +
<li> Now when you pxe boot a machine, you will get your custom boot menu. </li>
 +
</ul>
  
* Make a copy of pxeboot.n12 and name it pxeboot.0
+
== Adding Linux images to boot/install ==
* make a copy from abortpxe.com and rename it to abortpxe.0
+
* Create a folder named Linux (in the $WDS-ROOT\Boot\x86\ and $WDS-ROOT\Boot\x64\ folder)
+
** Open the Windows Deployment Services Console,
+
** Right Click on your Server and Select Properties,
+
** From the Boot Tab change the default boot program for your architecute (x86 and x64 as well) to Boot\x86\pxelinux.com and Boot\x64\pxelinux.com respectively
+
** '''NOTE:''' In the WDS included in Windows Server 2008 R2 the UI has changed and you have to use the command line to set the the default boot program.
+
** Thus to change the boot program to pxelinux.com, the wdsutil command line tool has to be used: (do this also for x64 if you have x64 clients also)
+
*** wdsutil /set-server /bootprogram:boot\x86\pxelinux.com /architecture:x86
+
*** wdsutil /set-server /N12bootprogram:boot\x86\pxelinux.com /architecture:x86
+
* Now when you pxe boot a machine you will get your custom boot menu
+
 
+
= Adding Linux images to boot/install =
+
  
== Debian and Ubuntu ==
+
=== Debian and Ubuntu ===
 +
<!--
 +
--><!--
 +
--><!--
 +
--><!--
 +
-->
 
* Download the netboot files (initrd.gz and linux) from a debian/ubuntu mirror
 
* Download the netboot files (initrd.gz and linux) from a debian/ubuntu mirror
 
** Debian x86 files
 
** Debian x86 files
Line 71: Line 197:
 
*** http://ftp.nl.debian.org/debian/dists/stable/main/installer-amd64/current/images/netboot/debian-installer/amd64/
 
*** http://ftp.nl.debian.org/debian/dists/stable/main/installer-amd64/current/images/netboot/debian-installer/amd64/
 
** Ubuntu x86 files
 
** Ubuntu x86 files
*** http://ubuntu.virginmedia.com/archive/dists/karmic/main/installer-i386/current/images/netboot/ubuntu-installer/i386/
+
*** http://archive.ubuntu.com/ubuntu/dists/devel/main/installer-i386/current/images/netboot/ubuntu-installer/i386/
** Ubuntu amd64 files
+
<!--
*** http://ubuntu.virginmedia.com/archive/dists/karmic/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/
+
--><!-- ** Ubuntu amd64 files
* Create a folder on your WDS server under $WDS-ROOT\Boot\arch\Linux called Debian (or Ubuntu)
+
--><!-- *** http://ubuntu.virginmedia.com/archive/dists/karmic/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/
* Copy the downloaded netboot files initrd.gz and linux to the new folder  
+
-->
* Create a menu entry at the end of the $WDS-ROOT\Boot\arch\pxelinux.cfg\default file (boot menu items for debian and ubuntu can be found in the download site under boot-screens in the text.cfg file)
+
* Create a folder on your WDS server under <!--
 +
--><code>''$WDS-ROOT''\Boot\''$ARCH''\Linux\</code> <!--
 +
-->called <tt>Debian</tt> (or <tt>Debian5</tt>, or <tt>Ubuntu</tt>)
 +
{|
 +
|
 +
''$WDS-ROOT''\Boot\''$ARCH''\
 +
''        ''      ''    ''|_ Linux\
 +
''        ''      ''    ''        |_ Debian5\
 +
''        ''      ''    ''        |_ Ubuntu\
 +
|}
 +
* Copy the downloaded netboot files <tt>initrd.gz</tt> and <tt>linux</tt> to the new folder  
 +
* Create a menu entry at the end of the <!--
 +
--><code>''$WDS-ROOT''\Boot\''$ARCH''\pxelinux.cfg\default</code> file  
 +
** (boot menu items for debian and ubuntu can be found in the download site <!--
 +
-->under "<code>boot-screens</code>" in the "<tt>text.cfg</tt>" file)
 +
{|
 +
|
 
<pre>
 
<pre>
  label debian5-0expert
+
  LABEL debian5-0expert
  menu label ^Debian 5-0 Expert install:
+
  MENU LABEL ^Debian 5-0 Expert install:
  kernel /Linux/Debian5.0/linux
+
  KERNEL Linux/Debian5/linux
  append priority=low vga=normal initrd=/Linux/Debian5.0/initrd.gz --  
+
  APPEND priority=low vga=normal initrd=Linux/Debian5/initrd.gz --  
  #--
+
   
  label debian5-0rescue
+
  LABEL debian5-0rescue
  menu label ^Debian 5-0 Rescue mode
+
  MENU LABEL ^Debian 5-0 Rescue mode
  kernel /Linux/Debian5.0/linux
+
  KERNEL Linux/Debian5/linux
  append vga=normal initrd=/Linux/Debian5.0/initrd.gz rescue/enable=true -- quiet  
+
  APPEND vga=normal initrd=Linux/Debian5/initrd.gz rescue/enable=true -- quiet  
  #--
+
   
  label debian5-0auto
+
  LABEL debian5-0auto
  menu label ^Debian 5-0 Automated install
+
  MENU LABEL ^Debian 5-0 Automated install
  kernel /Linux/Debian5.0/linux
+
  KERNEL Linux/Debian5/linux
  append auto=true priority=critical vga=normal initrd=/Linux/Debian5.0/initrd.gz -- quiet  
+
  APPEND auto=true priority=critical vga=normal initrd=Linux/Debian5/initrd.gz -- quiet  
  #--
+
   
  label debian5-0amd64expert
+
  LABEL debian5-0amd64expert
  menu label ^Debian 5-0 amd64 Expert install
+
  MENU LABEL ^Debian 5-0 amd64 Expert install
  kernel /Linux/Debian5.0/linux-amd64
+
  KERNEL Linux/Debian5/linux-amd64
  append priority=low vga=normal initrd=/Linux/Debian5.0/initrd-amd64.gz --  
+
  APPEND priority=low vga=normal initrd=Linux/Debian5/initrd-amd64.gz --  
  #--
+
   
  label debian5-0amd64rescue
+
  LABEL debian5-0amd64rescue
  menu label ^Debian 5-0 amd64 Rescue mode
+
  MENU LABEL ^Debian 5-0 amd64 Rescue mode
  kernel /Linux/Debian5.0/linux-amd64
+
  KERNEL Linux/Debian5/linux-amd64
  append vga=normal initrd=/Linux/Debian5.0/initrd-amd64.gz rescue/enable=true -- quiet  
+
  APPEND vga=normal initrd=Linux/Debian5/initrd-amd64.gz rescue/enable=true -- quiet  
  #--
+
   
  label debian5-0amd64auto
+
  LABEL debian5-0amd64auto
  menu label ^Debian 5-0 amd64 Automated install
+
  MENU LABEL ^Debian 5-0 amd64 Automated install
  kernel /Linux/Debian5.0/linux-amd64
+
  KERNEL Linux/Debian5/linux-amd64
  append auto=true priority=critical vga=normal initrd=/Linux/Debian5.0/initrd-amd64.gz -- quiet  
+
  APPEND auto=true priority=critical vga=normal initrd=Linux/Debian5/initrd-amd64.gz -- quiet  
  #---
+
   
  label ubuntu-expert
+
  LABEL ubuntu-expert
  menu label ^Ubuntu Expert install
+
  MENU LABEL ^Ubuntu Expert install
  kernel /linux/ubuntu/linux
+
  KERNEL Linux/Ubuntu/linux
  append priority=low vga=normal initrd=/linux/ubuntu/initrd.gz --  
+
  APPEND priority=low vga=normal initrd=Linux/Ubuntu/initrd.gz --  
  #--
+
   
  label ubuntu-cli-expert
+
  LABEL ubuntu-cli-expert
  menu label Ubuntu Command-line expert install
+
  MENU LABEL ^Ubuntu Command-line expert install
  kernel /linux/ubuntu/linux
+
  KERNEL Linux/Ubuntu/linux
  append tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false priority=low vga=normal initrd=/linux/ubuntu/initrd.gz --  
+
  APPEND tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false priority=low vga=normal initrd=Linux/Ubuntu/initrd.gz --  
  #--
+
   
  label ubuntu-rescue
+
  LABEL ubuntu-rescue
  menu label Ubuntu Rescue mode
+
  MENU LABEL ^Ubuntu Rescue mode
  kernel /linux/ubuntu/linux
+
  KERNEL Linux/Ubuntu/linux
  append vga=normal initrd=/linux/ubuntu/initrd.gz rescue/enable=true -- quiet  
+
  APPEND vga=normal initrd=Linux/Ubuntu/initrd.gz rescue/enable=true -- quiet  
  #--
+
   
  label ubuntu-expert-amd64
+
  LABEL ubuntu-expert-amd64
  menu label ^Ubuntu-amd64 Expert install
+
  MENU LABEL ^Ubuntu-amd64 Expert install
  kernel /linux/ubuntu/linux-amd64
+
  KERNEL Linux/Ubuntu/linux-amd64
  append priority=low vga=normal initrd=/linux/ubuntu/initrd-amd64.gz --  
+
  APPEND priority=low vga=normal initrd=Linux/Ubuntu/initrd-amd64.gz --  
  #--
+
   
  label ubuntu-amd64-cli-expert
+
  LABEL ubuntu-amd64-cli-expert
  menu label Ubuntu-amd64 Command-line expert install
+
  MENU LABEL ^Ubuntu-amd64 Command-line expert install
  kernel /linux/ubuntu/linux-amd64
+
  KERNEL Linux/Ubuntu/linux-amd64
  append tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false priority=low vga=normal initrd=/linux/ubuntu/initrd-amd64.gz --  
+
  APPEND tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false priority=low vga=normal initrd=Linux/Ubuntu/initrd-amd64.gz --  
  #--
+
   
  label ubuntu-amd64-rescue
+
  LABEL ubuntu-amd64-rescue
  menu label Ubuntu-amd64 Rescue mode
+
  MENU LABEL ^Ubuntu-amd64 Rescue mode
  kernel /linux/ubuntu/linux-amd64
+
  KERNEL Linux/Ubuntu/linux-amd64
  append vga=normal initrd=/linux/ubuntu/initrd-amd64.gz rescue/enable=true -- quiet
+
  APPEND vga=normal initrd=Linux/Ubuntu/initrd-amd64.gz rescue/enable=true -- quiet
 
</pre>
 
</pre>
 +
|}
  
== Gentoo ==
+
=== Gentoo ===
* Download the latest gentoo minimal install CD from a mirror
+
<!--
* Extract the files isolinux/gentoo isolinux/gentoo.igz image.squashfs from the iso to a temporary folder
+
--><!--
* Make a folder on the WDS server under $WDS-ROOT\Boot\arch\Linux called gentoo
+
--><!--
* Copy the extracted gentoo file to the $WDS-ROOT\Boot\arch\Linux\gentoo folder on the WDS server
+
--><!--
* Copy the extracted gentoo.igz and image.squashfs files to a temporary location on a linux machine (i.e. /root/tmp)
+
-->
* In the /root/tmp location create a folder called gentoo and change into this directory
+
<ul>
**    mkdir /root/tmp/gentoo
+
<li> Download the latest gentoo minimal install CD from a mirror </li>
**    cd /root/tmp/gentoo
+
<li> Extract the files:
* Type the following command and press enter (this extracts all the files from the gentoo.igz file)
+
<ul>
**    gunzip -c ../gentoo.igz | cpio -idv
+
<li> <tt>isolinux/gentoo</tt> </li>
* Make the follwing folders (in the extracted folder)
+
<li> <tt>isolinux/gentoo.igz</tt> </li>
**    mkdir mnt
+
<li> <tt>image.squashfs</tt> </li>
**    mkdir mnt/cdrom
+
</ul>
* Copy the image.squashfs  to the new created mnt/cdrom folder
+
from the iso to a temporary folder  
**    cp ../image.squashfs mnt/cdrom
+
</li>
* Make a backup copy of the init file
+
<li>
**    cp init init.orig
+
Make a folder on the WDS server under  
* Edit the init file with the following modifications 
+
<code>''$WDS-ROOT''\Boot\''$ARCH''\Linux\</code>
 +
called <tt>Gentoo</tt>
 +
{|
 +
|
 +
''$WDS-ROOT''\Boot\''$ARCH''\
 +
''        ''      ''    ''|_ Linux\
 +
''        ''      ''    ''        |_ Gentoo\
 +
|}
 +
</li>
 +
<li>
 +
Copy the extracted <tt>gentoo</tt> file to the  
 +
<code>''$WDS-ROOT''\Boot\''$ARCH''\Linux\Gentoo\</code>
 +
folder on the WDS server  
 +
</li>
 +
<li>
 +
Copy the extracted <tt>gentoo.igz</tt> and <tt>image.squashfs</tt> files  
 +
to a temporary location on a linux machine (e.g. "<tt>/root/tmp/</tt>")  
 +
</li>
 +
<li>
 +
In the "<tt>/root/tmp/</tt>" location,
 +
create a folder called <tt>Gentoo</tt> and change into this directory
 +
{|
 +
|
 
<pre>
 
<pre>
    Change the line:
+
mkdir /root/tmp/Gentoo
      -- if [ "${REAL_ROOT}" != "/dev/nfs" ] && [ "${LOOPTYPE}" != "sgimips" ]
+
  cd /root/tmp/Gentoo
    To:
+
      ++ if [ "${REAL_ROOT}" != "/dev/nfs" ] && [ "${LOOPTYPE}" != "sgimips" ] && [ "${REAL_ROOT}" != "/" ]
+
    Change the line (under # Check for a block device or /dev/nfs):
+
      -- elif [ -b "${REAL_ROOT}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ]
+
    To:
+
      ++ elif [ -b "${REAL_ROOT}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ] || [ "${REAL_ROOT}" = "/" ]
+
    Remove the line:
+
      -- cache_cd_contents
+
    Change the line:
+
      -- mount -t squashfs -o loop,ro ${NEW_ROOT}/mnt/cdrom/${LOOPEXT}${LOOP} ${NEW_ROOT}/mnt/livecd
+
    To:
+
      ++ mount -t squashfs -o loop,ro /mnt/cdrom/${LOOPEXT}${LOOP} ${NEW_ROOT}/mnt/livecd   
+
 
</pre>
 
</pre>
* Compress everything back into a file again by this typing the following and press enter
+
|}
**    find . -print | cpio -o -H newc |gzip -9 -c - > ../gentoo.igz.new  
+
</li>
* Copy the new gentoo.igz.new to the $WDS-ROOT\Boot\arch\Linux\gentoo folder on the WDS server and name it gentoo.igz
+
<li> Extract all the files from the <tt>gentoo.igz</tt> file
* Create a menu entry at the end of the $WDS-ROOT\Boot\arch\pxelinux.cfg\default file  
+
{|
 +
|
 +
<pre>
 +
gunzip -c ../gentoo.igz | cpio -idv
 +
</pre>
 +
|}
 +
</li>
 +
<li> Make the following folders (in the extracted folder)
 +
{|
 +
|
 +
<pre>
 +
mkdir mnt
 +
mkdir mnt/cdrom
 +
</pre>
 +
|}
 +
</li>
 +
<li>
 +
Copy the <tt>image.squashfs</tt> file to the newly-created <tt>mnt/cdrom/</tt> folder
 +
{|
 +
|
 +
<pre>
 +
cp ../image.squashfs mnt/cdrom
 +
</pre>
 +
|}
 +
</li>
 +
<li> Make a backup copy of the <tt>init</tt> file
 +
{|
 +
|
 +
<pre>
 +
cp init init.orig
 +
</pre>
 +
|}
 +
</li>
 +
<li> Edit the <tt>init</tt> file with the following modifications:
 +
{|
 +
|
 +
<pre>
 +
Change the line:
 +
  -- if [ "${REAL_ROOT}" != "/dev/nfs" ] && [ "${LOOPTYPE}" != "sgimips" ]
 +
To:
 +
  ++ if [ "${REAL_ROOT}" != "/dev/nfs" ] && [ "${LOOPTYPE}" != "sgimips" ] && [ "${REAL_ROOT}" != "/" ]
 +
 +
Change the line (under  # Check for a block device or /dev/nfs):
 +
  -- elif [ -b "${REAL_ROOT}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ]
 +
To:
 +
  ++ elif [ -b "${REAL_ROOT}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ] || [ "${REAL_ROOT}" = "/" ]
 +
 +
Remove the line:
 +
  -- cache_cd_contents
 +
 +
Change the line:
 +
  -- mount -t squashfs -o loop,ro ${NEW_ROOT}/mnt/cdrom/${LOOPEXT}${LOOP} ${NEW_ROOT}/mnt/livecd
 +
To:
 +
  ++ mount -t squashfs -o loop,ro /mnt/cdrom/${LOOPEXT}${LOOP} ${NEW_ROOT}/mnt/livecd   
 +
</pre>
 +
|}
 +
</li>
 +
<li>
 +
Compress everything back into a file again by typing the following and press enter:
 +
{|
 +
|
 +
<pre>
 +
find . -print | cpio -o -H newc |gzip -9 -c - > ../gentoo.igz.new
 +
</pre>
 +
|}
 +
</li>
 +
<li>
 +
Copy the new <tt>gentoo.igz.new</tt> to the  
 +
<code>''$WDS-ROOT''\Boot\''$ARCH''\Linux\Gentoo\</code>
 +
folder on the WDS server and name it <tt>gentoo.igz</tt>
 +
</li>
 +
<li>
 +
Create a menu entry at the end of the  
 +
<code>''$WDS-ROOT''\Boot\''$ARCH''\pxelinux.cfg\default</code> file  
 +
{|
 +
|
 
<pre>
 
<pre>
 
  LABEL gentoo2008-x86
 
  LABEL gentoo2008-x86
 
  MENU LABEL Deploy Gentoo 32 bit
 
  MENU LABEL Deploy Gentoo 32 bit
  KERNEL /linux/gentoo/gentoo
+
  KERNEL Linux/Gentoo/gentoo
  append root=/dev/ram0 init=/linuxrc dokeymap looptype=squashfs loop=/image.squashfs cdroot initrd=/linux/gentoo/gentoo.igz real_root=/ vga=791
+
  APPEND root=/dev/ram0 init=/linuxrc dokeymap looptype=squashfs loop=/image.squashfs cdroot initrd=Linux/Gentoo/gentoo.igz real_root=/ vga=791
  #--
+
   
 
  LABEL gentoo2008-x64
 
  LABEL gentoo2008-x64
 
  MENU LABEL Deploy Gentoo amd64
 
  MENU LABEL Deploy Gentoo amd64
  KERNEL /linux/gentoo/gentoo-amd64
+
  KERNEL Linux/Gentoo/gentoo-amd64
  append root=/dev/ram0 init=/linuxrc dokeymap looptype=squashfs loop=/image.squashfs cdroot initrd=/linux/gentoo/gentoo-amd64.igz real_root=/ vga=791
+
  APPEND root=/dev/ram0 init=/linuxrc dokeymap looptype=squashfs loop=/image.squashfs cdroot initrd=Linux/Gentoo/gentoo-amd64.igz real_root=/ vga=791
 
</pre>
 
</pre>
 +
|}
 +
</li>
  
== GParted ==
+
=== GParted ===
* Download GParted live zip file (You have to use 0.3.7-2 or later, network drivers are only included after that), and unzip all the files in a temp dir
+
<!--
* Copy necessary boot files (vmlinuz1 and initrd1.img) to a new folder on your WDS server ($WDS-ROOT\Boot\arch\Linux\gparted)
+
--><!--
* Copy /tmp/gparted/live/filesystem.squashfs to your http web server. (If on IIS create a new virtual directory and set the mime type for .* extension to text/plain)
+
--><!--
* Edit your PXE config file /Boot/arch/pxelinux.cfg/default, and append the following:
+
--><!--
 +
-->
 +
* Download GParted live zip file <!--
 +
-->(You have to use 0.3.7-2 or later, <!--
 +
-->network drivers are only included after that), <!--
 +
-->and unzip all the files in a temp dir
 +
* Copy necessary boot files (<tt>vmlinuz1</tt> and <tt>initrd1.img</tt>) <!--
 +
-->to a new folder on your WDS server <!--
 +
-->(<code>''$WDS-ROOT''\Boot\''$ARCH''\Linux\Gparted\</code>)
 +
{|
 +
|
 +
''$WDS-ROOT''\Boot\''$ARCH''\
 +
''        ''      ''    ''|_ Linux\
 +
''        ''      ''    ''        |_ Gparted\
 +
|}
 +
* Copy <tt>/tmp/gparted/live/filesystem.squashfs</tt> to your http web server. <!--
 +
-->(If on IIS, <!--
 +
-->create a new virtual directory and <!--
 +
-->set the mime type for "<tt>.*</tt>" extension to <tt>text/plain</tt>)
 +
* Edit your PXE config file <!--
 +
--><code>''$WDS-ROOT''\Boot\''$ARCH''\pxelinux.cfg\default</code>, <!--
 +
-->and append the following:
 +
{|
 +
|
 
<pre>
 
<pre>
  label GParted Live
+
  LABEL GParted Live
 
  MENU LABEL GParted Live
 
  MENU LABEL GParted Live
  kernel \Linux\gparted\vmlinuz1
+
  KERNEL Linux/Gparted/vmlinuz1
  append initrd=\Linux\gparted\initrd1.img boot=live union=aufs noswap noprompt vga=788 fetch=http://$webserverIP/gparted/filesystem.squashfs
+
  APPEND initrd=Linux/Gparted/initrd1.img boot=live union=aufs noswap noprompt vga=788 fetch=http://$webserverIP/gparted/filesystem.squashfs
  ###//NOTE// Replace $webserverIP with your IP address of http server.
+
  # //NOTE// Replace $webserverIP with your IP address of http server.
 
</pre>
 
</pre>
 +
|}
  
As of GParted-live version 0.3.8-3, fetch=tftp is supported. Just copy the <tt>filesystem.squashfs</tt> file into the same folder as <tt>vmlinuz1</tt> and <tt>initrd1.img</tt> (in the above example it would be <tt>\Linux\gparted</tt>. The above <tt>append</tt> can then be replaced with:
+
As of GParted-live version 0.3.8-3, <code>fetch=tftp</code> is supported.  
 +
Just copy the <tt>filesystem.squashfs</tt> file into the same folder as  
 +
<tt>vmlinuz1</tt> and <tt>initrd1.img</tt>  
 +
(in the above example, it would be <tt>Linux\Gparted\</tt>).  
 +
The above <code>APPEND</code> can then be replaced with:  
 +
{|
 +
|
 
<pre>
 
<pre>
append initrd=\Linux\gparted\initrd1.img boot=live union=aufs noswap noprompt vga=788 fetch=tftp://$tftpserverIP/linux/gparted/filesystem.squashfs
+
APPEND initrd=Linux/Gparted/initrd1.img boot=live union=aufs noswap noprompt vga=788 fetch=tftp://$tftpserverIP/gparted/filesystem.squashfs
# //NOTE// Replace $tftpserverIP with the IP address of your tftp server.
+
# //NOTE// Replace $tftpserverIP with the IP address of your tftp server.
 
</pre>
 
</pre>
 +
|}
  
== F-Secure Antivirus Rescue CD ==
+
See also [[linux.c32]].
* Download the latest f-secure Rescue CD from http://www.f-secure.com/en_EMEA/security/tools/rescue-cd/
+
 
* Extract the kernel from the ISO image (boot/isolinux/fsecure/linux) to a new folder on your WDS server ($WDS-ROOT\Boot\arch\Linux\fsecure)
+
=== F-Secure Antivirus Rescue CD ===
* Extract the boot/isolinux/fsecure/minirt.gz file and whole KNOPPIX folder from the ISO
+
<!--
* Copy the extracted minirt.gz file and KNOPPIX folder to a temporary location on a linux machine (i.e. /root/tmp)
+
--><!--
* In the /root/tmp location create a folder called fsecure and change into this directory
+
--><!--
**    mkdir /root/tmp/fsecure
+
--><!--
**    cd /root/tmp/fsecure
+
-->
* Type the following command and press enter (this extracts all the files from the minirt.gz file)
+
* Download the latest f-secure Rescue CD from <!--
**    gunzip -c ../minirt.gz | cpio -idv
+
--> http://www.f-secure.com/en_EMEA/security/tools/rescue-cd/
 +
* Extract the kernel from the ISO image (boot/isolinux/fsecure/linux) <!--
 +
-->to a new folder on your WDS server <!--
 +
-->(<code>''$WDS-ROOT''\Boot\''$ARCH''\Linux\Fsecure\</code>)
 +
{|
 +
|
 +
''$WDS-ROOT''\Boot\''$ARCH''\
 +
''        ''      ''    ''|_ Linux\
 +
''        ''      ''    ''        |_ Fsecure\
 +
|}
 +
* Extract the boot/isolinux/fsecure/minirt.gz file and <!--
 +
-->whole KNOPPIX folder from the ISO
 +
* Copy the extracted <tt>minirt.gz</tt> file and <!--
 +
-->KNOPPIX folder to a temporary location on a linux machine (e.g. /root/tmp/)
 +
* In the <tt>/root/tmp/</tt> location, <!--
 +
-->create a folder called <tt>fsecure</tt> and change into this directory
 +
{|
 +
|
 +
<pre>
 +
mkdir /root/tmp/fsecure
 +
cd /root/tmp/fsecure
 +
</pre>
 +
|}
 +
* Extract all the files from the <tt>minirt.gz</tt> file
 +
{|
 +
|
 +
<pre>
 +
gunzip -c ../minirt.gz | cpio -idv
 +
</pre>
 +
|}
 
* Copy the KNOPPIX folder extracted from the ISO to the mnt-system folder
 
* Copy the KNOPPIX folder extracted from the ISO to the mnt-system folder
** cp -r ../KNOPPIX mnt-system
+
{|
* Make a backup copy of the init file
+
|
** cp init init.orig
+
* Edit the init file with the following modifications 
+
 
<pre>
 
<pre>
find the findknoppix devices section and delete everything from it
+
  cp -r ../KNOPPIX mnt-system
 
+
findknoppix(){
+
-- local dev
+
-- for dev in "$@"; do
+
-- [ -b "$dev" ] || continue
+
--  echo -n -e "\r${CRE}${BLUE}${SEARCHINGFOR} $DISTRO in: ${MAGENTA}$dev${NORMAL}  "
+
--  trymount "$dev" /mnt-system >/dev/null 2>&1 || continue
+
--  if [ -r /mnt-system/"$knoppix_dir"/KNOPPIX ] ; then
+
--      # We must have also fsecure structure present else we might try to mount something wrong.
+
--      if [ -d /mnt-system/fsecure/rescuecd ] || [ -d /mnt-system/boot/isolinux/fsecure ] ; then
+
--        echo -e "\r${CRE}${GREEN}$DISTRO ${FOUNDAT}: ${MAGENTA}$dev${NORMAL}      "
+
--        return 0
+
--      fi
+
--  fi
+
--  umount /mnt-system
+
-- done
+
-- return 1
+
 
+
Add return 0 to the findknoppix devices section
+
 
+
++ return 0
+
 
+
}
+
 
</pre>
 
</pre>
* Compress everything back into a file again by this typing the following and press enter
+
|}
** find . -print | cpio -o -H newc |gzip -9 -c - > ../minirt.gz.new
+
* Make a backup copy of the <tt>init</tt> file
* Copy the new minirt.gz.new to the $WDS-ROOT\Boot\arch\Linux\fsecure folder on the WDS server and name it minirt.gz
+
{|
* Create a menu entry at the end of the $WDS-ROOT\Boot\arch\pxelinux.cfg\default file
+
|
 
<pre>
 
<pre>
  LABEL fsecurerescuecd
+
cp init init.orig
  MENU LABEL F-Secure AV Rescue CD
+
  KERNEL Linux/fsecure/linux
+
  APPEND ramdisk_size=100000 lang=en vt.default_utf8=0 apm=power-off vga=0x311 initrd=Linux/fsecure/minirt.gz nomce quiet loglevel=1 nolapic_timer nosound console=tty10 video=noblank
+
 
</pre>
 
</pre>
== Knoppix ==
+
|}
See http://pxe.dev.aboveaverageurl.com/index.php/PXE_Booting/Knoppix for details
+
* Edit the <tt>init</tt> file with the following modifications 
 +
** find the findknoppix devices section and delete everything from it
 +
{|
 +
|
 +
<pre>
 +
findknoppix(){
 +
-- local dev
 +
-- for dev in "$@"; do
 +
--  [ -b "$dev" ] || continue
 +
--  echo -n -e "\r${CRE}${BLUE}${SEARCHINGFOR} $DISTRO in: ${MAGENTA}$dev${NORMAL}  "
 +
--  trymount "$dev" /mnt-system >/dev/null 2>&1 || continue
 +
--  if [ -r /mnt-system/"$knoppix_dir"/KNOPPIX ] ; then
 +
--      # We must have also fsecure structure present else we might try to mount something wrong.
 +
--      if [ -d /mnt-system/fsecure/rescuecd ] || [ -d /mnt-system/boot/isolinux/fsecure ] ; then
 +
--        echo -e "\r${CRE}${GREEN}$DISTRO ${FOUNDAT}: ${MAGENTA}$dev${NORMAL}      "
 +
--        return 0
 +
--      fi
 +
--  fi
 +
--  umount /mnt-system
 +
-- done
 +
-- return 1
 +
</pre>
 +
|}
 +
:* Add return 0 to the findknoppix devices section
 +
{|
 +
|
 +
<pre>
 +
findknoppix(){
 +
++ return 0
 +
}
 +
</pre>
 +
|}
 +
* Compress everything back into a file again
 +
{|
 +
|
 +
<pre>
 +
find . -print | cpio -o -H newc |gzip -9 -c - > ../minirt.gz.new
 +
</pre>
 +
|}
 +
* Copy the new <tt>minirt.gz.new</tt> file to the <!--
 +
--><code>''$WDS-ROOT''\Boot\''$ARCH''\Linux\Fsecure\</code> <!--
 +
-->folder on the WDS server and name it <tt>minirt.gz</tt>
 +
* Create a menu entry at the end of the <!--
 +
--><code>''$WDS-ROOT''\Boot\''$ARCH''\pxelinux.cfg\default</code> file
 +
{|
 +
|
 +
<pre>
 +
LABEL fsecurerescuecd
 +
MENU LABEL F-Secure AV Rescue CD
 +
KERNEL Linux/Fsecure/linux
 +
APPEND ramdisk_size=100000 lang=en vt.default_utf8=0 apm=power-off vga=0x311 initrd=Linux/Fsecure/minirt.gz nomce quiet loglevel=1 nolapic_timer nosound console=tty10 video=noblank
 +
</pre>
 +
|}
  
== Citrix XenServer (Redhat/Centos) ==
+
See also [[linux.c32]].
 +
 
 +
=== Knoppix ===
 +
<!--
 +
--><!--
 +
--><!--
 +
--><!--
 +
-->
 +
See
 +
[https://web.archive.org/web/20080303030305/http://pxe.dev.aboveaverageurl.com:80/index.php/PXE_Booting/Knoppix]
 +
for details
 +
 
 +
=== Citrix XenServer (Redhat/Centos) ===
 +
<!--
 +
--><!--
 +
--><!--
 +
--><!--
 +
-->
 
* Download the latest XenServer ISO's  
 
* Download the latest XenServer ISO's  
* Make a folder on the WDS server under $WDS-ROOT\Boot\arch\Linux called xenserver
+
* Make a folder on the WDS server under <!--
 +
--><code>''$WDS-ROOT''\Boot\''$ARCH''\Linux\</code> called <tt>Xenserver</tt>
 +
{|
 +
|
 +
''$WDS-ROOT''\Boot\''$ARCH''\
 +
''        ''      ''    ''|_ Linux\
 +
''        ''      ''    ''        |_ Xenserver\
 +
|}
 
* Extract the following files from the first XenServer ISO
 
* Extract the following files from the first XenServer ISO
 +
** /install.img
 +
** /boot/xen.gz
 +
** /boot/vmlinuz
 +
** /boot/isolinux/mboot.c32
 +
** the whole /packages.main folder
 +
* Extract the following files from the second XenServer ISO
 +
** the whole /packages.linux folder
 +
* Copy the extracted files to the <!--
 +
--><code>''$WDS-ROOT''\Boot\''$ARCH''\Linux\Xenserver\</code> <!--
 +
-->folder on the WDS server
 +
* Create a virtual directory in IIS on the WDS server called <!--
 +
--><tt>Xen''$version''</tt> (e.g. ''<tt>xen5-5</tt>'' ) <!--
 +
-->with read access pointing to the <!--
 +
--><code>''$WDS-ROOT''\Boot\''$ARCH''\Linux\Xenserver\</code> folder
 +
* On the new IIS virtual directory, <!--
 +
-->add the mime type for extension "<tt>.*</tt>" <tt>text/plain</tt>
 +
* Edit your PXE config file <!--
 +
--><code>''$WDS-ROOT''/Boot/''$ARCH''/pxelinux.cfg/default</code>, <!--
 +
-->and append the following:
 +
{|
 +
|
 
<pre>
 
<pre>
    /install.img
+
  LABEL xenserver5-5beta
    /boot/xen.gz
+
  MENU LABEL Citrix ^Xen Server 5.5 install
    /boot/vmlinuz
+
  KERNEL Linux/Xenserver/mboot.c32
    /boot/isolinux/mboot.c32
+
  APPEND Linux/Xenserver/xen.gz dom0_mem=752M com1=115200,8n1 console=com1,tty --- Linux/Xenserver/vmlinuz console=ttyS0,115200n8 console=tty0 --- Linux/Xenserver/install.img
    the whole /packages.main folder
+
</pre>
+
* Extract the following files from the second !XenServer ISO
+
**    the whole /packages.linux folder
+
* Copy the extracted files to the $WDS-ROOT\Boot\arch\Linux\xenserver folder on the WDS server
+
* Create a virtual directory in IIS on the WDS server called Xen$version (i.e. xen5-5 ) with read access pointing to the $WDS-ROOT\Boot\arch\Linux\xenserver folder
+
* On the new IIS virtual directory add the mime type for extension .* text/plain
+
* Edit your PXE config file /Boot/arch/pxelinux.cfg/default, and append the following:
+
<pre>
+
  label xenserver5-5beta
+
  menu label Citrix ^Xen Server 5.5 install
+
  kernel /Linux/xenserver/mboot.c32
+
  APPEND /Linux/xenserver/xen.gz dom0_mem=752M com1=115200,8n1 console=com1,tty --- /Linux/xenserver/vmlinuz console=ttyS0,115200n8 console=tty0 --- /Linux/xenserver/install.img
+
 
</pre>
 
</pre>
* when installing xen select install from http/ftp and type in the location of your wds/web server (IIS webserver as configured above, i.e. <nowiki>http://172.16.0.1/xen5-5</nowiki> )
+
|}
 +
* When installing xen, <!--
 +
-->select install from http/ftp and <!--
 +
-->type-in the location of your wds/web server <!--
 +
-->(IIS webserver as configured above, <!--
 +
-->{{nowrap|1=e.g. ''<nowiki>http://172.16.0.1/xen5-5</nowiki>'' )}}

Latest revision as of 17:47, 22 December 2020


Creating a PXE Boot menu for deploying Linux with Windows Deployment Services (WDS)

See also:

Requirements

  • PXELINUX
  • Windows Deployment Services already set up. Setting up WDS is outside the scope of this article
    • NOTE: $WDS-ROOT will reference the WDS root folder location (e.g. D:\RemoteInstall\)
  • In this article, the following directory tree (and files) will be used:
$WDS-ROOT\Boot\$ARCH\
                   |
                   |
         $WDS-ROOT\
         |_ Boot\
                |_ x86\
                |     |_ pxelinux.0    ⇒  pxelinux.com
                |     |_ abortpxe.com  ⇒  abortpxe.0
                |     |_ pxeboot.n12   ⇒  pxeboot.0
                |     |_ *.c32
                |     |_ ...
                |     |_ Linux\
                |     |_ pxelinux.cfg\
                |                    |_ default
                |
                |_ x64\
                      |_ pxelinux.0    ⇒  pxelinux.com
                      |_ abortpxe.com  ⇒  abortpxe.0
                      |_ pxeboot.n12   ⇒  pxeboot.0
                      |_ *.c32
                      |_ ...
                      |_ Linux\
                      |_ pxelinux.cfg\
                                     |_ default

How To Setup Windows Deployment Services with PXELinux

  • Download Syslinux
  • Extract
    • core\pxelinux.0
    • com32\menu\vesamenu.c32
    • com32\modules\chain.c32
    • [5.00+] and the necessary library modules

    from the Syslinux download and put them on your WDS server in (respective) $WDS-ROOT\Boot\$ARCH\ folders

    • substitute WDS-ROOT for where your WDS root folder is
    • substitute $ARCH with respective x86 and/or x64 folders (architectures)
    • Depending on the version, you may also need additional modules such as ldlinux.c32, libcom32.c32 and libmenu.c32. See also ELF missing dependencies
  • In the $WDS-ROOT\Boot\$ARCH\ folders, rename pxelinux.0 to pxelinux.com
  • Create a folder named pxelinux.cfg (in the $WDS-ROOT\Boot\$ARCH\ folders)
  • In the pxelinux.cfg folder, create a text file named default and add the following to it (you can substitute MyMenuBackgroundPicture640x480.jpg for any image you want as your menu background)
     DEFAULT      vesamenu.c32
     PROMPT       0
     NOESCAPE     0
     ALLOWOPTIONS 0
     # Timeout in units of 1/10 s
     TIMEOUT 300
     MENU MARGIN 10
     MENU ROWS 16
     MENU TABMSGROW 21
     MENU TIMEOUTROW 26
     MENU COLOR BORDER 	30;44 	#20ffffff #00000000 none
     MENU COLOR SCROLLBAR 	30;44 	#20ffffff #00000000 none
     MENU COLOR TITLE 	0 	#ffffffff #00000000 none
     MENU COLOR SEL   	30;47 	#40000000 #20ffffff
     MENU BACKGROUND MyMenuBackgroundPicture640x480.jpg
     MENU TITLE PXE Boot Menu
     
     LABEL wds
     MENU LABEL Windows Deployment Services
     KERNEL pxeboot.0
     
     LABEL abort
     MENU LABEL AbortPXE
     KERNEL	abortpxe.0
     
     LABEL local 
     MENU DEFAULT
     MENU LABEL Boot from Harddisk
     LOCALBOOT 0
     # Type 0x80
    
  • Make a copy of pxeboot.n12 and name it pxeboot.0
  • Make a copy of abortpxe.com and rename it abortpxe.0
  • Create a folder named Linux (in the $WDS-ROOT\Boot\$ARCH\ folders)
    • Open the Windows Deployment Services Console,
    • Right Click on your Server and Select Properties,
    • From the Boot Tab, change the default boot program for your architecute (x86 and x64 as well) to $WDS-ROOT\Boot\x86\pxelinux.com and $WDS-ROOT\Boot\x64\pxelinux.com respectively
      • NOTE: In the WDS included in Windows Server 2008 R2, the UI has changed and you have to use the command line in order to set the default boot program. Thus, to change the boot program to pxelinux.com, the wdsutil command line tool has to be used (for x86 and/or x64, respectively):
         wdsutil /set-server /bootprogram:boot\x86\pxelinux.com /architecture:x86
         wdsutil /set-server /N12bootprogram:boot\x86\pxelinux.com /architecture:x86
        
         wdsutil /set-server /bootprogram:boot\x64\pxelinux.com /architecture:x64
         wdsutil /set-server /N12bootprogram:boot\x64\pxelinux.com /architecture:x64
        
    • Now when you pxe boot a machine, you will get your custom boot menu.

    Adding Linux images to boot/install

    Debian and Ubuntu

    $WDS-ROOT\Boot\$ARCH\
                        |_ Linux\
                                |_ Debian5\
                                |_ Ubuntu\
    
    • Copy the downloaded netboot files initrd.gz and linux to the new folder
    • Create a menu entry at the end of the $WDS-ROOT\Boot\$ARCH\pxelinux.cfg\default file
      • (boot menu items for debian and ubuntu can be found in the download site under "boot-screens" in the "text.cfg" file)
     LABEL debian5-0expert
     MENU LABEL ^Debian 5-0 Expert install:
     KERNEL Linux/Debian5/linux
     APPEND priority=low vga=normal initrd=Linux/Debian5/initrd.gz -- 
     
     LABEL debian5-0rescue
     MENU LABEL ^Debian 5-0 Rescue mode
     KERNEL Linux/Debian5/linux
     APPEND vga=normal initrd=Linux/Debian5/initrd.gz rescue/enable=true -- quiet 
     
     LABEL debian5-0auto
     MENU LABEL ^Debian 5-0 Automated install
     KERNEL Linux/Debian5/linux
     APPEND auto=true priority=critical vga=normal initrd=Linux/Debian5/initrd.gz -- quiet 
     
     LABEL debian5-0amd64expert
     MENU LABEL ^Debian 5-0 amd64 Expert install
     KERNEL Linux/Debian5/linux-amd64
     APPEND priority=low vga=normal initrd=Linux/Debian5/initrd-amd64.gz -- 
     
     LABEL debian5-0amd64rescue
     MENU LABEL ^Debian 5-0 amd64 Rescue mode
     KERNEL Linux/Debian5/linux-amd64
     APPEND vga=normal initrd=Linux/Debian5/initrd-amd64.gz rescue/enable=true -- quiet 
     
     LABEL debian5-0amd64auto
     MENU LABEL ^Debian 5-0 amd64 Automated install
     KERNEL Linux/Debian5/linux-amd64
     APPEND auto=true priority=critical vga=normal initrd=Linux/Debian5/initrd-amd64.gz -- quiet 
     
     LABEL ubuntu-expert
     MENU LABEL ^Ubuntu Expert install
     KERNEL Linux/Ubuntu/linux
     APPEND priority=low vga=normal initrd=Linux/Ubuntu/initrd.gz -- 
     
     LABEL ubuntu-cli-expert
     MENU LABEL ^Ubuntu Command-line expert install
     KERNEL Linux/Ubuntu/linux
     APPEND tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false priority=low vga=normal initrd=Linux/Ubuntu/initrd.gz -- 
     
     LABEL ubuntu-rescue
     MENU LABEL ^Ubuntu Rescue mode
     KERNEL Linux/Ubuntu/linux
     APPEND vga=normal initrd=Linux/Ubuntu/initrd.gz rescue/enable=true -- quiet 
     
     LABEL ubuntu-expert-amd64
     MENU LABEL ^Ubuntu-amd64 Expert install
     KERNEL Linux/Ubuntu/linux-amd64
     APPEND priority=low vga=normal initrd=Linux/Ubuntu/initrd-amd64.gz -- 
     
     LABEL ubuntu-amd64-cli-expert
     MENU LABEL ^Ubuntu-amd64 Command-line expert install
     KERNEL Linux/Ubuntu/linux-amd64
     APPEND tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false priority=low vga=normal initrd=Linux/Ubuntu/initrd-amd64.gz -- 
     
     LABEL ubuntu-amd64-rescue
     MENU LABEL ^Ubuntu-amd64 Rescue mode
     KERNEL Linux/Ubuntu/linux-amd64
     APPEND vga=normal initrd=Linux/Ubuntu/initrd-amd64.gz rescue/enable=true -- quiet
    

    Gentoo

    • Download the latest gentoo minimal install CD from a mirror
    • Extract the files:
      • isolinux/gentoo
      • isolinux/gentoo.igz
      • image.squashfs

      from the iso to a temporary folder

    • Make a folder on the WDS server under $WDS-ROOT\Boot\$ARCH\Linux\ called Gentoo
      $WDS-ROOT\Boot\$ARCH\
                          |_ Linux\
                                  |_ Gentoo\
      
    • Copy the extracted gentoo file to the $WDS-ROOT\Boot\$ARCH\Linux\Gentoo\ folder on the WDS server
    • Copy the extracted gentoo.igz and image.squashfs files to a temporary location on a linux machine (e.g. "/root/tmp/")
    • In the "/root/tmp/" location, create a folder called Gentoo and change into this directory
       mkdir /root/tmp/Gentoo
       cd /root/tmp/Gentoo
      
    • Extract all the files from the gentoo.igz file
       gunzip -c ../gentoo.igz | cpio -idv
      
    • Make the following folders (in the extracted folder)
       mkdir mnt
       mkdir mnt/cdrom
      
    • Copy the image.squashfs file to the newly-created mnt/cdrom/ folder
       cp ../image.squashfs mnt/cdrom
      
    • Make a backup copy of the init file
       cp init init.orig
      
    • Edit the init file with the following modifications:
       Change the line:
         -- if [ "${REAL_ROOT}" != "/dev/nfs" ] && [ "${LOOPTYPE}" != "sgimips" ]
       To:
         ++ if [ "${REAL_ROOT}" != "/dev/nfs" ] && [ "${LOOPTYPE}" != "sgimips" ] && [ "${REAL_ROOT}" != "/" ]
       
       Change the line (under  # Check for a block device or /dev/nfs):
         -- elif [ -b "${REAL_ROOT}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ]
       To:
         ++ elif [ -b "${REAL_ROOT}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ] || [ "${REAL_ROOT}" = "/" ]
       
       Remove the line:
         -- cache_cd_contents
       
       Change the line:
         -- mount -t squashfs -o loop,ro ${NEW_ROOT}/mnt/cdrom/${LOOPEXT}${LOOP} ${NEW_ROOT}/mnt/livecd
       To:
         ++ mount -t squashfs -o loop,ro /mnt/cdrom/${LOOPEXT}${LOOP} ${NEW_ROOT}/mnt/livecd    
      
    • Compress everything back into a file again by typing the following and press enter:
       find . -print | cpio -o -H newc |gzip -9 -c - > ../gentoo.igz.new
      
    • Copy the new gentoo.igz.new to the $WDS-ROOT\Boot\$ARCH\Linux\Gentoo\ folder on the WDS server and name it gentoo.igz
    • Create a menu entry at the end of the $WDS-ROOT\Boot\$ARCH\pxelinux.cfg\default file
       LABEL gentoo2008-x86
       MENU LABEL Deploy Gentoo 32 bit
       KERNEL Linux/Gentoo/gentoo
       APPEND root=/dev/ram0 init=/linuxrc dokeymap looptype=squashfs loop=/image.squashfs cdroot initrd=Linux/Gentoo/gentoo.igz real_root=/ vga=791
       
       LABEL gentoo2008-x64
       MENU LABEL Deploy Gentoo amd64
       KERNEL Linux/Gentoo/gentoo-amd64
       APPEND root=/dev/ram0 init=/linuxrc dokeymap looptype=squashfs loop=/image.squashfs cdroot initrd=Linux/Gentoo/gentoo-amd64.igz real_root=/ vga=791
      
    • GParted

      • Download GParted live zip file (You have to use 0.3.7-2 or later, network drivers are only included after that), and unzip all the files in a temp dir
      • Copy necessary boot files (vmlinuz1 and initrd1.img) to a new folder on your WDS server ($WDS-ROOT\Boot\$ARCH\Linux\Gparted\)
      $WDS-ROOT\Boot\$ARCH\
                          |_ Linux\
                                  |_ Gparted\
      
      • Copy /tmp/gparted/live/filesystem.squashfs to your http web server. (If on IIS, create a new virtual directory and set the mime type for ".*" extension to text/plain)
      • Edit your PXE config file $WDS-ROOT\Boot\$ARCH\pxelinux.cfg\default, and append the following:
       LABEL GParted Live
       MENU LABEL GParted Live
       KERNEL Linux/Gparted/vmlinuz1
       APPEND initrd=Linux/Gparted/initrd1.img boot=live union=aufs noswap noprompt vga=788 fetch=http://$webserverIP/gparted/filesystem.squashfs
       # //NOTE// Replace $webserverIP with your IP address of http server.
      

      As of GParted-live version 0.3.8-3, fetch=tftp is supported. Just copy the filesystem.squashfs file into the same folder as vmlinuz1 and initrd1.img (in the above example, it would be Linux\Gparted\). The above APPEND can then be replaced with:

       APPEND initrd=Linux/Gparted/initrd1.img boot=live union=aufs noswap noprompt vga=788 fetch=tftp://$tftpserverIP/gparted/filesystem.squashfs
       # //NOTE// Replace $tftpserverIP with the IP address of your tftp server.
      

      See also linux.c32.

      F-Secure Antivirus Rescue CD

      $WDS-ROOT\Boot\$ARCH\
                          |_ Linux\
                                  |_ Fsecure\
      
      • Extract the boot/isolinux/fsecure/minirt.gz file and whole KNOPPIX folder from the ISO
      • Copy the extracted minirt.gz file and KNOPPIX folder to a temporary location on a linux machine (e.g. /root/tmp/)
      • In the /root/tmp/ location, create a folder called fsecure and change into this directory
       mkdir /root/tmp/fsecure
       cd /root/tmp/fsecure
      
      • Extract all the files from the minirt.gz file
       gunzip -c ../minirt.gz | cpio -idv
      
      • Copy the KNOPPIX folder extracted from the ISO to the mnt-system folder
       cp -r ../KNOPPIX mnt-system
      
      • Make a backup copy of the init file
       cp init init.orig
      
      • Edit the init file with the following modifications
        • find the findknoppix devices section and delete everything from it
       findknoppix(){
       -- local dev
       -- for dev in "$@"; do
       --  [ -b "$dev" ] || continue
       --  echo -n -e "\r${CRE}${BLUE}${SEARCHINGFOR} $DISTRO in: ${MAGENTA}$dev${NORMAL}   "
       --  trymount "$dev" /mnt-system >/dev/null 2>&1 || continue
       --  if [ -r /mnt-system/"$knoppix_dir"/KNOPPIX ] ; then
       --      # We must have also fsecure structure present else we might try to mount something wrong.
       --      if [ -d /mnt-system/fsecure/rescuecd ] || [ -d /mnt-system/boot/isolinux/fsecure ] ; then
       --         echo -e "\r${CRE}${GREEN}$DISTRO ${FOUNDAT}: ${MAGENTA}$dev${NORMAL}       "
       --         return 0
       --      fi
       --  fi
       --  umount /mnt-system
       -- done
       -- return 1
      
      • Add return 0 to the findknoppix devices section
       findknoppix(){
       ++ return 0
       }
      
      • Compress everything back into a file again
       find . -print | cpio -o -H newc |gzip -9 -c - > ../minirt.gz.new 
      
      • Copy the new minirt.gz.new file to the $WDS-ROOT\Boot\$ARCH\Linux\Fsecure\ folder on the WDS server and name it minirt.gz
      • Create a menu entry at the end of the $WDS-ROOT\Boot\$ARCH\pxelinux.cfg\default file
       LABEL fsecurerescuecd
       MENU LABEL F-Secure AV Rescue CD
       KERNEL Linux/Fsecure/linux
       APPEND ramdisk_size=100000 lang=en vt.default_utf8=0 apm=power-off vga=0x311 initrd=Linux/Fsecure/minirt.gz nomce quiet loglevel=1 nolapic_timer nosound console=tty10 video=noblank
      

      See also linux.c32.

      Knoppix

      See [1] for details

      Citrix XenServer (Redhat/Centos)

      • Download the latest XenServer ISO's
      • Make a folder on the WDS server under $WDS-ROOT\Boot\$ARCH\Linux\ called Xenserver
      $WDS-ROOT\Boot\$ARCH\
                          |_ Linux\
                                  |_ Xenserver\
      
      • Extract the following files from the first XenServer ISO
        • /install.img
        • /boot/xen.gz
        • /boot/vmlinuz
        • /boot/isolinux/mboot.c32
        • the whole /packages.main folder
      • Extract the following files from the second XenServer ISO
        • the whole /packages.linux folder
      • Copy the extracted files to the $WDS-ROOT\Boot\$ARCH\Linux\Xenserver\ folder on the WDS server
      • Create a virtual directory in IIS on the WDS server called Xen$version (e.g. xen5-5 ) with read access pointing to the $WDS-ROOT\Boot\$ARCH\Linux\Xenserver\ folder
      • On the new IIS virtual directory, add the mime type for extension ".*" text/plain
      • Edit your PXE config file $WDS-ROOT/Boot/$ARCH/pxelinux.cfg/default, and append the following:
       LABEL xenserver5-5beta
       MENU LABEL Citrix ^Xen Server 5.5 install
       KERNEL Linux/Xenserver/mboot.c32
       APPEND Linux/Xenserver/xen.gz dom0_mem=752M com1=115200,8n1 console=com1,tty --- Linux/Xenserver/vmlinuz console=ttyS0,115200n8 console=tty0 --- Linux/Xenserver/install.img
      
      • When installing xen, select install from http/ftp and type-in the location of your wds/web server (IIS webserver as configured above, e.g. http://172.16.0.1/xen5-5 )