Novell Home

SUSE Linux Enterprise Desktop 10 for the Masses: Discover the Power of Network-Based, Hands-Free Installations

Novell Cool Solutions: Feature
By Nathan Conger

Digg This - Slashdot This

Posted: 28 Jun 2007
 

So you've installed SUSE Linux Enterprise Desktop 10 and have discovered the power and flexibility of the OS. The desktop comes loaded with the applications you need to be productive, like: OpenOffice.org ,Evolution and Firefox. The OS has seamlessly integrated with your existing network infrastructure and collaboration environment. Now you're ready to make the push to a wider audience in your organization, but where to begin? In this article, we'll explore in detail how to setup and configure a Network Installation Server paired with PXE Boot and AutoYaST for speedy, hands-free installations.

Network-based, scripted installations are great for any environment where installations need to be uniform; like classrooms, labs, call centers. Of course an automated installation environment could also be used for standard desktops and laptops within your organization, adding any required "personalization" after the install. An advantage over disk imaging, scripted installations (leveraging AutoYast) are more device agnostic, allowing you to leverage the same "script" across a variety of hardware models and disk geometries.

While this solution requires only one machine to setup, you'll need a second machine to test the configuration. To implement the full solution, you'll need to be able to modify DHCP on a given subnet or private network. For all of the the following configuration steps and exercises we'll assume the user is "root". In this example, I've used SUSE Linux Enterprise Server 10 SP1 and SUSE Linux Enterprise Desktop 10 SP1. You can download the latest CD and DVD ISO images here: http://www.novell.com/linux/download_linux.html

Installation Server

To get started, install SUSE Linux Enterprise Server 10 (SP1) with a static IP address. Of course you can leverage an existing SUSE Linux Enterprise Server, 9 or 10, as well (the steps will be virtually the same). It's good practice to disable the firewall on the initial setup. To do this, launch YaST and open Security and Users->Firewall. In the Service Start section choose Manually, then choose Stop Firewall Now in the Switch On and Off section. Click Next and then Accept to save settings and shut off the firewall. Once you've got the configuration set and have successfully performed a PXE boot installation, you can re-enable the firewall with the allowed service ports (they are: HTTP 80, TFTP 69, DHCP Server 547 and others as desired).

Once you have an installed system, you're ready to begin the Installation Server configuration. To get started, launch YaST (Computer->YaST), browse to the Miscellaneous section and open Installation Server. The first time you launch the Installation Server module, you'll be prompted to set up an HTTP, FTP or NFS installation server. For ease of setup and testing in this exercise choose HTTP (although NFS is typically the fastest of the three options). Choose a directory to contain the sources and click Next. In this example, I created an "/install" directory at the root of the file system for the installation sources. On the following screen you are prompted to select an alias for the installation sources. This is the directory in the HTTP URL that the sources will be visible from. I chose "install" as the alias. Once the installation server is configured, you can browse to http://<server_ip>/install/ to see the sources. Click Next to return to the main Installation Server screen. If not yet installed, you'll be prompted to install the apache2 and apache2-prefork rpms. Click Continue to install them.

After configuring the installation server, you are now ready to add installation sources. Click Add to add a new installation source. Enter a Source Name (I chose "SLED10SP1-32") and click Next. Choose a source to import the installation source. In this example I've used the DVDROM, but a CDROM or the distribution ISOs could be used just as well. On clicking next you'll be prompted to insert the first CD (or DVD). Insert the first DVD of SUSE Linux Enterprise Desktop 10 SP1 and click Continue. The copy process can take a while... now would be a good time to go get that caffeine fix. After the first DVD or DVD ISO image has been copied, you'll be prompted to enter the second DVD (or DVD ISO). This step can be safely skipped (choose Skip) as the second DVD only contains the source rpms. You can, however, copy the source rpms as well if desired. In the case of CDs or CD ISOs, you'll want to copy at least the first four. You should now be back at the Installation Server main screen. Click Finish here to wrap up the configuration.

You have now created an HTTP installation server with a SUSE Linux Enterprise Desktop 10 SP1 installation source. You can verify that the source was created correctly by entering the URL in a browser. Browse to: http://<server_ip>/install/ (be sure to enter the trailing forward slash after "install").

