Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]qemu/virt-manager failed to start virtual network
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
mooxxx1
n00b
n00b


Joined: 19 Jul 2023
Posts: 3

PostPosted: Wed Jul 19, 2023 3:32 am    Post subject: [SOLVED]qemu/virt-manager failed to start virtual network Reply with quote

Cant start virtual network
Code:
virsh net-start default
error: Failed to start network default
error: failed to enable IP forwarding: No such file or directory

virt-manager output:
Code:
Could not start virtual network 'default': failed to enable IP forwarding: No such file or directory

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/device/netlist.py", line 208, in _check_network_is_running
    netobj.start()
  File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 57, in newfn
    ret = fn(self, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/virt-manager/virtManager/object/network.py", line 69, in start
    self._backend.create()
  File "/usr/lib/python3.11/site-packages/libvirt.py", line 3547, in create
    raise libvirtError('virNetworkCreate() failed')
libvirt.libvirtError: failed to enable IP forwarding: No such file or directory

Code:
sysctl net.ipv4.ip_forward
sysctl: cannot stat /proc/sys/net/ipv4/ip_forward: No such file or directory


Last edited by mooxxx1 on Wed Jul 19, 2023 1:34 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: Wed Jul 19, 2023 9:23 am    Post subject: Reply with quote

Welcome to Gentoo!
Try
Code:

echo "net.ipv4.ip_forward = 1" > /etc/sysctl.d/ip_forward.conf
sysctl -p  /etc/sysctl.d/ip_forward.conf

Is your kernel configured for networking?
I am not sure if you need it for ip forwarding but for sure you need a full network stack with iptables and all for libvirt.
Have you installed libvirt?
You need libvirt for virt-manager.
Qemu is not enough.
_________________
:)
Back to top
View user's profile Send private message
mooxxx1
n00b
n00b


Joined: 19 Jul 2023
Posts: 3

PostPosted: Wed Jul 19, 2023 12:53 pm    Post subject: Reply with quote

alamahant wrote:
Welcome to Gentoo!
Try
Code:

echo "net.ipv4.ip_forward = 1" > /etc/sysctl.d/ip_forward.conf
sysctl -p  /etc/sysctl.d/ip_forward.conf

Is your kernel configured for networking?
I am not sure if you need it for ip forwarding but for sure you need a full network stack with iptables and all for libvirt.
Have you installed libvirt?
You need libvirt for virt-manager.
Qemu is not enough.

Same error:
Code:
echo "net.ipv4.ip_forward = 1" > /etc/sysctl.d/ip_forward.conf
sysctl -p  /etc/sysctl.d/ip_forward.conf
sysctl: cannot stat /proc/sys/net/ipv4/ip_forward: No such file or directory

Quote:
Is your kernel configured for networking?
I am using minimal kernel config and my network is working fine except for this. When I ran
Code:
virsh net-start default
the first time it showed that I am missing a kernel module so I checked the wiki and enabled some parameters, recompiled the kernel and now it shows only "failed to enable IP forwarding". I guess maybe there is some kernel parameters that I missed or some use flags.
Quote:
Have you installed libvirt?
Yes, with these use flags
Code:
app-emulation/libvirt-9.5.0:0/9.5.0::gentoo  USE="libvirtd qemu udev virt-network -apparmor -audit -bash-completion -caps -dtrace -firewalld -fuse -glusterfs -iscsi -iscsi-direct -libssh -libssh2 -lvm -lxc -nfs -nls -numa (-openvz) -parted -pcap -policykit -rbd -sasl (-selinux) -test -verify-sig -virtualbox -wireshark-plugins -xen -zfs"

and iptables
Code:
net-firewall/iptables-1.8.9:0/1.8.3::gentoo  USE="(split-usr) -conntrack -netlink -nftables -pcap -static-libs"
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1695

PostPosted: Wed Jul 19, 2023 1:19 pm    Post subject: Reply with quote

Is CONFIG_PROC_SYSCTL disabled in the kernel? This option will be necessary for ip_forward to exist.
Back to top
View user's profile Send private message
mooxxx1
n00b
n00b


Joined: 19 Jul 2023
Posts: 3

PostPosted: Wed Jul 19, 2023 1:33 pm    Post subject: Reply with quote

grknight wrote:
Is CONFIG_PROC_SYSCTL disabled in the kernel? This option will be necessary for ip_forward to exist.

Yes it was disabled. I recompiled the kernel and now everything works. Thanks.
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