Skip to content

Consoles and displays ​

There are three ways to see what a node is doing without SSH: its serial console, its saved console logs, and its graphics window. This page covers all three, plus the shared clipboard and sound.

You wantUseNeeds
a login prompt, boot messages, a rescue shellvz node console <node>a running lab
the boot log after the factvz node logs <node>consoleLog: true
a screen, an installer, a desktopvz node display <node>a display and a guest kernel that drives it

Serial console ​

bash
vz node console vm1

This opens a new Terminal window attached to the node's serial console (hvc0 in Linux). Every key you type goes to the VM, including Ctrl+C, so there is no escape sequence to remember:

  • Detach: close the window. The VM keeps running.
  • Several windows: run the command again. Every window sees the output, and any of them can type.
  • Recent output: a new window first replays up to 64 KiB of recent output, so the login prompt is visible straight away.

The examples log in with lab / lab.

Use another terminal app ​

The window is a small .command script written to <state>/<node>/console.command and opened with open -a. This needs no Automation permission. Set VZ_TERMINAL to the name of another terminal app:

bash
export VZ_TERMINAL=iTerm
vz node console vm1
Why some escape sequences are missing from the replay

Some guest output asks the terminal to answer. agetty, for example, sends ESC [6n (report the cursor position) before each login prompt. If that were replayed into a new window, your terminal would answer again and the answer would reach the guest as typed text, such as ^[[82;290R at the login prompt. vz removes these queries from the replay only. Live output is passed through untouched, because then the guest is waiting for the answer.

When there is no console ​

vz node console checks the node first and fails in your current terminal, not in a new window, when:

  • the lab is not running (vz up first),
  • the node is not part of the running lab,
  • the node has no serial console; the error then says what to use instead, such as vz node display. Only platform: apple nodes are this case: the macOS installer and login window are on the display, and consoleLog writes nothing.

Console logs ​

Set consoleLog: true on a node to also write its serial console to a file:

yaml
nodes:
  - name: vm1
    consoleLog: true

Each vz up starts a new file, <state>/<node>/console-<yyyyMMdd-HHmmss>.log. A vz node restart keeps writing to the same file, so one file can hold several boots.

bash
vz node logs vm1               # the newest log
vz node logs vm1 --boot 1      # the one before it (0 = newest, 1 = previous, ...)
vz node logs vm1 --follow      # keep printing new output; Ctrl-C to stop
vz node logs vm1 --json        # {"boot": 0, "file": "...", "text": "..."}

NOTE

-f is the lab file option on every command, so follow is spelled out as --follow.

Logs are kept until vz destroy. vz node reset does not delete them.

Displays ​

A node gets a virtio graphics device with one 1280x800 display unless the lab file says otherwise. List displays to change the size, or set displays: [] for no graphics at all:

yaml
nodes:
  - name: desktop
    disks:
      - { path: ~/.vz/images/debian-13-generic-arm64.raw, overlay: true }
    displays: [{ width: 1920, height: 1080 }]

  - name: tiny
    disks:
      - { path: ~/.vz/images/debian-13-genericcloud-arm64.raw, overlay: true }
    displays: []            # no graphics device

Width is 320 to 8192 and height 200 to 8192. Graphics are 2D only, with no GPU acceleration. A USB keyboard and pointer come with the display.

Open the window:

bash
vz node display desktop

The window belongs to the background lab process, because a running VM cannot move to another process. Closing it does not stop the VM; run the command again to bring it back.

IMPORTANT

The debian-13 and debian-12 cloud images have a small kernel without the virtio_gpu driver, so their screen does not show the running system. Use debian-13-generic for anything graphical. See OS images.

Installer ISOs draw their installer on the display, not on the serial console:

bash
vz up
vz node display deb     # run the installer here

See the Debian installer example.

Clipboard ​

clipboard: true shares the clipboard between the Mac and the guest through the SPICE agent port. It needs a display, and the guest must run spice-vdagent:

yaml
nodes:
  - name: desktop
    disks:
      - { path: ~/.vz/images/debian-13-generic-arm64.raw, overlay: true }
    displays: [{ width: 1920, height: 1080 }]
    clipboard: true
yaml
# init/desktop/user-data (excerpt)
packages:
  - spice-vdagent

vz only adds the port. Without an agent in the guest there is no error; copy and paste just do not cross. macOS has no SPICE agent, so clipboard: true on a platform: apple node is a validation error.

Sound ​

sound adds a virtio sound device bound to the Mac's default output and input devices:

yaml
sound: { output: true }                 # speakers only
sound: { output: true, input: true }    # speakers and microphone

A sound key with both set to false is a warning: remove it or turn one on. The Linux desktop example has a display, sound and the clipboard together.

See also ​