info
-
pxe
preboot execution environment# is widely used in enterprise environment # for mass deployment # is your box doesn't have cd/dvd or usb # you can install ubuntu using pxe
-
dhcp service
# pxe-bootable device will look for dhcp service # in order to receive available pxe boot server
-
prerequisite
-
netboot installer for ubuntu
-
tftp server
-
a pc that is to be installed to supports pxe
# ASUS Z97-K BIOS setup => power up => press `DEL` or `F2` enter `UEFI BIOS Utility` => press `F7` enter `Advanced Mode` => press `right arrow` select `Advanced` => press `down arrow` select `Network stack Configuration` => press `enter` enter `Network stack` => press `enter` choose `Enabled` => Ipv4 PXE support choose `Enabled` => Ipv6 PXE support choose `Disabled` => press `F7` exit `ExMode` => press `F10` `Save & Exit`
-
download ubuntu netboot installer
-
netboot choose amd64 installer
$ cd ~/Download $ curl -O http://archive.ubuntu.com/ubuntu/dists/vivid/main/installer-amd64/current/images/netboot/netboot.tar.gz
-
extract
netboot.tar.gz
$ mkdir tftp $ tar -zxvf netboot.tar.gz -C tftp
-
fix folder permissions
$ sudo chown -R hqlgree2@staff .
setup tftp server
-
easy setup with tftp server software
-
download tftp server
-
install dmg file
-
run tftpserver
-
change root for tftp server
# /private/tftpboot # => /Users/hqlgree2/Downloads/tftp
-
fixing folder permission
# working path permission # parentals folders permissions # you should see `attributes ok`
-
-
hard setup using built-in tftp server
-
configure
tftp.plist
$ pico /System/Library/LaunchDaemons/tftp.plist # change <key>Disabled</key> <true/> # to <key>Disabled</key> <false/> # change <string>/private/tftpboot</string> # to <string>/Users/hqlgree2/Downloads/tftp</string>
-
start the server
$ sudo launchctl load -F /System/Library/LaunchDaemons/tftp.plist # or $ sudo launchctl start com.apple.tftpd
-
once installation is finished disable it with
$ sudo launchctl unload -F /System/Library/LaunchDaemons/tftp.plist # or $ sudo launchctl stop com.apple.tftpd
-
-
test tftp server
$ tftp localhost tftp> get pxelinux.0 Received 43574 bytes in 0.0 seconds tftp> quit
setup dhcp server
-
with
isc-dhcp
-
install
$ brew install isc-dhcp ==> Downloading http://ftp.isc.org/isc/dhcp/4.3.0/dhcp-4.3.0.tar.gz ######################################################################## 100.0% ==> ./configure --prefix=/usr/local/Cellar/isc-dhcp/4.3.0 --localstatedir=/usr/local/var/dhcpd ==> make -C bind ==> make ==> make install ==> Caveats This install of dhcpd expects config files to be in /usr/local/etc. All state files (leases and pids) are stored in /usr/local/var/dhcpd. Dhcpd needs to run as root since it listens on privileged ports. There are two plists because a single dhcpd process may do either DHCPv4 or DHCPv6 but not both. Use one or both as needed. Note that you must create the appropriate config files before starting the services or dhcpd will refuse to run. DHCPv4: /usr/local/etc/dhcpd.conf DHCPv6: /usr/local/etc/dhcpd6.conf Sample config files may be found in /usr/local/etc. To have launchd start isc-dhcp at startup: sudo cp -fv /usr/local/opt/isc-dhcp/*.plist /Library/LaunchDaemons sudo chown root /Library/LaunchDaemons/homebrew.mxcl.isc-dhcp.plist Then to load isc-dhcp now: sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.isc-dhcp.plist ==> Summary 🍺 /usr/local/Cellar/isc-dhcp/4.3.0: 38 files, 7.2M, built in 7.7 minutes
-
create configuration file
$ pico /usr/local/etc/dhcpd.conf default-lease-time 600; max-lease-time 7200; subnet X.X.X.0 netmask Y.Y.Y.0 { range X.X.X.151 X.X.X.205; } option domain-name-servers 8.8.8.8; host netbook { hardware ethernet ??:??:??:??:??:??; filename "pxelinux.0"; next-server Z.Z.Z.Z; # the IP address of your TFTP server fixed-address X.X.X.202; option subnet-mask Y.Y.Y.0; option broadcast-address X.X.X.255; option routers X.X.X.1; } # X.X.X is network address # Y.Y.Y is subnet mask # ??:??:??:??:??:?? is mac address of the box # Z.Z.Z.Z is address of tftp server
-
start dhcp server
$ sudo /usr/local/sbin/dhcpd -f -d -cf /usr/local/etc/dhcpd.conf
-
once installation finished clean up with
brew uninstall isc-dhcp
-
-
with built-in bootpd
-
configure
/etc/bootpd.plist
$ pico /etc/bootpd.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>bootp_enabled</key> <false/> <key>detect_other_dhcp_server</key> <integer>1</integer> <key>dhcp_enabled</key> <array> <string>en0</string> </array> <key>reply_threshold_seconds</key> <integer>0</integer> <key>Subnets</key> <array> <dict> <key>allocate</key> <true/> <key>lease_max</key> <integer>86400</integer> <key>lease_min</key> <integer>86400</integer> <key>name</key> <string>192.168.1</string> <key>net_address</key> <string>192.168.1.0</string> <key>net_mask</key> <string>255.255.255.0</string> <key>net_range</key> <array> <string>192.168.1.101</string> <string>192.168.1.202</string> </array> </dict> </array> </dict> </plist> # network address is 192.168.1.0 # dhcp allocation pool is 101 to 202
-
assign static ip address to our to-be-installed host
$ pico /etc/bootptab %% # machine entries have the following format: # # hostname hwtype hwaddr ipaddr bootfile client1 1 00:1f:16:08:61:96 192.168.1.105 pxelinux.0
-
start the server
$ sudo /bin/launchctl load -w /System/Library/LaunchDaemons/bootps.plist
-
stop the server once done
$ sudo /bin/launchctl unload -w /System/Library/LaunchDaemons/bootps.plist
-
installation
-
-
obtain one of the desktop ios
$ wget http://old-releases.ubuntu.com/releases/9.10/ubuntu-9.10-desktop-amd64.iso
-
loopback mount the ios
$ mkdir /mnt/ubuntu $ mount -o loop ubuntu-9.10-desktop-amd64.iso /mnt/ubuntu
-
expose installation media via http server
# if running apache # use a symbolic link $ cd /var/www/html $ sudo ln -s /mnt/ubuntu ubuntu
-
test installation directory is accessible by pointing a brower
$ open http://192.168.100.100/ubuntu
-
network boot the target machine proceed to the mirrors dialog
# when asked to select a mirror # go to the top of the list and select `enter manually` # enter ip address of the http server # at the next screen it'll ask for a path # enter `/ubuntu` # from here on # the installation is the same as using the internet mirrors
-