Default Console - KVM or Serial - What is the difference?

I am installing on linux/QEMU/KVM/libvirt and when doing an install image the initial script prompts as follows;

What console should be used by default? (K:KVM, S: Serial)? (default: K)

FWIW : The default seems to be based on what console you are using when you run the script. If I run the script from a virsh console, the default will be Serial.

I am trying to understand the difference between these two options.

  1. I have tried both, they both work and they both;

    a. allow me to use virsh --connect qemu:///system console <VyOS-DomainName>, even though the KVM option shows no output after the grub option screen until the login prompt is reached.

    b. allow me to use the ā€˜graphical consoleā€™ mode of virt-manager, even though the Serial option displays Display output is not active and shows no output after the grub option screen until the login prompt is reached (the opposite of 1.a).

  2. I canā€™t seem to find anything in the documentation.

  3. I am also presuming that KVM in this context refers to Kernel-based Virtual Machine (due to the message above about display outputā€™ as opposed to Keyboard, Video Mouseā€¦

  4. Neither seem to get the correct stty size when using virsh --connect qemu:///system console <VyOS-DomainName>.

Other than directing the boot output are there any reasons to choose one over the other?

I predominantly use virsh to access the VyOS console as my routers are local, although I do also sometimes use SSH. I rarely use the graphical console offered by virt-manager although I do sometimes fire-up the equivalent with remote-viewer. Whilst the graphical console of virt-manager or remote-viewer offer a better initial CLI experience because the default STTY size is used for the window, using the virsh console method allows for easy changing of the CLI size with stty rows <Y> cols <X> so I prefer that which is the reason I have so far been changing away from the default to use the serial console.

Linux have this issue where the virtual console of whats output to the ā€œscreenā€ can only have a single destination.

Either the actual monitor (aka KVM (Keyboard, Video, Mouse)) or serial - unfortunately it cannot do both at the same time (which is a bit odd in 2024 but still).

So if you select serial the monitor output will stop working once the bootloader (grub) starts. While if you select KVM well then no output will reach the serial console and you must connect a monitor to your device (unless you connect using SSH or similar).

Now when you run VyOS virtually many hypervisors have solved this issue so you can connect through ssh or even through serial cable to the hypervisor in order to get the output of the screen of the vm guest. Similar to how BMC solutions (IPMI, LoM etc) can let the running operating system output to ā€œmonitorā€ (aka KVM with VyOS lingo) and redirect that to serial console so you now can have output to both a monitor AND serial at the same time.

2 Likes

Cheers. So given that I am using Kernel-based Virtual Machine, and boot output aside, do you know if there is any advantage or disadvantage to me using one over the other? I canā€™t seem to find any, I was just curiousā€¦ :man_shrugging:

If you run your VyOS as a VM guest I would select ā€œKVMā€ to have the output going to the ā€œmonitorā€.

If you run VyOS on baremetal I would select ā€œserialā€ (you must then use a serialcable to connect to your VyOS box in case SSH wont work).

If you run VyOS on baremetal connected to a monitor and you dont want to use a serialcable then select ā€œKVMā€.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.