Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 322107 - app-emulation/libvirt-0.8.1-r1: add elog to load tun module (was Failed to add tap interface to bridge 'virbr0')
Summary: app-emulation/libvirt-0.8.1-r1: add elog to load tun module (was Failed to ad...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Doug Goldstein (RETIRED)
URL: https://bugzilla.redhat.com/show_bug....
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-30 16:26 UTC by Dennis Schridde
Modified: 2010-08-05 19:58 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Schridde 2010-05-30 16:26:43 UTC
When I try to start my freshly setup winxp-in-qemu-kvm VM in app-emulation/virt-manager-0.8.4, I get the following error message:

libvirtError: Failed to add tap interface to bridge 'virbr0': No such file or directory
Details:
---
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/engine.py", line 808, in run_domain
    vm.startup()
  File "/usr/share/virt-manager/virtManager/domain.py", line 1286, in startup
    self._backend.create()
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 333, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: Failed to add tap interface to bridge 'virbr0': No such file or directory
---

Reproducible: Always




[I] app-emulation/libvirt
     Available versions:  (~)0.7.5!t (~)0.7.6-r1!t (~)0.8.1!t (~)0.8.1-r1!t {avahi caps iscsi +libvirtd lvm +lxc +network nfs nls numa one openvz parted phyp policykit python qemu sasl selinux udev uml virtualbox xen}                                                                                                                                                                                                               
     Installed versions:  0.8.1-r1!t(18:09:44 30/05/10)(avahi caps libvirtd lvm lxc network nls policykit python qemu sasl udev -iscsi -nfs -numa -openvz -parted -phyp -selinux -uml -virtualbox -xen)
[D] app-emulation/virt-manager
     Available versions:  (~)0.8.2 (~)0.8.2-r1 (~)0.8.3 (~)0.8.4 {gnome-keyring policykit}
     Installed versions:  0.8.4(17:11:51 30/05/10)(policykit -gnome-keyring)


Portage 2.2_rc67 (default/linux/amd64/10.0/desktop/kde, gcc-4.4.3, glibc-2.11.1-r0, 2.6.34-gentoo x86_64)
=================================================================
System uname: Linux-2.6.34-gentoo-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_5000+-with-gentoo-2.0.1
Timestamp of tree: Sun, 30 May 2010 06:45:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:     4.1_p7
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r2, 3.1.2-r3
dev-python/pycrypto: 2.1.0
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.1-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.3-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.7b
virtual/os-headers:  2.6.33
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-pipe -O2 -march=athlon64-sse3 -fstack-protector -ftree-vectorize"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-pipe -O2 -march=athlon64-sse3 -fstack-protector -ftree-vectorize"
DISTDIR="/var/cache/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
GENTOO_MIRRORS="ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ http://distfiles.gentoo.org"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed"
LINGUAS="de"
MAKEOPTS="-j3"
PKGDIR="/var/cache/portage/packages"
PORTAGE_COMPRESS="xz"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/cache/portage/gentoo"
PORTDIR_OVERLAY="/var/cache/portage/layman/java-overlay /var/cache/portage/layman/kde /var/cache/portage/layman/oss-overlay /var/cache/portage/layman/pcsx2 /var/cache/portage/layman/sunrise /var/cache/portage/local"
SYNC="rsync://gentoo.kynes.de:660/gentoo-portage"
[...]
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Michael Weber (RETIRED) gentoo-dev 2010-06-07 08:53:41 UTC
Hello Dennis,

can you please verify that you've TUN/TAP support in the kernel (`grep CONFIG_TUN /boot/config` or better `zgrep CONFIG_TUN /proc/config.gz`).
If it says `# ... is not set`, please recompile the kernel with TUN/TAP enabled (Device Drivers -> Network Deviced -> Universal TUN/TAP...).
If it says `CONFIG_TUN=m` please verify that you've loaded the module (`lsmod | grep tun` and `modprobe tun` if it's not listed).

