STREAMING UBUNTU Desktop (or streaming linux desktop), so:
- no local installation
- highly scalable
- high performance
- low cost in administration and hardware
- highly adaptable
NOTE:: this is work in progress to port from 9.10 to 10.04 LTS and later possibly newer versions of Ubuntu, document is currently being updated.
Goal
Offering a desktop based on Ubuntu GNU/Linux, booting over a local network from one single image. This image needs to be customized for our users at the Leiden University, The Netherlands. Current authentication is done via Kerberos and LDAP. The home directories are mounted over NFS.
Results
The test deployment has currently more than 75 clients desktops booting via PXE on a read-only squashfs image, served from a one single NFS/TFTP server (having a load of 0)
Unix admins: understanding the "AS IS" section in the license . What is written here, will not work off the shelf. To make it work you have to customize it, in the end can save you a lot of time.
Our set-up has to offer: Ubuntu Lucid 10.4.2 LTS (previous 9.10) is used as a base. Documentation used: https://help.ubuntu.com/6.10/ubuntu/installation-guide/hppa/linux-upgrade.html http://syslinux.zytor.com/wiki/index.php/PXELINUX#Custom_Menu_Example_with_sub-menus https://help.ubuntu.com/community/LiveCDCustomizationFromScratch Environment: about 100 ASRock nettop clients The main focus is the staging environment, keeping staging and production separate. For this !How-To I won't describe the production server, since they are mostly the same. But as a habit, I never build on production servers since one error in the build script could give me, and some hundred users, a bad day. This actually happened, one day my build server did not reboot any more. The build script escaped to the root and the initrd.img was replaced..... As a policy, we use LTS on servers.
192.168.1.0/24 => external (uplink) 192.168.2.0/24 => internal (pxeboot)
Install the build host with 3 raid1 partitions: Or choose another appropriate setup.
First install some packages
Content of /etc/network/interfaces: Content of /etc/dhcp3/dhcpd.conf:
Content of /etc/sysctl.d/10-ip_forward.conf Content of /etc/exports: Content of /etc/default/tftpd-hpa:
Content of /data/tftpboot/pxelinux.cfg/default : Content of /data/tftpboot/pxelinux.cfg/graphics.cfg: Keep an eye on the options, and make sure you understand the documentation! Setting bad options here may allow a user to escape from the loader menu and start a shell as root instead of invoking init. This would give one access to all user files on NFS, which would only make you popular to a very limited set of people (and not at all popular to many others). Read more about PXELinux how to get nice menus and more.
Read this info and execute the next commands: Run apt-mirror: Add it to cron: Add to apache: assuming everything is in /data/mirror/ Be In /etc/apache2/sites-enabled/mirror: Restart apache: Test the mirror:
No build scripts are available yet, but the picture
generally while chrooting into build environment set correct env and mounts
The kernel and initrd environment needs: There are two ways to build it, one is with a kernel package and the other is manual. I have found the manual manner more reliable.
This will create packages. I found issues creating an initrd file, to solve this:
chroot build apt-get install <list>
Here a sample tarbal: https://wiki.ubuntu.com/MartenVijn?action=AttachFile&do=get&target=ubuntu_pxe.desktop.0.0.128.tgz Newer versions may exist here. So download it and untar it. Now you should be able to use the build-script: explanation of the files:
With the TREE option you can add/utilize: We add: Details of this are not public.
This is pre-alpha, meant as an example to feed unix admins creativity. From you should be able the work yourself into it as you a unix admin. Patches, Tips, better Ubuntu Practices are more than welcome. send an email to mvn at math dot leidenuniv dot nl
Audience
Set-up
Server Set-up
Networks
Installation
Packages
apt-get install dhcp3-server tftpd-hpa nfs-kernel-server syslinux debootstrap
Network Configuration
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
post-up iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE
down iptables -t nat -D POSTROUTING 1
auto eth1
iface eth1 inet static
address 192.168.2.1
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.254
DHCPDARGS=eth1;
ddns-update-style none;
option domain-name "test.example.com";
option domain-name-servers 192.168.1.1;
default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.100 192.168.2.200;
option routers 192.168.2.1;
filename "pxelinux.0";
next-server 192.168.2.1;
}
NAT and Forwarding
# Enable packet forwarding for IPv4
net.ipv4.ip_forward=1
/data/tftpboot/ *(no_subtree_check,ro,no_root_squash,async)
/data/home/ *(no_subtree_check,rw,no_root_squash,async)
RUN_DAEMON="yes"
OPTIONS="-l -s /data/tftpboot"
Prepare Pxe Set-up
mkdir -p /data/tftpboot/pxelinux.cfg
cp /usr/lib/syslinux/pxelinux.0 /data/tftpboot/
cp /usr/lib/syslinux/menu.c32 /data/tftpboot/
cp /usr/lib/syslinux/vesamenu.c32 /data/tftpboot/
menu INCLUDE pxelinux.cfg/graphics.cfg
DEFAULT vesamenu.c32
NOESCAPE 1
ALLOWOPTIONS 0
boot label in /data/tftpboot
LABEL Karmic
MENU LABEL new test
MENU DEFAULT
KERNEL new/vmlinuz
APPEND quiet splash initrd=new/initrd.img boot=casper netboot=nfs raid=noautodetect root=/dev/nfs nfsroot=192.168.2.1:/data/tftpboot/new ip=dhcp rw --
MENU TITLE PXE Menu
menu color tabmsg 37;40 #80ffffff #00000000
menu color hotsel 30;47 #40000000 #20ffffff
menu color sel 30;47 #40000000 #20ffffff
menu color scrollbar 30;47 #40000000 #20ffffff
MENU WIDTH 80
MENU MARGIN 20
MENU ROWS 20
MENU TABMSGROW 18
MENU CMDLINEROW 18
MENU ENDROW 2
MENU MASTER PASSWD vingerhoed
MENU PASSWORDROW 24
MENU PASSWORDMARGIN 20
MENU PASSPROMPT Enter Password:
MENU TIMEOUTROW 20
MENU TIMEOUTROW 13
MENU VSHIFT 3
NOESCAPE 1
ALLOWOPTIONS 0
PROMPT 0
TIMEOUT 60
Important NOESCAPE
ALLOWOPTIONS
PROMPT
Starting Services
/etc/init.d/tftpd-hpa restart
/etc/init.d/nfs-kernel-server
/etc/init.d/dhcp3-server
Local Mirror
apt-get install apt-mirror apache2
vi /etc/apt/mirror.list # configure it to put every thing in /data/mirror/
like this:
set base_path /data/mirror
mkdir -p /data/mirror/skel /data/mirror/mirror /data/mirror/var
apt-mirror
vi /etc/cron.d/apt-mirror
and remove the # from the last line
Alias /ubuntu/ "/data/mirror/mirror/XX.archive.ubuntu.com/ubuntu/"
<Directory "/data/mirror/mirror">
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
AllowOverride None
</Directory>
/etc/init.d/apache2 restart
apt-get install lynx
lynx http://localhost/ubuntu/
Running a Build
Boot-strap Lucid
apt-get install debootstrap
mkdir build
debootstrap lucid build
mount -o bind /dev/ build/dev
chroot build
export LANG=en_US.UTF-8
export HOME=/root
export LC_ALL=C
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devpts none /dev/pts
# do work here
umount -lf /proc
umount -lf /sys
umount -lf /dev/pts
exit
umount -lf build/dev
Make a Suitable Kernel and Initrd
1 For Both Ways
# prepare
mount -o bind /dev/ build/dev
chroot build
export LANG=en_US.UTF-8
export HOME=/root
export LC_ALL=C
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devpts none /dev/pts
#do
vi /etc/initramfs-tools/initramfs.conf
#change in BOOT=local to BOOT=nfs
apt-get update
apt-get install casper linux-source libncurses5-dev
cd /usr/src/
tar xvjf linux-source-2.6.32.tar.bz2
ln -s linux-source-2.6.32 linux
cd linux
make menuconfig
# add network cards, dhcp, nfs, aufs, squashfs, devtmpfs
2a Manual
make
make install
make modules
make modules_install
mkinitramfs -o /initrd.img `ls /lib/modules`
cp /boot/vmlinuz /vmlinuz
# close
umount -lf /proc
umount -lf /sys
umount -lf /dev/pts
exit
umount -lf build/dev
2b Kernel Package
fakeroot make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=-1 kernel-image kernel-headers
# close
umount -lf /proc
umount -lf /sys
umount -lf /dev/pts
exit
umount -lf build/dev
chroot built
mkinitramfs -o /initrd.img `ls /lib/modules`
Adding Packages
Authentication + Storage
Automating the build (a tinderbox)
Setting up Support
Previous Work (to be obsoleted)
Read and understand:
* config.txt.
* build.sh
* LICENSE.txt
Make sure are not on a production machine and you made backups
Getting it to Work
HELP
Future plans