Difference between revisions of "KVM enable vm serial console"
Jump to navigation
Jump to search
(Created page with "How to configure serial console for KVM vm. So virsh will have access: virsh console <vm-name> =ubuntu= systemctl enable serial-getty@ttyS0.service systemctl start serial-...") |
|||
Line 1: | Line 1: | ||
How to configure serial console for KVM vm. So virsh will have access: | How to configure serial console for KVM vm. So virsh will have access: | ||
virsh console <vm-name> | virsh console <vm-name> | ||
+ | |||
+ | =Red Hat= | ||
+ | * https://access.redhat.com/articles/7212 | ||
+ | ===RHEL9=== | ||
+ | grubby --update-kernel=ALL --args="console=tty0 console=ttyS0,115200" | ||
+ | ===RHEL8=== | ||
+ | grub2-editenv - set "$(grub2-editenv - list | grep kernelopts) console=tty0 console=ttyS0,115200" | ||
+ | |||
+ | |||
=ubuntu= | =ubuntu= | ||
Line 40: | Line 49: | ||
</PRE> | </PRE> | ||
+ | [[Category:KVM]] | ||
[[Category:Linux]] | [[Category:Linux]] | ||
− |
Latest revision as of 05:57, 14 June 2022
How to configure serial console for KVM vm. So virsh will have access:
virsh console <vm-name>
Contents
1 Red Hat
1.1 RHEL9
grubby --update-kernel=ALL --args="console=tty0 console=ttyS0,115200"
1.2 RHEL8
grub2-editenv - set "$(grub2-editenv - list | grep kernelopts) console=tty0 console=ttyS0,115200"
2 ubuntu
systemctl enable serial-getty@ttyS0.service systemctl start serial-getty@ttyS0.service
3 alpine
3.1 Enabling a login console
This is done in /etc/inittab. There is commented entry for ttyS0. Just enable it.
# Put a getty on the serial port ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100
To start the getty, restart init:
kill -HUP 1
3.2 Enabling two consoles during boot
It's possible to output to both the serial and vga console during the system boot.
append "quiet console=ttyS0,9600 console=tty0"
Not known how to do the same thing in the extlinux menu. You might find a starting point in this thread: http://patchwork.openembedded.org/patch/45175/
3.3 Add your serial console to the trusted local terminal list
If you face the problem that the login prompt always refuses your password when you use serial console, you missed this entry.
Add this to the /etc/securetty file:
ttyS0