xref: /openbmc/qemu/docs/system/barrier.rst (revision 235fe6d0)
1QEMU Barrier Client
2===================
3
4Generally, mouse and keyboard are grabbed through the QEMU video
5interface emulation.
6
7But when we want to use a video graphic adapter via a PCI passthrough
8there is no way to provide the keyboard and mouse inputs to the VM
9except by plugging a second set of mouse and keyboard to the host
10or by installing a KVM software in the guest OS.
11
12The QEMU Barrier client avoids this by implementing directly the Barrier
13protocol into QEMU.
14
15`Barrier <https://github.com/debauchee/barrier>`__
16is a KVM (Keyboard-Video-Mouse) software forked from Symless's
17synergy 1.9 codebase.
18
19This protocol is enabled by adding an input-barrier object to QEMU.
20
21Syntax::
22
23    input-barrier,id=<object-id>,name=<guest display name>
24    [,server=<barrier server address>][,port=<barrier server port>]
25    [,x-origin=<x-origin>][,y-origin=<y-origin>]
26    [,width=<width>][,height=<height>]
27
28The object can be added on the QEMU command line, for instance with::
29
30    -object input-barrier,id=barrier0,name=VM-1
31
32where VM-1 is the name the display configured in the Barrier server
33on the host providing the mouse and the keyboard events.
34
35by default ``<barrier server address>`` is ``localhost``,
36``<port>`` is ``24800``, ``<x-origin>`` and ``<y-origin>`` are set to ``0``,
37``<width>`` and ``<height>`` to ``1920`` and ``1080``.
38
39If the Barrier server is stopped QEMU needs to be reconnected manually,
40by removing and re-adding the input-barrier object, for instance
41with the help of the HMP monitor::
42
43    (qemu) object_del barrier0
44    (qemu) object_add input-barrier,id=barrier0,name=VM-1
45