{"id":22,"date":"2012-07-30T19:59:30","date_gmt":"2012-07-30T17:59:30","guid":{"rendered":"http:\/\/www.keinzweifel.ch\/?p=22"},"modified":"2018-03-05T21:03:57","modified_gmt":"2018-03-05T19:03:57","slug":"kvm-ifup-on-convirt","status":"publish","type":"post","link":"http:\/\/www.keinzweifel.ch\/?p=22","title":{"rendered":"kvm ifup on convirt"},"content":{"rendered":"<p>Some time ago a Kernel change broke a qemu-kvm feature known as ifup script.<\/p>\n<p>I came across this while i was installing convirt (a nice web management tool for not only kvm). New VMs with bridged ethernet just wouldnt start and spit out an error like:<\/p>\n<p><strong>could not configure \/dev\/net\/tun (tap%d): Operation not permitted <\/strong><\/p>\n<p>A few google searches later i tried the suggestion over linux capabilities (libcap2), but that did not worked for me. Also running the VMs as root was not an option!<\/p>\n<p>Luckily, \/usr\/sbin\/kvm is just a symlink on gentoo, so i made a little wrapper-script for creating the tap interfaces on demand!<\/p>\n<p>Be aware that your ifup-script might be called different, if youre not using convirt! I also had to set the suid bit on brctl as well as tunctl!<\/p>\n<p>#!\/bin\/bash<\/p>\n<p>setup_tap()<br \/>\n{<br \/>\nNEWTAP=`tunctl -u convirt | cut -d &#8220;&#8216;&#8221; -f 2`<br \/>\n\/sbin\/brctl addif br0 $NEWTAP<br \/>\n}<\/p>\n<p>for PARAM in $@; do<br \/>\nif `echo $PARAM | grep -q &#8220;qemu-ifup-br0&#8243; `; then<br \/>\nsetup_tap<br \/>\nNEWPARAM=`echo $PARAM | sed &#8216;s\/\/etc\/kvm\/qemu-ifup-br0\/no,ifname=&#8217;$NEWTAP&#8217;\/g&#8217;`<br \/>\nPARAMSTRING=&#8221;$PARAMSTRING<br \/>\n$NEWPARAM&#8221;<br \/>\nelse<br \/>\nPARAMSTRING=&#8221;$PARAMSTRING $PARAM&#8221;<br \/>\nfi<br \/>\ndone<\/p>\n<p>\/usr\/bin\/qemu-kvm $PARAMSTRING<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Some time ago a Kernel change broke a qemu-kvm feature known as ifup script. I came across this while i was installing convirt (a nice web management tool for not only kvm). New VMs with bridged ethernet just wouldnt start &hellip; <a href=\"http:\/\/www.keinzweifel.ch\/?p=22\">Weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,3],"tags":[],"_links":{"self":[{"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=\/wp\/v2\/posts\/22"}],"collection":[{"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=22"}],"version-history":[{"count":3,"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=\/wp\/v2\/posts\/22\/revisions"}],"predecessor-version":[{"id":26,"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=\/wp\/v2\/posts\/22\/revisions\/26"}],"wp:attachment":[{"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=22"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=22"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}