Install Server: Difference between revisions

From Free Geek Seattle
No edit summary
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 5: Line 5:


=Status and To-Do=
=Status and To-Do=
* We're slowly working on a metapackage to automate installing this setup. The code lives here: https://github.com/freegeek-seattle/install_pxeserver but as of today is is not yet ready. [[User:Koanhead|Koanhead]] ([[User talk:Koanhead|talk]]) 21:05, 15 November 2014 (PST)
* Where is the server? It is not seen on the network and the physical location is UNKNOWN
* Where is the server? It is not seen on the network and the physical location is UNKNOWN
** Currently there is no install server. The last one went missing, hence automation.
** Currently there is no install server. The last one went missing, hence automation.
* The server should have a flawless boot operation. Currently not the case.
** As of 20150221 the install server is live in FCSTMC, serving 32- and 64-bit Xubuntu live images. Installer does not support OEM mode, further hacking is needed. Server duties will be transferred to [[voltron]] soon.
** Currently it doesn't work at all. Flawless may be a bit much to ask; I'd be happy with 'boots Ubuntu 12.o4 32-bit more quickly than a CD', which is the best we've achieved with it so far. I expect we can do better. Watch this space ☺
 
* The server should have Xubuntu 14.04 (Trusty) boot/install. Currently it has (just) 12.04 (Precise)
* The server should have Xubuntu 14.04 (Trusty) boot/install. Currently it has (just) 12.04 (Precise)
** We can add arbitrary images to the boot server after it is set up. Storage is the only limit.
** We can add arbitrary images to the boot server after it is set up. Storage is the only limit.
Line 14: Line 15:
** See http://www.debianadmin.com/automatic-update-of-packages-using-cron-apt.html (or package `unattended-upgrades`)
** See http://www.debianadmin.com/automatic-update-of-packages-using-cron-apt.html (or package `unattended-upgrades`)
* The server data & configuration should ideally be backed up somewhere- as should '''all''' important data.
* The server data & configuration should ideally be backed up somewhere- as should '''all''' important data.
* One machine has already refused to boot over PXE due to "client does not accept TFTP option". This message is not especially helpful in that it doesn't specify which option it doesn't like. The only option specified in server's config is "secure". Turning this option off did not clear the message. May be related to http://lkml.iu.edu/hypermail/linux/kernel/0202.2/0724.html, "The PXE daemon cannot be used on this server because the DHCP daemon will not
allow sending back a class-identifier (option 60) in the DHCP offer."


=References=
=References=
Line 25: Line 28:
*http://www.syslinux.org/old/menu.php
*http://www.syslinux.org/old/menu.php
*http://lkml.iu.edu/hypermail/linux/kernel/0202.2/0724.html
*http://lkml.iu.edu/hypermail/linux/kernel/0202.2/0724.html
*http://webapp5.rrz.uni-hamburg.de/SuSe-Dokumentation/packages/syslinux/pxelinux.txt


This will probably also come in handy:
This will probably also come in handy:
Line 47: Line 51:
Little is needed. Intel P4, 1024GB RAM is adequate. More than can saturate available NIC is probably not useful.
Little is needed. Intel P4, 1024GB RAM is adequate. More than can saturate available NIC is probably not useful.
Enough storage for whichever exported filesystems we want. Two NICs allows updates and proxy / router operation.
Enough storage for whichever exported filesystems we want. Two NICs allows updates and proxy / router operation.
As of 20141217 [[seawall]] provides DHCP and the admin workstation at 192.168.1.27 provides both TFTP and NFS. Currently tftpd is not working. [[User:Koanhead|Koanhead]] ([[User talk:Koanhead|talk]]) 01:17, 18 December 2014 (PST)


