Product SiteDocumentation Site

3.2. URI formats

Libvirt uses Uniform Resource Identifiers (URIs) to identify hypervisor connections. Both local and remote hypervisors are addressed by libvirt using URIs. The URI scheme and path defines the hypervisor to connect to, while the host part of the URI determines where it is located.

3.2.1. Local URIs

Libvirt local URIs have one of the following forms:
driver:///system
driver:///session
driver+unix:///system
driver+unix:///session
All other uses of the libvirt URIs are considered remote, and behave as such, even if connecting to localhost. See Section 3.2.2, “Remote URIs” for details on remote URIs.
The following drivers are currently supported:
Driver
Description
qemu
For managing qemu and KVM guests
xen
For managing old-style (Xen 3.1 and older) Xen guests
xenapi
For managing new-style Xen guests
uml
For managing UML guests
lxc
For managing Linux Containers
vbox
For managing VirtualBox guests
openvz
For managing OpenVZ containers
esx
For managing VMware ESX guests
one
For managing OpenNebula guests
phyp
For managing Power Hypervisor guests
Table 3.1. Supported Drivers

The following example shows how to connect to a local QEMU hypervisor using a local URI.
# Example-6.py
from __future__ import print_function
import sys
import libvirt

conn = libvirt.open('qemu:///system')
if conn == None:
    print('Failed to open connection to qemu:///system', file=sys.stderr)
    exit(1)
conn.close()
exit(0)
Example 3.5. Connecting to a local QEMU hypervisor