I am trying to define a network filter using virsh console in libvirt with the following command:
runuser -u CherryWorker -- virsh nwfilter-define --file "${DIR_LIBVIRT}filters/isolated-nat-filter.xml"
This is the result I get:
error: Failed to define network filter from /opt/cherry-vm-manager/libvirt/filters/isolated-nat-filter.xml
error: internal error: connection not open
The issue is within the `connection not open` error.
I am executing virsh commands using a dedicated user that has been configured to use virsh adequately - it was added to the libvirt system group and libvirtd.socket and libvirtd-ro.socket have been modified per documentation.
Executing the same nwfilter-define command from bare root account succeeds.
At the same time running other virsh command succeeds:
runuser -u CherryWorker – virsh net-define --file “${DIR_LIBVIRT}networks/isolated-nat.xml”
Result:
Network isolated-nat defined from /opt/cherry-vm-manager/libvirt/networks/isolated-nat.xml
Is this an issue with libvirt daemon configuration or does nwfilter-define work in some different way?