LinuxCommandLibrary

virt-viewer

Display graphical console of a virtual machine

TLDR

Launch virt-viewer with a prompt to select running virtual machines

$ virt-viewer
copy

Launch virt-viewer for a specific virtual machine by ID, UUID or name
$ virt-viewer "[domain]"
copy

Wait for a virtual machine to start and automatically reconnect if it shutdown and restarts
$ virt-viewer --reconnect --wait "[domain]"
copy

Connect to a specific remote virtual machine over TLS
$ virt-viewer --connect "xen//[url]" "[domain]"
copy

Connect to a specific remote virtual machine over SSH
$ virt-viewer --connect "qemu+ssh//[username]@[url]/system" "[domain]"
copy

SYNOPSIS

virt-viewer [OPTIONS] VMNAME|UUID|ID|URI

PARAMETERS

--version
    Display version information and exit.

-c | --connect URI
    Connect to the specified hypervisor. This overrides the default hypervisor.

-w | --wait
    Wait indefinitely until the guest starts, before displaying the window.

-f | --fullscreen
    Start in fullscreen mode.

-s | --shared
    Allow other clients to connect.

-r | --reconnect
    Automatically reconnect if the connection is lost.

-z | --zoom
    Use scaling and zoom to fit the window size

-d | --debug
    Enable debug messages

-h | --help
    Display help and exit.

DESCRIPTION

The virt-viewer command is a graphical tool for displaying the console of a virtual machine. It connects to the virtual machine's graphical output using either the VNC or SPICE protocol. Virt-viewer is typically used with virtual machines managed by libvirt, but it can connect to any VNC or SPICE server. It allows you to interact with the guest operating system running inside the VM, providing a window to view and control the virtual machine as if it were a physical machine. Virt-viewer supports various features like keyboard and mouse input, clipboard sharing, audio, and video streaming from the guest. It also allows for configuring display settings such as resolution and scaling.

CAVEATS

Virt-viewer requires a graphical environment to run. Ensure the libvirt daemon is running and configured correctly before using virt-viewer. Performance depends on network connectivity and the guest's resource allocation.

SPICE VS VNC

SPICE offers better performance and features compared to VNC, such as improved audio and video streaming, better keyboard/mouse handling, and enhanced remote display capabilities. If both are available, SPICE is generally the preferred option.

HISTORY

Virt-viewer was developed as part of the libvirt project to provide a simple and reliable way to access the graphical console of virtual machines. It has evolved over time to support new features and protocols, such as SPICE, to improve performance and user experience.

SEE ALSO

virsh(1), qemu(1)

Copied to clipboard