All Projects → coreprocess → Linux Unattended Installation

coreprocess / Linux Unattended Installation

Licence: mit
This project provides all you need to create an unattended installation of a minimal setup of Linux.

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Linux Unattended Installation

Ebcvm
EFI Byte Code Virtual Machine in userspace
Stars: ✭ 34 (-84.19%)
Mutual labels:  uefi, virtual-machine, vm
Qemu Images
A collection of disk images and virtual machines that can be used by the QEMU emulator
Stars: ✭ 145 (-32.56%)
Mutual labels:  virtual-machine, kvm
Build
Armbian Linux build framework
Stars: ✭ 1,827 (+749.77%)
Mutual labels:  ubuntu, uefi
Terrible
An Ansible playbook that apply the principle of the Infrastructure as Code on a QEMU/KVM environment.
Stars: ✭ 161 (-25.12%)
Mutual labels:  ubuntu, kvm
Liveusb Builder
A script suite to create multiboot USB stick for GNU/Linux distributions
Stars: ✭ 118 (-45.12%)
Mutual labels:  iso, uefi
Cv4pve Autosnap
Automatic snapshot tool for Proxmox VE
Stars: ✭ 123 (-42.79%)
Mutual labels:  vm, kvm
Quickjs
QuickJS是一个小型并且可嵌入的Javascript引擎,它支持ES2020规范,包括模块,异步生成器和代理器。
Stars: ✭ 2,199 (+922.79%)
Mutual labels:  virtual-machine, vm
S2e
S2E: A platform for multi-path program analysis with selective symbolic execution.
Stars: ✭ 102 (-52.56%)
Mutual labels:  vm, kvm
Lam
🚀 a lightweight, universal actor-model vm for writing scalable and reliable applications that run natively and on WebAssembly
Stars: ✭ 176 (-18.14%)
Mutual labels:  virtual-machine, vm
Rufus
The Reliable USB Formatting Utility
Stars: ✭ 16,917 (+7768.37%)
Mutual labels:  iso, uefi
Box
[DEPRECATED] Official, pre-packaged Vagrant Box
Stars: ✭ 197 (-8.37%)
Mutual labels:  virtual-machine, vm
Macos Simple Kvm
Tools to set up a quick macOS VM in QEMU, accelerated by KVM.
Stars: ✭ 11,732 (+5356.74%)
Mutual labels:  virtual-machine, kvm
Quickjs
The official repo is at bellard/quickjs.
Stars: ✭ 1,429 (+564.65%)
Mutual labels:  virtual-machine, vm
E4vm
A small portable virtual machine that would run Erlang on embedded systems
Stars: ✭ 124 (-42.33%)
Mutual labels:  virtual-machine, vm
Redtamarin
AS3 running on the command line / server side
Stars: ✭ 105 (-51.16%)
Mutual labels:  virtual-machine, vm
Kvm Vmi
KVM-based Virtual Machine Introspection
Stars: ✭ 153 (-28.84%)
Mutual labels:  virtual-machine, kvm
Packer Build
Packer Automated VM Image and Vagrant Box Builds
Stars: ✭ 199 (-7.44%)
Mutual labels:  ubuntu, kvm
Albatross
Albatross: orchestrate and manage MirageOS unikernels with Solo5
Stars: ✭ 85 (-60.47%)
Mutual labels:  provisioning, virtual-machine
Footloose
Container Machines - Containers that look like Virtual Machines
Stars: ✭ 1,289 (+499.53%)
Mutual labels:  virtual-machine, vm
Runtime
Kata Containers version 1.x runtime (for version 2.x see https://github.com/kata-containers/kata-containers).
Stars: ✭ 2,103 (+878.14%)
Mutual labels:  virtual-machine, kvm

Linux Unattended Installation

This project provides all you need to create an unattended installation of a minimal setup of Linux, whereas minimal translates to the most lightweight setup - including an OpenSSH service and Python - which you can derive from the standard installer of a Linux distribution. The idea is, you will do all further deployment of your configurations and services with the help of Ansible or similar tools once you completed the minimal setup.

Ubuntu 16.04 LTS and 18.04 LTS

Use the build-iso.sh script to create an ISO file based on the netsetup image of Ubuntu.

Use the build-disk.sh script to create a cloneable preinstalled disk image based on the output of build-iso.sh.

Features

  • Fully automated installation procedure.
  • Shutdown and power off when finished. We consider this a feature since it produces a defined and detectable state once the setup is complete.
  • Authentication based on SSH public key and not on a password.
  • Setup ensures about 25% of free disk space in the LVM group. We consider this a feature since it enables you to use LVM snapshots; e.g., for backup purposes.
  • Generates SSH server keys on first boot and not during setup stage. We consider this a feature since it enables you to use the installed image as a template for multiple machines.
  • Prints IPv4 and IPv6 address of the device on screen once booted.
  • USB bootable hybrid ISO image.
  • UEFI and BIOS mode supported.

Prerequisites

Linux

Run sudo apt-get install dos2unix p7zip-full cpio gzip genisoimage whois pwgen wget fakeroot isolinux xorriso to install software tools required by the build-iso.sh script.

Run sudo apt-get install qemu-utils qemu-kvm in addition to install software tools required by the build-disk.sh script.

Mac (Ubuntu 18.04 LTS only)

Run brew install p7zip xorriso wget dos2unix fakeroot coreprocess/gnucpio/gnucpio to install software tools required by the build-iso.sh script.

The script build-disk.sh is not supported on Mac.

Docker

Run docker build -t ubuntu-unattended . to build the Docker image.

When running the Docker container, add the public key you want to use and the ISO output directory as volume links and specify the desired Ubuntu version as parameter (defaults to 18.04), e.g:

docker run \
  --rm \
  -t \
  -v "$HOME/.ssh/id_rsa.pub:/root/.ssh/id_rsa.pub:ro" \
  -v "$(pwd):/iso" \
  ubuntu-unattended \
  16.04

Explanation of the command switches:

--rm
# Remove the Docker container when finished

-t
# Show terminal output

-v "$HOME/.ssh/id_rsa.pub:/root/.ssh/id_rsa.pub:ro"
# Mount "$HOME/.ssh/id_rsa.pub" from your machine to "/root/.ssh/id_rsa.pub"
# in the container (read only).
# This is the path, where the script expects your public key to be.

-v "$(pwd):/iso"
# Mount the current working directory from your machine to "/iso"
# in the container. This is the path, where the ISO file is written to.

It is enough to build the container once. If you want to add a custom preseed config when executing docker run, mount your local copy of the file into the container, e.g: -v "$(pwd)/my_preseed.cfg:/ubuntu/<version>/custom/preseed.cfg.

The script build-disk.sh is not supported on Docker.

Usage

Build ISO images

You can run the build-iso.sh script as regular user. No root permissions required.

./ubuntu/<VERSION>/build-iso.sh <ssh-public-key-file> <target-iso-file>

All parameters are optional.

Parameter Description Default Value
<ssh-public-key-file> The ssh public key to be placed in authorized_keys $HOME/.ssh/id_rsa.pub
<target-iso-file> The path of the ISO image created by this script ubuntu-<VERSION>-netboot-amd64-unattended.iso

Boot the created ISO image on the target VM or physical machine. Be aware the setup will start within 10 seconds automatically and will reset the disk of the target device completely. The setup tries to eject the ISO/CD during its final stage. It usually works on physical machines, and it works on VirtualBox. It might not function in certain KVM environments in case the managing environment is not aware of the eject event. In that case, you have to detach the ISO image manually to prevent an unintended reinstall.

Power-on the machine and log into it as root using your ssh key. The ssh host key will be generated on first boot.

Build disk images

You can run the build-disk.sh script as regular user. No root permissions required, if you are able to run kvm with your user account.

./ubuntu/<VERSION>/build-disk.sh <ram-size> <disk-size> <disk-format> <ssh-public-key-file> <disk-file>

All parameters are optional.

Parameter Description Default Value
<ram-size> The RAM size used during setup routine in MB (might affect size of swap partition) 2048
<disk-size> The disk size of the disk image file to be created 10G
<disk-format> The format of the disk image file to be created (qcow2 or raw) qcow2
<ssh-public-key-file> The ssh public key to be placed in authorized_keys $HOME/.ssh/id_rsa.pub
<disk-file> The path of the disk image created by this script ubuntu-<VERSION>-amd64-<ram-size>-<disk-size>.<disk-format>

Use the generated disk image as template image and create copies of it to deploy virtual or physical machines. Do not boot the template itself, since the ssh host key will be generated on first boot.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].