<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ohjeah! &#187; kickstart</title>
	<atom:link href="http://www.ohjeah.net/tag/kickstart/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ohjeah.net</link>
	<description>The writings of JRO...</description>
	<lastBuildDate>Wed, 09 Jun 2010 20:58:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PXE and Kickstart, Automated Installations for Linux via WDS</title>
		<link>http://www.ohjeah.net/2008/09/24/pxe-and-kickstart-automated-installations-for-linux-via-wds/</link>
		<comments>http://www.ohjeah.net/2008/09/24/pxe-and-kickstart-automated-installations-for-linux-via-wds/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 01:18:51 +0000</pubDate>
		<dc:creator>jro</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[kickstart]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[pxe]]></category>
		<category><![CDATA[wds]]></category>

		<guid isPermaLink="false">http://nativemo.de/?p=50</guid>
		<description><![CDATA[Today I decided to setup automated installations for Linux distros (RHEL, Fedora, CentOS), similar to how we deploy our Windows installations via PXE.  Since we already had WDS running for installing Windows, it was just a matter of reconfiguring WDS, setting up the necessary structure and kickstart files for our automated Linux installations.  While I do not cover [...]]]></description>
			<content:encoded><![CDATA[<p>Today I decided to setup automated installations for Linux distros (RHEL, Fedora, CentOS), similar to how we deploy our Windows installations via <a href="http://en.wikipedia.org/wiki/Preboot_Execution_Environment" target="_blank">PXE</a>.  Since we already had <a href="http://en.wikipedia.org/wiki/Windows_Deployment_Services">WDS</a> running for installing Windows, it was just a matter of reconfiguring WDS, setting up the necessary structure and kickstart files for our automated Linux installations.  While I do not cover the initial WDS installation process, I will attempt to go over the steps performed after the basic WDS install (native or mixed).  <span id="more-29"></span></p>
<p>What you will need:</p>
<ul>
<li>Windows server running WDS (and working via DHCP).</li>
<li>A recent copy of <a href="http://www.kernel.org/pub/linux/utils/boot/syslinux/" target="_blank">SYSLINUX</a> (extracted to a folder somewhere on the WDS server).</li>
<li>An HTTP or anonymous FTP server to hold your installation media.</li>
</ul>
<p>Currently when I boot my computer with PXE enabled, I am prompted to hit F12 for network boot.  When I press F12, I am prompted by &#8220;Windows Boot Manager&#8221; to select my boot images that I setup in WDS.  Since I can&#8217;t install Linux images directly using the WDS interface, an alternative boot image is necessary.  That is where SYSLINUX/PXELINUX takes over.</p>
<p><strong>Pre-Setup</strong></p>
<ul>
<li>Create the necessary directory structure inside the WDS RemoteInstall directory (this was specified during the WDS installation).
<ul>
<li>Inside the x86 folder (<span style="text-decoration: underline;">RemoteInstall\Boot\x86\</span>), create the following folders (including pxelinux.cfg):
<ul>
<li>conf</li>
<li>img</li>
<li>knl</li>
<li>pxelinux.cfg</li>
</ul>
</li>
</ul>
</li>
</ul>
<p><strong>Preparing Installation Media</strong></p>
<ul>
<li>Setup an FTP server to hold your installation media (HTTP works also): Currently the average size of a Red Hat distribution is about 5GB, so make sure the server you select will have the necessary disk space. You will need separate installation media for both distribution specific 32bit and 64bit installs.  If you want Fedora 9, CentOS 5.2, and RHEL 5.2 images (both 32bit and 64bit), that will be about 30GB.  As long as you&#8217;re not archiving old distributions, this should not be an issue.
<ul>
<li>On my FTP server in the root/path, I created a directory for each of my installation media.  Also, creating a standard naming convention will help with editing the configuration files later and any case sensitivity issues.  Example: My directory names are DistroVersion_arc (Fedora9_32bit), as you will see later on.</li>
<li>Copy the entire installation dvd media to the corresponding directories you created (not the .iso, extract its entire contents).</li>
</ul>
</li>
<li>In the FTP root directory for the media you copied, create a kickstart file (ks.cfg).  (Example:  <a href="ftp://ftpserver.domain.com/fedora-9-32bit/ks.cfg">ftp://ftpserver.domain.com/Fedora9_32bit/ks.cfg</a>)  I have included example kickstart files at the bottom of this article.</li>
<li>Once you have copied the installation media for a distro to your FTP server, you need to copy 2 files from <span style="color: #ff0000;">that specific distro media</span> to your WDS server.
<ul>
<li>From the (installation media\images\pxeboot) directory, copy the following:
<ul>
<li>Copy vmlinuz to the following directory on the WDS server (<span style="text-decoration: underline;">RemoteInstall\Boot\x86\knl\</span>).  Rename the file to an identifying name such as vmlinuz-fedora9-32bit.</li>
<li>Copy initrd.img to the following directory on the WDS server (<span style="text-decoration: underline;">RemoteInstall\Boot\x86\img\</span>).  Rename the file to an identifying name such as initrd-fedora9-32bit.</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>When it comes time to configure your option menus, you will need to specify these files for each version/distro you plan on making available.</p>
<p><strong>Configuring WDS</strong></p>
<ul>
<li>From inside the downloaded SYSLINUX archive, copy the following files:
<ul>
<li><span style="text-decoration: underline;">pxelinux.0</span> from the (syslinux\core) directory to your (<span style="text-decoration: underline;">RemoteInstall\Boot\x86\</span>) directory on the WDS server.</li>
<li><span style="text-decoration: underline;">menu.c32</span> and <span style="text-decoration: underline;">vesamenu.c32</span> from the (syslinux\com32\menu) directory to your (<span style="text-decoration: underline;">RemoteInstall\Boot\x86\</span>) directory on the WDS server.</li>
</ul>
</li>
<li>Inside the (<span style="text-decoration: underline;">RemoteInstall\Boot\x86\</span>) directory, create copies of the following files, rename them accordingly (you can copy paste then rename):
<ul>
<li>Make a copy of pxeboot.n12, save it as pxeboot.0</li>
<li>Make a copy of abortpxe.com, save it as abortpxe.0</li>
</ul>
</li>
<li>Inside (<span style="text-decoration: underline;">RemoteInstall\Boot\x86\pxelinux.cfg\</span>), create a file called default.  This will be the initial menu you see during PXE boot, edit the file and give it the following contents:</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">       <span style="color: #666666; font-style: italic;"># File: wdspath\RemoteInstall\Boot\x86\pxelinux.cfg\default</span>
       <span style="color: #666666; font-style: italic;"># Default boot option to use</span>
       DEFAULT menu.c32
       TIMEOUT <span style="color: #000000;">50</span>
       <span style="color: #666666; font-style: italic;"># Prompt user for selection</span>
       PROMPT <span style="color: #000000;">0</span>
       <span style="color: #666666; font-style: italic;"># Menu Configuration</span>
       MENU WIDTH <span style="color: #000000;">80</span>
       MENU MARGIN <span style="color: #000000;">10</span>
       MENU PASSWORDMARGIN <span style="color: #000000;">3</span>
       MENU ROWS <span style="color: #000000;">12</span>
       MENU TABMSGROW <span style="color: #000000;">18</span>
       MENU CMDLINEROW <span style="color: #000000;">18</span>
       MENU ENDROW <span style="color: #000000;">24</span>
       MENU PASSWORDROW <span style="color: #000000;">11</span>
       MENU TIMEOUTROW <span style="color: #000000;">20</span>
       MENU TITLE Main Menu
&nbsp;
       <span style="color: #666666; font-style: italic;"># Menus</span>
       <span style="color: #666666; font-style: italic;"># Windows</span>
	LABEL Windows
	MENU LABEL Windows Installer
	KERNEL pxeboot.0
       <span style="color: #666666; font-style: italic;"># x86</span>
       LABEL x86
         MENU LABEL Linux 32bit Installs <span style="color: #7a0874; font-weight: bold;">&#40;</span>x86<span style="color: #7a0874; font-weight: bold;">&#41;</span>
         KERNEL menu.c32
         APPEND conf<span style="color: #000000; font-weight: bold;">/</span>x86.conf
       <span style="color: #666666; font-style: italic;"># x64</span>
       LABEL x64
         MENU LABEL Linux 64bit Installs <span style="color: #7a0874; font-weight: bold;">&#40;</span>x64<span style="color: #7a0874; font-weight: bold;">&#41;</span>
         KERNEL menu.c32
         APPEND conf<span style="color: #000000; font-weight: bold;">/</span>x64.conf
	<span style="color: #666666; font-style: italic;"># Windows</span>
	LABEL Exit
	MENU LABEL Exit
	KERNEL abortpxe.0</pre></div></div>

<ul>
<li>Now you need to create the sub-menu configuration files for your 32 and 64 bit installs that you specified in your default file (RemoteInstall\Boot\x86\conf\x86.conf and RemoteInstall\Boot\x86\conf\x64.conf respectively).  These files will list the available distros to install, and the path to your copied kernel\image files, including your kickstart file which contains the path for your FTP or HTTP installation media.  Each option needs to point to the specific kernel and image that was created from the installation media earlier.</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">       <span style="color: #666666; font-style: italic;"># File: wdspath\RemoteInstall\Boot\x86\conf\x86.conf</span>
       <span style="color: #666666; font-style: italic;"># Default boot option to use</span>
       DEFAULT menu.c32
       <span style="color: #666666; font-style: italic;"># Prompt user for selection</span>
       PROMPT <span style="color: #000000;">0</span>
       <span style="color: #666666; font-style: italic;"># Menu Configuration</span>
       MENU WIDTH <span style="color: #000000;">80</span>
       MENU MARGIN <span style="color: #000000;">10</span>
       MENU PASSWORDMARGIN <span style="color: #000000;">3</span>
       MENU ROWS <span style="color: #000000;">12</span>
       MENU TABMSGROW <span style="color: #000000;">18</span>
       MENU CMDLINEROW <span style="color: #000000;">18</span>
       MENU ENDROW <span style="color: #000000;">24</span>
       MENU PASSWORDROW <span style="color: #000000;">11</span>
       MENU TIMEOUTROW <span style="color: #000000;">20</span>
       MENU TITLE Linux32Bit <span style="color: #7a0874; font-weight: bold;">&#40;</span>x86<span style="color: #7a0874; font-weight: bold;">&#41;</span> OS Selection
       <span style="color: #666666; font-style: italic;"># Return to Main Menu</span>
       LABEL MainMenu
         MENU DEFAULT
         MENU LABEL ^Main Menu
         KERNEL menu.c32
       <span style="color: #666666; font-style: italic;">#</span>
       <span style="color: #666666; font-style: italic;"># Blank boots</span>
       <span style="color: #666666; font-style: italic;">#</span>
       LABEL Fedora <span style="color: #000000;">9</span> 32bit
         MENU LABEL Fedora <span style="color: #000000;">9</span> 32bit
         KERNEL knl<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-fedora9-x86
         APPEND <span style="color: #007800;">initrd</span>=img<span style="color: #000000; font-weight: bold;">/</span>initrd-fedora9-x86.img <span style="color: #007800;">ks</span>=<span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>ftpserver.mydomain.com<span style="color: #000000; font-weight: bold;">/</span>Fedora9_32bit<span style="color: #000000; font-weight: bold;">/</span>ks.cfg</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">       <span style="color: #666666; font-style: italic;"># File: wdspath\RemoteInstall\Boot\x86\conf\x64.conf</span>
       <span style="color: #666666; font-style: italic;"># Default boot option to use</span>
       DEFAULT menu.c32
       <span style="color: #666666; font-style: italic;"># Prompt user for selection</span>
       PROMPT <span style="color: #000000;">0</span>
       <span style="color: #666666; font-style: italic;"># Menu Configuration</span>
       MENU WIDTH <span style="color: #000000;">80</span>
       MENU MARGIN <span style="color: #000000;">10</span>
       MENU PASSWORDMARGIN <span style="color: #000000;">3</span>
       MENU ROWS <span style="color: #000000;">12</span>
       MENU TABMSGROW <span style="color: #000000;">18</span>
       MENU CMDLINEROW <span style="color: #000000;">18</span>
       MENU ENDROW <span style="color: #000000;">24</span>
       MENU PASSWORDROW <span style="color: #000000;">11</span>
       MENU TIMEOUTROW <span style="color: #000000;">20</span>
       MENU TITLE 64Bit <span style="color: #7a0874; font-weight: bold;">&#40;</span>x64<span style="color: #7a0874; font-weight: bold;">&#41;</span> OS Choice
       <span style="color: #666666; font-style: italic;"># Return to Main Menu</span>
       LABEL MainMenu
         MENU DEFAULT
         MENU LABEL ^Main Menu
         KERNEL menu.c32
       <span style="color: #666666; font-style: italic;">#</span>
       <span style="color: #666666; font-style: italic;"># Blank boots</span>
       <span style="color: #666666; font-style: italic;">#</span>
       LABEL CentOS <span style="color: #000000;">5.2</span> 64bit
         MENU LABEL CentOS <span style="color: #000000;">5.2</span> 64bit
         KERNEL knl<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-centos52-x64
         APPEND <span style="color: #007800;">initrd</span>=img<span style="color: #000000; font-weight: bold;">/</span>initrd-centos52-x64.img <span style="color: #007800;">ks</span>=<span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>ftpserver.mydomain.com<span style="color: #000000; font-weight: bold;">/</span>CentOS52_64bit<span style="color: #000000; font-weight: bold;">/</span>ks.cfg
       LABEL Fedora <span style="color: #000000;">9</span> 64bit
         MENU LABEL Fedora <span style="color: #000000;">9</span> 64bit
         KERNEL knl<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-fedora9-x64
         APPEND <span style="color: #007800;">initrd</span>=img<span style="color: #000000; font-weight: bold;">/</span>initrd-fedora9-x64.img <span style="color: #007800;">ks</span>=<span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>ftpserver.mydomain.com<span style="color: #000000; font-weight: bold;">/</span>Fedora9_64bit<span style="color: #000000; font-weight: bold;">/</span>ks.cfg
       LABEL RHEL <span style="color: #000000;">5.2</span> 64bit
         MENU LABEL RHEL <span style="color: #000000;">5.2</span> 64bit
         KERNEL knl<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-rhel52-x64
         APPEND <span style="color: #007800;">initrd</span>=img<span style="color: #000000; font-weight: bold;">/</span>initrd-rhel52-x64.img <span style="color: #007800;">ks</span>=<span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>ftpserver.mydomain.com<span style="color: #000000; font-weight: bold;">/</span>RHEL52_64bit<span style="color: #000000; font-weight: bold;">/</span>ks.cfg</pre></div></div>

<ul>
<li>Lastly, set WDS to use the pxelinux.0 boot image.  If you need to get to the normal WDS boot image, you can use the Windows Installer option created in your default menu.
<ul>
<li>Open Windows Deployment Services on your WDS server.  Right click your server -&gt; Properties.  Under the Boot tab, set the Default boot program for x86 architecture (Boot\x86\pxelinux.0), or browse to the pxelinux.0 file we created earlier.  You may leave the other architectures alone or change as you see fit.</li>
</ul>
</li>
</ul>
<p><a class="flickr-image" title="wds_properties" rel="flickr-mgr" href="http://www.flickr.com/photos/20873416@N08/2888619618/"><img class="flickr-medium" longdesc="http://farm3.static.flickr.com/2086/2888619618_315a352499_o.png" src="http://farm3.static.flickr.com/2086/2888619618_5404f127bc_t.jpg" alt="wds_properties" /></a></p>
<p>**For <strong>Windows 2008 R2</strong> installations you must set the bootimage via command-line as followed:</p>
<div>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">wdsutil <span style="color: #000000; font-weight: bold;">/</span>set-server <span style="color: #000000; font-weight: bold;">/</span>bootprogram:boot\x86\pxelinux.0 <span style="color: #000000; font-weight: bold;">/</span>Architecture:x86
wdsutil <span style="color: #000000; font-weight: bold;">/</span>set-server <span style="color: #000000; font-weight: bold;">/</span>bootprogram:boot\x86\pxelinux.0 <span style="color: #000000; font-weight: bold;">/</span>Architecture:x64
wdsutil <span style="color: #000000; font-weight: bold;">/</span>set-server <span style="color: #000000; font-weight: bold;">/</span>N12bootprogram:boot\x86\pxelinux.0 <span style="color: #000000; font-weight: bold;">/</span>Architecture:x86
wdsutil <span style="color: #000000; font-weight: bold;">/</span>set-server <span style="color: #000000; font-weight: bold;">/</span>N12bootprogram:boot\x86\pxelinux.0 <span style="color: #000000; font-weight: bold;">/</span>Architecture:x64</pre></div></div>

</div>
<p><strong>Finished Result</strong></p>
<p><a href="http://www.ohjeah.net/wp-content/uploads/2008/10/linux_pxe.swf" rel="shadowbox[post-29];width=640;height=385;"></a><a href="http://www.ohjeah.net/2008/09/24/pxe-and-kickstart-automated-installations-for-linux-via-wds/"><p><em>Click here to view the embedded video.</em></p></a></p>
<p><strong>Example Kickstart File</strong></p>
<p>Here is an example kickstart file for Fedora 9.  For each new distro I normally perform a cd install with my desired options, then use the resulting /root/anaconda-cfg.ks for assistance.  Note that the kickstart file specifies the FTP path of your installation media that you created in the beginning of this article.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#Version=F9</span>
<span style="color: #666666; font-style: italic;">#32bit</span>
<span style="color: #c20cb9; font-weight: bold;">install</span>
text
url <span style="color: #660033;">--url</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>ftpserver.mydomain.com<span style="color: #000000; font-weight: bold;">/</span>Fedora9_32bit
lang en_US.UTF-<span style="color: #000000;">8</span>
keyboard us
network <span style="color: #660033;">--device</span> eth0 <span style="color: #660033;">--bootproto</span> dhcp
rootpw <span style="color: #660033;">--iscrypted</span> $<span style="color: #000000;">1</span><span style="color: #007800;">$X</span>.qPQYdk<span style="color: #007800;">$L</span>.YRbuORBd30
firewall <span style="color: #660033;">--disabled</span>
authconfig <span style="color: #660033;">--enableshadow</span> <span style="color: #660033;">--enablemd5</span> <span style="color: #660033;">--passalgo</span>=sha512
selinux <span style="color: #660033;">--disabled</span>
timezone America<span style="color: #000000; font-weight: bold;">/</span>Chicago
bootloader <span style="color: #660033;">--location</span>=mbr <span style="color: #660033;">--driveorder</span>=sda <span style="color: #660033;">--append</span>=<span style="color: #ff0000;">&quot;rhgb quiet&quot;</span>
clearpart <span style="color: #660033;">--all</span> <span style="color: #660033;">--drives</span>=sda
part <span style="color: #000000; font-weight: bold;">/</span>boot <span style="color: #660033;">--fstype</span> ext3 <span style="color: #660033;">--size</span>=<span style="color: #000000;">1000</span>
part swap <span style="color: #660033;">--size</span>=<span style="color: #000000;">2048</span>
part <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">--fstype</span> ext3 <span style="color: #660033;">--size</span>=<span style="color: #000000;">1</span> <span style="color: #660033;">--grow</span>
<span style="color: #000000; font-weight: bold;">%</span>packages
<span style="color: #000000; font-weight: bold;">@</span>editors
<span style="color: #000000; font-weight: bold;">@</span>development-tools
<span style="color: #000000; font-weight: bold;">@</span>text-internet
<span style="color: #000000; font-weight: bold;">@</span>core
<span style="color: #000000; font-weight: bold;">@</span>base
<span style="color: #000000; font-weight: bold;">@</span>hardware-support
<span style="color: #000000; font-weight: bold;">@</span>admin-tools
grub
openldap
openldap-devel
openldap-client
net-snmp<span style="color: #000000; font-weight: bold;">*</span>
ntp</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.ohjeah.net/2008/09/24/pxe-and-kickstart-automated-installations-for-linux-via-wds/feed/</wfw:commentRss>
		<slash:comments>48</slash:comments>
		</item>
	</channel>
</rss>
