This is a draft write up. There could possibly be some errors in paths.
EDIT:I made a test version of a live PXE CD.
http://ubuntuforums.org/showpost.php...3&postcount=16
http://sourceforge.net/projects/qfpxeinstaller
The goal of this is excersise is a pxe install & utility server targeted to home users.
This is particular interesting since many device sold now does not have an optical drive.
We want to use a proxyDHcp since most people are using dhcp on a home router without pxe support.
I do not include a sub structure 32bit/64bit, in this example all is 32bit.
I have documented this since it was quite a struggle to put it together. Not a lot of correct information out there.
I think a consilidated wiki page should be created.
My own contribution is making it work and collecting the info.
I have copied much of it from:
https://help.ubuntu.com/community/PXEInstallMultiDistro
https://help.ubuntu.com/community/Installation/LocalNet
https://help.ubuntu.com/community/UbuntuLTSP/ProxyDHCP
https://help.ubuntu.com/community/PXEInstallServer
I have tested this on Karmic so far.
-------------------------------
Install Ubuntu (karmic server)
---------------------------------
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install ssh
(
I have also installed gnome on the test server.
sudo apt-get install xorg gnome-core
)
==================================================
Install dnsmasq
==================================================
https://help.ubuntu.com/community/UbuntuLTSP/ProxyDHCP
http://www.thekelleys.org.uk/dnsmasq...smasq-man.html
sudo apt-get install dnsmasq
sudo nano /etc/dnsmasq.d/pxe.conf
add (this sample will connect to the local tftp server):
Code:
####################################################################
# Copied from https://help.ubuntu.com/community/UbuntuLTSP/ProxyDHCP
# Modified by vikjon0 2010-10-22 for PXE install server
#####################################################################
# Sample configuration for dnsmasq to function as a proxyDHCP server,
# enabling PXE clients to boot when an external, unmodifiable DHCP
# server is present.
# The main dnsmasq configuration is in /etc/dnsmasq.conf;
# the contents of this script are added to the main configuration.
# You may modify the file to suit your needs.
# Don't function as a DNS server:
port=0
# Log lots of extra information about DHCP transactions.
log-dhcp
# Dnsmasq can also function as a TFTP server. You may uninstall
# tftpd-hpa if you like, and uncomment the next line:
#enable-tftp
# Set the root directory for files available via FTP.
tftp-root=/var/lib/tftpboot
# The boot filename.
dhcp-boot=/var/lib/tftpboot/pxelinux.0
# rootpath option, for NFS
dhcp-option=17,/var/www/PXE
# kill multicast
dhcp-option=vendor:PXEClient,6,2b
# Disable re-use of the DHCP servername and filename fields as extra
# option space. That's to avoid confusing some old or broken DHCP clients.
dhcp-no-override
# PXE menu
pxe-prompt="Press F8 for boot menu", 3
# The known types are x86PC, PC98, IA64_EFI, Alpha, Arc_x86,
# Intel_Lean_Client, IA32_EFI, BC_EFI, Xscale_EFI and X86-64_EFI
pxe-service=X86PC, "Boot from network", pxelinux
# A boot service type of 0 is special, and will abort the
# net boot procedure and continue booting from local media.
pxe-service=X86PC, "Boot from local hard disk", 0
# If an integer boot service type, rather than a basename is given, then the
# PXE client will search for a suitable boot service for that type on the
# network. This search may be done by multicast or broadcast, or direct to a
# server if its IP address is provided.
#pxe-service=x86PC, "Install windows from RIS server", 1
# This range(s) is for the public interface, where dnsmasq functions
# as a proxy DHCP server providing boot information but no IP leases.
# Any ip in the subnet will do, so you may just put your server NIC ip here.
dhcp-range=192.168.0.130,proxy
# This range(s) is for the private network on 2-NIC servers,
# where dnsmasq functions as a normal DHCP server, providing IP leases.
#dhcp-range=192.168.0.20,192.168.0.250,8h
# For static client IPs, and only for the private subnets,
# you may put entries like this:
#dhcp-host=00:20:e0:3b:13:af,10.160.31.111,client111,infinite
==================================================
Install tftpboot
==================================================
https://help.ubuntu.com/community/PXEInstallMultiDistro
sudo apt-get -y install tftpd-hpa
sudo /etc/init.d/openbsd-inetd stop
sudo update-rc.d -f openbsd-inetd remove
sudo sed -i s/no/yes/ /etc/default/tftpd-hpa
sudo /etc/init.d/tftpd-hpa start
Ubuntu installs the openbsd-inetd pakcage when the tfpd-hpa package is installed. In our example we will simply run TFTP as a daemon and will always be listening for connections.
In the above code snippet:
•tftpd-hpa was intsalled
•The openbsd-inetd daemon was stopped
•openbsd-inetd was removed from the startup scripts
•/etc/defaul/tftpd-hpa was modified to allow tftpd-hpa to run as a daemon process
•tftpd-hpa was started
Verify the TFTP server is listening for connections:
netstat -uap | grep tftp
Sample output:
Proto Recv-Q Send-Q Local Address Foreign Address State
udp 0 0 *:tftp *:*
==================================================
install SYSLINUX
==================================================
https://help.ubuntu.com/community/PXEInstallMultiDistro
sudo apt-get -y install syslinux
Copy the PXELINUX bootstrap to the root of our TFTP server.
sudo cp /usr/lib/syslinux/pxelinux.0 /var/lib/tftpboot
Create the PXELINUX default configuration file.
(dir missing in guide)
sudo mkdir /var/lib/tftpboot/pxelinux.cfg/
)
sudo touch /var/lib/tftpboot/pxelinux.cfg/default
/var/lib/tftpboot is the boot directory.
==================================================
install apache
==================================================
The client can access files on the server in a number of ways.
e.g. tftp, http and nfs.
What is available depends on the boot files, mostly initrd I think. It needs to have the drivers etc.
http seems to be the easiest and most common what to access the installation CD and other files.
We will install a web server and later put the installation CDs here.
sudo apt-get -y install apache2
sudo mkdir /var/www/pxe
This will be the location of the installation media,
(would be nice to move pxe outside www since it will also be accessed by nfs)
==================================================
install NFS
==================================================
We are also going to use nfs, not for install but for the live CDs.
sudo apt-get -y install nfs-kernel-server
sudo nano /etc/exports
add:
Code:
/var/www/pxe 192.168.0.0/24(ro,async,no_root_squash,no_subtree_check)
Export our file system or restart the NFS server.
sudo exportfs -a
or
sudo /etc/init.d/nfs-kernel-server restart
==================================
setting up main menu
==================================
https://help.ubuntu.com/community/PX...arget=logo.png
sudo cp /usr/lib/syslinux/vesamenu.c32 /var/lib/tftpboot/
sudo cp /location/of/image/logo.png /var/lib/tftpboot/pxelinux.cfg/
sudo nano /var/lib/tftpboot/pxelinux.cfg/default
add:
Code:
DEFAULT vesamenu.c32
TIMEOUT 600
ONTIMEOUT BootLocal
PROMPT 0
MENU INCLUDE pxelinux.cfg/pxe.conf
NOESCAPE 1
LABEL BootLocal
localboot 0
TEXT HELP
Boot to local hard disk
ENDTEXT
MENU BEGIN Ubuntu
MENU TITLE Ubuntu
LABEL Previous
MENU LABEL Previous Menu
TEXT HELP
Return to previous menu
ENDTEXT
MENU EXIT
MENU SEPARATOR
MENU INCLUDE Ubuntu/Ubuntu.menu
MENU END
MENU BEGIN Tools and Utilities
MENU TITLE Tools and Utilities
LABEL Previous
MENU LABEL Previous Menu
TEXT HELP
Return to previous menu
ENDTEXT
MENU EXIT
MENU SEPARATOR
MENU INCLUDE utilities/utilities.menu
MENU END
sudo nano /var/lib/tftpboot/pxelinux.cfg/pxe.conf
add:
Code:
MENU TITLE PXE Server
MENU BACKGROUND pxelinux.cfg/logo.png
NOESCAPE 1
ALLOWOPTIONS 1
PROMPT 0
menu width 80
menu rows 14
MENU TABMSGROW 24
MENU MARGIN 10
menu color border 30;44 #ffffffff #00000000 std
================================
Example 1 Booting LiveCD
=================================
Copy kernal & initrd
sudo mkdir -p /var/lib/tftpboot/Ubuntu/lucidLiveCD
(mount cd or image first)
sudo cp /media/cdrom0/casper/vmlinuz /var/lib/tftpboot/Ubuntu/lucidLiveCD
sudo cp /media/cdrom0/casper/initrd.lz /var/lib/tftpboot/Ubuntu/lucidLiveCD
copy CD to installation directory
sudo mkdir -p /var/www/pxe
We need a complete copy including hidden files (folder .disk) otherwise it does not work.
Not sure what is the best way in linux but this works.
Assuming target directory does not exists!
sudo cp -ra /media/cdrom0 /var/www/pxe/lucidLiveCD
==================================================
setting up Ubuntu menu
==================================================
sudo nano /var/lib/tftpboot/Ubuntu/Ubuntu.menu
Code:
LABEL 1
MENU LABEL Ubuntu 10.04 LTS (32-bit) Live
KERNEL Ubuntu/lucidLiveCD/vmlinuz
APPEND boot=casper netboot=nfs nfsroot=192.168.0.130:/var/www/pxe/lucidLiveCD initrd=Ubuntu/lucidLiveCD/initrd.lz
TEXT HELP
Boot the Ubuntu 10.04 32-bit in Live Mode
ENDTEXT
It should now be possible to boot the live cd over pxe!
================================
Example 2 Install from Alt CD
=================================
Copy Netboot kernal & initrd
sudo mkdir -p /var/lib/tftpboot/Ubuntu/lucidAltCD
(mount cd or image first)
sudo cp /media/cdrom0/install/netboot/ubuntu-installer/i386/linux /var/lib/tftpboot/Ubuntu/lucidAltCD
sudo cp /media/cdrom0/install/netboot/ubuntu-installer/i386/initrd.gz /var/lib/tftpboot/Ubuntu/lucidAltCD
copy CD to installation directory
sudo mkdir -p /var/www/pxe/
*dest may not exist
sudo cp -r /media/cdrom0 /var/www/pxe/lucidAltCD
This will start the installation and allow you to select mirror. Including you local server,
sudo nano /var/lib/tftpboot/Ubuntu/Ubuntu.menu
Code:
label 2
MENU LABEL Lucid Alt install (remote mirrors)
KERNEL Ubuntu/lucidAltCD/linux
APPEND initrd=Ubuntu/lucidAltCD/initrd.gz
TEXT HELP
Boot the alt CD installer on remote mirrors
ENDTEXT
================================================== ====
Example 3 install from CD on server with kickstart
================================================== =====
I am not going to use this is, since it does not seem to work in combination with expert mode (priority=low)
https://help.ubuntu.com/community/PXEInstallServer:
There is a package called system-config-kickstart which is a GUI frontend to creating kickstart files. The kickstart file tells the installer where to get its packages from, what to install and a number of other useful settings. See KickstartCompatibility for more info.
This is for generating a kickstart file.
we just need to point out the installation CD
sudo nano /var/www/pxe/lucidalt.cfg
Code:
install
url --url http://192.168.0.130/pxe/lucidAltCD
sudo nano /var/lib/tftpboot/Ubuntu/Ubuntu.menu
Code:
label 3
MENU LABEL Lucid Alt install with kickstart, all local
KERNEL Ubuntu/lucidAltCD/linux
APPEND ks=http://192.168.0.130/pxe/lucidalt.cfg initrd=Ubuntu/lucidAltCD/initrd.gz
TEXT HELP
Boot the alt CD installer on local http
ENDTEXT
========================================
Example 4&5 preseed
========================================
EDIT: I get an error about corrupt package when I run the installer against the CD.
I need to do some more tests. It was working before...
EDIT2: I think it is not a good solution anyway.
It is better to use a apt cache to minimize the network traffic.
As mentioned in this post
http://www.peterlyons.com/problog/2010/07/
sudo nano /var/lib/tftpboot/Ubuntu/lucidAltCD/test.cli
There is 3 pressed files on the alt CD (/preseed/).
If you e.g. want to install a minimal CLI system you point to cli.seed.
If we want to install a cli system but automatically point to the cd on the server:
cp cli.seed => test.seed
sudo nano /var/lib/tftpboot/Ubuntu/lucidAltCD/test.seed
add:
Code:
### Mirror settings
# If you select ftp, the mirror/country string does not need to be set.
d-i mirror/protocol string http
d-i mirror/country string enter information manually
d-i mirror/http/hostname string 192.168.0.130
d-i mirror/http/directory string /pxe/lucidAltCD
d-i mirror/http/proxy string
sudo nano /var/lib/tftpboot/Ubuntu/Ubuntu.menu
Code:
label 4
MENU LABEL Lucid Alt CLI
KERNEL Ubuntu/lucidAltCD/linux
APPEND preseed/url=http://192.168.0.130/pxe/lucidAltCD/preseed/test.seed initrd=Ubuntu/lucidAltCD/initrd.gz
TEXT HELP
Boot the alt CD installer cli preseed
ENDTEXT
label 5
MENU LABEL Lucid Alt CLI expert mode
KERNEL Ubuntu/lucidAltCD/linux
APPEND preseed/url=http://192.168.0.130/pxe/lucidAltCD/preseed/test.seed priority=low initrd=Ubuntu/lucidAltCD/initrd.gz
TEXT HELP
Boot the alt CD installer cli expert mode
ENDTEXT
If we want to install a server, there a server seed on the server cd. Not sure if it can be used with the local alt cd.
If not it should work with a network mirror or of course the server cd.
========================================
Example 6 install with minimal CD
===========================================
sudo mkdir -p /var/lib/tftpboot/Ubuntu/lucidMiniCD
sudo cp /media/cdrom0/linux /var/lib/tftpboot/Ubuntu/lucidMiniCD
sudo cp /media/cdrom0/initrd.gz /var/lib/tftpboot/Ubuntu/lucidMiniCD
copy CD to installation directory
sudo mkdir -p /var/www/pxe/
*dest may not exist
sudo cp -r /media/cdrom0 /var/www/pxe/lucidMiniCD
sudo nano /var/lib/tftpboot/Ubuntu/Ubuntu.menu
Code:
label 6
MENU LABEL Install Lucid mini expert
kernel Ubuntu/lucidMiniCD/linux
append priority=low vga=normal initrd=Ubuntu/lucidMiniCD/initrd.gz
TEXT HELP
Boot the mini CD
ENDTEXT
=========================================
clonezilla
=========================================
I had some problems with the ubuntu version, not sure if I made a misstake.
This is tested with the debian stable.
The parameters appears to change between versions. The idea seem to be to check the syslinux/syslinux.cfg on the cd.
Copy kernal & initrd
sudo mkdir -p /var/lib/tftpboot/utilities/clonezilla
sudo cp /media/cdrom0/live/vmlinuz1 /var/lib/tftpboot/utilities/clonezilla
sudo cp /media/cdrom0/live/initrd1.img /var/lib/tftpboot/utilities/clonezilla
copy CD to installation directory
sudo cp -r /media/cdrom0 /var/www/pxe/clonezilla
sudo nano /var/lib/tftpboot/utilities/utilities.menu
Code:
label 1
MENU LABEL clonezilla
KERNEL utilities/clonezilla/vmlinuz1
APPEND initrd=utilities/clonezilla/initrd1.img boot=live union=aufs netboot=nfslive-config live-config noswap nolocales edd=on nomodeset noprompt ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_keymap="" ocs_live_batch="no" ocs_lang="" vga=788 nosplash nfsroot=192.168.0.130:/var/www/pxe/clonezilla
TEXT HELP
Boot the Clonezilla CD
ENDTEXT
It is possible to skip NFS and load the image with http instead:
The same work for gparted.
Code:
label 3
MENU LABEL clonezilla - http
KERNEL utilities/clonezilla/vmlinuz1
APPEND initrd=utilities/clonezilla/initrd1.img boot=live union=aufs live-config noswap nolocales edd=on nomodeset noprompt ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_keymap="" ocs_live_batch="no" ocs_lang="" vga=785 nosplash fetch=http://192.168.0.130/pxe/clonezilla/live/filesystem.squashfs
TEXT HELP
Boot the Clonezilla CD
ENDTEXT
===================================
gparted
=====================================
Copy kernal & initrd
sudo mkdir -p /var/lib/tftpboot/utilities/gparted
sudo cp /media/cdrom0/live/vmlinuz1 /var/lib/tftpboot/utilities/gparted
sudo cp /media/cdrom0/live/initrd1.img /var/lib/tftpboot/utilities/gparted
copy CD to installation directory
sudo cp -r /media/cdrom0 /var/www/pxe/gparted
Same thing as for clonezilla when it comes to parameters.
sudo nano /var/lib/tftpboot/utilities/utilities.menu
Code:
label 2
MENU LABEL gparted
KERNEL utilities/gparted/vmlinuz1
APPEND initrd=utilities/gparted/initrd1.img boot=live config i915.modeset=0 xforcevesa radeon.modeset=0 noswap nomodeset noprompt vga=788 nosplash vga=788 netboot=nfs nfsroot=192.168.0.130:/var/www/pxe/gparted
TEXT HELP
Boot the gparted CD
ENDTEXT
It is possible to use http instead of nfs, check clonzilla example above.
Bookmarks