===PROBLEMS===
===PROBLEMS===
Line 55: Line 61:
:https://www.gnu.org/software/grub/manual/html_node/GRUB-only-offers-a-rescue-shell.html
:https://www.gnu.org/software/grub/manual/html_node/GRUB-only-offers-a-rescue-shell.html
:https://www.gnu.org/software/grub/manual/html_node/Command_002dline-and-menu-entry-commands.html
:https://www.gnu.org/software/grub/manual/html_node/Command_002dline-and-menu-entry-commands.html
:This may be due to incorrect BIOS / bus settings. There are only 2 SATA connectors on the mobo, and the drive only shows as Second Master or Fourth Master IIRC...
 
;Not currently configured to share internet access with DHCP clients.
[[User:Koanhead|Koanhead]] ([[User talk:Koanhead|talk]]) 01:17, 18 December 2014 (PST) TFTP not working for unknown reasons. Troubleshooting with tftp-hpa is not instructive. Recommend nc for this if I can remember/figure out how to use it (need to know the tftp protocol.)
:use squid?
;Synaptics touchpads don't seem to work with Trusty Tahr? Perhaps the iso is corrupt?
:Nope, it's a known bug in Trusty: https://bugs.launchpad.net/bugs/1265885
;Wishlist: set up an APT cache.
:https://help.ubuntu.com/community/Apt-Cacher-Server
:squid-deb-proxy


===Software===
===Software===
Line 70: Line 70:
NFS server. nfs-kernel-server
NFS server. nfs-kernel-server


Optionally: caching proxy server for updates. Squid or apt-cacher or similar.
Optionally: caching proxy server for updates. Squid or apt-cacher or similar. NOTE: we don't need to unpack and modify the iso files in order to use a proxy: DHCP option 252 defines proxy information for the client. See http://manpages.debian.org/cgi-bin/man.cgi?query=dhcpd&apropos=0&sektion=0&manpath=Debian+6.0+squeeze&format=html&locale=en under "OPTIONS" for more information.
 
[[User:Koanhead|Koanhead]] ([[User talk:Koanhead|talk]]) 01:17, 18 December 2014 (PST) [[seawall]] is providing Squid.


==OS==
==OS==


The examples here assume Debian Wheezy.
The examples here assume Debian Wheezy.
==DHCP==
''isc-dhcp-server'' with configs as shown in Files.
==TFTP==
''tftpd-hpa''
http://releases.ubuntu.com/12.04.4/ubuntu-12.04.4-desktop-i386.iso
http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-i386/current/images/netboot/
http://mirror.anl.gov/pub/ubuntu-iso/CDs-Xubuntu/14.04/release/xubuntu-14.04-desktop-i386.iso
#extract files from image
#place files in tftpd directory
<pre>
mkdir -p /srv/tftp/ubuntu-livecd-boot/i386
mkdir -p /srv/ubuntu-livecd/i386
cp -av /media/cdrom/* /srv/ubuntu-livecd/i386
cp -av /media/cdrom/.disk /srv/ubuntu-livecd/i386
cp -av /media/cdrom/casper/initrd.lz /srv/tftp/ubuntu-livecd-boot/i386
cp -av /media/cdrom/casper/vmlinuz /srv/tftp/ubuntu-livecd-boot/i386
</pre>
'''NOTE''' Only i386 works right now. [[User:Koanhead|Koanhead]] ([[User talk:Koanhead|talk]])
==NFS==
''nfs-kernel-server''


==Files==
==Files==


*/etc/network/interfaces
===/etc/===
 
====network/interfaces====
<pre>
<pre>
#wired
#wired
allow-hotplug eth0
allow-hotplug eth0
iface eth0 inet static
 
#config for pxeserver interface
iface pxesrv inet static
   address 192.168.0.1
   address 192.168.0.1
   netmask 255.255.255.0
   netmask 255.255.255.0
#radio
#config for uplink interface
allow-hotplug wlan0
iface uplink inet dhcp
iface wlan0 inet dhcp
 
  wpa-ssid "FCSTEAMLAB"
#sample wifi config
  wpa-psk "whateveritis"
