notes:linux_automatic_network_install
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| notes:linux_automatic_network_install [2024/05/03 14:20] – Nikita Kipriyanov | notes:linux_automatic_network_install [2024/05/15 09:53] (current) – [Bootloader configuration] Nikita Kipriyanov | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Linux Automatic Network Install ====== | ====== Linux Automatic Network Install ====== | ||
| - | General outline: | + | |
| + | Purpose: to install Linux automatically unattended, without any manual user input during the process. | ||
| + | |||
| + | This can be used in further automation using tool like Ansible. It should create a VM and obtain its MAC address from the virtualization environment, | ||
| + | |||
| + | General outline | ||
| * PXE boot server with support for " | * PXE boot server with support for " | ||
| * HTTP server for EL (it doesn' | * HTTP server for EL (it doesn' | ||
| * A set of boot images and minimal autoinstall files for Debian (at least, Bookworm) and EL (at least, Oracle Linux 8) | * A set of boot images and minimal autoinstall files for Debian (at least, Bookworm) and EL (at least, Oracle Linux 8) | ||
| + | |||
| + | Possible optional additions: | ||
| + | * A proxy server to perform installation and updates in restricted environments | ||
| + | * Set of repositories to store packages needed by installers, beneficial for mass installs. The set of " | ||
| ===== Boot server configuration ===== | ===== Boot server configuration ===== | ||
| - | ==== dnsmasq | + | We can use ISC DHCPD + BIND + tftpd-hpa, or dnsmasq on the server side, and GRUB or PXELinux/ |
| + | |||
| + | ==== PXE bootloader | ||
| + | All (more or less) dynamic data is to be stored in ''/ | ||
| + | |||
| + | <tabbox GRUB> | ||
| + | |||
| + | GRUB manual is available here: [[https:// | ||
| + | |||
| + | < | ||
| + | srv/ | ||
| + | ┠─ dhcp-hostsfile.cfg | ||
| + | ┗━ tftp/ | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | ┠─ gentoo | ||
| + | ┖─ initramfs.igz | ||
| + | </ | ||
| + | |||
| + | The most logic lies within ''/ | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | The rest items are symlinks to these files: | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | This approach is new to me, but it can support both " | ||
| + | |||
| + | To generate the contents of that directory (including GRUB images themselves) a Gentoo system was used, where GRUB was emerged with '' | ||
| + | |||
| + | < | ||
| + | grub-mknetdir --net-directory=/ | ||
| + | grub-mknetdir --net-directory=/ | ||
| + | </ | ||
| + | |||
| + | Then the ''/ | ||
| + | |||
| + | <tabbox PXELinux> | ||
| + | |||
| + | < | ||
| + | srv/ | ||
| + | ┠─ dhcp-hostsfile.cfg | ||
| + | ┗━ tftp/ | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | ┠─ gentoo | ||
| + | ┖─ initramfs.igz | ||
| + | </ | ||
| + | |||
| + | The most logic is within ''/ | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | The rest items are symlinks to these files: | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | This is well tested setup. The main downside is that PXELinux doesn' | ||
| + | |||
| + | </ | ||
| + | |||
| + | Boot menu can contain other entries if needed, for example, it can boot [[https:// | ||
| + | |||
| + | We need some more work in preseed/ | ||
| + | |||
| + | ==== DNS, DHCP and TFTP servers ==== | ||
| + | |||
| + | <tabbox dnsmasq> | ||
| The default Debian' | The default Debian' | ||
| The most configuration is ''/ | The most configuration is ''/ | ||
| + | |||
| <file - / | <file - / | ||
| no-dhcp-interface = tun0 | no-dhcp-interface = tun0 | ||
| + | # upstream DNS | ||
| server = 10.226.130.130 | server = 10.226.130.130 | ||
| server = 10.226.130.131 | server = 10.226.130.131 | ||
| no-resolv | no-resolv | ||
| - | domain = test.ucom.am, 172.31.1.0/ | + | domain = auto.example.org, 172.31.1.0/ |
| - | domain = test.ucom.am, 172.31.255.0/ | + | domain = auto.example.org, 172.31.255.0/ |
| domain-needed | domain-needed | ||
| expand-hosts | expand-hosts | ||
| - | # no dynamic allocation for DHCP service on this subnet; static allocation via dhcp-host will still be possible | + | # no dynamic allocation for DHCP service on these subnets; static allocation via dhcp-host |
| dhcp-range = 192.168.205.224, | dhcp-range = 192.168.205.224, | ||
| dhcp-range = 172.31.255.0, | dhcp-range = 172.31.255.0, | ||
| Line 42: | Line 184: | ||
| dhcp-match = set:http, option: | dhcp-match = set:http, option: | ||
| - | dhcp-boot = tag: | + | dhcp-boot = tag: |
| - | dhcp-boot = tag: | + | dhcp-boot = tag: |
| - | + | ||
| - | #pxe-prompt = " | + | |
| - | #pxe-prompt = "Press F8 for menu.", | + | |
| - | # | + | |
| - | # | + | |
| log-queries | log-queries | ||
| Line 54: | Line 191: | ||
| </ | </ | ||
| - | It references the ''/ | + | It references the ''/ |
| <file - / | <file - / | ||
| BC: | BC: | ||
| Line 72: | Line 209: | ||
| </ | </ | ||
| - | I put auxiliary | + | Auxiliary |
| - | <file / | + | < |
| cname = boot.test.ucom.am, | cname = boot.test.ucom.am, | ||
| </ | </ | ||
| - | ==== Mini HTTPD ==== | + | <tabbox ISC DHCPD, ISC BIND, tftpd-hpa> |
| - | Needed for EL variants to be able to run installer from the network. | + | |
| + | * [[https:// | ||
| + | |||
| + | </ | ||
| + | |||
| + | ==== HTTP server | ||
| + | |||
| + | Needed for EL variants to be able to run installer from the network. | ||
| + | |||
| + | This directory is already served | ||
| ===== Debian: preseed ==== | ===== Debian: preseed ==== | ||
| + | |||
| + | ==== Network installer files ==== | ||
| Debian conveniently maintains all the required bits for the netboot as an archive distributed through its mirrors, available, for example, [[http:// | Debian conveniently maintains all the required bits for the netboot as an archive distributed through its mirrors, available, for example, [[http:// | ||
| Line 89: | Line 238: | ||
| ==== Bootloader configuration ==== | ==== Bootloader configuration ==== | ||
| + | |||
| + | <tabbox GRUB> | ||
| + | |||
| + | <file - / | ||
| + | set timeout=1 | ||
| + | |||
| + | menuentry ' | ||
| + | linux debian-bookworm/ | ||
| + | initrd debian-bookworm/ | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | <tabbox PXELinux> | ||
| + | |||
| <file - / | <file - / | ||
| default debian-bookworm-auto | default debian-bookworm-auto | ||
| Line 96: | Line 260: | ||
| kernel debian-bookworm/ | kernel debian-bookworm/ | ||
| append priority=critical initrd=debian-bookworm/ | append priority=critical initrd=debian-bookworm/ | ||
| - | |||
| </ | </ | ||
| + | |||
| + | </ | ||
| + | |||
| ==== Example preseed file ==== | ==== Example preseed file ==== | ||
| Works for Bullseye too (it was actually originally developed for Bullseye, but worked with Bookworm like a charm)! | Works for Bullseye too (it was actually originally developed for Bullseye, but worked with Bookworm like a charm)! | ||
| + | |||
| + | <tabbox BIOS> | ||
| <file - / | <file - / | ||
| Line 226: | Line 394: | ||
| in-target chmod 0600 / | in-target chmod 0600 / | ||
| </ | </ | ||
| + | |||
| + | <tabbox UEFI> | ||
| + | |||
| + | </ | ||
| ==== Additional documentation ==== | ==== Additional documentation ==== | ||
| Line 238: | Line 410: | ||
| Need to consider which else packages may be omitted. | Need to consider which else packages may be omitted. | ||
| - | ==== A directory tree ==== | + | ==== Network installer files ==== |
| For Oracle Linux, the best is to obtain a "Boot UEK" ISO image, approx. 1G of size (obviously, the more " | For Oracle Linux, the best is to obtain a "Boot UEK" ISO image, approx. 1G of size (obviously, the more " | ||
| Line 250: | Line 422: | ||
| ==== Bootloader configuration ==== | ==== Bootloader configuration ==== | ||
| + | |||
| + | <tabbox GRUB> | ||
| + | |||
| + | <file - / | ||
| + | set timeout=1 | ||
| + | |||
| + | menuentry ' | ||
| + | linux ol8u9/ | ||
| + | initrd ol8u9/ | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | <tabbox PXELinux> | ||
| + | |||
| <file - / | <file - / | ||
| default ol8u9 | default ol8u9 | ||
| Line 259: | Line 445: | ||
| </ | </ | ||
| - | ==== A complete working | + | </ |
| + | |||
| + | ==== Example | ||
| + | |||
| + | <tabbox BIOS> | ||
| <file - / | <file - / | ||
| # | # | ||
| Line 366: | Line 557: | ||
| %end | %end | ||
| </ | </ | ||
| - | ==== More documentation ==== | + | |
| + | <tabbox UEFI> | ||
| + | |||
| + | </ | ||
| + | |||
| + | ==== Additional | ||
| * https:// | * https:// | ||
| * https:// | * https:// | ||
notes/linux_automatic_network_install.1714746034.txt.gz · Last modified: by Nikita Kipriyanov
