Commit graph

11 commits

Author SHA1 Message Date
2b7e20493a [FIX] script qemu: boot VMs via UEFI (Debian 13 boot loop)
Debian 13 (trixie) genericcloud dropped the BIOS/GRUB-pc bootloader, so
SeaBIOS looped forever on "Booting Debian GNU/Linux" and the install
never completed. Boot via UEFI (OVMF) by default: trixie boots, and
Ubuntu/Debian 12/Fedora keep working (verified Debian 13 and Ubuntu
24.04 end to end). Add a --bios opt-out for hosts without OVMF, and pull
the UEFI firmware (ovmf / edk2-ovmf) with the libvirt/QEMU stack. VM
deletion already removes the nvram (undefine --nvram).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 09:53:21 +00:00
79c69fb6d5 [FIX] script qemu: avoid --osinfo generic for versions newer than osinfo-db
When the exact osinfo id is missing from the local osinfo-db (e.g.
ubuntu26.04, fedora43/44), the fallback was detect=on,require=off, which
made virt-install fall back to "generic" and warn "VM performance may
suffer". Fall back instead to the latest KNOWN osinfo of the same distro
(ubuntu26.04 -> ubuntu25.10, fedora44 -> fedora42): proper virtio/OS
defaults, no warning. detect=on,require=off remains only if nothing of
the family is known.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 09:41:21 +00:00
dc9dfa5779 [FIX] script qemu: make Debian VMs usable (virtio seed + sudo group)
Debian VMs came up with no configured user, no hostname and no SSH key,
so neither the console (erplibre/erplibre) nor SSH worked. Two causes,
found via the guest cloud-init.log:

1. The NoCloud seed was attached as a CD-ROM. Debian's initramfs does
   not load the CD driver (sr_mod) at the init-local stage, so the
   "cidata" volume was invisible and cloud-init fell back to an empty
   DMI seed (Ubuntu tolerates the CD). Attach the seed as a read-only
   virtio disk instead: virtio-blk is in the initramfs, the label is
   seen immediately, and the user-data is applied. Works for Ubuntu too.
2. The user was added to group "admin", which does not exist on Debian
   (it does on Ubuntu) -> useradd failed and the user was never created.
   Use "sudo" (present on both) instead.

Validated end to end: Debian 12 and Ubuntu 24.04 both get the erplibre
user (in sudo), the hostname, console login erplibre/erplibre and SSH by
key.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 09:33:33 +00:00
990c81c0e7 [FIX] script qemu: use /releases/ Ubuntu URLs, drop EOL versions, quiet crypt
Interim Ubuntu releases (24.10, 25.04) were removed from cloud-images
/current/ once EOL, so their image URL 404'd. Switch the Ubuntu image
URL to /releases/<version>/release/ubuntu-<version>-server-cloudimg-
<arch>.img, which stays available for every published release, and drop
the EOL interim versions from the catalogue (keep supported LTS + 25.10
+ 26.04).

Also:
- silence the "crypt is deprecated" DeprecationWarning (openssl fallback
  already covers Python 3.13+);
- a 404 during download now reports "image not found (EOL/removed), pick
  a supported LTS" instead of blaming connectivity;
- add a NoCloud network-config (DHCP on e*) to the seed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 08:41:24 +00:00
4b988bbe46 [FIX] script qemu: don't run apt at first boot by default
cloud-init's package_update/package_upgrade forced apt to hit the distro
mirrors on first boot; on a slow or unreachable network that stalls
cloud-init and delays SSH availability. They are now off by default
(SSH is already present in the cloud images and enabled via runcmd);
--apt-update opts back in (and runs upgrade too unless --no-upgrade).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 08:02:11 +00:00
f5923d0fbb [FIX] script qemu: reliable image download + SSH server by default
The Debian deploy appeared frozen: cloud.debian.org sent this host to an
unreachable mirror and urlretrieve had no timeout, so it hung forever;
worse, output was block-buffered under the todo pipe so nothing showed.

- Stream downloads via urlopen with a 30s per-operation timeout: a dead
  mirror now fails fast instead of hanging.
- Try several Debian mirrors in order (cloud.debian.org, then two
  acc.umu.se mirrors) — first responsive one wins.
- Reconfigure stdout to line-buffered in main() so headers and progress
  appear live even when captured by the menu.
- Add openssh-server to the cloud-init packages and a runcmd enabling
  ssh/sshd, so every VM (Debian genericcloud included) is SSH-reachable.
- Add a timeout to the SHA256SUMS fetch too.

Validated: debian-11 fails over from cloud.debian.org to gemmei and
completes; debian-12 downloads fully.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 07:24:36 +00:00
9c8e7454f3 [IMP] script qemu: multi-distro (Debian/Fedora), resilient osinfo, 26.04
Generalise the deployer beyond Ubuntu with a distro registry and a new
--distro flag (ubuntu default, debian, fedora). Each distro keeps its
own codenames, osinfo ids and per-version minimum RAM/disk. Image URLs
are built per distro (Ubuntu current/, Debian latest/, Fedora resolved
from the release index since it has no "latest" link).

Add --list-images to print the whole catalogue with specs, exposed in
the todo menu ("List available images and specs"); the deploy/download
flows now prompt for the distro first.

Resilient osinfo: when the local osinfo-db does not know an id (e.g.
ubuntu26.04, fedora43+), fall back to virt-install detect=on,require=off
instead of failing. Ubuntu 26.04 (resolute) is now enabled.

Also: throttle the download progress to integer-percent steps (single
updating line on a TTY, at most 101 lines when captured by the menu),
and skip the spurious "network is already active" error by checking the
libvirt network state before net-start.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 06:38:04 +00:00
a202143c30 [IMP] script qemu: default VM sizing to per-version minimums
Replace the fixed 8192 MB / 4 vCPU / 20G defaults with the minimum
resources required by the chosen Ubuntu version (libosinfo/osinfo-db
values): 20.04 -> 2048 MB/5G, 22.04 -> 2048 MB/10G, 24.04+ -> 3072
MB/20G. --vcpus now defaults to 2. This stops a small host from being
starved by an oversized default (an 8 GB VM failed to allocate on a
6.7 GB host) and silences the libvirt "less than recommended" warning.

In the todo menu, leaving the RAM/vCPU/disk fields blank now means
"version minimum" (the flag is simply not passed) instead of forcing
8192/4/20G. Any explicit value still overrides. README regenerated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 06:26:43 +00:00
a42633c8ce [IMP] script qemu: auto image + libvirt install
The script previously required a manually supplied image path and only
installed the client tools, so a bare host aborted at virt-install with
a missing libvirt-sock. It now derives and downloads the Ubuntu cloud
image from --version, detects and installs the full libvirt+QEMU stack
(daemon and system emulator included) through the host package manager,
then enables libvirtd. Adds a --download-only mode, a hypervisor
preflight check, clean error messages instead of Python tracebacks, and
a bilingual usage guide (README).

Generated by Claude Code 2.1.210 claude-opus-4-8

Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
2026-07-15 11:48:00 +00:00
dc42bb715a [UPD] script qemu: show adress ip after launch 2026-07-15 04:45:49 -04:00
6f087d2a9b [IMP] script qemu to create and deploy new VM 2026-07-15 04:45:45 -04:00