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-devicesfrigate-exporter
parent
9bea8e1ce7
commit
75a146e19e
1
newvm.sh
1
newvm.sh
|
@ -128,6 +128,7 @@ set -- \
|
||||||
--disk pool=default,size=${disk_size},cache=none \
|
--disk pool=default,size=${disk_size},cache=none \
|
||||||
--network ${network} \
|
--network ${network} \
|
||||||
--os-variant fedora$(rpm -E %fedora) \
|
--os-variant fedora$(rpm -E %fedora) \
|
||||||
|
--console pty,target.type=serial,log.file=/var/log/libvirt/console/${name}.log \
|
||||||
--sound none \
|
--sound none \
|
||||||
--redirdev none \
|
--redirdev none \
|
||||||
--rng /dev/random \
|
--rng /dev/random \
|
||||||
|
|
Loading…
Reference in New Issue