Sunday, March 31, 2013

Arch Linux installation using ipxe and a Fedora server

Arch Linux is great way to learn, e.g. installing Arch Linux booting over the network. As is usual with Arch Linux, the documentation for the process is excellent. Surprisingly, a mirror in India gave an excellent speed and low latency so even the first stage went well.

Since I was experimenting with ipxe, I decided to install Arch Linux using the iso and ipxe. Using dnsmasq was no problem. However, since I use Fedora and the default is dhcpd, I wanted to make it work with dhcpd. The problem  was finding the equivalent options of dhcp-option-force.

The issue was that the client would try to search for cfg file as per its rules and ignore the specification in the dhcpd configuration file. The solution was available on the syslinux wiki in response to
Can I send information to PXELINUX via special options in the DHCP response?
It is much harder syntax than the dnsmasq's dhcp-option-force but worked.

Saturday, March 30, 2013

Install an OS from a DVD iso without booting

While experimenting with LTSP on Fedora18, I realized that I would have to have a supported environment in order to be able to understand the failure on Fedora. I had an iso file of Scientific Linux 6.3 and decided to use that.

Since ltsp-build-client installs an OS in a chroot environment while the system is operational, I decided to see if I could use a LTSP script to install the Scientific Linux on a free partition.

A python program, chroot-creator, seemed a likely prospect.
  1. Commented a few lines in chroot-creator meant specifically for LTSP clients. 
  2. Chose a suitable kickstart file 
  3. Loop mounted the iso image and used it as the yum repository
  4. Started installation on on the free partition which failed.
Installation was not possible as the partition needed to be mounted and the chroot-creator installs the OS in a directory which should not be existing. So, the installation was successfully done in a directory 'Install' under the mount point.

After the installation:
  1. In Install:
    # mv * ..
  2. Modify fstab file for Scientific Linux
  3. Run grub2-mkconfig. It should find and include the Scientific Linux partition.
  4. Chroot to the SL partition
  5. Change password for root. Create additional users if needed.
Scientific Linux should now be a usable boot option.

This process should work with any distribution which is compatible with yum on Fedora.

Note: the experimental version of LTSP scripts now uses mock and chroot-creator program is not included.

LTSP On Fedora 18 using client created on Ubuntu 12.10

Exploration of LTSP turned out to be a very interesting challenge. My motivation was to write a monthly column for Linux For You.

My primary system runs Fedora 18. I thought that I would be able to get the scripts to run on Fedora 18 in spite of the explicit caution that Fedora 15 onward is not supported. I haven't succeeded so far but I did succeed in getting an client image created on Ubuntu 12.10 to run on Fedora 18.

I installed the server scripts from the repository for experimental version of LTSP 5 for Fedora 18. This ensured that that the ldminfod version was compatible with the ldm version on Ubuntu 12.10 client.

Ubuntu uses nbd by default. Unionfs root was not working with NFS root on Ubuntu as well. So, nbd version 3.1.1 needed to be installed on Fedora. The version in Fedora repository is 2.9.20.

LTSP scripts run nbd server using xinetd while Ubuntu 12.10 runs nbd-server as a system service. Since the xinetd option did not work, nbd-server was started using a system service script. The key extract from nbd-server script is:

test -x $DAEMON || exit 0
case "$1" in
    daemon $DAEMON 10809 -C /etc/nbd-server/config
The port has to be 10809 to be compatible with the -N option used by ndb-client on Ubuntu client.

/opt/ltsp/amd64, /etc/nbd-server and  /var/lib/tftpboot/ltsp/amd64 directories was copied from Ubuntu to Fedora. The following were the final steps:

  1. Run ltsp-update-sshkeys
  2. Run ltsp-update-kernels
  3. Run ltsp-update-image amd64 -f
  4. Change the dhcpd configuration files to use the amd64 directory in tftpboot instead of i386. I modified the /etc/dhcp/dhcpd.conf file and did not use the ltsp-dhcpd script.
If all has gone well, you will get a LDM login screen with Ubuntu theme. The sessions available will be the ones on Fedora 18 and you should be able to login to a session using your Fedora 18 credentials!