PXE Server

Having a network installation server in place is the first component of a hands-free installation environment. The second component is configuring a PXE server (Preboot Execution Environment). PXE, part of the firmware of most modern network cards, leverages DHCP (Dynamic Host Configuration Protocol) to find available PXE servers to download a network bootstrap program (NBP) and download it to the computer's RAM using TFTP (Trivial File Transfer Protocol). Once in RAM the NBP can execute and download installation or other software, removing the need for installation media.

To set up a PXE server (on the same installation server) we'll need to create a PXE directory structure and some accompanying configuration files. We'll also need to enable and configure DHCP and TFTP services. To start, launch YaST, browse to Software and open Software Management. In the Search field, type "syslinux" and click Search. If the package is not yet installed, check the box and click Accept to install it. Once the the package is on the system, issue the following commands in a terminal:

mkdir -p /tftpboot/pxelinux.cfg
cp /usr/share/syslinux/pxelinux.0 /tftpboot
cp /install/SLED10SP1-32/CD1/boot/i386/loader/linux /tftpboot/sle10sp1_32bit_linux
cp /install/SLED10SP1-32/CD1/boot/i386/loader/initrd /tftpboot/sle10sp1_32bit_initrd

In the above commands, I first created a two-level directory structure, /tftpboot/pxelinux.cfg. Next, I copied "pxelinux.0" (the network bootstrap program) to the /tftpboot directory. Finally, I copied the linux kernel and the initrd file (initial ramdisk) from the installation source to the /tftpboot directory.

In the /tftpboot/pxelinux.cfg directory, create two files, "default" and "boot.msg". I've included samples of the two files below:

default

prompt 1
timeout 0
display pxelinux.cfg/boot.msg
label 1 
  kernel sle10sp1_32bit_linux
  append initrd=sle10sp1_32bit_initrd splash=verbose install=http://172.17.2.70/install/SLED10SP1-32/CD1
#(the "append" line is all one line)
boot.msg

|--------------------------------|
|                                |
| PXE Boot Menu List             |
|                                |
| 1. SLED 10 SP1 (32-bit)        |
|--------------------------------|
# (do not use any tabs in the boot.msg file)

TFTP Server

To set up TFTP, launch YaST, browse to Network Services and open TFTP Server. If you are prompted to install the tftp rpm, click Continue. At the TFTP Server Configuration, select Enable, enter "/tftpboot" as the Boot Image Directory and click Finish. The TFTP server is now configured and enabled.

DHCP Server

To configure DHCP services, launch YaST, browse to Network Services and open DHCP Server. If you are prompted to install the dhcp-server rpm, click Continue. From here, the DHCP Wizard starts. On screen 1 (Card Selection) select the Network Cards that you would like to offer the DHCP service on. On screen 2 (Global Settings), enter your Domain name ("local.com"), your Primary and Secondary name servers as needed (172.17.2.2) and your Default Gateway (172.17.2.2). On screen 3 (Dyanmic DNS) enter the First IP Address and Last IP Address that the DHCP Server can assign (172.17.2.100-172.17.2.200). On screen 4 (Start-Up), select When Booting under Service Start and click Finish. the DHCP service is now running, however, it is not yet configured to support PXE boot. To correct this, open /etc/dhcpd.conf in your favorite text editor and add the options in bold for your environment:

option domain-name "local.com";
option domain-name-servers 172.17.2.2;
option routers 172.17.2.2;
default-lease-time 14400;
ddns-update-style none;
allow booting;
allow bootp;
subnet 172.17.2.0 netmask 255.255.255.0 {
  range 172.17.2.100 172.17.2.200;
  default-lease-time 14400;
  max-lease-time 172800;
  next-server 172.17.2.70;
  filename "pxelinux.0";
}

Save the configuration file and restart the DHCP daemon (rcdhcpd restart). With the new options in place, every machine on the network subnet will have the capability to PXE boot (given the network card supports it). If a DHCP server is already in place on your network, you may be able to leverage it using the same or similar parameters to direct PXE requests to your TFTP server.

