Hello everyone!
Before anything else, BIG thanks to Erwan who made TPS, and to everyone (Misty and Erwan in particular as far as I can tell) for all the various how-to's and guides.
The goal of this post:
1. PXE-boot a client system
2. Load an ubuntu installer over the web
3. Install ubuntu on an iSCSI target
4. PXE-boot the client into the new ubuntu installation
Instructions were largely taken from here:
I had some trouble figuring it all out and it took me several hours to cobble everything together. Maybe due to my particular circumstance of desired outcome and lack of previous knowledge in this area, I had trouble understanding everything correctly and spent a lot of time with trial and error to figure out some basic things about PXE. In the end I had to combine things from several resources (mostly the above ones, which I now see that I wouldn't have needed if I had more knowledge about PXE before starting this project.
For this reason, I hope my post here can help other newcomers connect the dots. I spent hours stuck on the most basic things (didn't understand what to use for initiator-iqn, for example) - so don't be like me, read my story and learn from my mistake instead :)
Regardless - here's how I made it all work in the end, dummies version:
First - my setup
Host system:
192.168.1.10
Running Win10, TinyPXEServer, pyTarget
Client system:
192.168.1.15
Intel NUC
Local gateway (also the DHCP server):
192.168.1.1
pfSense 2.3.1-RELEASE
Configs
TinyPXE's config.ini:
[dhcp]
root=E:\TinyPXEServer\files\
filename=ipxe.pxe
altfilename=ubuntu1604netboot.ipxe
httpd=0
binl=0
start=0
dnsd=0
proxydhcp=1
bind=1
smb=0
optextra=175.6.1.1.1.8.1.1
log=0
opt1=255.255.255.0
opt3=192.168.1.1
opt6=192.168.1.1
opt28=192.168.1.255
opt43=0
opt51=3600
opt54=192.168.1.10
next-server=192.168.1.10
opt60=PXEClient
poolstart=192.168.1.210
poolsize=10
[frmDHCPServer]
top=476
left=3206
TinyPXE's ubuntu1604netboot.ipxe:
#!ipxe
set boot-url http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64
kernel ${boot-url}/linux vga=788 --- quiet
initrd ${boot-url}/initrd.gz
boot
pyTarget's config.xml:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<root>
<console ip="" port="3260" debug_level="6" />
<target name="iscsi" ip="192.168.1.10" port="3260" portal="1">
<host name="iqn.2006-11.1" target_pwd="" initiator_pwd="">
<lun id="0" type="0" path="E:\pyTarget\ubuntu16.ima" capacity="81943040" />
</host>
<item key="MaxConnections" value="8" />
<item key="InitialR2T" value="Yes" />
<item key="ImmediateData" value="Yes" />
<item key="FirstBurstLength" value="65536" />
<item key="MaxBurstLength" value="262144" />
<item key="DefaultTime2Wait" value="2" />
<item key="DefaultTime2Retain" value="20" />
<item key="MaxOutstandingR2T" value="16" />
<item key="DataPDUInOrder" value="Yes" />
<item key="DataSequenceInOrder" value="Yes" />
<item key="ErrorRecoveryLevel" value="2" />
<item key="MaxRecvDataSegmentLength" value="65536" />
<item key="AuthMethod" value="none" />
</target>
</root>
Installation procedure
1. Start pyTarget
2. Start TinyPXEServer
3. Verify that both services' consoles show everything is OK
4. Boot client
5. Wait for the files to load & ubuntu installation to start
6. Once you're at the part to select installation directory, select "Manual" and then "Configure iSCSI volumes".
7. Choose "Log in", enter IP and IQN (copy TARGET NAME value from your config.xml)
8. If you left the password field empty in config.xml, when ubuntu now prompts you for a password you have to press SPACEBAR a single time and then press ENTER.
9. Go back and select "Guided" (unless you really want to install using manual... it's your tears, not mine, so go ahead)
10. Install as usual
Installation in progress *as seen from the host consoles*:
Wireshark wasn't necessary, but I'd used it to troubleshoot a problem I had to figure out after I made the configs poorly so I figured I would look at the network as well during the install.
Post-install setup of TinyPXE to allow the booting
This file can also be used to launch the installation instead of ubuntu1604netboot.ipxe, but I hadn't made this file at that point in time.
bootmenu.ipxe:
#!ipxe
set boot-url http://${next-server}
# iqn must be same as TARGET NAME in pytarget config.xml
set iqn iscsi
#set iscsi-target iscsi:${boot-url}::::${iqn}
set iscsi-target iscsi:192.168.1.10::::iscsi
#================ Main Menu =================
:menu
menu iPXE MENU
item ubuntuiscsi Boot ubuntu 16.04 via iSCSI
item ubuntunetboot Install ubuntu 16.04 via netboot
item shell Drop iPXE shell
choose target && goto ${target}
#============== End Main Menu ===============
:ubuntuiscsi
set gateway 0.0.0.0
# initiator-iqn must be same as HOST NAME under the TARGET in config.xml
set initiator-iqn iqn.2006-11.1
set keep-san 1
sanboot ${iscsi-target}
boot
:ubuntunetboot
set boot-url http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64
kernel ${boot-url}/linux vga=788 --- quiet
initrd ${boot-url}/initrd.gz
boot
:shell
echo Type exit to get the back to the menu
shell
set menu-timeout 0
So far, so good
But we are not there yet... We need to set iscsi properties, so that GRUB knows how to load the OS. They can be set at boot time as well as in a persistent configuration file.
For the boot arguments as well as persistence, follow the bottom instructions here:
To get to the place where you can enter the boot arguments for the first time, press E when you're at the startup menu where you can select to start ubuntu or choose advanced options for ubuntu.
Ensure that all your configs are correct and that both TPS and pyTarget have reloaded the configs. By now, you should be able to boot to desktop! :)
Edited by vsoraas, 09 October 2017 - 10:50 PM.