1.. _vhost_user_input:
2
3QEMU vhost-user-input - Input emulation
4=======================================
5
6This document describes the setup and usage of the Virtio input device.
7The Virtio input device is a paravirtualized device for input events.
8
9Description
10-----------
11
12The vhost-user-input device implementation was designed to work with a daemon
13polling on input devices and passes input events to the guest.
14
15QEMU provides a backend implementation in contrib/vhost-user-input.
16
17Linux kernel support
18--------------------
19
20Virtio input requires a guest Linux kernel built with the
21``CONFIG_VIRTIO_INPUT`` option.
22
23Examples
24--------
25
26The backend daemon should be started first:
27
28::
29
30  host# vhost-user-input --socket-path=input.sock	\
31      --evdev-path=/dev/input/event17
32
33The QEMU invocation needs to create a chardev socket to communicate with the
34backend daemon and access the VirtIO queues with the guest over the
35:ref:`shared memory <shared_memory_object>`.
36
37::
38
39  host# qemu-system								\
40      -chardev socket,path=/tmp/input.sock,id=mouse0				\
41      -device vhost-user-input-pci,chardev=mouse0				\
42      -m 4096 									\
43      -object memory-backend-file,id=mem,size=4G,mem-path=/dev/shm,share=on	\
44      -numa node,memdev=mem							\
45      ...
46