File: failed_connection_after_install.rst

package info (click to toggle)
libvirt 11.9.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 209,020 kB
  • sloc: ansic: 535,831; xml: 321,783; python: 11,974; perl: 2,626; sh: 2,185; makefile: 448; javascript: 126; cpp: 22
file content (68 lines) | stat: -rw-r--r-- 2,046 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
========================================
Libvirt does not work after installation
========================================

.. contents::

TL;DR
=====

Most probably you want to start a virtqemud socket:

::

   # systemctl start virtqemud.socket

If you are unsure whether to do this, please read the rest of this document.

Symptom
=======

After installing libvirt or a virt tool that uses libvirt, commands do
not work when run as root:

::

   # virsh list
   error: failed to connect to the hypervisor
   error: Operation not supported: Cannot use direct socket mode if no URI is set.
   For more information see https://libvirt.org/kbase/failed_connection_after_install.html

Or

::

   # virsh list
   error: failed to connect to the hypervisor
   error: Operation not supported: No URI is provided and cannot identify any listening
   daemon socket path to attempt to connect to. For more information see
   https://libvirt.org/kbase/failed_connection_after_install.html

Root cause
==========

Distribution guidelines and/or configurations may discourage or prohibit
starting services as part of a package installation.  And because libvirt cannot
know where you might want to connect it cannot start it on its own.

Solution
========

After installing libvirt you may need to start a particular libvirt daemon on
the local machine, set a (default) URI to connect to or, alternatively,
rebooting the machine might work.

If you are trying to connect to a remote libvirt daemon you need to specify a `connection URI <../uri.html>`__.

If you are trying to control a local hypervisor, then the solution depends on various factors. You should know:

- what hypervisor driver you want to connect to, whether it is ``virtqemud`` for QEMU, ``virtchd`` for Cloud Hypervisor, etc. and
- how to start a service or socket (in case of systemd) on you system.

Example of the most common solution, trying to use QEMU/KVM on Linux with systemd as an init system, is:

::

   # systemctl start virtqemud.socket

also provided on the top of the page.