QEMU standalone VNC server
Synopsis
qemu-vnc [OPTION]…
Description
qemu-vnc is a standalone VNC server that connects to a running QEMU instance
via the D-Bus display interface (D-Bus display). It serves the guest
display, input, audio, clipboard, and serial console chardevs over the VNC
protocol, allowing VNC clients to interact with the virtual machine without QEMU
itself binding a VNC socket.
Options
- -h, --help
Display help and exit.
- -V, --version
Print version information and exit.
- -a ADDRESS, --dbus-address=ADDRESS
D-Bus address to connect to. When not specified,
qemu-vncconnects to the session bus.
- -p FD, --dbus-p2p-fd=FD
File descriptor of an inherited Unix socket for a peer-to-peer D-Bus connection to QEMU. This is mutually exclusive with
--dbus-addressand--bus-name.
- -n NAME, --bus-name=NAME
D-Bus bus name of the QEMU instance to connect to. The default is
org.qemu. When a custom--dbus-addressis given without a bus name, peer-to-peer D-Bus is used.
- -W, --wait
Wait for the D-Bus bus name to appear. Only for bus connections.
- --password
Require VNC password authentication from connecting clients. The password is set at runtime via the D-Bus
SetPasswordmethod (see D-Bus VNC). Clients will not be able to connect until a password has been set.This option is ignored when a systemd credential password is present, since password authentication is already enabled via
password-secretin that case.
- -l ADDR, --vnc-addr=ADDR
VNC listen address in the same format as the QEMU
-vncoption (defaultlocalhost:0, i.e. TCP port 5900).
- -w ADDR, --websocket=ADDR
Enable WebSocket transport on the given address. ADDR can be a port number or an address:port pair.
- -O OBJDEF, --object=OBJDEF
Create a QEMU user-creatable object. OBJDEF uses the same key=value syntax as the QEMU
-objectoption. This option may be given multiple times. It is needed, for example, to create authorization objects referenced by--tls-authz.
- -t DIR, --tls-creds=DIR
Directory containing TLS x509 credentials (
ca-cert.pem,server-cert.pem,server-key.pem). When specified, the VNC server requires TLS from connecting clients.
- --tls-authz=ID
ID of a
QAuthZobject previously created with--objectfor TLS client certificate authorization. When specified, the TLS credentials are created withverify-peer=yesso connecting clients must present a valid certificate. After the TLS handshake, the client certificate Distinguished Name is checked against the authorization object. This option requires--tls-creds.
- --sasl
Require that the client use SASL to authenticate with the VNC server. The exact choice of authentication method used is controlled from the system / user’s SASL configuration file for the ‘qemu’ service. This is typically found in
/etc/sasl2/qemu.conf. If running QEMU as an unprivileged user, an environment variableSASL_CONF_PATHcan be used to make it search alternate locations for the service config. While some SASL auth methods can also provide data encryption (eg GSSAPI), it is recommended that SASL always be combined with the ‘tls’ and ‘x509’ settings to enable use of SSL and server certificates. This ensures a data encryption preventing compromise of authentication credentials. See the VNC security section in the System Emulation Users Guide for details on using SASL authentication.
- --sasl-authz=ID
ID of a
QAuthZobject previously created with--objectfor SASL username authorization. After successful SASL authentication, the authenticated username is checked against the authorization object. If the check fails, the client is disconnected. This option requires--sasl.
- -s POLICY, --share=POLICY
Set display sharing policy. POLICY is one of
allow-exclusive,force-shared, orignore.allow-exclusiveallows clients to ask for exclusive access. As suggested by the RFB spec this is implemented by dropping other connections. Connecting multiple clients in parallel requires all clients asking for a shared session (vncviewer: -shared switch). This is the default.force-shareddisables exclusive client access. Useful for shared desktop sessions, where you don’t want someone forgetting to specify -shared disconnect everybody else.ignorecompletely ignores the shared flag and allows everybody to connect unconditionally. Doesn’t conform to the RFB spec but is traditional QEMU behavior.
- -C NAME, --vt-chardev=NAME
Chardev type name to expose as a VNC text console. This option may be given multiple times to expose several chardevs. When not specified, the defaults
org.qemu.console.serial.0andorg.qemu.monitor.hmp.0are used.
- -N, --no-vt
Do not expose any chardevs as text consoles. This overrides the default chardev list and any
--vt-chardevoptions.
- -k LAYOUT, --keyboard-layout=LAYOUT
Keyboard layout (e.g.
en-us). Passed through to the VNC server for key-code translation.
- --lossy
Enable lossy compression methods (gradient, JPEG, …). If this option is set, VNC client may receive lossy framebuffer updates depending on its encoding settings. Enabling this option can save a lot of bandwidth at the expense of quality.
- --non-adaptive
Disable adaptive encodings. Adaptive encodings are enabled by default. An adaptive encoding will try to detect frequently updated screen regions, and send updates in these regions using a lossy encoding (like JPEG). This can be really helpful to save bandwidth when playing videos. Disabling adaptive encodings restores the original static behavior of encodings like Tight.
- -T, --trace [[enable=]PATTERN][,events=FILE][,file=FILE]
Specify tracing options.
[enable=]PATTERNImmediately enable events matching PATTERN (either event name or a globbing pattern). This option is only available if QEMU has been compiled with the
simple,logorftracetracing backend. To specify multiple events or patterns, specify the-traceoption multiple times.Use
-trace helpto print a list of names of trace points.events=FILEImmediately enable events listed in FILE. The file must contain one event name (as listed in the
trace-events-allfile) per line; globbing patterns are accepted too. This option is only available if QEMU has been compiled with thesimple,logorftracetracing backend.file=FILELog output traces to FILE. This option is only available if QEMU has been compiled with the
simpletracing backend.
Examples
Start QEMU with the D-Bus display backend:
qemu-system-x86_64 -display dbus ...
Then attach qemu-vnc:
qemu-vnc
A VNC client can now connect to localhost:5900.
To listen on a different port with TLS:
qemu-vnc --vnc-addr localhost:1 --tls-creds /etc/pki/qemu-vnc
To require TLS with client certificate authorization:
qemu-vnc --object authz-list-file,id=auth0,filename=/etc/qemu/vnc.acl,refresh=on \
--tls-creds /etc/pki/qemu-vnc --tls-authz auth0
To enable SASL authentication with TLS:
qemu-vnc --tls-creds /etc/pki/qemu-vnc --sasl
VNC password authentication
There are two ways to enable VNC password authentication:
--passwordflag – startqemu-vncwith--passwordand then set the password at runtime using the D-BusSetPasswordmethod. Clients will be rejected until a password is set.systemd credentials – if the
CREDENTIALS_DIRECTORYenvironment variable is set (see systemd.exec(5)) and contains a file namedvnc-password, the VNC server will use that file’s contents as the password automatically. The--passwordflag is not needed in this case.
D-Bus interface
qemu-vnc exposes a D-Bus interface for management and monitoring of
VNC connections. See D-Bus VNC for the full interface
reference.
See also
qemu(1), D-Bus display, D-Bus VNC, The RFB Protocol