QEMU can export the VM display through D-Bus (when started with -display
dbus
), to allow out-of-process UIs, remote protocol servers or other
interactive display usages.
Various specialized D-Bus interfaces are available on different object paths
under /org/qemu/Display1/
, depending on the VM configuration.
QEMU also implements the standard interfaces, such as org.freedesktop.DBus.Introspectable.
This interface is implemented on /org/qemu/Display1/VM
.
read-only
yes
The name of the VM.
read-only
yes
The UUID of the VM.
read-only
yes
The list of consoles available on /org/qemu/Display1/Console_$id
.
read-only
yes
This property lists extra interfaces provided by the /org/qemu/Display1/VM object, and can be used to detect the capabilities with which they are communicating.
Unlike the standard D-Bus Introspectable interface, querying this property does not require parsing XML.
(earlier version of the display interface do not provide this property)
This interface is implemented on /org/qemu/Display1/Console_$id
. You
may discover available consoles through introspection or with the
org.qemu.Display1.VM.ConsoleIDs
property.
A console is attached to a video device head. It may be “Graphic” or
“Text” (see Type
and other properties).
Interactions with a console may be done with
org.qemu.Display1.Keyboard
,
org.qemu.Display1.Mouse
and
org.qemu.Display1.MultiTouch
interfaces when available.
listener (h) – a Unix socket FD, for peer-to-peer D-Bus communication.
listener – a Unix socket FD, for peer-to-peer D-Bus communication.
Register a console listener, which will receive display updates, until it is disconnected.
Multiple listeners may be registered simultaneously.
The listener is expected to implement the
org.qemu.Display1.Listener
interface.
width_mm (q) – the physical display width in millimeters.
height_mm (q) – the physical display height in millimeters.
xoff (i) – horizontal offset, in pixels.
yoff (i) – vertical offset, in pixels.
width (u) – console width, in pixels.
height (u) – console height, in pixels.
Modify the dimensions and display settings.
read-only
yes
A user-friendly name for the console (for ex: “VGA”).
read-only
yes
Graphical device head number.
read-only
yes
Console type (“Graphic” or “Text”).
read-only
yes
Console width, in pixels.
read-only
yes
Console height, in pixels.
read-only
yes
The device address (ex: “pci/0000/02.0”).
read-only
yes
This property lists extra interfaces provided by the
/org/qemu/Display1/Console_$id
object, and can be used to detect the
capabilities with which they are communicating.
Unlike the standard D-Bus Introspectable interface, querying this property does not require parsing XML.
(earlier version of the display interface do not provide this property)
This interface is optionally implemented on
/org/qemu/Display1/Console_$id
(see
Console
).
keycode (u) – QEMU key number (xtkbd + special re-encoding of high bit)
Send a key press event.
keycode (u) – QEMU key number (xtkbd + special re-encoding of high bit)
Send a key release event.
read-only
yes
The active keyboard modifiers:
Scroll = 1 << 0
Num = 1 << 1
Caps = 1 << 2
This interface is optionally implemented on
/org/qemu/Display1/Console_$id
(see
Console
documentation).
Left = 0
Middle = 1
Right = 2
Wheel-up = 3
Wheel-down = 4
Side = 5
Extra = 6
button (u) – button value.
Send a mouse button press event.
button (u) – button value.
Send a mouse button release event.
x (u) – X position, in pixels.
y (u) – Y position, in pixels.
Set the mouse pointer position.
Returns an error if not IsAbsolute
.
dx (i) – X-delta, in pixels.
dy (i) – Y-delta, in pixels.
Move the mouse pointer position, relative to the current position.
Returns an error if IsAbsolute
.
read-only
yes
Whether the mouse is using absolute movements.
This interface in implemented on /org/qemu/Display1/Console_$id
(see
Console
documentation).
Kind values:
Begin = 0
Update = 1
End = 2
Cancel = 3
kind (u) – The touch event kind
num_slot (t) – The slot number.
x (d) – The x coordinates.
y (d) – The y coordinates.
Send a touch gesture event.
read-only
yes
The maximum number of slots.
This client-side interface must be available on
/org/qemu/Display1/Listener
when registering the peer-to-peer
connection with Register
.
width (u) – display width, in pixels.
height (u) – display height, in pixels.
stride (u) – data stride, in bytes.
pixman_format (u) – image format (ex: PIXMAN_X8R8G8B8
).
data (ay) – image data.
Resize and update the display content.
The data to transfer for the display update may be large. The preferred
scanout method is ScanoutDMABUF
, used whenever possible.
x (i) – X update position, in pixels.
y (i) – Y update position, in pixels.
width (i) – update width, in pixels.
height (i) – update height, in pixels.
stride (u) – data stride, in bytes.
pixman_format (u) – image format (ex: PIXMAN_X8R8G8B8
).
data (ay) – display image data.
Update the display content.
This method is only called after a Scanout
call.
dmabuf (h) – the DMABUF file descriptor.
width (u) – display width, in pixels.
height (u) – display height, in pixels.
stride (u) – stride, in bytes.
fourcc (u) – DMABUF fourcc.
modifier (t) – DMABUF modifier.
y0_top (b) – whether Y position 0 is the top or not.
Resize and update the display content with a DMABUF.
x (i) – the X update position, in pixels.
y (i) – the Y update position, in pixels.
width (i) – the update width, in pixels.
height (i) – the update height, in pixels.
Update the display content with the current DMABUF and the given region.
Disable the display (turn it off).
x (i) – X mouse position, in pixels.
y (i) – Y mouse position, in pixels.
on (i) – whether the mouse is visible or not.
Set the mouse position and visibility.
width (i) – cursor width, in pixels.
height (i) – cursor height, in pixels.
hot_x (i) – hot-spot X position, in pixels.
hot_y (i) – hot-spot Y position, in pixels.
data (ay) – the cursor data.
Set the mouse cursor shape and hot-spot. The “data” must be ARGB, 32-bit per pixel.
read-only
yes
This property lists extra interfaces provided by the /org/qemu/Display1/Listener object, and can be used to detect the capabilities with which they are communicating.
Unlike the standard D-Bus Introspectable interface, querying this property does not require parsing XML.
(earlier version of the display interface do not provide this property)
This optional client-side interface can complement
org.qemu.Display1.Listener on /org/qemu/Display1/Listener
for
Unix-specific shared memory scanouts.
handle (h) – the shared map FD.
offset (u) – mapping offset, in bytes.
width (u) – display width, in pixels.
height (u) – display height, in pixels.
stride (u) – stride, in bytes.
pixman_format (u) – image format (ex: PIXMAN_X8R8G8B8
).
Resize and update the display content with a shared map.
x (i) – the X update position, in pixels.
y (i) – the Y update position, in pixels.
width (i) – the update width, in pixels.
height (i) – the update height, in pixels.
Update the display content with the current shared map and the given region.
This optional client-side interface can complement
org.qemu.Display1.Listener on /org/qemu/Display1/Listener
for Windows
specific shared memory scanouts.
handle (t) – the shared file mapping handle value (not a file handle)
offset (u) – mapping offset.
width (u) – display width, in pixels.
height (u) – display height, in pixels.
stride (u) – stride, in bytes.
pixman_format (u) – image format (ex: PIXMAN_X8R8G8B8
).
Resize and update the display content with a shared file mapping object.
x (i) – the X update position, in pixels.
y (i) – the Y update position, in pixels.
width (i) – the update width, in pixels.
height (i) – the update height, in pixels.
Update the display content with the current shared map and the given region.
This optional client-side interface can complement
org.qemu.Display1.Listener on /org/qemu/Display1/Listener
for Windows
specific Direct3D texture sharing of the scanouts.
handle (t) – the NT handle for the shared texture (to be opened back with ID3D11Device1::OpenSharedResource1).
texture_width (u) – texture width, in pixels.
texture_height (u) – texture height, in pixels.
y0_top (b) – whether Y position 0 is the top or not.
x (u) – the X scanout position, in pixels.
y (u) – the Y scanout position, in pixels.
width (u) – the scanout width, in pixels.
height (u) – the scanout height, in pixels.
Resize and update the display content with a Direct3D 11 2D texture. You must acquire and release the associated KeyedMutex 0 during rendering.
x (i) – the X update position, in pixels.
y (i) – the Y update position, in pixels.
width (i) – the update width, in pixels.
height (i) – the update height, in pixels.
Update the display content with the current Direct3D 2D texture and the given region. You must acquire and release the associated KeyedMutex 0 during rendering.
This optional client-side interface can complement
org.qemu.Display1.Listener on /org/qemu/Display1/Listener
for
Unix-specific DMABUF scanout setup which support multi plane.
dmabuf (ah) – DMABUF file descriptor of each plane.
x (u) – display x offset, in pixels
y (u) – display y offset, in pixels
width (u) – display width, in pixels.
height (u) – display height, in pixels.
offset (au) – offset of each plane, in bytes.
stride (au) – stride of each plane, in bytes.
num_planes (u) – plane number.
fourcc (u) – DMABUF fourcc.
backing_width (u) – backing framebuffer width, in pixels
backing_height (u) – backing framebuffer height, in pixels
modifier (t) – DMABUF modifier.
y0_top (b) – whether Y position 0 is the top or not.
Resize and update the display content with DMABUF.
This interface must be implemented by both the client and the server on
/org/qemu/Display1/Clipboard
to support clipboard sharing between
the client and the guest.
Once Register
’ed, method calls may be sent and received in both
directions. Unregistered callers will get error replies.
Selection values:
Clipboard = 0
Primary = 1
Secondary = 2
Serial counter
To solve potential clipboard races, clipboard grabs have an associated serial counter. It is set to 0 on registration, and incremented by 1 for each grab. The peer with the highest serial is the clipboard grab owner.
When a grab with a lower serial is received, it should be discarded.
When a grab is attempted with the same serial number as the current grab, the one coming from the client should have higher priority, and the client should gain clipboard grab ownership.
Register a clipboard session and reinitialize the serial counter.
The client must register itself, and is granted an exclusive access for handling the clipboard.
The server can reinitialize the session as well (to reset the counter).
Unregister the clipboard session.
selection (u) – a selection value.
serial (u) – the current grab serial.
mimes (as) – the list of available content MIME types.
Grab the clipboard, claiming current clipboard content.
selection (u) – a selection value.
Release the clipboard (does nothing if not the current owner).
selection (u) – a selection value
mimes (as) – requested MIME types (by order of preference).
reply_mime (s) – the returned data MIME type.
data (ay) – the clipboard data.
Request the clipboard content.
Return an error if the clipboard is empty, or the requested MIME types are unavailable.
read-only
yes
This property lists extra interfaces provided by the /org/qemu/Display1/Clipboard object, and can be used to detect the capabilities with which they are communicating.
Unlike the standard D-Bus Introspectable interface, querying this property does not require parsing XML.
(earlier version of the display interface do not provide this property)
Audio backend may be available on /org/qemu/Display1/Audio
.
listener (h) – a Unix socket FD, for peer-to-peer D-Bus communication.
listener – a Unix socket FD, for peer-to-peer D-Bus communication.
Register an audio backend playback handler.
Multiple listeners may be registered simultaneously.
The listener is expected to implement the
org.qemu.Display1.AudioOutListener
interface.
listener (h) – a Unix socket FD, for peer-to-peer D-Bus communication.
listener – a Unix socket FD, for peer-to-peer D-Bus communication.
Register an audio backend record handler.
Multiple listeners may be registered simultaneously.
The listener is expected to implement the
org.qemu.Display1.AudioInListener
interface.
read-only
yes
The number of samples per read/write frames. (for example the default is 480, or 10ms at 48kHz)
(earlier version of the display interface do not provide this property)
read-only
yes
This property lists extra interfaces provided by the /org/qemu/Display1/Audio object, and can be used to detect the capabilities with which they are communicating.
Unlike the standard D-Bus Introspectable interface, querying this property does not require parsing XML.
(earlier version of the display interface do not provide this property)
This client-side interface must be available on
/org/qemu/Display1/AudioOutListener
when registering the peer-to-peer
connection with RegisterOutListener
.
id (t) – the stream ID.
bits (y) – PCM bits per sample.
is_signed (b) – whether the PCM data is signed.
is_float (b) – PCM floating point format.
freq (u) – the PCM frequency in Hz.
nchannels (y) – the number of channels.
bytes_per_frame (u) – the bytes per frame.
bytes_per_second (u) – the bytes per second.
be (b) – whether using big-endian format.
Initializes a PCM playback stream.
id (t) – the stream ID.
Finish & close a playback stream.
id (t) – the stream ID.
enabled (b) –
Resume or suspend the playback stream.
id (t) – the stream ID.
mute (b) – whether the stream is muted.
volume (ay) – the volume per-channel.
Set the stream volume and mute state (volume without unit, 0-255).
id (t) – the stream ID.
data (ay) – the PCM data.
PCM stream to play.
read-only
yes
This property lists extra interfaces provided by the /org/qemu/Display1/AudioOutListener object, and can be used to detect the capabilities with which they are communicating.
Unlike the standard D-Bus Introspectable interface, querying this property does not require parsing XML.
(earlier version of the display interface do not provide this property)
This client-side interface must be available on
/org/qemu/Display1/AudioInListener
when registering the peer-to-peer
connection with RegisterInListener
.
id (t) – the stream ID.
bits (y) – PCM bits per sample.
is_signed (b) – whether the PCM data is signed.
is_float (b) – PCM floating point format.
freq (u) – the PCM frequency in Hz.
nchannels (y) – the number of channels.
bytes_per_frame (u) – the bytes per frame.
bytes_per_second (u) – the bytes per second.
be (b) – whether using big-endian format.
Initializes a PCM record stream.
id (t) – the stream ID.
Finish & close a record stream.
id (t) – the stream ID.
enabled (b) –
Resume or suspend the record stream.
id (t) – the stream ID.
mute (b) – whether the stream is muted.
volume (ay) – the volume per-channel.
Set the stream volume and mute state (volume without unit, 0-255).
id (t) – the stream ID.
size (t) – the amount to read, in bytes.
data (ay) – the recorded data (which may be less than requested).
Read “size” bytes from the record stream.
read-only
yes
This property lists extra interfaces provided by the /org/qemu/Display1/AudioInListener object, and can be used to detect the capabilities with which they are communicating.
Unlike the standard D-Bus Introspectable interface, querying this property does not require parsing XML.
(earlier version of the display interface do not provide this property)
Character devices may be available on /org/qemu/Display1/Chardev_$id
.
They may be used for different kind of streams, which are identified via
their FQDN Name
.
Here are some known reserved kind names (the org.qemu
prefix is
reserved by QEMU):
A serial console stream.
A QEMU HMP human monitor.
A QEMU QMP monitor.
A usbredir stream.
listener (ay) –
stream (h) – a Unix FD to redirect the stream to.
Register a file-descriptor for the stream handling.
The current handler, if any, will be replaced.
Send a break event to the character device.
read-only
yes
The FQDN name to identify the kind of stream. See reserved names.
read-only
yes
Whether the front-end side is opened.
read-only
yes
Whether the input should be echo’ed (for serial streams).
read-only
yes
The D-Bus unique name of the registered handler.
read-only
yes
This property lists extra interfaces provided by the
/org/qemu/Display1/Chardev_$i
object, and can be used to detect
the capabilities with which they are communicating.
Unlike the standard D-Bus Introspectable interface, querying this property does not require parsing XML.
(earlier version of the display interface do not provide this property)