A link to the PDF of this article can be found here: Linux Imaging - KACE SDA
Introduction
With the introduction of SDA version 7.0, Quest KACE now supports deploying Linux operating systems. Linux is very configurable and this document will cover only the basics of deploying Linux with the KACE SDA. The KACE SDA supports Red Hat, CentOS, and Ubuntu deployments. Here we will focus on two free flavors of Linux, Ubuntu and CentOS. Red Hat Linux is a paid distribution of Linux and is very similar to CentOS in the commands and syntax.
Glossary of Terms
• Preseed File – Similar to a sysprep answer file in Windows, the preseed file is used in Ubuntu to configure the setup of the Ubuntu Operating system during the deployment.
• Kickstart File – Same as a Preseed file but used for configuring CentOS and RedHat deployments
• Package Repository – Linux distributions have online files for the operating system that are updated regularly. KACE can pull files from online repository and store them on the SDA server for faster deployment
• Boot Environment – Operating system that is loaded via network boot and used to deploy the operating system, KACE SDA will automatically create these when uploading the operating system (unlike Windows Boot environments which are created separately from the operating system upload)
Document Assumptions
• KACE SDA is installed and upgraded to at least 7.0
• You have downloaded and installed KACE Media Manager on a Windows system (for Ubuntu) and a Mac system (for CentOS only).
• Internet access is needed to download the Linux distributions
• Optional but highly recommended – KACE SDA has internet access to download and update the repository for the distribution(s) you plan to use
Note: For ALL Linux installations the KACE SDA only supports scripted installations. It is not possible to capture a disk image of Linux operating systems
Ubuntu Imaging
Ubuntu is a popular distribution of Linux that is used in desktops and servers. Ubuntu has many variants that can also be installed with the base Ubuntu system. Common variants of Ubuntu are KUbuntu,, Lubuntu, and XUbuntu.
Uploading Ubuntu Media to the SDA
KACE SDA supports Ubuntu 16.04 and version 18.04 64 bit versions only. When uploading Ubuntu media to the KACE SDA, you MUST have the correct version downloaded before you begin. Ubuntu has many different download options and in order to utilize the SDA deployment functionality, you need to get the full server version of the Ubuntu operating system. KACE does NOT support the Desktop version of Ubuntu. If you want to use Ubuntu as a desktop/laptop, the desktop OS features can still be installed from the server media. You cannot use live or interactive installation media. If you look at the ubuntu.com site it is not the main option for download. The CDs are available to download from here:
Ubuntu 18: http://cdimage.ubuntu.com/releases/18.04.3/release/
Ubuntu 16: http://cdimage.ubuntu.com/releases/16.04.6/release/
Ubuntu Server Download
Full Ubuntu Server ISO Download
Once the server ISO is downloaded, the administrator must mount the ISO file and upload the media via KACE Media Manager.
Uploading Ubuntu Source Media
During the Media Manager upload, the KACE SDA will create the source media record for Ubuntu as well as automatically build the boot environment for Ubuntu that will be used to network boot and install Ubuntu. The boot environment will be labeled with “BE” at the end of the name provided when uploading the source media.
Ubuntu Source Media and Boot Environment
If desired, the administrator can rename the boot environment and/or the Source media in the SDA console.
Renamed Ubuntu Boot Environment
Configure Ubuntu Mirror
Linux distributions allow for live updating of the image deployment and often require a connection to a package repository distribution (mirror) server to install packages and updates during the deployment. In the KACE SDA we can specify the repository mirrors to use and how often we will update the cached installation files on the SDA. While the mirror server is not required, it is recommended as the OS will be able to get the latest patches and updates during the installation process.
To setup an Ubuntu Package Repository server, open the Source Media for the Ubuntu media.
Enter the mirror server you wish to use. Large organizations might have a mirror server they have internally. Typically, administrators will just use the package repositories from Ubuntu. The two most common mirrors are:
http://us.archive.ubuntu.com/ubuntu/
http://us2.archive.ubuntu.com/ubuntu/
Ubuntu Repositories added to Source Media
Once we have added the repository, we can setup the KACE SDA to cache the update files so future installations use packages downloaded from Ubuntu and stored on the SDA instead of updating through the package repositories on each installation. In order to enable repository caching, go to the SDA console and navigate to Settings General Settings and scroll down to the Linux Repository Caching setting.
Linux Repository Caching
When repository caching is enabled, packages used by Linux during the install process are saved locally to speed up deployments and decrease bandwidth usage.
The cache duration is how long a package will be cached on the server before a refresh of the package is requested from the original source.
Now that we have setup package repositories and configured caching on the SDA, we can begin to build a scripted installation of Ubuntu.
Ubuntu Scripted Installation
Now that we have the Ubuntu media and boot environment on the SDA, we can start to build a scripted installation for Ubuntu using the KACE SDA Scripted installation wizard. In the Deployments Scripted Installations menu, select new scripted installation. Enter the name of the scripted installation and select the uploaded media to use.
Scripted Installation – Enter Name and Select OS
Next, we define the parameters of the installation, either with a pre-configured preseed file, or by creating one. In this example we will walk through creating a preseed file from scratch. The preseed file can always be edited later after we create the scripted installation.
Selecting Preseed File Setup
Select the Ubuntu Server option, and enter the root password to be used in the image.
Select Preseed Template and enter Root Password
By default, there will be no tasks in the installation plan. For a simple setup, this is typically fine. In this example we have added two tasks to the installation, the first installs OpenVM tools (for virtual machines) and the second installs the KACE SMA Agent.
Post-Installation Tasks (optional)
Click next and the SDA will complete the setup of the scripted installation.
Completed Scripted Installation
Modifying the Ubuntu Configuration
Once you have the scripted installation created, you will be able to edit the deployment and make changes to the installation plan (if you have post install tasks created) or edit the configuration file. We will look at the default preseed file here and discuss options to further customize the scripted installation. In order to view the preseed file contents, open the scripted installation and show the Setup Configuration (hidden by default).
Show Setup Configuration in Scripted Installation
Here is the default preseed file created by the SDA.
# Mostly based on the Ubuntu installation guide
# https://help.ubuntu.com/16.04/installation-guide/
# Debian sample
# https://www.debian.org/releases/stable/example-preseed.txt
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_US
# Keyboard selection.
d-i keyboard-configuration/xkb-keymap select us
d-i keyboard-configuration/xkb-keymap select us
# Disable automatic (interactive) keymap detection.
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/toggle select No toggling
d-i keyboard-configuration/layoutcode string us
d-i keyboard-configuration/variantcode string
# netcfg will choose an interface that has link if possible. This makes it
# skip displaying a list if there is more than one interface.
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
# uncomment this line to manually set the hostname
#d-i netcfg/hostname string unassigned-hostname
# If non-free firmware is needed for the network or other hardware, you can
# configure the installer to always try to load it, without prompting. Or
# change to false to disable asking.
# d-i hw-detect/load_firmware boolean true
# NTP/Time Setup
d-i time/zone string US/Eastern
d-i clock-setup/utc boolean true
d-i clock-setup/ntp boolean true
d-i clock-setup/ntp-server string ntp.ubuntu.com
# Setup the installation source
#d-i mirror/country string manual
#d-i mirror/http/hostname string 192.168.2.170
#d-i mirror/http/directory string /repocache/ubuntu/
#d-i mirror/http/proxy string
%%K2_REPO_URL%%
# Suite to install.
# d-i mirror/suite string precise
# d-i mirror/udeb/suite string precise
# Components to use for loading installer components (optional).
#d-i mirror/udeb/components multiselect main, restricted
# Disk Partitioning
# Use LVM, and wipe out anything that already exists
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman-auto/method string lvm
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman-auto-lvm/guided_size string max
d-i partman-efi/non_efi_system boolean true
# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
# - home: separate /home partition
# - multi: separate /home, /usr, /var, and /tmp partitions
d-i partman-auto/choose_recipe select atomic
# If you just want to change the default filesystem from ext3 to something
# else, you can do that without providing a full recipe.
# d-i partman/default_filesystem string ext4
# root account and password
d-i passwd/root-login boolean true
d-i passwd/root-password-crypted password %%K2_ENCRYPTED_ROOT_PASSWORD%%
d-i user-setup/allow-password-weak boolean true
# skip creation of a normal user account.
d-i passwd/make-user boolean false
# You can choose to install restricted and universe software, or to install
# software from the backports repository.
# d-i apt-setup/restricted boolean true
# d-i apt-setup/universe boolean true
# d-i apt-setup/backports boolean true
# Uncomment this if you don't want to use a network mirror.
# d-i apt-setup/use_mirror boolean false
# Select which update services to use; define the mirrors to be used.
# Values shown below are the normal defaults.
# d-i apt-setup/services-select multiselect security
# d-i apt-setup/security_host string security.ubuntu.com
# d-i apt-setup/security_path string /ubuntu
# Enable deb-src lines
# d-i apt-setup/local0/source boolean true
# URL to the public key of the local repository; you must provide a key or
# apt will complain about the unauthenticated repository and so the
# sources.list line will be left commented out
# d-i apt-setup/local0/key string http://local.server/key
# By default the installer requires that repositories be authenticated
# using a known gpg key. This setting can be used to disable that
# authentication. Warning: Insecure, not recommended.
# d-i debian-installer/allow_unauthenticated boolean true
# Package selection
# Default for minimal
tasksel tasksel/first multiselect standard
# Default for server
# tasksel tasksel/first multiselect standard, web-server
# Default for gnome-desktop
# tasksel tasksel/first multiselect standard, ubuntu-desktop
d-i pkgsel/update-policy select none
# Individual additional packages to install
# wget is REQUIRED otherwise quite a few things won't work
# later in the build (like late-command scripts)
d-i pkgsel/include string ssh wget
# Debian needs this for the installer to avoid any question for grub
# Please verify that it suit your needs as it may overwrite any usb stick
d-i grub-installer/grub2_instead_of_grub_legacy boolean true
d-i grub-installer/bootdev string default
# Use the following option to add additional boot parameters for the
# installed system (if supported by the bootloader installer).
# Note: options passed to the installer will be added automatically.
# d-i debian-installer/add-kernel-opts string $kernel_options_post
# Avoid that last message about the install being complete.
d-i finish-install/reboot_in_progress note
# This first command is run as early as possible, just after preseeding is read.
# d-i preseed/early_command string [command]
%%K2_PRE_INSTALL_TASKS%%
# This command is run immediately before the partitioner starts. It may be
# useful to apply dynamic partitioner preseeding that depends on the state
# of the disks (which may not be visible when preseed/early_command runs).
# d-i partman/early_command \
# string debconf-set partman-auto/disk "\$(list-devices disk | head -n1)"
# This command is run just before the install finishes, but when there is
# still a usable /target directory. You can chroot to /target and use it
# directly, or use the apt-install and in-target commands to easily install
# packages and run commands in the target system.
# d-i preseed/late_command string [command]
%%K2_MID_LEVEL_TASKS%%
# Mostly based on the Ubuntu installation guide # https://help.ubuntu.com/16.04/installation-guide/ # Debian sample # https://www.debian.org/releases/stable/example-preseed.txt # Preseeding only locale sets language, country and locale. d-i debian-installer/locale string en_US # Keyboard selection. d-i keyboard-configuration/xkb-keymap select us d-i keyboard-configuration/xkb-keymap select us # Disable automatic (interactive) keymap detection. d-i console-setup/ask_detect boolean false d-i keyboard-configuration/toggle select No toggling d-i keyboard-configuration/layoutcode string us d-i keyboard-configuration/variantcode string # netcfg will choose an interface that has link if possible. This makes it # skip displaying a list if there is more than one interface. d-i netcfg/choose_interface select auto d-i netcfg/get_hostname string unassigned-hostname d-i netcfg/get_domain string unassigned-domain # uncomment this line to manually set the hostname d-i netcfg/hostname string UbuntuImage # If non-free firmware is needed for the network or other hardware, you can # configure the installer to always try to load it, without prompting. Or # change to false to disable asking. # d-i hw-detect/load_firmware boolean true # NTP/Time Setup d-i time/zone string US/Eastern d-i clock-setup/utc boolean true d-i clock-setup/ntp boolean true d-i clock-setup/ntp-server string server 0.us.pool.ntp.org # Setup the installation source #d-i mirror/country string manual #d-i mirror/http/hostname string 192.168.2.170 #d-i mirror/http/directory string /repocache/ubuntu/ #d-i mirror/http/proxy string %%K2_REPO_URL%% # Suite to install. # d-i mirror/suite string precise # d-i mirror/udeb/suite string precise # Components to use for loading installer components (optional). #d-i mirror/udeb/components multiselect main, restricted # Disk Partitioning # Use LVM, and wipe out anything that already exists d-i partman/choose_partition select finish d-i partman/confirm boolean true d-i partman/confirm_nooverwrite boolean true d-i partman-auto/method string lvm d-i partman-lvm/device_remove_lvm boolean true d-i partman-lvm/confirm boolean true d-i partman-lvm/confirm_nooverwrite boolean true d-i partman-md/device_remove_md boolean true d-i partman-partitioning/confirm_write_new_label boolean true d-i partman-auto-lvm/guided_size string max d-i partman-efi/non_efi_system boolean true # You can choose one of the three predefined partitioning recipes: # - atomic: all files in one partition # - home: separate /home partition # - multi: separate /home, /usr, /var, and /tmp partitions d-i partman-auto/choose_recipe select atomic # If you just want to change the default filesystem from ext3 to something # else, you can do that without providing a full recipe. # d-i partman/default_filesystem string ext4 # root account and password d-i passwd/root-login boolean true d-i passwd/root-password-crypted password %%K2_ENCRYPTED_ROOT_PASSWORD%% d-i user-setup/allow-password-weak boolean true # Skip creation of a root account (normal user account will be able to # use sudo). The default is false; preseed this to true if you want to set # a root password. #d-i passwd/root-login boolean false # Alternatively, to skip creation of a normal user account. #d-i passwd/make-user boolean false # Root password, either in clear text #d-i passwd/root-password password r00tme #d-i passwd/root-password-again password r00tme # or encrypted using a crypt(3) hash. #d-i passwd/root-password-crypted password [crypt(3) hash] # To create a normal user account. d-i passwd/user-fullname string Admin User d-i passwd/username string adminuser # Normal user's password, either in clear text d-i passwd/user-password password Admin123 d-i passwd/user-password-again password Admin123 # or encrypted using a crypt(3) hash. #d-i passwd/user-password-crypted password [crypt(3) hash] # Create the first user with the specified UID instead of the default. #d-i passwd/user-uid string 1010 # The installer will warn about weak passwords. If you are sure you know # what you're doing and want to override it, uncomment this. d-i user-setup/allow-password-weak boolean true # The user account will be added to some standard initial groups. To # override that, use this. #d-i passwd/user-default-groups string audio cdrom video # Set to true if you want to encrypt the first user's home directory. d-i user-setup/encrypt-home boolean false # You can choose to install restricted and universe software, or to install # software from the backports repository. # d-i apt-setup/restricted boolean true # d-i apt-setup/universe boolean true # d-i apt-setup/backports boolean true # Uncomment this if you don't want to use a network mirror. # d-i apt-setup/use_mirror boolean false # Select which update services to use; define the mirrors to be used. # Values shown below are the normal defaults. # d-i apt-setup/services-select multiselect security # d-i apt-setup/security_host string security.ubuntu.com # d-i apt-setup/security_path string /ubuntu # Enable deb-src lines # d-i apt-setup/local0/source boolean true # URL to the public key of the local repository; you must provide a key or # apt will complain about the unauthenticated repository and so the # sources.list line will be left commented out # d-i apt-setup/local0/key string http://local.server/key # By default the installer requires that repositories be authenticated # using a known gpg key. This setting can be used to disable that # authentication. Warning: Insecure, not recommended. # d-i debian-installer/allow_unauthenticated boolean true # Package selection # Default for minimal # tasksel tasksel/first multiselect standard # Default for server # tasksel tasksel/first multiselect standard, web-server # Define which Ubuntu Desktop to use tasksel tasksel/first multiselect standard, ubuntu-desktop #Ubuntu Desktops #standard (standard tools) #ubuntu-desktop #kubuntu-desktop #edubuntu-desktop #lubuntu-desktop #ubuntu-gnome-desktop #xubuntu-desktop #ubuntu-mate-desktop #lamp-server #print-server (print server) #d-i pkgsel/update-policy select none d-i pkgsel/update-policy select unattended-upgrades # Individual additional packages to install # wget is REQUIRED otherwise quite a few things won't work # later in the build (like late-command scripts) d-i pkgsel/include string ssh wget # Debian needs this for the installer to avoid any question for grub # Please verify that it suit your needs as it may overwrite any usb stick d-i grub-installer/grub2_instead_of_grub_legacy boolean true d-i grub-installer/bootdev string default # Use the following option to add additional boot parameters for the # installed system (if supported by the bootloader installer). # Note: options passed to the installer will be added automatically. # d-i debian-installer/add-kernel-opts string $kernel_options_post # Avoid that last message about the install being complete. d-i finish-install/reboot_in_progress note # This first command is run as early as possible, just after preseeding is read. # d-i preseed/early_command string [command] %%K2_PRE_INSTALL_TASKS%% # This command is run immediately before the partitioner starts. It may be # useful to apply dynamic partitioner preseeding that depends on the state # of the disks (which may not be visible when preseed/early_command runs). # d-i partman/early_command \ # string debconf-set partman-auto/disk "\$(list-devices disk | head -n1)" # This command is run just before the install finishes, but when there is # still a usable /target directory. You can chroot to /target and use it # directly, or use the apt-install and in-target commands to easily install # packages and run commands in the target system. # d-i preseed/late_command string [command] %%K2_MID_LEVEL_TASKS%%
# Define which Ubuntu Desktop to use
tasksel tasksel/first multiselect standard, ubuntu-desktop
#Ubuntu Desktops
#standard (standard tools)
#ubuntu-desktop
#kubuntu-desktop
#edubuntu-desktop
#lubuntu-desktop
#xubuntu-desktop
#ubuntu-mate-desktop
#lamp-server
#print-server (print server)
Example syntax for kubuntu
tasksel tasksel/first multiselect standard, kubuntu-desktop
Deploying any Linux Scripted Installation
Post-Installation Task for SMA Agent – Ubuntu
Other Considerations / Settings
CentOS Imaging
Uploading CentOS Media to the SDA
Command line to mount ISO file: hdiutil attach -nomount CentOS-7-x86_64-DVD-1810.iso
Command to mount ISO into directory in MacOSX: mount -t cd9660 -o noowners /dev/disk2 cent-mount
Configure CentOS Mirror
Repository Caching
CentOS Scripted Installation
# Sample kickstart file for current EL, Fedora based distributions.#platform=x86, AMD64, or Intel EM64T# System authorization informationauth --useshadow --enablemd5# System bootloader configurationbootloader --location=mbr# Partition clearing informationclearpart --all --initlabel# Use text mode installtext# Firewall configurationfirewall --enabled# Run the Setup Agent on first bootfirstboot --disable# System keyboardkeyboard us# System languagelang en_US# Use network installation#url --url="http://mirror.zetup.net/CentOS/7/os/x86_64/"%%K2_REPO_URL%%# Network information# Reboot after installationreboot#Root passwordrootpw --iscrypted %%K2_ENCRYPTED_ROOT_PASSWORD%%# SELinux configurationselinux --disabled# Do not configure the X Window Systemskipx# System timezonetimezone America/New_York# Install OS instead of upgradeinstall# Clear the Master Boot Recordzerombr# Allow anaconda to partition the system as neededautopart%pre --log /tmp/pre-install.log --interpreter=/bin/bash%%K2_PRE_INSTALL_TASKS%%%end%packages --ignoremissing --excludedocs@compat-libraries@corenet-toolschronywget%end%post --log /tmp/post-install.log%%K2_MID_LEVEL_TASKS%%%end
Modifying the CentOS Kickstart File
# Sample kickstart file for current EL, Fedora based distributions.#KACE#platform=x86, AMD64, or Intel EM64T# Install OS instead of upgradeinstall# Keyboard layoutskeyboard 'us'# Root password (created by config utility – can be used in place of K2 password)# rootpw --iscrypted $1$CqSnVOvW$NoppAeOMH4Vtqddl0YrFf.# KACE SDA Root passwordrootpw --iscrypted %%K2_ENCRYPTED_ROOT_PASSWORD%%# Specify CentOS repository to use# Live Online repository (use KACE cached repository unless you want to use the live one each installation)#url --url="http://mirror.zetup.net/CentOS/7/os/x86_64/"# KACE SDA Cached Repositoryurl --url=%%K2_REPO_URL%%# System authorization informationauth --useshadow --passalgo=sha512# Use Graphical Installgraphical# Run the Setup Agent on first bootfirstboot --disable# Users# Will add users into the system. default groups wheel (users) and admin, passwords in quotes allow for special characters in PWuser --name=kace-admin --groups=wheel,admin --plaintext --password="Admin123!"user --name=kace-user --groups=wheel --plaintext --password="Admin123"user --name=kace-tech --groups=wheel,admin --plaintext --password="Admin123!@#"# SELinux configurationselinux --enforcingservices --enabled=cups# Firewall configurationfirewall --disabled# Network informationnetwork --bootproto=dhcp --device=eth0 --hostname centos7.demo.vm.local# Reboot after installationreboot# System timezonetimezone America/New_York# System languagelang en_US# System bootloader configurationbootloader --location=mbr# Clear the Master Boot Recordzerombr# Partition clearing informationclearpart --all# Disk partitioning informationpart /boot --asprimary --fstype="ext4" --size=512part / --asprimary --fstype="ext4" --grow --size=1# Unused parameters - GUI and Desktop are handled in packages# Do not configure the X Window System# skipx# Configure xsystem# xconfig --defaultdesktop=GNOME --startxonboot%packages@compat-libraries@core@base@gnome-apps@internet-applications# @kde-desktop@gnome-desktop@legacy-x@network-file-system-client@network-tools@performance@remote-desktop-clients@x11xterm-abrt-addon-ccpp-abrt-addon-python-abrt-cli-abrt-console-notification-bash-completion-bpftool-bridge-utils-bzip2-chrony-cryptsetup-cups-dmraid-dosfstools-ethtool-fprintd-pam-gnupg2-hunspell-hunspell-en-kmod-kvdo-kpatch-ledmon-libaio-libreport-plugin-mailx-libstoragemgmt-lvm2-man-pages-man-pages-overrides-mdadm-mlocate-mtr-nano-ntpdate-open-vm-tools-perl-pinfo-plymouth-pm-utils-psmisc-psiutils-rdate-rfkill-rng-tools-rsync-scl-utils-setuptool-smartmontools-sos-sssd-client-strace-systemtap-runtime-tcsh-teamd-time-unzip-usbutils-vdo-vim-enhanced-virt-what-wget-which-words-xfsdump-xz-yum-langpacks-yum-utils-zip%end%pre --log /tmp/pre-install.log --interpreter=/bin/bash%%K2_PRE_INSTALL_TASKS%%%end%post --log /tmp/post-install.log%%K2_MID_LEVEL_TASKS%%%end
Thanks with your post I used to run my automated linux installation. But I wonder if it's possible to install linux on an other way as the automated deployment?
The problem ist, that I don't want to type in the MAC adress for every new client i'm installing.
Thanks for your answer ;) - abahelpdesk 5 years ago