2
0

qemu-ga.rst 4.1 KB

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