Install using clr-installer and a configuration file

In addition to the interactive GUI and text-based modes, clr-installer also supports an unattended mode where you simply provide it a YAML configuration file.

This guide shows you two examples of how to use its unattended mode.

Prerequisites

For installation onto bare metal, ensure that your target system supports these requirements:

Example 1: Fresh installation onto bare metal

This example uses a YAML configuration file to perform a new installation.

  1. Boot up the Clear Linux OS Live Server USB thumb drive.

  2. Select Clear Linux OS from the menu.

  3. In the console window, log in as root and set a password.

  4. Verify you have a network connection to the Internet and configure proxy settings if you’re working behind a firewall.

  5. Download a sample YAML configuration file. For example, if you want to install Clear Linux OS with a desktop GUI, you might want to use live-desktop.yaml. Or you can use the live-server.yaml if you want to install a non-GUI version of Clear Linux OS.

    • Desktop:

      curl -O https://cdn.download.clearlinux.org/current/config/image/live-desktop.yaml
      
    • Server:

      curl -O https://cdn.download.clearlinux.org/current/config/image/live-server.yaml
      
  6. Edit the YAML configuration file and change the settings as needed.

    Commonly-changed settings include (refer to the example below):

    1. Under block-devices (line 15), set your target media. For example: file: "/dev/sda".
    2. Under targetMedia (line 34), set the third partition size to “0” to use the entire disk space.
    3. Under bundles (line 37), add additional bundles as needed.
    4. Delete the post-install section unless you have post-installation scripts.
    5. Under Version (line 50), set a version number. To use the latest version, set to “0”.

    See Installer YAML Syntax for more details.

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
              #clear-linux-config
    
              # c-basic-offset: 2; tab-width: 2; indent-tabs-mode: nil
              # vi: set shiftwidth=2 tabstop=2 expandtab:
              # :indentSize=2:tabSize=2:noTabs=true:
    
              # File:         developer-live-server.yaml
              # Use Case:     Live Image which boots into login prompt
              #               Optionally allows for installing Clear Linux OS
              #               using the TUI clr-installer by running clr-installer
    
              # switch between aliases if you want to install to an actual block device
              # i.e /dev/sda
              block-devices: [
                 {name: "bdevice", file: "/dev/sda"}
              ]
    
              targetMedia:
              - name: ${bdevice}
                type: disk
                children:
                - name: ${bdevice}1
                  fstype: vfat
                  mountpoint: /boot
                  size: "150M"
                  type: part
                - name: ${bdevice}2
                  fstype: swap
                  size: "32M"
                  type: part
                - name: ${bdevice}3
                  fstype: ext4
                  mountpoint: /
                  size: "0"
                  type: part
    
              bundles: [os-core, os-core-update, NetworkManager, clr-installer, vim]
    
              autoUpdate: false
              postArchive: false
              postReboot: false
              telemetry: false
              iso: true
              keepImage: true
    
              keyboard: us
              language: en_US.UTF-8
              kernel: kernel-native
    
              version: 30010
    
  7. Start the unattended installation using the –config option.

    clr-installer --config live-server.yaml
    
  8. Reboot your system after installation is completed.

Example 2: Replicate a previous installation

This example uses a saved configuration file from a previous installation, which you can use to easily clone the installation on additional machines , ideally with the same hardware configuration.

Warning

Be aware of the following when applying a saved configuration on a new machine:

  • Make sure the target media on the new machine matches up
  • The users’ credentials will be replicated as well
  1. On a system where Clear Linux OS was installed, open a terminal window.

  2. Get root privilege.

    sudo su
    
  3. Copy the clr-installer.yaml from /root to a USB thumb drive.

    cp /root/clr-installer.yaml <USB-thumb-drive>
    
  4. Install on target system.

    1. Boot up the Clear Linux OS Live Server USB thumb drive.

    2. Select Clear Linux OS from the menu.

    3. In the console window, log in as root and set a password.

    4. Verify you have a network connection to the Internet and configure proxy settings if you’re working behind a firewall.

    5. Plug in and mount the USB thumb drive containing the retrieved clr-installer.yaml configuration file.

    6. Doublecheck to make sure the target media in the saved configuration file matches with the target system’s.

    7. Start the installation.

      clr-installer --config clr-installer.yaml
      
    8. Reboot your system after installation is completed.