Installation on a headless host: Difference between revisions

From Alpine Linux
(created page with contents from Installation page Raspberry Pi page)
(changed wikitags, added shell prompts, rephrased sentence to add clarity)
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This page documents the Installation procedure for Alpine Linux on a headless host i.e a system without a keyboard, mouse & display to interract with but otherwise available only through a network connection.
This page documents an easy installation procedure for Alpine Linux on a headless host i.e a system without keyboard, mouse & display to interact with but otherwise available only through a network connection. This procedure applies to '''all''' platforms.


{{Note| These steps still require physical access to the headless machine. Somebody has to insert the installation medium and power up the headless server.}}
{{Note| These steps still require physical access to the headless host. Somebody has to insert the Install media and power up the headless host.}}


== Headless install media ==
== Headless bootstrap overlay file ==


A Custom-made headless [[Diskless Mode#Apkovl|apkovl]] file can be created as per the below process.
The [https://github.com/macmpi/alpine-linux-headless-bootstrap Headless bootstrap] repo provides a ready-to-use overlay file to bootstrap a headless system.
{{Todo|Verification of the below steps and adding missing details(if any) is needed}}
* Booting the install media on some computer with a display and keyboard attached, or in a virtual machine, and doing an intermediate "diskless" setup of just the boot media (more details below), i.e. using the offical <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> to configure the system's network, possibly for dhcp if needed, a ssh server, and a login user.
* Choosing "disks=none" for now, yet, configure to store configs on the boot media (if it is writable, otherwise on a separate storage media).
* Use <code>[[Alpine_local_backup|lbu commit]]</code> to store the configs as local backup. Then your completed setup, including its securely created own private keys, will readily get (re)loaded on every subsequent (headless) boot from your custom-build <code><hostname>.apkovl.tar.gz</code> stored on the boot media (or on an auxilary media or server location, in case the boot media is read-only).


== Alternate solution ==
While straightforward to use in default use-case, repo homepage provides details on many optional settings and advanced modes like unattended installs scripting, secured logon, ssh keys configuration, etc.


{{Note| The below solution is from [https://github.com/macmpi/alpine-linux-headless-bootstrap github repository]. The author macmpi is also the maintainer of a number of {{pkg|raspberrypi-*|arch=|maintainer=macmpi}} Alpine Linux packages.}}
{{Note|The author of above repo macmpi also maintains a number of {{pkg|raspberrypi*|arch=|maintainer=macmpi}} packages for Alpine Linux.}}


To Install Alpine Linux on a headless host, a bootstrapping configuration overlay file [https://github.com/macmpi/alpine-linux-headless-bootstrap  headless.apkovl.tar.gz] may be added as-is at the root of Alpine Linux [[Installation#Preparing_installation_media|Installation media]].  
To Install Alpine Linux on a headless host, just add [https://github.com/macmpi/alpine-linux-headless-bootstrap  headless.apkovl.tar.gz] overlay file as-is (along with optional config files) at the root of the Alpine Linux [[Installation#Preparing_installation_media|Installation media]], or custom side media.


To enable wifi, create a file {{Path|wpa_supplicant.conf}} in the install media as follows:{{Cat|wpa_supplicant.conf|<nowiki>country=FR
If using wifi networking, create a file {{Path|wpa_supplicant.conf}} in the same location as follows:{{Cat|wpa_supplicant.conf|<nowiki>country=FR


network={
network={
Line 25: Line 21:
}</nowiki>}}  
}</nowiki>}}  


Alternately, <code>wpa_passphrase</code> utility from {{pkg|wpa_supplicant}} package can be used to create the encrypted version of the above file as follows:{{Codeline| wpa_passphrase 'mySSID' 'myPassPhrase' > wpa_supplicant.conf}}
Alternately, <code>wpa_passphrase</code> utility from {{pkg|wpa_supplicant}} package can be used to create the encrypted version of the above file as follows:{{Cmd|$ wpa_passphrase 'mySSID' 'myPassPhrase' > wpa_supplicant.conf}}
The above encrypted version of the {{Path|wpa_supplicant.conf}} file may be placed in the Install media.
The above encrypted version of the {{Path|wpa_supplicant.conf}} file may be placed in the same location.
 
Boot the system with the above setup: usual [[Installation#Installation_Step_Details|Installation steps]] can then be performed remotely using {{ic|ssh}}
 
To find the ip of your headless host, one may use the {{ic|nmap}} tool from {{pkg|nmap}} package as follows: {{Codeline|$ nmap -v -sn 192.168.1.0/24}}
 
== Alternative custom install media preparation steps==


With the above setup, the usual [[Installation#Installation_Step_Details|Installation steps]] can be performed remotely using <code>ssh</code>. Use the {{ic|nmap}} tool from {{pkg|nmap}} package as follows: {{Codeline|nmap -v -sn 192.168.1.0/24}} to find the ip of your headless host.
A Custom-made headless [[Diskless Mode#Apkovl|apkovl]] file can be created as per the below process.
{{Expand}}
* Booting the install media on some computer with a display and keyboard attached, or in a virtual machine, and doing an intermediate "diskless" setup of just the boot media (more details below), i.e. using the offical <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> to configure the system's network, possibly for dhcp if needed, a ssh server, and a login user.
* Choosing "disks=none" for now, yet, configure to store configs on the boot media (if it is writable, otherwise on a separate storage media).
* Use <code>[[Alpine_local_backup|lbu commit]]</code> to store the configs as local backup. Then your completed setup, including its securely created own private keys, will readily get (re)loaded on every subsequent (headless) boot from your custom-build <code><hostname>.apkovl.tar.gz</code> stored on the boot media (or on an auxilary media or server location, in case the boot media is read-only).


==See also==
==See also==


* [[Diskless Mode#Apkovl|Diskless page with information on apkovl]]
* [[Alpine local backup]]
* [https://github.com/macmpi/alpine-linux-headless-bootstrap/ Bootstrap Alpine Linux on a headless system] using pre-built <code>apkovl</code> overlay file.
* [https://github.com/macmpi/alpine-linux-headless-bootstrap/ Bootstrap Alpine Linux on a headless system] using pre-built <code>apkovl</code> overlay file.
[[Category:Installation]]

Revision as of 09:40, 1 April 2025

This page documents an easy installation procedure for Alpine Linux on a headless host i.e a system without keyboard, mouse & display to interact with but otherwise available only through a network connection. This procedure applies to all platforms.

Note: These steps still require physical access to the headless host. Somebody has to insert the Install media and power up the headless host.

Headless bootstrap overlay file

The Headless bootstrap repo provides a ready-to-use overlay file to bootstrap a headless system.

While straightforward to use in default use-case, repo homepage provides details on many optional settings and advanced modes like unattended installs scripting, secured logon, ssh keys configuration, etc.

Note: The author of above repo macmpi also maintains a number of raspberrypi* packages for Alpine Linux.

To Install Alpine Linux on a headless host, just add headless.apkovl.tar.gz overlay file as-is (along with optional config files) at the root of the Alpine Linux Installation media, or custom side media.

If using wifi networking, create a file wpa_supplicant.conf in the same location as follows:

Contents of wpa_supplicant.conf

country=FR network={ key_mgmt=WPA-PSK ssid="mySSID" psk="myPassPhrase" }

Alternately, wpa_passphrase utility from wpa_supplicant package can be used to create the encrypted version of the above file as follows:

$ wpa_passphrase 'mySSID' 'myPassPhrase' > wpa_supplicant.conf

The above encrypted version of the wpa_supplicant.conf file may be placed in the same location.

Boot the system with the above setup: usual Installation steps can then be performed remotely using ssh

To find the ip of your headless host, one may use the nmap tool from nmap package as follows: $ nmap -v -sn 192.168.1.0/24

Alternative custom install media preparation steps

A Custom-made headless apkovl file can be created as per the below process.

This material needs expanding ...

Please feel free to help us complete it.

  • Booting the install media on some computer with a display and keyboard attached, or in a virtual machine, and doing an intermediate "diskless" setup of just the boot media (more details below), i.e. using the offical setup-alpine to configure the system's network, possibly for dhcp if needed, a ssh server, and a login user.
  • Choosing "disks=none" for now, yet, configure to store configs on the boot media (if it is writable, otherwise on a separate storage media).
  • Use lbu commit to store the configs as local backup. Then your completed setup, including its securely created own private keys, will readily get (re)loaded on every subsequent (headless) boot from your custom-build <hostname>.apkovl.tar.gz stored on the boot media (or on an auxilary media or server location, in case the boot media is read-only).

See also