Update Template for Debian with fixes and improvements

This commit is contained in:
2026-04-17 07:31:56 +02:00
parent 005213ac7f
commit 3b14aa7c2b
6 changed files with 81 additions and 12 deletions

View File

@@ -241,6 +241,38 @@ build {
name = "debian-13-gui-template"
sources = ["source.vsphere-iso.debian"]
# Install VS Code + YAML extension and Zeal docsets (requires internet via DHCP)
provisioner "shell" {
inline = [
"set -e",
# BDs are mounted at boot via fstab (installer keeps trays closed via
# cdrom-detect/eject=false in preseed).
"for n in 1 2 3 4 5 6; do mountpoint -q /mnt/bd$n || mount /mnt/bd$n; done",
"sudo apt-get update",
# ── VS Code ─────────────────────────────────────────────────────────────
# Download the .deb directly — avoids apt-get update hitting stale CD-ROM sources
"curl -fL --retry 3 'https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64' -o /tmp/vscode.deb",
"file /tmp/vscode.deb | grep -q 'Debian binary package' || { echo 'VS Code download is not a valid .deb'; head -c 500 /tmp/vscode.deb; exit 1; }",
"dpkg -i /tmp/vscode.deb || apt-get install -fy",
"rm -f /tmp/vscode.deb",
"code --install-extension redhat.vscode-yaml --no-sandbox --user-data-dir /root/.vscode --force",
# Patch the .desktop launcher so VS Code opens without the root sandbox error
"sed -i 's|Exec=/usr/share/code/code|Exec=/usr/share/code/code --no-sandbox|g' /usr/share/applications/code.desktop",
# ── Zeal ────────────────────────────────────────────────────────────────
"apt-get install -y zeal",
# Qt WebEngine (Chromium) refuses to run as root without disabling sandbox.
# Patch the launcher to pass the env var instead of --no-sandbox flag.
"sed -i 's|^Exec=zeal|Exec=env QTWEBENGINE_CHROMIUM_FLAGS=--no-sandbox zeal|' /usr/share/applications/org.zealdocs.zeal.desktop",
"mkdir -p /root/.local/share/Zeal/Zeal/docsets",
"wget -qO /tmp/Python.tgz https://kapeli.com/feeds/Python.tgz && tar -xz -C /root/.local/share/Zeal/Zeal/docsets -f /tmp/Python.tgz && rm /tmp/Python.tgz",
"wget -qO /tmp/Ansible.tgz https://kapeli.com/feeds/Ansible.tgz && tar -xz -C /root/.local/share/Zeal/Zeal/docsets -f /tmp/Ansible.tgz && rm /tmp/Ansible.tgz",
"wget -qO /tmp/Nginx.tgz https://kapeli.com/feeds/Nginx.tgz && tar -xz -C /root/.local/share/Zeal/Zeal/docsets -f /tmp/Nginx.tgz && rm /tmp/Nginx.tgz",
"wget -qO /tmp/Bash.tgz https://kapeli.com/feeds/Bash.tgz && tar -xz -C /root/.local/share/Zeal/Zeal/docsets -f /tmp/Bash.tgz && rm /tmp/Bash.tgz",
]
}
# Generalise the VM so every clone starts with a clean identity
provisioner "shell" {
inline = [