xref: /qemu/docs/interop/qemu-ga.rst (revision f8bf2347ed6036adf195202fa55c2cb587004679)
1QEMU Guest Agent
2================
3
4Synopsis
5--------
6
7**qemu-ga** [*OPTIONS*]
8
9Description
10-----------
11
12The QEMU Guest Agent is a daemon intended to be run within virtual
13machines. It allows the hypervisor host to perform various operations
14in the guest, such as:
15
16- get information from the guest
17- set the guest's system time
18- read/write a file
19- sync and freeze the filesystems
20- suspend the guest
21- reconfigure guest local processors
22- set user's password
23- ...
24
25qemu-ga will read a system configuration file on startup (located at
26|CONFDIR|\ ``/qemu-ga.conf`` by default), then parse remaining
27configuration options on the command line. For the same key, the last
28option wins, but the lists accumulate (see below for configuration
29file format).
30
31Options
32-------
33
34.. program:: qemu-ga
35
36.. option:: -c, --config=PATH
37
38  Configuration file path (the default is |CONFDIR|\ ``/qemu-ga.conf``,
39  unless overriden by the QGA_CONF environment variable)
40
41.. option:: -m, --method=METHOD
42
43  Transport method: one of ``unix-listen``, ``virtio-serial``, or
44  ``isa-serial``, or ``vsock-listen`` (``virtio-serial`` is the default).
45
46.. option:: -p, --path=PATH
47
48  Device/socket path (the default for virtio-serial is
49  ``/dev/virtio-ports/org.qemu.guest_agent.0``,
50  the default for isa-serial is ``/dev/ttyS0``). Socket addresses for
51  vsock-listen are written as ``<cid>:<port>``.
52
53.. option:: -l, --logfile=PATH
54
55  Set log file path (default is stderr).
56
57.. option:: -f, --pidfile=PATH
58
59  Specify pid file (default is ``/var/run/qemu-ga.pid``).
60
61.. option:: -F, --fsfreeze-hook=PATH
62
63  Enable fsfreeze hook. Accepts an optional argument that specifies
64  script to run on freeze/thaw. Script will be called with
65  'freeze'/'thaw' arguments accordingly (default is
66  |CONFDIR|\ ``/fsfreeze-hook``). If using -F with an argument, do
67  not follow -F with a space (for example:
68  ``-F/var/run/fsfreezehook.sh``).
69
70.. option:: -t, --statedir=PATH
71
72  Specify the directory to store state information (absolute paths only,
73  default is ``/var/run``).
74
75.. option:: -v, --verbose
76
77  Log extra debugging information.
78
79.. option:: -V, --version
80
81  Print version information and exit.
82
83.. option:: -d, --daemon
84
85  Daemonize after startup (detach from terminal).
86
87.. option:: -b, --block-rpcs=LIST
88
89  Comma-separated list of RPCs to disable (no spaces, use ``--block-rpcs=help``
90  to list available RPCs).
91
92.. option:: -a, --allow-rpcs=LIST
93
94  Comma-separated list of RPCs to enable (no spaces, use ``--allow-rpcs=help``
95  to list available RPCs).
96
97.. option:: -D, --dump-conf
98
99  Dump the configuration in a format compatible with ``qemu-ga.conf``
100  and exit.
101
102.. option:: -h, --help
103
104  Display this help and exit.
105
106Files
107-----
108
109
110The syntax of the ``qemu-ga.conf`` configuration file follows the
111Desktop Entry Specification, here is a quick summary: it consists of
112groups of key-value pairs, interspersed with comments.
113
114::
115
116    # qemu-ga configuration sample
117    [general]
118    daemonize = 0
119    pidfile = /var/run/qemu-ga.pid
120    verbose = 0
121    method = virtio-serial
122    path = /dev/virtio-ports/org.qemu.guest_agent.0
123    statedir = /var/run
124
125The list of keys follows the command line options:
126
127=============  ===========
128Key             Key type
129=============  ===========
130daemon         boolean
131method         string
132path           string
133logfile        string
134pidfile        string
135fsfreeze-hook  string
136statedir       string
137verbose        boolean
138block-rpcs     string list
139=============  ===========
140
141See also
142--------
143
144:manpage:`qemu(1)`
145