I have followed the Virt-manager - Official NixOS Wiki . But, the internet inside VMs aren’t working properly. I was able to view/ping my router’s dashboard from VM, but I couldn’t visit or ping any public URLs (e.g., nixos.org). Configuring DNS manually didn’t help solve the issue. I have tried on both Windows 10 and Arch Linux VMs.
I didn’t understand what you meant by a system session.
Can you explain what a system session is? And, it will be also helpful if you give any relevant wiki links that shows how I can create VM in a system session.
I use virt-manager which did not prompt for asking anything like this but, my Libvirt Connection URI is qemu:///system, I checked it with virsh uri command.
Currently you using networkmanager to handle the network on the host. If you provide us with networkmanager settings and the libvirt domain xml of your virtual machine to show the full network settings.
Perhaps someone using the networkmanager with virtual machines could give then some comments. I don’t use networkmanager but a static network definition and a bridge on my nixos host for using with multiple virtual machines.
And, I did not configure anything by myself. Everything should be in default values.
Also, if you think using something else other than NetworkManager is easier please share.
I just realized, I uploaded a broken configuration.nix. Can you check again? I probably tried to remove the lines related to virt-manager and reinsert them but forgot.
In the configuration I see that you use the device virbr0. That means that you want to use a virtual machine with a NATed network connection. This is the default for virtlib. If you look into libvirt: Virtual Networking it could helpto set parameters in virt-manager, for which there is no Nixos configuration. This is out of scope for my configuration.
Sorry, I wasn’t able to fix it, I just found out Quickemu to be more userfriendly and easier for me. I had to install quickemu from the unstable branch.
If you have your own firewall installed, libvirt will stomp all over it with iptable tables and rules translated to nftables
I have my own nftable configuration and found it better to write my own nat and forwarding rules and set the libvirt network config from <forward mode='nat'/> to <forward mode=’open’/>
I think before looking at the wiki for virt-manager I didn’t tinker with anything related to firewall. So, I there was something else which was causing the issue. I have very little knowledge about customizing XML for a VM.