newvm: Configure serial console log file

When a VM uses a serial port for its default console, kernel messages
(e.g. panics) are lost if no console client is connected at the time.
This is a major disadvantage when compared to a graphical console, which
usually at least keeps a "screenshot" of the console when the kernel
crashes.

While researching the available console device types to determine how
best to implement a tool that would both log the output from the serial
console at all times, while still allowing interactive connections to
it, I discovered that _libvirt_ actually already has this exact
functionality built-in:

https://libvirt.org/formatdomain.html#consoles-serial-parallel-channel-devices
frigate-exporter
Dustin 2024-10-13 18:12:46 -05:00
parent 9bea8e1ce7
commit 75a146e19e
1 changed files with 1 additions and 0 deletions

View File

@ -128,6 +128,7 @@ set -- \
--disk pool=default,size=${disk_size},cache=none \
--network ${network} \
--os-variant fedora$(rpm -E %fedora) \
--console pty,target.type=serial,log.file=/var/log/libvirt/console/${name}.log \
--sound none \
--redirdev none \
--rng /dev/random \