Netboot Mythbuntu from 10.04 LTS server


I used a vmware session on my MacBook Pro to test all of this.
It has a mac address of 00:50:56:35:24:b7, and my dhcp server assignes it ad address of 00:50:56:35:24:b7.
Make changes to the docs according to your setup.
I set it up to network boot, this was much easier and faster than using actual hardware.

The two webpages that I found most usefull were.

https://help.ubuntu.com/community/MythTV/Install/Hardy/Diskless
http://www.mythbuntu.org/wiki/network-boot-mythbuntu-diskless

I struggled with this about 5 hours on a saturday. I am posting this here in hopes that it will help someone, and to aid me in the future.

How does it work / architecture
Clients will boot from a read-only compressed file system (squashfs) which is shared out by the server via nbd (network block device). A writeable overlay directory is put on top of the squashfs using aufs ("another unionfs"). The overlay directory is a NFS share exported by the server. Any changes you make on the client are stored in that NFS share and are available across reboots. The client can identify its overlay directory using the MAC address of the network card which was used to boot the system.

The compressed file system is created using a plugin for ltsp-build-image which adds the mythbuntu-specifics bits.

1) DHCP

Configure your DHCP server with the following section, This document assumes that you have a dhcp server running on the backend 192.168.1.3

#
# Diskless systems
#

group {

use-host-decl-names on;
option ntp-servers 192.168.1.1;
#option root-path "/var/lib/tftpboot";

host pxetest {
hardware ethernet 00:50:56:35:24:b7;
fixed-address 192.168.1.20;
next-server 192.168.20.3; # IP address of your TFTP server

if substring( option vendor-class-identifier, 0, 9 ) = "PXEClient" {
filename "/ltsp/i386/pxelinux.0";
} else {
filename "/ltsp/i386/nbi.img";
}
}

}

2) Install the mythbuntu-diskless-server

sudo apt-get install mythbuntu-diskless-server

It brings in tftpd-hpa which I could not get to work even from the command line, so I installed aftpd


3) TFTP

sudo apt-get atftpd

Modify /etc/default/afttpd to look like


USE_INETD=false
OPTIONS="--tftpd-timeout 300 --retry-timeout 5 --mcast-port 1758 --mcast-addr 239.239.239.0-255 --mcast-ttl 1 --maxthread 100 --verbose=5 /var/lib/tftpboot"

restart aftpd

4) Configure the overlay NFS export

sudo dpkg-reconfigure mythbuntu-diskless-server

Answer yes to both questions

5) Create the boot image

sudo ltsp-build-client --arch i386 --mythbuntu --mythbuntu-user-credentials="your-user-id-here:your-password-here"

My server is a 64 bit AMD so I needed the --arch i386 option

This will install the image to /opt/ltsp/i386 (This will take some time!)


6) Fix the network block device server

My install did not create the config file in /etc/nbd-server so I had to create it manually

sudo vi /etc/nbd-server/config

Make it look like:

[generic]
# If you want to run everything as root rather than the nbd user, you
# may either say "root" in the two following lines, or remove them
# altogether. Do not remove the [generic] section, however.
user = nbd
group = nbd

# What follows are export definitions. You may create as much of them as
# you want, but the section header has to be unique.
[export]
exportname = /opt/ltsp/images/i386.img
port = 2000


Restart ndb

7) You should not be able to boot your client

If you are having problems or just want to watch the system boot remove the "quiet splash" from /var/lib/tftpboot/ltsp/i386/pxelinux.cfg/default

Any changes you make while your frontend is booted will be saved for only that fronend on the server under /var/cache/mythbuntu-diskless/overlay

8) Making Changes


Making Changes On the server

sudo mount -o bind /proc /opt/ltsp/i386/proc/

sudo chroot /opt/ltsp/i386

You may Install additional packages for the clients, modify files etc:

apt-get install your-package

edit files on the file system etc.



a) Configure Auto Login (Note myth is the user that I installed with above)
cd /etc/gdm
vi custom.conf

[daemon]
AutomaticLoginEnable=true
AutomaticLogin=myth
TimedLoginEnable=true
TimedLogin=myth
TimedLoginDelay=10


b) Get the time set on the frontend

sudo vi /etc/rc.local

Add the line
ntpdate 192.168.1.1

c) NVIDA-Drivers
Blacklist nouveau
vi /etc/modprobe.d/blacklist.conf
Add the following to the end of the file
blacklist nouveau

Install Nvidia Drivers
apt-get install nvidia-common
apt-get install nvidia-current

Continued after booting frontend



d) When you are done type exit then
sudo umount /opt/ltsp/i386/proc/

Now that your changes are all done you need to rebuild the compressed filesystem that is used to boot the clients.

sudo ltsp-update-image

If you made changes to the kernel you also need to run

sudo ltsp-update-kernels


9) Optional remove the overlays that are created on the frontend for things that are changed and configured there.
cd /var/cache/mythbuntu-diskless/overlay

The overlay filename is the mac address of the front end. You may delete it and a new one will be created the next time the frontend is started.



10) Final Configuration on the frontend

NVIDIA-Drivers Final
Boot frontend
CTRL-ALT-F1
Login
sudo service gdm stop
sudo sh ./PATH_TO_DOWNLOADED_NVIDIA_DRIVERS
sudo service gdm start
To enable sound via HDMI
Open Terminal
alsamixer
Unmute the SPIF outputs to enable sound via HDMI

blog comments powered by Disqus