[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#769406: Serial console not set up after serial install



On 8/20/25 05:00, Cyril Brulebois wrote:
Kevin Otte <nivex@nivex.net> (2025-08-18):
I've just run headlong into this 10 years later.

I have a script that creates a VM thusly:
virt-install --name ${vm_name} --memory ${mem_size} \
  --disk "size=${disk_size},pool=${disk_pool},discard=unmap" \
  --machine q35 \
  --location
http://ftp.us.debian.org/debian/dists/${suite}/main/installer-amd64/ \
  --os-variant name=debiantesting \
  --network network=ovs-net,target=ve0-${vm_name} \
  --graphics none --extra-args="console=ttyS0 netcfg/hostname=${vm_name}" \
  --console pty \
  --initrd-inject preseed.cfg

Under both bookworm and trixie, the install completes successfully over the
serial console.

In bookworm it seems systemd was being overly smart and starting a getty on
the serial port when it saw one, as there is no other apparent configuration
to start it. Under trixie this behavior is no longer present, so I get no
way to log into the installed system. (I can't be certain this is the case
as I have not been able to locate a relevant changelog entry in systemd.)
However, since grub does get configured, I can edit the kernel command line
manually on boot and append "console=ttyS0". systemd sees this kernel
argument and starts the getty.

So it seems like the simplest way to fix this in the current environment is
to have the code that sets up the grub serial arguments also go ahead and
tack on a matching "console=" to GRUB_CMDLINE_LINUX.

Let's see what's been documented for 10+ years (see commit below) on
https://www.debian.org/releases/trixie/amd64/ch05s03.en.html#module-parms

     5.3.1. Boot serial console
[…] Be sure to specify this option after “---”, so that it is copied into
         the bootloader configuration for the installed system (if supported by
         the installer for the bootloader).

(Arguably it could be moved elsewhere within that section to make it
easier to spot.)

Commit: https://salsa.debian.org/installer-team/installation-guide/-/commit/615fcaa11aa37bfd5b6295d02a9e642e5d2e2f48



"console=ttyS0,115200n8" is the last element on the kernel boot parameter line and I also use "--boot bios.useserial=on", this is without the use of "--console pty".

This worked for Bookworm and works for Trixie.

--
John Doe


Reply to: