qemu -net nic -net tap does not start due to qemu-ifXXX scripts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
qemu-kvm (Ubuntu) |
Fix Released
|
Low
|
Anton Patsev |
Bug Description
Binary package hint: qemu
qemu in ubuntu karmic brings new /etc/qemu-
Btw, these scripts are symlinks to /usr/bin. Imho it's not a good idea to have environment dependend scripts in a bin or sbin path.
My qemu -net nic -net tap terminates in an early startup stage:
can't add tap0 to bridge eth1: Operation not supported
/etc/qemu-ifup: could not launch network script
qemu: Could not initialize device 'tap'
qemu-ifstart does:
cat /usr/bin/qemu-ifup
#!/bin/sh
switch=$(/sbin/ip route list | awk '/^default / { print $5 }')
/sbin/ifconfig $1 0.0.0.0 up
/usr/sbin/brctl addif ${switch} $1
There's really no need to reconfigure my network interfaces. Not only that users often like to have their virtual machine(s) to be routet or NAT'ed behind their real machine. Your startup will not work, like at my notebook, properly if that network interface is a wireless device. Wireless devices are normaly in WLAN client mode, and this does not work -by design- as a bridge.
Ugly fix:
edit /usr/bin/qemu-if* and insert "exit 0" after the first empty line.
Because new qemu versions do bring their new /usr/bin/qemu-if*, you need to put qemu on hold, or chattr +i /usr/bin/qemu-if*.
The correct way would be to ask the user during installation if he likes every qemu process to join a bridge with the NICs the default route, and only then install that qemu-if*. I'd like to see this to be really in /etc and not in /usr/sbin, and not to be touched again by a regular package update.
Changed in qemu (Ubuntu): | |
assignee: | nobody → Patsev Anton (patsev-anton) |
Changed in qemu (Ubuntu): | |
status: | Confirmed → Triaged |
affects: | qemu (Ubuntu) → qemu-kvm (Ubuntu) |
Similar problem for me.
I set up the following tap device
$ cat /etc/network/ interfaces
<<<<
# Loopback device:
auto lo
iface lo inet loopback
# device: eth0
auto eth0
iface eth0 inet static
address x.x.x.x
broadcast x.x.x.x
netmask x.x.x.x
gateway x.x.x.x
# default route to access subnet
up route add -net x.x.x.x netmask x.x.x.x gw x.x.x.x eth0
auto tap0 ip_forward= 1 conf.tap0. proxy_arp= 1 ip_forward= 0
iface tap0 inet manual
tunctl_user root
uml_proxy_arp x.x.x.x
uml_proxy_ether eth0
up ip link set tap0 up
post-up sysctl -w net.ipv4.
post-up sysctl -w net.ipv4.
pre-down sysctl -w net.ipv4.
down ip link set tap0 down
>>>>
When i start the virtual domain, the following happens:
$ sudo virsh start windows-sbs
<<<<
Connecting to uri: qemu:///system
error: Failed to start domain windows-sbs
error: internal error unable to start guest: /etc/qemu-ifup: could not launch network script
qemu: Could not initialize device 'tap'
>>>>
Even when use the "ugly fix" this error persists. I can call /etc/qemu-ifup as a normal user so there should be no problem with acces rights. I also get the same error when i delete /etc/qemu-ifup or comment out its content.
What can i do to avoid this error?