I created an image of alpine with bash.
Then I installed KVM and created a guest vm.
Now I want to make the guest vm to connect to internet, but I'm stuck.
docker exec -it <running_container_id> /bin/bash
whoami
# root
groups root
# root bin daemon sys adm disk wheel floppy dialout tape video kvm libvirt qemu
virsh net-list --all
# error: failed to connect to the hypervisor
# error: Operation not supported: Cannot use direct socket mode if no URI is set
virsh net-start vnet001
# same error
Meanwhile
su virsh_user
groups virsh_user
# virsh_user wheel kvm libvirt qemu
virsh net-list --all
# Name State Autostart Persistent
# ----------------------------------------------
# vnet001 inactive no yes
virsh net-start vnet001
# error: Failed to start network vnet001
# error: error creating bridge interface virbr1: Operation not permitted
What can I do?
EDIT 1
I managed to make more commands to work also in root, but still I cannot start any network.
I noticed that rc-status
was returning:
libvirtd [stopped]
Then I did this.
rc-service libvirtd start # returns error
apk add openrc
touch /run/openrc/softlevel
openrc
rc-status
# libvirtd [started]
virsh net-list # working
virsh net-define vnet001.xml # working
virsh start default # not working
# error: Failed to start network default
# error: error creating bridge interface virbr0: Operation not permitted
I cannot create new guest VMs without the default network active:
virsh-install ...
ERROR Requested operation is not valid: network 'default' is not active
Anyway VirtualBox seems to work.