Boot a system on the given subnet, ensuring that you choose network boot at startup or configure network (PXE) boot to be first in the BIOS boot order. You should see some boot messages, followed by the message created in the boot.msg file. Type "1" followed by enter to start the installation. Go through the install, selecting the options appropriate for your environment. This system will become the template for others that you will deploy. At the end of the installation, check the "Clone This System for Autoyast" checkbox. This will generate AutoYaST file based on the installation information that was just used. The generated file, called "autoinst.xml" can be found in "/root" after install.

AutoYaST

You'll likely want to edit the "autoinst.xml" file manually to make it more generic and usable among different types of hardware. Two elements I always change are <device> in the <interfaces> section and <size> in the <partition> section.
Change from <device>eth-id-00:0c:29:42:2d:50</device> to <device>eth0</device>
Changed from <size>7978521088</size> to <size>auto</size> for swap and /root

The YaST Autoinstallation module, like HTML editors, can also help edit the file without knowing the underlying syntax. To start the Autoinstallation module, launch Yast, browse to Miscellaneous and launch Autoinstallation. To open and edit your existing AutoYaST file choose File->Open. When finished editing choose File->Save. You can also export the current configuration of any system by choosing Tools->Create Reference Profile. A full description of AutoYaST and the Autoinstallation module are beyond the scope of this article. For the latest documentation on all things AutoYaST, checkout: http://www.suse.com/~ug/

Click here to download a sample autoinst.xml file that you can use. It includes "root" and "student" users with passwords of "changeme" and "student".

Copy the "autoinst.xml" to the "/.install" directory on the installation server. Now add a new entry to the pxelinux.cfg and boot.msg files. I've included the required changes in bold in the files below:

default

prompt 1
timeout 0
display pxelinux.cfg/boot.msg
label 1 
  kernel sle10sp1_32bit_linux
  append initrd=sle10sp1_32bit_initrd splash=verbose install=http://172.17.2.70/install/SLED10SP1-32/CD1
label 2 
  kernel sle10sp1_32bit_linux
  append initrd=sle10sp1_32bit_initrd splash=verbose install=http://172.17.2.70/install/SLED10SP1-32/CD1 autoyast=http://172.17.2.70/install/autoinst.xml
#(the "append" line is all one line)
boot.msg

|--------------------------------|
|                                |
| PXE Boot Menu List             |
|                                |
| 1. SLED 10 SP1 (32-bit)        |
| 2. SLED 10 SP1 (32-bit) + auto |
|--------------------------------|

Now repeat the steps from the previous PXE boot test, choosing 2 this time. Verify that the system installs automatically.

Hands-Free

With an installation and PXE server in place, you have the infrastructure to quickly deploy known configurations to a variety of hardware, all without lifting a finger for installation media. Save those precious CDs for other uses like coasters and paper weights and enjoy your newfound time!


If you don't have control over the DHCP server on your subnet or if you're not able to setup a TFP server for one reason or another, all is not lost. You can create a custom boot CD with hard-coded install and autoyast parameters. To do this, simply download the CD1 ISO of SUSE Linux Enterprise Desktop 10 (or 10 SP1), available here: http://www.novell.com/linux/download_linux.html

Loopback mount the ISO and copy the contents to a local directory, commands below (as root):

mount -o loop sled10sp1.iso /mnt
mkdir /tmp/cdroot
cp -a /mnt/* /tmp/cdroot

Edit the isolinux.cfg, found in boot/i386/loader from the root of the "cdroot", to include the install and autoyast parameters shown in the file snippet below:

# install
label linux
  kernel linux
  append initrd=initrd splash=silent showopts install=http://172.17.2.70/install/SLED10SP1-32/CD1 autoyast=http://172.17.2.70/install/autoinst.xml
#(the "append" line is all one line)

Recreate the CD1 ISO with the command below:

mkisofs -o /tmp/bootcd.iso -b boot/i386/loader/isolinux.bin -c boot.cat -no-emul-boot
-boot-load-size 4 -boot-info-table /tmp/cdroot/

You can now burn the resulting ISO to a CD using K3B or other CD/DVD burning programs.


You can continue to grow your installation environment by creating additional AutoYaST templates and by introducing Rule-Based Autoinstallation. For more information, check out: SUSE linux Enterprise Desktop 10 SP1


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell