I had this error when starting a kvm vm : “Virtual network ‘default’ has not been started”. It was related to the docker service.

After trying basic things like restarting the service( service libvirtd restart) and checking errors in dmesg, i tried to start manually the network :

[root@rhel6 ~]# virsh net-start default
error: Failed to start network default
error: Unable to set bridge virbr0 forward_delay: Read-only file system

And getting information on the newtork :

[root@rhel6 ~]# virsh net-info default
Name default
UUID f4f6e3c0-2319-4aef-b030-8eb4007c391d
Active: no
Persistent: yes
Autostart: yes
Bridge: virbr0

All seemed right except this read-only permission error. i tried to disable selinux but no luck. After some googling, i found it was related to docker starting before libvirtd.

First at service level :

[root@rhel6 ~]# chkconfig --list|egrep "docker|libvirt"
docker 0:off 1:off 2:on 3:on 4:on 5:on 6:off
libvirt-guests 0:off 1:off 2:on 3:on 4:on 5:on 6:off
libvirtd 0:off 1:off 2:off 3:on 4:on 5:on 6:off

So by default, dokcer is started at runlevel 2 but it’s also started before libvirtd.

[root@rhel6 ~]# egrep "# chkconfig" /etc/init.d/libvirtd /etc/init.d/docker
/etc/init.d/libvirtd:# chkconfig: 345 97 03
/etc/init.d/docker:# chkconfig: 2345 95 95

The best solution is to override the default chkconfig parameters :

echo "# chkconfig: 345 98 95" > /etc/chkconfig.d/docker

And it’s enough to have libvirt and docker playing nicely together on RHEL 6 :)

Checking it with ifconfig :

[root@rhel6 ~]# ~/Desktop ifconfig virbr0
virbr0 Link encap:Ethernet HWaddr 52:54:00:15:40:34
          inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

[root@rhel6 ~]# ~/Desktop ifconfig docker0
docker0 Link encap:Ethernet HWaddr FA:27:91:8A:CE:8D
          inet addr:172.17.42.1 Bcast:0.0.0.0 Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:80 (80.0 b) TX bytes:0 (0.0 b)