Hi all,

I am trying to add vagrant-libvirt support for landrush plugin[0] and found out that libvirt fails for me with:


Call to virConnectNumOfNetworks failed: Cannot write data: Broken pipe (Libvirt::RetrieveError)

I created a minimal reproducer that causes this:

```
#!/usr/bin/ruby
require 'libvirt'

conn = Libvirt::open("qemu:///system")

fork do
  puts conn.list_networks
end

puts conn.list_networks
```

This works just fine on my host, but fails on my virtualized guest (when using nested KVM). The journal shows
the following lines in logs:

Failed to acquire pid file '/run/user/1001/libvirt/libvirtd.pid': Resource temporarily unavailable

So the forked process here tries to access not-existing libvirtd pid file for root (1001 on the VM).

Is this a feature/bug? How can one avoid it?

Thanks everyone
Josef


[0] https://github.com/phinze/landrush/pull/124