Netboot
#1
Question 
Does anybody have a good guide for netbooting? I'd like to have a central server on my network with a master library, with all the client machines booting from an image stored on the server, each one accessing a common library.

Thanks in advance,

Pete
Reply
#2
Pete_London Wrote:Does anybody have a good guide for netbooting? I'd like to have a central server on my network with a master library, with all the client machines booting from an image stored on the server, each one accessing a common library.

Thanks in advance,

Pete

I know it could be too late, but I'm writing also to let others know Tongue
I found also a iscsi guide, but... really... iscsi? It's worthless for this installations... we are not running 100 machines!
So I managed to let it boot just with lan and without any other medias (usb, sd, hd...), just by doing that:

- On the server where tftp is, grab debootstrap and run it using ubuntu karmic as distro (note: if you're using ubuntu, just type apt-get install debootstrap; if you're using debian, grab the .tgz, grab the ubuntu debootstrap.deb , extract both and be sure the devices.tgz is in the debootstrap dir as the readme says)
- Debootstrap a minimal ubuntu karmic
- Mount /dev, /dev/pts, /sys and /proc using the following command: mount --bind /dev <path_to_karmic>/dev
- Chroot into the environment, apt-get install nano
- Nano /etc/resolv.conf to add a working server (not 127.0.0.1, something like 8.8.8.8)
- Edit /etc/initramfs-tools/initramfs.conf and change MODULES=netboot and BOOT=nfs
- type inside the chroot shell update-initramfs -u
- passwd, to change root password!
- Now copy the /boot/vmlinuz and /boot/initrd to tftp server, add the directory where karmic is to the /etc/exports, configure a pxelinux.cfg file and reboot the nfs-kernel-server
- Boot you diskless client via lan
- Once you have a shell prompt, apt-get install wget; then download http://sourceforge.net/projects/xci/ this tool
- Edit it and remove all the useless reboots it want to do (remove all the reboots, they're all useless, you'll have to reboot when you want to, not when it wants you to! Big Grin)
- Execute it, install xbmc and watch out what linux-image-headers version it installs (eg. in my case is 2.6.31-22, you can find it under /usr/src)
- When install is finished, apt-get install linux-image-<version>
- Nvidia module generation is started automatically (yep, the script should do it automatically, but it doesn't, don't ask me why, ask the developer)
- Everything should work out-of-the-box.

About the pxelinux.cfg file, this is my configuration:
Code:
prompt 1
noescape 1
allowoptions 0
timeout 300
default linux

LABEL linux
        kernel images/xbmc-kernel
#        append root=/dev/nfs initrd=images/xbmc-initrd nfsroot=<TFTP_SERVER_IP>:<NFS_PATH_TO_KARMIC> ip=dhcp rw xbmc=autostart,tempfs,nodiskmount,setvolume,norediir module=nvidia acpi_enforce_resources=lax
        append root=/dev/nfs initrd=images/xbmc-initrd nfsroot=192.168.1.2:/home/media/XBMC/xbmc-base ip=dhcp rw xbmc=autostart,tempfs,nodiskmount,setvolume,norediir module=nvidia acpi_enforce_resources=lax quiet splash

Remember to use "quiet splash" only when everything works, otherwise you couldn't see the error messages!

So, if you really wanna use netboot, you should have these services configured and running:
- DHCP Server to send boot informations
- TFTP Server to send boot files (kernel and initrd)
- NFS Server to let the client mounts the disk via lan

In my case, I already had everything and just installed via debootstrap ubuntu first, then xbmc (I am using debian).
Talking about speed... speed is okay. My nvidia ion 330 boots in under 30 secs, and using Xperience from teambolt skin everything is okay (it is completely usable, no lag in the interface or whatever).
Ubuntu always gave me problems about vdpau, but xci.sh works well and really enables it out-of-the-box. 1080p movies don't have any problem at all and sound works well (I just had to disable microphone and line in, enabled by default, which cause a little noise on background).
I have actually a 100mbps lan, and I'm fully surprised by the performances. Anyway, for others reasons I'm gonna change the switches, and I'll upgrade to 1Gbps, so... xD

About multiple clients sharing the same db, this is how I have done it:
I used the "xbmc-base" installation for all the clients, and then mounted via aufs a "disk" for each client. Aufs lets you have a base system, and then store each difference in a separate "difference image", so you shouldn't have 4 disks (4x2gb = 8gb!) for 4 clients, but just one common base + a virtual one for each client (the virtual one is really small... things like 10mb at max! xD).
Aufs support can be installed as a module, but doing this nfs is not supported; to have nfs+aufs support you have to patch you kernel and recompile it (yeah, don't blame me, talk to linus torvalds instead xD). Once this has been done, you can have, like I did, the base-image, the clients-images and the public-dirs: the base-image is the one with the filesystem in common, the clients-images contain the differences between base and the each client (different viewers can see different shows... and if one show has been seen by one, the other viewers may haven't!) and the public-dirs are the one to be exported via nfs (they're the merge between base and client images, done automatically by aufs).

Best luck to everyone... and thanks to the xbmc project
PS: Just a question: Why doesn't edit the wii-remote eventlistener to use the B key as trigger? I already enhanced it and now pressing B+A I can go back, B+UP is seen as "page up", B+DOWN as "page down" etc. Could this be useful to you? Should I share my code? xD
Let me know about it, I really would like to see it into official version without having to recompile it every time I install.
Reply
#3
I found another way to mount with aufs the client image: I really don't like the idea of kernel recompilation (anytime the kernel is updated, I have to recompile it!), so anything should be done on the client (aufs CAN merge two nfs shares, but cannot share via nfs a merged mount!)

The server offers two nfs shares: xbmc-base and xbmc-clients; in xbmc-clients there are the client directories, mounted on boot (eg. 00:01:2E:27:BB:F0/).
Next step is to add the aufs module into the xbmc-base, then edit /etc/initramfs-tools/modules and add the following line:
Code:
aufs

Once this is done, the script /usr/share/initramfs-tools/scripts/nfs must be edited, replace the following line:
Code:
nfsmount -o nolock ${roflag} ${NFSOPTS} ${NFSROOT} ${rootmnt}
with the following three:
Code:
nfsmount -o nolock ${NFSOPTS} ${NFSROOT}/xbmc-base /root-base
        nfsmount -o nolock ${NFSOPTS} ${NFSROOT}/xbmc-clients/${MACADDRESS} /root-client
        mount -t aufs -o br:/root-client=rw:/root-base=ro none ${rootmnt}

Now issue update-initramfs -u, go to /usr/src and extract the updated initramfs:
Code:
gzip -dc /var/lib/tftpboot/images/xbmc-initrd | cpio -id

Copy the awk executable:
Code:
cp /usr/bin/awk bin/

And recompress the initram image:
Code:
find . | cpio --quiet -H newc -o | gzip -9 -n > /xbmc-initrd

Copy this image to /var/lib/tftpboot (replace the old one) and edit, always on the server, /etc/exports:
Code:
/home/media/XBMC/xbmc-base                              192.168.0.0/255.255.0.0(ro,no_root_squash,async,no_subtree_check)
/home/media/XBMC/xbmc-clients                           192.168.0.0/255.255.0.0(rw,no_root_squash,async,crossmnt,no_subtree_check)

Now reboot the nfs-kernel-server, create the directory for the client in the path exported, edit your pxelinux.cfg and set nfsroot to the directory containing both the xbmc-base and xbmc-client directories... and enjoy!! xD
Reply

Logout Mark Read Team Forum Stats Members Help
Netboot0