Automatic diskless boot of media directors

From LinuxMCE
(Redirected from PXE)
Jump to: navigation, search
Version Status Date Updated Updated By
710 Unknown N/A N/A
810 Unknown N/A N/A
1004 Unknown N/A N/A
1204 Unknown N/A N/A
Usage Information

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 not needed since version 7.04

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

This step is not needed since version 7.04 although the May 7th release of 7.10 appears to require it

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.

After some time, you will see the avwizard screen where you can choose your UI, resolution and so forth. After finishing the avwizard, the system will setup your interface and eventually you will be prompted by the setup wizard where you should choose the media center setup and then go through your typical setup for this new MD.

How to use it

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

MD freezes when the splash screen loads

My MD freezes when the splash screen loads, where can I find out what is causing the issue?

Answer

Remove the splashscreen from the append- in /tftpboot/pxelinux.cfg/aa-bb-cc-dd-ee-ff (mac address) to see the kernel boot messages.

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

I have 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.....


I have a single NIC motherboard and the exact same thing is happen. After the MD registers and reboots, it loads the Kubuntu splash screen and hangs as the filename: tftpboot/pxelinux.0 and then after a bit reboots.

Answer

It is switching NICs during the PXE boot. Disable one of the on-board NICs via the BIOS.

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

LinuxMCE-0810 beta

Run 'sudo /usr/pluto/bin/Diskless_CreateTBZ.sh' on the core to created the MD image.

Diskless Setup Failed

I have multiple MDs which all give a Diskless Setup Failed after announcing themselves to the CORE.

Answer

Log into the Web Interface on the CORE, change to the devices view and open up the options for the new MD. Under Device Data check to make sure that the field Architecture is correct. On mine it shows amd64 but all my MDs are actually Intel chipsets*. I manually enter i386 and hit save. Then reboot the MD and it will finish setting itself up correctly.

NOTE: The field labeled Model is not user editable. If you change the Architecture field, upon reboot the CORE will automatically update the Model field appropriately so do not worry about it being wrong.

  • Note: For the core, core/hybrid install CD/DVD's, amd64 simply means 64bit- while i386 means 32bit; It does not mean amd64 is only for Amd processors and i386 is only for Intel. Amd came out with 64bit before Intel, so for a time all 64bit hardware was Amd- 64bit installs often retained the amd64 name even after Intel came out with 64bit hardware. My intel i7 core/hybrid for example is running amd64, and I've not found any issues . While researching my own (amd) net boot problem, I read a post mentioning changing the field to i386 in the panel for an Amd MD, and the machine correctly reporting Amd while net booting, I'm not 100% sure, but this seams to support the conclusion that the architecture field in the admin panel is like the install disks, and denotes the install type (32 or 64bit) rather then the actual physical architecture of the hardware (amd or intel). 32bit currently (7.10) has better hardware support 64bit, especially for NIC's- the marvel yukon for example- so a 32bit install is often recommended as a simple solution to net boot compatibility problems. Also of note, a 64bit (core) install can run 32bit MD's, but not the other way around. A 32bit core install will only configure 32bit MD's, thereby avoiding some potential problems.

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.