Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved]QEMU/virt-manager/session: problem setting up virbr0
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
equaeghe
l33t
l33t


Joined: 22 Feb 2005
Posts: 637

PostPosted: Tue Apr 02, 2024 7:52 am    Post subject: [solved]QEMU/virt-manager/session: problem setting up virbr0 Reply with quote

I'm using virt-manager for a Win11 VM. Currently, I'm using (default) user-mode networking, but I have the impression it has limitations I need to overcome (OneDrive connection in Windows does not work). I gather from various online docs that using a bridged network is the way to go and that I should select virbr0 as the interface. However, that does not work for me. I do not have the virbr0 interface and it is unclear to me what I would need to do to get it.

I read that I needed to set up a qemu:///system connection (I just have a qemu:///session one now) and that that would result in the virbr0 interface being created. However, when I try that, I get the message
Code:
Unable to connect to libvist qemu:///system
Failed to connect socket to '/var/run/libvirt/virtqemud-sock': File or folder does not exist

I then looked into what could create that socket. When perusing the systemd unit files, I saw a whole list of them related to ‘virt’. On some Arch docs page, they mentioned I should enable the libvirtd.socket one. I assumed that when virt-manager starts, this would trigger starting all needed auxiliary unit files (some of which have ‘virtqemud’ in their name and some of which have ‘network’ in their name). However, that does not seem to be the case.

(Most other documentation I come across is from the period 2014-2016 and I have the impression quite a number of things have changed since then in terms of systemd units for libvirt/virt-manager.)

To avoid me trial-and-errroring my way through this without guarantees of success, I'm asking here what the proper way is to deal with all this. What systemd units should I enable? Is there anything else I need to do to get the bridged networking working?


Last edited by equaeghe on Tue Apr 02, 2024 8:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Tue Apr 02, 2024 12:08 pm    Post subject: Reply with quote

If you need your VMs to be on the same LAN as your host machine,then and only then you will need to manually create a bridge iface on top of your ethernet.
Do you need this?
Do you have ethernet or wifi?
Virbr0 etc are created by libvirt in order to provide NAT networking to your vms and you normally do not need to do anything manual.
As for libvirt, it has recently become modular.
Try
Code:

systemctl enable --now libvirtd{,-ro,-admin,-tcp,-tls}.socket
systemctl enable --now libvirtd


_________________
:)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54236
Location: 56N 3W

PostPosted: Tue Apr 02, 2024 12:27 pm    Post subject: Reply with quote

equaeghe,

virbr0 is not a bridge like you are thinking.

Its a NAT node with the IP address 192.168.122.1 on the VM side and provides NAT to your LAN, which is probably further NATed to the outside world.
This just works for outgoing (from the VM) initiated networking but incoming would need port forwarding.

OneDrive works behind NAT, so you shouldn't need a real bridge.

If you want a real bridge, add another (virtual) NIC to your guest and set that up as a bridge.
Make sure its used for the default route.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
equaeghe
l33t
l33t


Joined: 22 Feb 2005
Posts: 637

PostPosted: Tue Apr 02, 2024 8:48 pm    Post subject: Reply with quote

@NeddySagoon: Thanks for your input. You were right that I didn't need anything special in terms of network; the OneDrive issue was not related to that (hadn't used it recently enough, so they had blocked that account…).

@alamahant: Your suggestion to enable some of libvirtd's services put me on the right track. In the end I enabled virtnetworkd.service, virtnodedevd.service, virtqemud.service, and virtstoraged.service (possibly overkill: I enabled things that were complained about as missing in my logs). Then virbr0 was auto-created in the qemu:///system connection I setup and I could reuse it in my qemu:///session connection after saying "allow virbr0" in /etc/qemu/bridge.conf.

N.B.: I was possibly also missing some kernel modules.I find out which to add to my config by looking at the ebuild of qemu and libvirt and checking the CONFIG_CHECKs being done.

My qemu VM setup has now surpassed my virtualbox VM setup, so I can ditch the latter and its inconvenient out-of-tree kernel module. :-)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum