Serial Console

The serial console attaches a text terminal (TTY) to a virtual machine's serial port. It is ideal for headless Linux guests, watching kernel boot messages, and capturing kernel panic output — cases where the graphical VNC console is not useful.

The serial console connects to the KubeVirt virtual machine instance console subresource over a WebSocket that carries the raw TTY byte stream (subprotocol plain.kubevirt.io).

Notes

  • The serial console is available whenever the virtual machine has a running instance (Running, Paused, Starting, or Stopping). It is unavailable for a stopped virtual machine, because no instance exists — the endpoint returns 404.
  • The guest must expose a serial getty on its console — Linux cloud images typically set console=ttyS0 on the kernel command line. Windows guests have no serial console; use VNC instead.
  • Permission: requires the get verb on virtualmachineinstances/console.

Open the serial console

virtctl console web-01 -n demo

This upgrades to a WebSocket on the virtual machine instance console subresource:

GET /apis/subresources.kubevirt.io/v1/namespaces/demo/virtualmachineinstances/web-01/console
Upgrade: websocket
Sec-WebSocket-Protocol: plain.kubevirt.io

A running instance returns 101 Switching Protocols and then streams the raw TTY bytes; a stopped virtual machine returns 404 (no instance).