If it says, `CONFIG_TUN=y` then comment this fact here and,  excuse my blind guess.

Michael
Comment 2 Dennis Schridde 2010-06-07 09:24:56 UTC
# zgrep CONFIG_TUN /proc/config.gz
CONFIG_TUN=m
# lsmod | grep tun
# 

Can the module be loaded automatically, like most other modules seem to be loaded on demand?
Can maybe the libvirtd init script load it? Or can the ebuild warn about loading the module if CONFIG_TUN=m?
Comment 3 Dennis Schridde 2010-06-07 09:28:06 UTC
After "modprobe tun" everything worked, thanks a lot!
I'll submit a bug to upstream libvirt, so they check for the existance of that module first, to ease diagnosis.
Comment 4 Dennis Schridde 2010-06-07 09:35:49 UTC
(In reply to comment #3)
> I'll submit a bug to upstream libvirt, so they check for the existance of that
> module first, to ease diagnosis.
https://bugzilla.redhat.com/show_bug.cgi?id=601118

Comment 5 Michael Weber (RETIRED) gentoo-dev 2010-06-07 10:45:46 UTC
(In reply to comment #2)
> Can the module be loaded automatically, like most other modules seem to be
> loaded on demand?
Sure, just add it to /etc/conf.d/modules as `modules=tun`.

> Can maybe the libvirtd init script load it?
You need root privileges to do so, it'll fail if this script runns as regular user.

> Or can the ebuild warn about loading the module if CONFIG_TUN=m?
app-emulation/virtualbox-modules does so in pkg_postinst(), i'll assign it to the maintainer to add such a notice.

Michael
Comment 6 Dennis Schridde 2010-06-07 11:10:26 UTC
(In reply to comment #5)
> (In reply to comment #2)
> > Can the module be loaded automatically, like most other modules seem to be
> > loaded on demand?
> Sure, just add it to /etc/conf.d/modules as `modules=tun`.
I meant more like: Is it technically possible to make the kernel load the module automatically when e.g. libvirtd tries to use it?

> > Can maybe the libvirtd init script load it?
> You need root privileges to do so, it'll fail if this script runns as regular
> user.
Init scripts (/etc/init.d) are always run by root, are they not?
Comment 7 Michael Weber (RETIRED) gentoo-dev 2010-06-07 11:18:12 UTC
(In reply to comment #6)
> I meant more like: Is it technically possible to make the kernel load the
> module automatically when e.g. libvirtd tries to use it?
That depends on what exactly libvirt opens the device. There is a kernel module autoloader but it requires a device file to exists inside /dev, with is event-driven upon module loading these days. Virtualbox didn't find a better way, too.

> Init scripts (/etc/init.d) are always run by root, are they not?
Yes, they are. I misread that as "application init script". That can be the solution.
Comment 8 Doug Goldstein (RETIRED) gentoo-dev 2010-06-16 21:26:41 UTC
There's 3 different ways to have networking in virtualized environments. Host Bridge, Host Only, and NAT. Only the last actually requires a tun driver. Now I say "a tun" driver specifically as there's a few different tun drivers. The old boring tun, mactun, vmnet, and xennet. Which one will be used is really entirely up to how the user configured their system. So adding it to the init script isn't an option.

The device node that controls the "tun" module is /dev/net/tun, which is a character device with a major of 10 and minor of 200. But this doesn't solve the issue for people that built their kernel with CONFIG_TUN=n and are trying to use tun networking.

So really what do you guys propose the message look like?
Comment 9 Doug Goldstein (RETIRED) gentoo-dev 2010-07-06 16:44:22 UTC
With macvtap support, now you either need the macvtap module loaded or the tun module based on your configuration.

This message is going to be very confusing to get right.
Comment 10 Doug Goldstein (RETIRED) gentoo-dev 2010-08-05 19:58:42 UTC
I've instead made libvirt load the tun module when it attempts to use it and it can't find it.

Fixed in 0.8.3