Description=My little container
[Service]
-ExecStart=/usr/bin/virsh -c lxc:/// start --pass-fds 3 mycontainer
-ExecStop=/usr/bin/virsh -c lxc:/// destroy mycontainer
+ExecStart=/usr/bin/virsh -c lxc:///system start --pass-fds 3 mycontainer
+ExecStop=/usr/bin/virsh -c lxc:///system destroy mycontainer
Type=oneshot
RemainAfterExit=yes
KillMode=none
As with any libvirt virtualization driver, LXC containers can be
managed via a wide variety of libvirt based tools. At the lowest
level the <code>virsh</code> command can be used to perform many
-tasks, by passing the <code>-c lxc:///</code> argument. As an
+tasks, by passing the <code>-c lxc:///system</code> argument. As an
alternative to repeating the URI with every command, the <code>LIBVIRT_DEFAULT_URI</code>
-environment variable can be set to <code>lxc:///</code>. The
+environment variable can be set to <code>lxc:///system</code>. The
examples that follow outline some common operations with virsh
and LXC. For further details about usage of virsh consult its
manual page.
</p>
<pre>
-# virsh -c lxc:/// define myguest.xml
+# virsh -c lxc:///system define myguest.xml
</pre>
<h3><a id="usageView">Viewing container configuration</a></h3>
</p>
<pre>
-# virsh -c lxc:/// dumpxml myguest
+# virsh -c lxc:///system dumpxml myguest
</pre>
<h3><a id="usageStart">Starting containers</a></h3>
</p>
<pre>
-# virsh -c lxc:/// start myguest
+# virsh -c lxc:///system start myguest
</pre>
<p>
</p>
<pre>
-# virsh -c lxc:/// create myguest.xml
+# virsh -c lxc:///system create myguest.xml
</pre>
</p>
<pre>
-# virsh -c lxc:/// shutdown myguest
+# virsh -c lxc:///system shutdown myguest
</pre>
<p>
</p>
<pre>
-# virsh -c lxc:/// destroy myguest
+# virsh -c lxc:///system destroy myguest
</pre>
</p>
<pre>
-# virsh -c lxc:/// reboot myguest
+# virsh -c lxc:///system reboot myguest
</pre>
<h3><a id="usageDelete">Undefining (deleting) a container configuration</a></h3>
</p>
<pre>
-# virsh -c lxc:/// undefine myguest
+# virsh -c lxc:///system undefine myguest
</pre>
<h3><a id="usageConnect">Connecting to a container console</a></h3>
</p>
<pre>
-# virsh -c lxc:/// console myguest
+# virsh -c lxc:///system console myguest
</pre>
<p>
</p>
<pre>
-# virsh -c lxc:/// console myguest --devname console1
+# virsh -c lxc:///system console myguest --devname console1
</pre>
<h3><a id="usageEnter">Running commands in a container</a></h3>
</p>
<pre>
-# virsh -c lxc:/// lxc-enter-namespace myguest -- /bin/ls -al /dev
+# virsh -c lxc:///system lxc-enter-namespace myguest -- /bin/ls -al /dev
</pre>
<h3><a id="usageTop">Monitoring container utilization</a></h3>
</p>
<pre>
-# virt-top -c lxc:///
+# virt-top -c lxc:///system
</pre>
<h3><a id="usageConvert">Converting LXC container configuration</a></h3>
</p>
<pre>
-# virsh -c lxc:/// domxml-from-native lxc-tools /var/lib/lxc/myguest/config
+# virsh -c lxc:///system domxml-from-native lxc-tools /var/lib/lxc/myguest/config
</pre>
<p>
if (lxc_driver == NULL)
return VIR_DRV_OPEN_DECLINED;
- if (!(conn->uri = virURIParse("lxc:///")))
+ if (!(conn->uri = virURIParse("lxc:///system")))
return VIR_DRV_OPEN_ERROR;
} else {
if (conn->uri->scheme == NULL ||
/* If path isn't '/' then they typoed, tell them correct path */
if (conn->uri->path != NULL &&
- STRNEQ(conn->uri->path, "/")) {
+ STRNEQ(conn->uri->path, "/") &&
+ STRNEQ(conn->uri->path, "/system")) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unexpected LXC URI path '%s', try lxc:///"),
+ _("Unexpected LXC URI path '%s', try lxc:///system"),
conn->uri->path);
return VIR_DRV_OPEN_ERROR;
}