Skip to content

Instantly share code, notes, and snippets.

@AndreiCherniaev
Last active December 8, 2025 07:07
Show Gist options
  • Select an option

  • Save AndreiCherniaev/f29d024b7c2bbbd59f39e2b66dfc2a04 to your computer and use it in GitHub Desktop.

Select an option

Save AndreiCherniaev/f29d024b7c2bbbd59f39e2b66dfc2a04 to your computer and use it in GitHub Desktop.
YAML configuration files for Ubuntu installer
# Manual https://canonical-subiquity.readthedocs-hosted.com/en/latest/reference/autoinstall-reference.html
autoinstall:
version: 1
refresh-installer:
update: true
channel: latest/edge
updates: all
identity:
hostname: ubuntu-desktop
password: '$6$TThZwH2sYnfxdzIN$COsmkwowJBH.pYW/jpfhzcBsxSQ6.lrEygIGUQLDrJBsTBgT1gLnkspvttBmgKIJl6UGGSOv4cDfV4Hj0BqS9/'
# There is password hash, use `mkpasswd --method=SHA-512`
realname: q
username: q
apt:
preserve_sources_list: false
mirror-selection:
primary:
- country-mirror
- uri: "http://ko.archive.ubuntu.com/ubuntu"
arches: [amd64]
fallback: abort
geoip: true
keyboard:
layout: us
variant: ''
toggle: null
timezone: Asia/Seoul
storage:
layout:
name: lvm
match:
ssd: true
size: largest
packages:
- tmux
ssh:
allow-pw: true
authorized-keys: []
install-server: false
late-commands:
# About $HOME. late-commands works in the host environment, not in the target. $HOME does NOT point to the username home
- echo "alias upd='sudo apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false update && sudo apt upgrade -y && sudo apt autoremove -y'" >> '/target/home/q/.bash_aliases'
- echo "alias t='sudo apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false update && sudo apt autoremove -y'" >> '/target/home/q/.bash_aliases'
# Update rustdesk in Debian from https://gist.github.com/AndreiCherniaev/9bef25311726b3955f7c11ae35784307?permalink_comment_id=5878204#gistcomment-5878204
- |
cat<<'EOF' >> $HOME/.bashrc
upd_rustdesk() {
sudo dpkg --install $(basename $(wget $(wget -qk -l 0 "https://github.com/rustdesk/rustdesk/releases" -O /tmp/index.html ; cat /tmp/index.html | grep -o 'https:[^"]*.deb' | grep '\/rustdesk-[0-9]*[0-9]\.[0-9].*_64.deb' | sort -r -n | head -1)))
}
EOF
@AndreiCherniaev
Copy link
Author

Always verify your YAML before using. How to do it? Use subiquity

git clone https://github.com/canonical/subiquity.git && cd subiquity/
make install_deps
# put my Cher0_1_ubuntu-deployment.yaml to subiquity/
wcurl https://gist.github.com/AndreiCherniaev/f29d024b7c2bbbd59f39e2b66dfc2a04/raw/8404f7b0d4f6678d36a4ac695822c344bb1ee876/Cher0_1_ubuntu-deployment.yaml

SNAP=. ./scripts/validate-autoinstall-user-data.py --no-expect-cloudconfig 'Cher0_1_ubuntu-deployment.yaml'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment