Skip to content

Knowledgebase

Preparing a Linux guest for virsh serial-console access

servers

A serial console provides a text recovery path to a KVM guest when its network is unavailable. It requires both a virtual serial device on the host and a guest configured to send output and a login prompt to that device.

What you need before you begin

Confirm authorized host and guest access. Keep the existing graphical console or SSH session available while configuring the alternative. Record the guest operating system, serial-device name and current bootloader settings; examples for one architecture may not match another.

01 Prepare a Linux guest for virsh serial-console access

  1. Inspect the guest domain definition for a supported serial and console device. Use the controlling platform's configuration workflow when the VM belongs to a management panel.
  2. Inside a systemd Linux guest, identify the appropriate serial device, commonly ttyS0 for a PC-style serial port. Enable the matching serial-getty service if the image does not already provide it.
  3. If boot messages are required, add the correct console argument through the distribution-supported bootloader configuration process and regenerate its configuration as documented. Preserve existing console arguments and a recovery entry.
  4. Connect with virsh -c qemu:///system console GUEST_NAME, using the real name. Press Enter to request a login prompt.
  5. Test authentication and the documented escape sequence, normally Ctrl+], to leave the console without shutting down the VM. Test a guest reboot during a maintenance window if boot output was configured.

Does serial-console access bypass the guest password?

No normal login bypass is implied. The guest still controls authentication. Recovery-mode access has different security implications, so restrict who can control VM boot and console settings.

Confirm the intended access works

Confirm that the console works independently of guest networking and that ordinary authentication is still required. Check both boot messages and the login prompt if both are intended. Limit host access because hypervisor console privileges are powerful.

Troubleshoot unexpected results

A blank console often means the guest login service or kernel console is absent even though the virtual device exists. A message that another session is active needs ownership coordination, not an immediate forced takeover. Use the existing graphical console to repair a bad bootloader change.

Was this answer helpful?

Need a little more help?

Our support team can help you find the next step.

Contact support