Public bug reported:

Hello,
I started a virtual machine on the command line in Ubuntu 12.10 64bit via:
sudo qemu-system-x86_64 -m 2048 -enable-kvm -cpu core2duo -usb -device 
usb-tablet,id=input0 -vga std -vnc 0.0.0.0:10 -net nic -net tap -drive 
file=/vmachine.qcow2

Instead of starting the machine, I got an error:
/etc/kvm/kvm-ifup: could not launch network script
qemu-system-x86_64: -net tap: Device 'tap' could not be initialized

In any case I can understand, that the script cannot be launched since it 
doesn't exist.
I found a blog, containing a script, that shows some solution for the problem.
http://www.sjvs.nl/?p=147
But this does not work. Probably the script is truncated somehow (no brackets 
are closed in the for loop).

I created a bridge as described in
https://help.ubuntu.com/community/KVM/Networking
Thus I installed libcap2-bin and bridge-utils and I changed my 
/etc/network/interfaces to

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet manual
auto br0
iface br0 inet static
        address 192.168.115.15
        network 192.168.115.0
        netmask 255.255.255.0
        broadcast 192.168.115.255
        gateway 192.168.115.254
        dns-nameservers 192.168.115.10
        dns-search sirah.int
        bridge_ports eth0
        bridge_stp off
        bridge_fd 0
        bridge_maxwait 0

I executed
sudo setcap cap_net_admin=ei /usr/bin/qemu-system-x86_64
and edited /etc/security/capability.conf.

The kvm command mentioned above worked on Ubuntu 12.04 with the same 
adjustments. There the machine started and it was bridged to my network.
At the moment I'm using kvm version 1:84+dfsg-0ubuntu16+1.2.0+noroms+0ubuntu2.

** Affects: kvm (Ubuntu)
     Importance: Undecided
         Status: New

** Description changed:

  Hello,
  I started a virtual machine on the command line in Ubuntu 12.10 64bit via:
  sudo qemu-system-x86_64 -m 2048 -enable-kvm -cpu core2duo -usb -device 
usb-tablet,id=input0 -vga std -vnc 0.0.0.0:10 -net nic -net tap -drive 
file=/vmachine.qcow2
  
  Instead of starting the machine, I got an error:
  /etc/kvm/kvm-ifup: could not launch network script
  qemu-system-x86_64: -net tap: Device 'tap' could not be initialized
  
  In any case I can understand, that the script cannot be launched since it 
doesn't exist.
- I found a blog, containing a script, that shows some solution for the 
problem. But this does not work. Probably the script is truncated somehow (no 
brackets are closed in the for loop).
+ I found a blog, containing a script, that shows some solution for the problem.
+ http://www.sjvs.nl/?p=147
+ But this does not work. Probably the script is truncated somehow (no brackets 
are closed in the for loop).
  
  I created a bridge as described in
  https://help.ubuntu.com/community/KVM/Networking
  Thus I installed libcap2-bin and bridge-utils and I changed my 
/etc/network/interfaces to
  
  auto lo
  iface lo inet loopback
  auto eth0
  iface eth0 inet manual
  auto br0
  iface br0 inet static
-         address 192.168.115.15
-         network 192.168.115.0
-         netmask 255.255.255.0
-         broadcast 192.168.115.255
-         gateway 192.168.115.254
-         dns-nameservers 192.168.115.10
-         dns-search sirah.int
-         bridge_ports eth0
-         bridge_stp off
-         bridge_fd 0
-         bridge_maxwait 0
+         address 192.168.115.15
+         network 192.168.115.0
+         netmask 255.255.255.0
+         broadcast 192.168.115.255
+         gateway 192.168.115.254
+         dns-nameservers 192.168.115.10
+         dns-search sirah.int
+         bridge_ports eth0
+         bridge_stp off
+         bridge_fd 0
+         bridge_maxwait 0
  
  I executed
  sudo setcap cap_net_admin=ei /usr/bin/qemu-system-x86_64
  and edited /etc/security/capability.conf.
  
  The kvm command mentioned above worked on Ubuntu 12.04 with the same 
adjustments. There the machine started and it was bridged to my network.
  At the moment I'm using kvm version 1:84+dfsg-0ubuntu16+1.2.0+noroms+0ubuntu2.

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to kvm in Ubuntu.
https://bugs.launchpad.net/bugs/1091579

Title:
  Networking when starting kvm in commandline

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/kvm/+bug/1091579/+subscriptions

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to