I do not know it if this fixes your problem. However following solved mine:
- Stop all
tmux sessions. - Really all, such that no
tmux runs anymore on the machine
- Logout
- Login again
- Start a fresh
tmux
Now virsh list --all works within tmux as expected.
At my side the problem was, that my user was added to group libvirt after I started tmux. Hence all sessions within tmux, even the brand new ones, did not have group libvirt yet.
This is a tmux annoyance, as even brand new tmux invocations still are started by the same old tmux server (they could be started by the current tmux and then being handed over to the server by FD-passing via Unix sockets, but this is not how tmux works, sigh), such that everything dies with this server, too (I'd like to see that the tty is held by both, the server and each client tmux, such that if either dies nothing really bad happens).
And the tmux server crashes far too frequently: 1 time a year means 3 times a day when running tmux on 1000 VMs. Even if it crashes with a probability as low as 10^-20 (tmux' crash probability is higher), this still means far too frequent crashes, as each computer runs - at least these days - 10^10 instructions per second, which roughly means, 1 crash every 350 years.
With rounded down estimate of 100 billion computing units out there and 5$ worth of lost work per crash, this still means the possibility of far more than 1 million $ net worth damage dealt each day due to tmux instable design.
Sorry, just some math. (Note that "crash" includes "hang" or any other possibility, which stops all tmux session from becoming accessible. But hangs are the most frequent source of trouble with tmux and are not that fatal. As I once stumbled across a crude script somwhere - sorry I do no more remember - which allows to take over ttys, even from some hanging tmux. This creates some other problems afterwards and only works as long as the ttys are still open due to a hanging tmux server. If it really crashes, all ttys are closed.)