qemu.conf 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. # Master configuration file for the QEMU driver.
  2. # All settings described here are optional - if omitted, sensible
  3. # defaults are used.
  4. # VNC is configured to listen on 127.0.0.1 by default.
  5. # To make it listen on all public interfaces, uncomment
  6. # this next option.
  7. #
  8. # NB, strong recommendation to enable TLS + x509 certificate
  9. # verification when allowing public access
  10. #
  11. #vnc_listen = "0.0.0.0"
  12. # Enable this option to have VNC served over an automatically created
  13. # unix socket. This prevents unprivileged access from users on the
  14. # host machine, though most VNC clients do not support it.
  15. #
  16. # This will only be enabled for VNC configurations that do not have
  17. # a hardcoded 'listen' or 'socket' value. This setting takes preference
  18. # over vnc_listen.
  19. #
  20. #vnc_auto_unix_socket = 1
  21. # Enable use of TLS encryption on the VNC server. This requires
  22. # a VNC client which supports the VeNCrypt protocol extension.
  23. # Examples include vinagre, virt-viewer, virt-manager and vencrypt
  24. # itself. UltraVNC, RealVNC, TightVNC do not support this
  25. #
  26. # It is necessary to setup CA and issue a server certificate
  27. # before enabling this.
  28. #
  29. #vnc_tls = 1
  30. # Use of TLS requires that x509 certificates be issued. The
  31. # default it to keep them in /etc/pki/libvirt-vnc. This directory
  32. # must contain
  33. #
  34. # ca-cert.pem - the CA master certificate
  35. # server-cert.pem - the server certificate signed with ca-cert.pem
  36. # server-key.pem - the server private key
  37. #
  38. # This option allows the certificate directory to be changed
  39. #
  40. #vnc_tls_x509_cert_dir = "/etc/pki/libvirt-vnc"
  41. # The default TLS configuration only uses certificates for the server
  42. # allowing the client to verify the server's identity and establish
  43. # an encrypted channel.
  44. #
  45. # It is possible to use x509 certificates for authentication too, by
  46. # issuing a x509 certificate to every client who needs to connect.
  47. #
  48. # Enabling this option will reject any client who does not have a
  49. # certificate signed by the CA in /etc/pki/libvirt-vnc/ca-cert.pem
  50. #
  51. #vnc_tls_x509_verify = 1
  52. # The default VNC password. Only 8 bytes are significant for
  53. # VNC passwords. This parameter is only used if the per-domain
  54. # XML config does not already provide a password. To allow
  55. # access without passwords, leave this commented out. An empty
  56. # string will still enable passwords, but be rejected by QEMU,
  57. # effectively preventing any use of VNC. Obviously change this
  58. # example here before you set this.
  59. #
  60. #vnc_password = "XYZ12345"
  61. # Enable use of SASL encryption on the VNC server. This requires
  62. # a VNC client which supports the SASL protocol extension.
  63. # Examples include vinagre, virt-viewer and virt-manager
  64. # itself. UltraVNC, RealVNC, TightVNC do not support this
  65. #
  66. # It is necessary to configure /etc/sasl2/qemu.conf to choose
  67. # the desired SASL plugin (eg, GSSPI for Kerberos)
  68. #
  69. #vnc_sasl = 1
  70. # The default SASL configuration file is located in /etc/sasl2/
  71. # When running libvirtd unprivileged, it may be desirable to
  72. # override the configs in this location. Set this parameter to
  73. # point to the directory, and create a qemu.conf in that location
  74. #
  75. #vnc_sasl_dir = "/some/directory/sasl2"
  76. # QEMU implements an extension for providing audio over a VNC connection,
  77. # though if your VNC client does not support it, your only chance for getting
  78. # sound output is through regular audio backends. By default, libvirt will
  79. # disable all QEMU sound backends if using VNC, since they can cause
  80. # permissions issues. Enabling this option will make libvirtd honor the
  81. # QEMU_AUDIO_DRV environment variable when using VNC.
  82. #
  83. #vnc_allow_host_audio = 0
  84. # SPICE is configured to listen on 127.0.0.1 by default.
  85. # To make it listen on all public interfaces, uncomment
  86. # this next option.
  87. #
  88. # NB, strong recommendation to enable TLS + x509 certificate
  89. # verification when allowing public access
  90. #
  91. #spice_listen = "0.0.0.0"
  92. # Enable use of TLS encryption on the SPICE server.
  93. #
  94. # It is necessary to setup CA and issue a server certificate
  95. # before enabling this.
  96. #
  97. #spice_tls = 1
  98. # Use of TLS requires that x509 certificates be issued. The
  99. # default it to keep them in /etc/pki/libvirt-spice. This directory
  100. # must contain
  101. #
  102. # ca-cert.pem - the CA master certificate
  103. # server-cert.pem - the server certificate signed with ca-cert.pem
  104. # server-key.pem - the server private key
  105. #
  106. # This option allows the certificate directory to be changed.
  107. #
  108. #spice_tls_x509_cert_dir = "/etc/pki/libvirt-spice"
  109. # The default SPICE password. This parameter is only used if the
  110. # per-domain XML config does not already provide a password. To
  111. # allow access without passwords, leave this commented out. An
  112. # empty string will still enable passwords, but be rejected by
  113. # QEMU, effectively preventing any use of SPICE. Obviously change
  114. # this example here before you set this.
  115. #
  116. #spice_password = "XYZ12345"
  117. # Enable use of SASL encryption on the SPICE server. This requires
  118. # a SPICE client which supports the SASL protocol extension.
  119. #
  120. # It is necessary to configure /etc/sasl2/qemu.conf to choose
  121. # the desired SASL plugin (eg, GSSPI for Kerberos)
  122. #
  123. #spice_sasl = 1
  124. # The default SASL configuration file is located in /etc/sasl2/
  125. # When running libvirtd unprivileged, it may be desirable to
  126. # override the configs in this location. Set this parameter to
  127. # point to the directory, and create a qemu.conf in that location
  128. #
  129. #spice_sasl_dir = "/some/directory/sasl2"
  130. # By default, if no graphical front end is configured, libvirt will disable
  131. # QEMU audio output since directly talking to alsa/pulseaudio may not work
  132. # with various security settings. If you know what you're doing, enable
  133. # the setting below and libvirt will passthrough the QEMU_AUDIO_DRV
  134. # environment variable when using nographics.
  135. #
  136. #nographics_allow_host_audio = 1
  137. # Override the port for creating both VNC and SPICE sessions (min).
  138. # This defaults to 5900 and increases for consecutive sessions
  139. # or when ports are occupied, until it hits the maximum.
  140. #
  141. # Minimum must be greater than or equal to 5900 as lower number would
  142. # result into negative vnc display number.
  143. #
  144. # Maximum must be less than 65536, because higher numbers do not make
  145. # sense as a port number.
  146. #
  147. #remote_display_port_min = 5900
  148. #remote_display_port_max = 65535
  149. # VNC WebSocket port policies, same rules apply as with remote display
  150. # ports. VNC WebSockets use similar display <-> port mappings, with
  151. # the exception being that ports start from 5700 instead of 5900.
  152. #
  153. #remote_websocket_port_min = 5700
  154. #remote_websocket_port_max = 65535
  155. # The default security driver is SELinux. If SELinux is disabled
  156. # on the host, then the security driver will automatically disable
  157. # itself. If you wish to disable QEMU SELinux security driver while
  158. # leaving SELinux enabled for the host in general, then set this
  159. # to 'none' instead. It's also possible to use more than one security
  160. # driver at the same time, for this use a list of names separated by
  161. # comma and delimited by square brackets. For example:
  162. #
  163. # security_driver = [ "selinux", "apparmor" ]
  164. #
  165. # Notes: The DAC security driver is always enabled; as a result, the
  166. # value of security_driver cannot contain "dac". The value "none" is
  167. # a special value; security_driver can be set to that value in
  168. # isolation, but it cannot appear in a list of drivers.
  169. #
  170. #security_driver = "selinux"
  171. # If set to non-zero, then the default security labeling
  172. # will make guests confined. If set to zero, then guests
  173. # will be unconfined by default. Defaults to 1.
  174. #security_default_confined = 1
  175. # If set to non-zero, then attempts to create unconfined
  176. # guests will be blocked. Defaults to 0.
  177. #security_require_confined = 1
  178. # The user for QEMU processes run by the system instance. It can be
  179. # specified as a user name or as a user id. The qemu driver will try to
  180. # parse this value first as a name and then, if the name doesn't exist,
  181. # as a user id.
  182. #
  183. # Since a sequence of digits is a valid user name, a leading plus sign
  184. # can be used to ensure that a user id will not be interpreted as a user
  185. # name.
  186. #
  187. # Some examples of valid values are:
  188. #
  189. # user = "qemu" # A user named "qemu"
  190. # user = "+0" # Super user (uid=0)
  191. # user = "100" # A user named "100" or a user with uid=100
  192. #
  193. user = "root"
  194. # The group for QEMU processes run by the system instance. It can be
  195. # specified in a similar way to user.
  196. group = "root"
  197. # Whether libvirt should dynamically change file ownership
  198. # to match the configured user/group above. Defaults to 1.
  199. # Set to 0 to disable file ownership changes.
  200. #dynamic_ownership = 1
  201. # What cgroup controllers to make use of with QEMU guests
  202. #
  203. # - 'cpu' - use for schedular tunables
  204. # - 'devices' - use for device whitelisting
  205. # - 'memory' - use for memory tunables
  206. # - 'blkio' - use for block devices I/O tunables
  207. # - 'cpuset' - use for CPUs and memory nodes
  208. # - 'cpuacct' - use for CPUs statistics.
  209. #
  210. # NB, even if configured here, they won't be used unless
  211. # the administrator has mounted cgroups, e.g.:
  212. #
  213. # mkdir /dev/cgroup
  214. # mount -t cgroup -o devices,cpu,memory,blkio,cpuset none /dev/cgroup
  215. #
  216. # They can be mounted anywhere, and different controllers
  217. # can be mounted in different locations. libvirt will detect
  218. # where they are located.
  219. #
  220. #cgroup_controllers = [ "cpu", "devices", "memory", "blkio", "cpuset", "cpuacct" ]
  221. # This is the basic set of devices allowed / required by
  222. # all virtual machines.
  223. #
  224. # As well as this, any configured block backed disks,
  225. # all sound device, and all PTY devices are allowed.
  226. #
  227. # This will only need setting if newer QEMU suddenly
  228. # wants some device we don't already know about.
  229. #
  230. #cgroup_device_acl = [
  231. # "/dev/null", "/dev/full", "/dev/zero",
  232. # "/dev/random", "/dev/urandom",
  233. # "/dev/ptmx", "/dev/kvm", "/dev/kqemu",
  234. # "/dev/rtc","/dev/hpet", "/dev/vfio/vfio"
  235. #]
  236. #
  237. # RDMA migration requires the following extra files to be added to the list:
  238. # "/dev/infiniband/rdma_cm",
  239. # "/dev/infiniband/issm0",
  240. # "/dev/infiniband/issm1",
  241. # "/dev/infiniband/umad0",
  242. # "/dev/infiniband/umad1",
  243. # "/dev/infiniband/uverbs0"
  244. # The default format for Qemu/KVM guest save images is raw; that is, the
  245. # memory from the domain is dumped out directly to a file. If you have
  246. # guests with a large amount of memory, however, this can take up quite
  247. # a bit of space. If you would like to compress the images while they
  248. # are being saved to disk, you can also set "lzop", "gzip", "bzip2", or "xz"
  249. # for save_image_format. Note that this means you slow down the process of
  250. # saving a domain in order to save disk space; the list above is in descending
  251. # order by performance and ascending order by compression ratio.
  252. #
  253. # save_image_format is used when you use 'virsh save' or 'virsh managedsave'
  254. # at scheduled saving, and it is an error if the specified save_image_format
  255. # is not valid, or the requested compression program can't be found.
  256. #
  257. # dump_image_format is used when you use 'virsh dump' at emergency
  258. # crashdump, and if the specified dump_image_format is not valid, or
  259. # the requested compression program can't be found, this falls
  260. # back to "raw" compression.
  261. #
  262. # snapshot_image_format specifies the compression algorithm of the memory save
  263. # image when an external snapshot of a domain is taken. This does not apply
  264. # on disk image format. It is an error if the specified format isn't valid,
  265. # or the requested compression program can't be found.
  266. #
  267. #save_image_format = "raw"
  268. #dump_image_format = "raw"
  269. #snapshot_image_format = "raw"
  270. # When a domain is configured to be auto-dumped when libvirtd receives a
  271. # watchdog event from qemu guest, libvirtd will save dump files in directory
  272. # specified by auto_dump_path. Default value is /var/lib/libvirt/qemu/dump
  273. #
  274. #auto_dump_path = "/var/lib/libvirt/qemu/dump"
  275. # When a domain is configured to be auto-dumped, enabling this flag
  276. # has the same effect as using the VIR_DUMP_BYPASS_CACHE flag with the
  277. # virDomainCoreDump API. That is, the system will avoid using the
  278. # file system cache while writing the dump file, but may cause
  279. # slower operation.
  280. #
  281. #auto_dump_bypass_cache = 0
  282. # When a domain is configured to be auto-started, enabling this flag
  283. # has the same effect as using the VIR_DOMAIN_START_BYPASS_CACHE flag
  284. # with the virDomainCreateWithFlags API. That is, the system will
  285. # avoid using the file system cache when restoring any managed state
  286. # file, but may cause slower operation.
  287. #
  288. #auto_start_bypass_cache = 0
  289. # If provided by the host and a hugetlbfs mount point is configured,
  290. # a guest may request huge page backing. When this mount point is
  291. # unspecified here, determination of a host mount point in /proc/mounts
  292. # will be attempted. Specifying an explicit mount overrides detection
  293. # of the same in /proc/mounts. Setting the mount point to "" will
  294. # disable guest hugepage backing. If desired, multiple mount points can
  295. # be specified at once, separated by comma and enclosed in square
  296. # brackets, for example:
  297. #
  298. # hugetlbfs_mount = ["/dev/hugepages2M", "/dev/hugepages1G"]
  299. #
  300. # The size of huge page served by specific mount point is determined by
  301. # libvirt at the daemon startup.
  302. #
  303. # NB, within these mount points, guests will create memory backing
  304. # files in a location of $MOUNTPOINT/libvirt/qemu
  305. #
  306. #hugetlbfs_mount = "/dev/hugepages"
  307. # Path to the setuid helper for creating tap devices. This executable
  308. # is used to create <source type='bridge'> interfaces when libvirtd is
  309. # running unprivileged. libvirt invokes the helper directly, instead
  310. # of using "-netdev bridge", for security reasons.
  311. #bridge_helper = "/usr/libexec/qemu-bridge-helper"
  312. # If clear_emulator_capabilities is enabled, libvirt will drop all
  313. # privileged capabilities of the QEmu/KVM emulator. This is enabled by
  314. # default.
  315. #
  316. # Warning: Disabling this option means that a compromised guest can
  317. # exploit the privileges and possibly do damage to the host.
  318. #
  319. #clear_emulator_capabilities = 1
  320. # If enabled, libvirt will have QEMU set its process name to
  321. # "qemu:VM_NAME", where VM_NAME is the name of the VM. The QEMU
  322. # process will appear as "qemu:VM_NAME" in process listings and
  323. # other system monitoring tools. By default, QEMU does not set
  324. # its process title, so the complete QEMU command (emulator and
  325. # its arguments) appear in process listings.
  326. #
  327. #set_process_name = 1
  328. # If max_processes is set to a positive integer, libvirt will use
  329. # it to set the maximum number of processes that can be run by qemu
  330. # user. This can be used to override default value set by host OS.
  331. # The same applies to max_files which sets the limit on the maximum
  332. # number of opened files.
  333. #
  334. #max_processes = 0
  335. #max_files = 0
  336. # mac_filter enables MAC addressed based filtering on bridge ports.
  337. # This currently requires ebtables to be installed.
  338. #
  339. #mac_filter = 1
  340. # By default, PCI devices below non-ACS switch are not allowed to be assigned
  341. # to guests. By setting relaxed_acs_check to 1 such devices will be allowed to
  342. # be assigned to guests.
  343. #
  344. #relaxed_acs_check = 1
  345. # If allow_disk_format_probing is enabled, libvirt will probe disk
  346. # images to attempt to identify their format, when not otherwise
  347. # specified in the XML. This is disabled by default.
  348. #
  349. # WARNING: Enabling probing is a security hole in almost all
  350. # deployments. It is strongly recommended that users update their
  351. # guest XML <disk> elements to include <driver type='XXXX'/>
  352. # elements instead of enabling this option.
  353. #
  354. #allow_disk_format_probing = 1
  355. # In order to prevent accidentally starting two domains that
  356. # share one writable disk, libvirt offers two approaches for
  357. # locking files. The first one is sanlock, the other one,
  358. # virtlockd, is then our own implementation. Accepted values
  359. # are "sanlock" and "lockd".
  360. #
  361. #lock_manager = "lockd"
  362. # Set limit of maximum APIs queued on one domain. All other APIs
  363. # over this threshold will fail on acquiring job lock. Specially,
  364. # setting to zero turns this feature off.
  365. # Note, that job lock is per domain.
  366. #
  367. #max_queued = 0
  368. ###################################################################
  369. # Keepalive protocol:
  370. # This allows qemu driver to detect broken connections to remote
  371. # libvirtd during peer-to-peer migration. A keepalive message is
  372. # sent to the daemon after keepalive_interval seconds of inactivity
  373. # to check if the daemon is still responding; keepalive_count is a
  374. # maximum number of keepalive messages that are allowed to be sent
  375. # to the daemon without getting any response before the connection
  376. # is considered broken. In other words, the connection is
  377. # automatically closed approximately after
  378. # keepalive_interval * (keepalive_count + 1) seconds since the last
  379. # message received from the daemon. If keepalive_interval is set to
  380. # -1, qemu driver will not send keepalive requests during
  381. # peer-to-peer migration; however, the remote libvirtd can still
  382. # send them and source libvirtd will send responses. When
  383. # keepalive_count is set to 0, connections will be automatically
  384. # closed after keepalive_interval seconds of inactivity without
  385. # sending any keepalive messages.
  386. #
  387. #keepalive_interval = 5
  388. #keepalive_count = 5
  389. # Use seccomp syscall whitelisting in QEMU.
  390. # 1 = on, 0 = off, -1 = use QEMU default
  391. # Defaults to -1.
  392. #
  393. #seccomp_sandbox = 1
  394. # Override the listen address for all incoming migrations. Defaults to
  395. # 0.0.0.0, or :: if both host and qemu are capable of IPv6.
  396. #migration_address = "0.0.0.0"
  397. # The default hostname or IP address which will be used by a migration
  398. # source for transferring migration data to this host. The migration
  399. # source has to be able to resolve this hostname and connect to it so
  400. # setting "localhost" will not work. By default, the host's configured
  401. # hostname is used.
  402. #migration_host = "host.example.com"
  403. # Override the port range used for incoming migrations.
  404. #
  405. # Minimum must be greater than 0, however when QEMU is not running as root,
  406. # setting the minimum to be lower than 1024 will not work.
  407. #
  408. # Maximum must not be greater than 65535.
  409. #
  410. #migration_port_min = 49152
  411. #migration_port_max = 49215
  412. # Timestamp QEMU's log messages (if QEMU supports it)
  413. #
  414. # Defaults to 1.
  415. #
  416. #log_timestamp = 0
  417. # Location of master nvram file
  418. #
  419. # When a domain is configured to use UEFI instead of standard
  420. # BIOS it may use a separate storage for UEFI variables. If
  421. # that's the case libvirt creates the variable store per domain
  422. # using this master file as image. Each UEFI firmware can,
  423. # however, have different variables store. Therefore the nvram is
  424. # a list of strings when a single item is in form of:
  425. # ${PATH_TO_UEFI_FW}:${PATH_TO_UEFI_VARS}.
  426. # Later, when libvirt creates per domain variable store, this list is
  427. # searched for the master image. The UEFI firmware can be called
  428. # differently for different guest architectures. For instance, it's OVMF
  429. # for x86_64 and i686, but it's AAVMF for aarch64. The libvirt default
  430. # follows this scheme.
  431. #nvram = [
  432. # "/usr/share/OVMF/OVMF_CODE.fd:/usr/share/OVMF/OVMF_VARS.fd",
  433. # "/usr/share/AAVMF/AAVMF_CODE.fd:/usr/share/AAVMF/AAVMF_VARS.fd"
  434. #]
  435. # The backend to use for handling stdout/stderr output from
  436. # QEMU processes.
  437. #
  438. # 'file': QEMU writes directly to a plain file. This is the
  439. # historical default, but allows QEMU to inflict a
  440. # denial of service attack on the host by exhausting
  441. # filesystem space
  442. #
  443. # 'logd': QEMU writes to a pipe provided by virtlogd daemon.
  444. # This is the current default, providing protection
  445. # against denial of service by performing log file
  446. # rollover when a size limit is hit.
  447. #
  448. #stdio_handler = "logd"