#allow-hotplug wlan0
#iface wlan0 inet dhcp
wpa-ssid "FCSTEAMLAB"
wpa-psk "whateveritis"
</pre>
</pre>
This uses "logical interfaces" as in [http://manpages.debian.org/cgi-bin/man.cgi?query=interfaces&apropos=0&sektion=0&manpath=Debian+7.0+wheezy&format=html&locale=en| the interfaces manpage], so the interfaces need to be brought up like '''ifup eth0=pxesrv''' for example.


Make sure that wicd or NetworkManager or similar automaticity is disabled, or your manual settings are likely to suddenly stop working...
Make sure that wicd or NetworkManager or similar automaticity is disabled, or your manual settings are likely to suddenly stop working...


*/etc/default/
====default/====
Edit isc-dhcp-server to specify which interface to use. Also found here is defaults for tftpd which so far do not need to be altered from what the package writes.
Edit isc-dhcp-server to specify which interface to use. Also found here is defaults for tftpd which so far do not need to be altered from what the package writes.


*/etc/exports
=====tftpd=====
Config file for NFS. Run <pre>exportfs -a</pre> after editing this file.


===/srv/===
TFTP_DIRECTORY="/srv/tftp"
Top-level of files to be served.
*xubuntu-14.04-i386.iso - downloaded ISO image.
*tmpmnt/ Directory for loop-mounting the iso images. You could serve the mounted images, but I prefer to copy the files.


=====isc-dhcp-server=====


<pre>
INTERFACES="eth0"
</pre>




 
====dhcp/dhcpd.conf====
===DHCP===
 
isc-dhcp-server with the following configs:
 
====/etc/dhcp/dhcpd.conf====
<pre>
<pre>
# lines retained from default preceded by a comment (like this one)
# lines retained from default preceded by a comment (like this one)
Line 143: Line 178:
</pre>
</pre>


====/etc/default/isc-dhcp-server====
====exports====
 
Config file for NFS. Run <pre>exportfs -a</pre> after editing this file.
<pre>
INTERFACES="eth0"
</pre>
 
===TFTP===
tftpd-hpa
 
http://releases.ubuntu.com/12.04.4/ubuntu-12.04.4-desktop-i386.iso
http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-i386/current/images/netboot/
 
http://mirror.anl.gov/pub/ubuntu-iso/CDs-Xubuntu/14.04/release/xubuntu-14.04-desktop-i386.iso
 
#extract files from image
#place files in tftpd directory
<pre>
mkdir -p /srv/tftp/ubuntu-livecd-boot/i386
mkdir -p /srv/ubuntu-livecd/i386
cp -av /media/cdrom/* /srv/ubuntu-livecd/i386
cp -av /media/cdrom/.disk /srv/ubuntu-livecd/i386
cp -av /media/cdrom/casper/initrd.lz /srv/tftp/ubuntu-livecd-boot/i386
cp -av /media/cdrom/casper/vmlinuz /srv/tftp/ubuntu-livecd-boot/i386
</pre>
 
'''NOTE''' Only i386 works right now. [[User:Koanhead|Koanhead]] ([[User talk:Koanhead|talk]])
====/etc/default/tftpd====
 
TFTP_DIRECTORY="/srv/tftp"


===NFS===
====/etc/exports====
<pre>
<pre>
# /etc/exports: the access control list for filesystems which may be exported
# /etc/exports: the access control list for filesystems which may be exported
Line 195: Line 199:


</pre>
</pre>
===/srv/===
Top-level of files to be served.
====pxe/====
Boot menu and other PXE stuff lives here.
Populate this directory with the contents of your favorite installer image's netboot directory, for example:
*  http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-i386/current/images/netboot/
Or set it up manually. Details at *http://webapp5.rrz.uni-hamburg.de/SuSe-Dokumentation/packages/syslinux/pxelinux.txt
=====pxelinux.cfg/=====
======default======
=====pxelinux.0 (binary)=====
====nfs/====
files to be served live here, including ISO images.
*xubuntu-14.04-i386.iso - downloaded ISO image.
*tmpmnt/ Directory for loop-mounting the iso images. You could serve the mounted images, but I prefer to copy the files.
[[Category:Projects]]
[[Category:Projects]]

Latest revision as of 17:25, 22 February 2015

What's it for?[edit]

We have a chronic shortage of install media at FCS Workshops, so this is a project to mitigate the situation.

You set up a computer to boot from its network interface, plug in a network cable on the server's subnet, and boot into a Xubuntu Live session.

Status and To-Do[edit]

  • We're slowly working on a metapackage to automate installing this setup. The code lives here: https://github.com/freegeek-seattle/install_pxeserver but as of today is is not yet ready. Koanhead (talk) 21:05, 15 November 2014 (PST)
  • Where is the server? It is not seen on the network and the physical location is UNKNOWN
    • Currently there is no install server. The last one went missing, hence automation.
    • As of 20150221 the install server is live in FCSTMC, serving 32- and 64-bit Xubuntu live images. Installer does not support OEM mode, further hacking is needed. Server duties will be transferred to voltron soon.
  • The server should have Xubuntu 14.04 (Trusty) boot/install. Currently it has (just) 12.04 (Precise)
    • We can add arbitrary images to the boot server after it is set up. Storage is the only limit.
  • The server should be configured to auto-update to ensure security vulnerabilities are avoided.
  • The server data & configuration should ideally be backed up somewhere- as should all important data.
  • One machine has already refused to boot over PXE due to "client does not accept TFTP option". This message is not especially helpful in that it doesn't specify which option it doesn't like. The only option specified in server's config is "secure". Turning this option off did not clear the message. May be related to http://lkml.iu.edu/hypermail/linux/kernel/0202.2/0724.html, "The PXE daemon cannot be used on this server because the DHCP daemon will not

allow sending back a class-identifier (option 60) in the DHCP offer."

References[edit]

This will probably also come in handy:

Clients[edit]

Any computer with the following:

  1. Wired network interface supporting PXE (check BIOS)
  2. Enough RAM to support kernel + RAMdisk (currently >1 GiB, will be more with Ubuntu)
  3. Architecture supported by install image (currently i386)

Server[edit]

Hardware[edit]

Little is needed. Intel P4, 1024GB RAM is adequate. More than can saturate available NIC is probably not useful. Enough storage for whichever exported filesystems we want. Two NICs allows updates and proxy / router operation.

As of 20141217 seawall provides DHCP and the admin workstation at 192.168.1.27 provides both TFTP and NFS. Currently tftpd is not working. Koanhead (talk) 01:17, 18 December 2014 (PST)

PROBLEMS[edit]

Kept for nostalgia, the machine in question has gone missing:

GRUB is not properly installed, machine does not boot normally. Use grub-rescue prompt to boot
http://gnu-linux.org/grub-rescue-commands.html
https://www.gnu.org/software/grub/manual/html_node/GRUB-only-offers-a-rescue-shell.html
https://www.gnu.org/software/grub/manual/html_node/Command_002dline-and-menu-entry-commands.html

Koanhead (talk) 01:17, 18 December 2014 (PST) TFTP not working for unknown reasons. Troubleshooting with tftp-hpa is not instructive. Recommend nc for this if I can remember/figure out how to use it (need to know the tftp protocol.)

Software[edit]

DHCP server. Example uses isc-dhcp-server, dnsmasq is also alleged to work. TFTP server. For Debian this is tftpd-hpa. NFS server. nfs-kernel-server

Optionally: caching proxy server for updates. Squid or apt-cacher or similar. NOTE: we don't need to unpack and modify the iso files in order to use a proxy: DHCP option 252 defines proxy information for the client. See http://manpages.debian.org/cgi-bin/man.cgi?query=dhcpd&apropos=0&sektion=0&manpath=Debian+6.0+squeeze&format=html&locale=en under "OPTIONS" for more information.

Koanhead (talk) 01:17, 18 December 2014 (PST) seawall is providing Squid.

OS[edit]

The examples here assume Debian Wheezy.

DHCP[edit]

isc-dhcp-server with configs as shown in Files.

TFTP[edit]

tftpd-hpa

http://releases.ubuntu.com/12.04.4/ubuntu-12.04.4-desktop-i386.iso

http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-i386/current/images/netboot/
http://mirror.anl.gov/pub/ubuntu-iso/CDs-Xubuntu/14.04/release/xubuntu-14.04-desktop-i386.iso
  1. extract files from image
  2. place files in tftpd directory
mkdir -p /srv/tftp/ubuntu-livecd-boot/i386
mkdir -p /srv/ubuntu-livecd/i386
cp -av /media/cdrom/* /srv/ubuntu-livecd/i386
cp -av /media/cdrom/.disk /srv/ubuntu-livecd/i386
cp -av /media/cdrom/casper/initrd.lz /srv/tftp/ubuntu-livecd-boot/i386
cp -av /media/cdrom/casper/vmlinuz /srv/tftp/ubuntu-livecd-boot/i386

NOTE Only i386 works right now. Koanhead (talk)

NFS[edit]

nfs-kernel-server

Files[edit]

/etc/[edit]

network/interfaces[edit]

#wired
allow-hotplug eth0

#config for pxeserver interface
iface pxesrv inet static
   address 192.168.0.1
   netmask 255.255.255.0
#config for uplink interface
iface uplink inet dhcp

#sample wifi config
#allow-hotplug wlan0
#iface wlan0 inet dhcp
#   wpa-ssid "FCSTEAMLAB"
#   wpa-psk "whateveritis"

This uses "logical interfaces" as in the interfaces manpage, so the interfaces need to be brought up like ifup eth0=pxesrv for example.

Make sure that wicd or NetworkManager or similar automaticity is disabled, or your manual settings are likely to suddenly stop working...

default/[edit]

Edit isc-dhcp-server to specify which interface to use. Also found here is defaults for tftpd which so far do not need to be altered from what the package writes.

tftpd[edit]
TFTP_DIRECTORY="/srv/tftp"
isc-dhcp-server[edit]
INTERFACES="eth0"


dhcp/dhcpd.conf[edit]

# lines retained from default preceded by a comment (like this one)

ddns-update-style none; 

# option definitions common to all supported networks...
option domain-name "installment.local";
option domain-name-servers 8.8.8.8, 4.4.2.1;

default-lease-time 600;
max-lease-time 7200;

allow booting;

subnet 192.168.0.0 netmask 255.255.255.0 {
    range 192.168.0.3 192.168.0.127;
    option broadcast-address 192.168.0.255;
    option routers 192.168.0.1;
    filename "pxelinux.0";
}

group {
    next-server 192.168.0.1;
    host tftpclient {
        filename "pxelinux.0";
    }
}

exports[edit]

Config file for NFS. Run

exportfs -a

after editing this file.

# /etc/exports: the access control list for filesystems which may be exported
#		to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
#

#Live ubuntu i386

/srv/nfs/live-files/i386   *(ro,async,no_root_squash,no_subtree_check)
/srv/nfs/live-files/amd64   *(ro,async,no_root_squash,no_subtree_check)

/srv/[edit]

Top-level of files to be served.

pxe/[edit]

Boot menu and other PXE stuff lives here. Populate this directory with the contents of your favorite installer image's netboot directory, for example:

Or set it up manually. Details at *http://webapp5.rrz.uni-hamburg.de/SuSe-Dokumentation/packages/syslinux/pxelinux.txt

pxelinux.cfg/[edit]
default[edit]
pxelinux.0 (binary)[edit]

nfs/[edit]

files to be served live here, including ISO images.

  • xubuntu-14.04-i386.iso - downloaded ISO image.
  • tmpmnt/ Directory for loop-mounting the iso images. You could serve the mounted images, but I prefer to copy the files.