Booting Solaris X86 via PXE

As long as the hardware supports PXE (Preboot Execution Environment) as server can be booted and installed from the network. For standard Sparc servers the normal method of setting up a jumpstart is the best forward, but for X86 clients PXE is the way to go.

The steps in oder to get a client to boot are as follows:

Configure the TFTP server

The TFTP server is controlled by SMF, hopefully it should be up and running

# svcs tftp/udp6
online 16:57:20 svc:/network/tftp/udp6:default

# inetadm -l tftp/udp6
exec="/usr/sbin/in.tftpd -s /tftpboot"
default bind_addr=""
default bind_fail_max=-1
default bind_fail_interval=-1
default max_con_rate=-1
default max_copies=-1
default con_rate_offline=-1
default failrate_cnt=40
default failrate_interval=60
default inherit_env=TRUE
default tcp_trace=FALSE
default tcp_wrappers=FALSE

If the service is not running then carry out the following, check that the inetd.conf file has the below line

# TFTPD - tftp server (primarily used for booting)
tftp dgram udp6 wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot

The inetd.conf configuration can be converted into service manifests and then imported into the SMF repository

# inetconv
tftp -> /var/svc/manifest/network/tftp-udp6.xml
Importing tftp-udp6.xml.....Done

Or you can manually import into the SMF repository

# svccfg -v import /var/svc/manifest/network/tftp-udp6.xml
svccfg: Taking "previous" snapshot for svc:/network/tftp/udp6:default.
svccfg: Upgrading properties of svc:/network/tftp/udp6 according to instance "default".
svccfg: Taking "last-import" snapshot for svc:/network/tftp/udp6:default.
svccfg: Refreshed svc:/network/tftp/udp6:default.
svccfg: Successful import.

A minmum installtion of the tftp boot area is as follows

/tftpboot/boot/grub/pxegrub GRand Unified Bootloader (GRUB) program image for PXE use
/tftpboot/boot/multiboot Kernel ELF executable which is passed control too after GRUB
/tftpboot/boot/x86.miniroot Module, provides minimal functionality of solaris OS.

The GRUB menu makes life easy so that that the GRUB commands do not have to be entered manually, the below GRUB menu (menu.lst.pxe can be called anything) has two meni items one for single user boot and one for an Solaris install

default 0
timeout -1

title Solaris Single-user Session
  kernel /solaris/boot/multiboot kernel/unix -s
  module /solaris/boot/x86.miniroot

title Solaris Install Console
  kernel /solaris/boot/multiboot kernel/unix -v -B console=ttya,install_media=
  module /solaris/boot/x86.miniroot

title Solaris Install No Console
  kernel /solaris/boot/multiboot kernel/unix -v install_media=
  module /solaris/boot/x86.miniroot

Configure the DHCP Server

Confirm that the DHCP server is not running

# svcs dhcp-server
offline 16:35:49 svc:/network/dhcp-server:default

Unconfigure any old DHCP servers

dhcpconfig -U

-U unconfigure the DHCP service

Remove any unwanted files that have been left around in the /var/dhcp directory

rm /var/dhcp/SUNW*
rm /var/dhcp/.SUNW*

To initialise the DHCP server and create a number of default confgiuration databases run the following, here we are going to use the /var/dhcp directory

dhcpconfig -D -r SUNWfiles -p /var/dhcp

-D Configure the DHCP server
-r Specifys the data stores
-p Path

Now setup the DHCP network

dhcpconfig -N -m -t

-N Confiure network for DHCP
-m subnet mask for network
-t router addresses for network

Define a custom symbol called "GRUBMenu" for the DHCP option #150

dhtadm -A -s GrubMenu -d Site,150,ASCII,1,0

-A Add a custom symbol/Macro
-s symbol
site this is site specific
150 the DHCP option code
ASCII the value is a text string
1 granularity
0 maximum

Define the macro with boot options

dhtadm -A -m netboot -d :BootSrvA="solaris/boot/grub/pxegrub":GrubMenu="menu.lst.pxe":

-A Add symbol or Macro
-m Macro name
-d definition

Add the client definition information to the network table

pntadm -A -i 000C29567867 -m netboot
pntadm -A -i 000C2970965B -m netboot

-A Add a client with hostname or IP address
-i Client identifier (normally MAC address)
-m Macro to be used

Start the DHCP server

dhcpconfig -Se

-S Control the DHCP service
-e enable and strta the DHCP server

Not to sure why but on a number of occations i have had to restart the DHCP server

svcadm restart dhcp-server