Automatic diskless boot of media directors

From LinuxMCE
Revision as of 22:58, 23 January 2008 by Rrambo (Talk | contribs) (Determine your network card's MAC address)

Jump to: navigation, search

LinuxMCE allows media directors to be booted over the network. This means that you can boot up thin clients without hard drives, or systems with other operating systems without affecting what is already on the disk.

How to set it up

Enable PXE boot

This is also known as network boot and can be accessed in your computer's BIOS. The exact procedure varies depending on your PC. Normally you press F2 or DEL right after turning the PC on to enter the BIOS settings. There is then usually an advanced option to enable this.

Set the correct boot order

You are also going to want to set the boot order in the BIOS so the network boot comes first, and your hard drive second. However most BIOS's will make you first enable network boot, save your changes, restart the computer, and then enter the BIOS settings a second time to set the boot order.

Determine your network card's MAC address

This step is no longer needed in 7.10

When network boot is working you should see at bootup the PC's mac address, and a messages about trying to contact a DHCP server, or trying to find a network boot image. This will be a new message you didn't see before and it means network boot is active on the PC. It will usually try for about 10 seconds to do a network boot image, and then give up and boot off the hard drive. This is what you want. When you see the message that it is trying to do the network boot, write down the mac address.

You can also get the mac address in Windows by running IPCONFIG command prompt, or in Linux by typing ifconfig as root from a console or a terminal.

Setup the media director in LinuxMCE

In LinuxMCE Admin go to Wizard > Devices > Media Directors. Add the media director if this is a new one, and set the mac address. The mac address should be a series of six 2 character sequences separated by colons, like this: 1A:00:F2:21:23:9F

Click 'update' to save your changes, and then click 'Setup Diskless Media Directors'. Wait for the popup window to finish. If this is a new media director you just added, go to Wizard, Restart and click 'Quick Reload Router' so the Router is aware of this new device.

Boot up from the network

Now turn on the PC. You should see that it gets an IP address and boots into the media director software. The first time you boot it, it can take up to 30 minutes to boot because it will be installing a lot of the software on the diskless image on the core, and it will also need to generate a user interface.

Once it's up, use the Wizard > Devices > Media Directors page to set the display resolution and also choose extra software you want to run on that Media Director with the 'Edit Computing Applications' button.

How to use it

Using LinuxMCE. If this media director has a hard drive in it that contains another operating system (like Windows or Linux), then from the media director's on-screen orbiter, or from any other orbiter that is currently controlling that media director, hit the 'power' button and choose 'restart as windows/linux' to boot up the computer off the hard drive and use it like a normal PC. Then choose 'restart as LinuxMCE' from the orbiter to boot it back again into LinuxMCE.

Troubleshooting

PXE-Boot hangs up, looping......

I got an Asus A7N8X-deluxe board, with two NICs onboard, when I connect one of them the md tries to boot via PXE, everything seems to go its way, until, the line: filename tftpboot/pxelinux.0 comes up, for about 20 seconds and after this. After this, the last block written:

IP-Config eth0 complete (from 192.168.1.23) adr: 192.168.80.255 broadcast: 192.168.80.255 netmask: 255.255.255.0 gateway: 192.168.80.1 dns0: 192.168.80.1 dns1: 0.0.0.0 rootserver: 192.168.80.1 rootpath: filename tftpboot/pxelinux.0

is repeated about hours in a really fast way.....

Answer

It is switching nics on you during the pxe boot. Disabling one of the on-board nics.

Source: http://forum.linuxmce.org/index.php?topic=3521.0

GRUB PXE network boot

In some situations, it may be more appropriate to use GNU GRUB bootloader:

  1. The machine does not support PXE booting directly (no boot-ROM).
  2. You can use a GRUB boot menu to decide wheter you want to boot LMCE or the native OS.
  3. Booting is a lot faster when you boot the native OS by skipping the network step.
  4. GRUB allows for easy adjustments of the boot parameters at boot-time.

This is described in detail at GRUB PXE network boot.

Reduce boot time

When using diskless boot, all data have to be read over the network connection. This can cause boot up times longer than desirable. To avoid long boot up times, you can tune the NFS mount options of the NFS root. Specifically, the rsize and wsize options. You might do a Internet search for resources on this. Another option is to implement suspending of the media director. Also know as standby, suspend or hibernate. This function is not integrated into LinuxMCE (yet), and requires some Linux shell hacking. See the Suspend article for more information.

Programmer's guide

The network boot images are contained in /usr/pluto/diskless/[deviceID]. If a network image is corrupted, just delete that directory, and re-run 'Setup Diskless Media Directors'.

When the user hits the power button to change which device is booted, the command is sent to "General Info Plugin", which updates /tftpboot/pxelinux.cfg/01-[mac address]. That file contains a line KERNEL or LOCALBOOT 0, depending on what the user wants to boot. If it's LOCALBOOT 0, then when the media director tries to do a network boot the Core will tell it to boot off the hard drive instead. General Info Plugin then sends the App Server running on that machine a command to reboot.

Since there is both a Linux and Windows version of App Server, if App Server is installed and running on the Windows PC, then LinuxMCE can still reboot it remotely back into the network boot even if it's running Windows. Also the Windows App Server utility gives you a tray icon to switch back to network boot.

Other Network Cards

If you get to the remote machine starting the boot process, but then fails with it unable to find eth0, the reason may be because the stock diskless image did not have your network card statically compiled. The linux image building process does allow for additional network modules to be loaded during the boot process. The installer that linuxmce uses builds this image from a base copy of the operating system (ubuntu) that is untar'd during the diskless setup process. It puts this into it's own directory that serves as a virtual harddrive for your diskless machine. In the /usr/pluto/diskless directory you should have a list of device numbers that correspond to your diskless machines. For example: '45' was the number for my diskless machine. Edit the file /usr/pluto/diskless/###/etc/initramfs-tools/modules and add on your nic's module. In my case I edit /usr/pluto/diskless/45/etc/initramfs-tools/modules and added sky2. Then run the /usr/pluto/bin/Diskless_InstallKernel.sh script with the device number (directory name) of your diskless machine. In my case "/usr/pluto/bin/Diskless_InstallKernel.sh 45". This script builds the initrd image and puts it in the proper place (symlinks it actually).

The driver used in my machine was the 'sky2' driver for Marvell Gigabit ethernet cards. Other drivers will be located in the /usr/pluto/diskless/xx/lib/modules/2.xxx/kernel/drivers/net/ directory.