Cannot use OVS commands with libvirt












0















I have an Ubuntu 18.04 on which I have installed OVS. I have created a bridge 'br1', and the output of



$sudo ovs-vsctl show
Bridge "br1"
Port "enp0s25"
Interface "enp0s25"
Port "br1"
Interface "br1"
type: internal


I am now trying to create VMs with virt-install and have them create a port on the OVS bridge and connect to it. Following the virt-install manual, in my VM configuration file I added:



  <interface type='bridge'>
<source bridge='br1'/>
<virtualport type='openvswitch'>
</virtualport>
<target dev='tap0'/>
<model type='rtl8139'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</interface>


And when I try to start the VM I get the following error:



internal error: Unable to add port tap0 to OVS bridge br1


And looking further into the libvirt logs I found:



libvirtd[2926]: 2018-12-11 11:53:10.382+0000: 2930: error : virCommandWait:2601 : 
internal error: Child process (ovs-vsctl --timeout=5 -- --if-exists del-port tap0 --
add-port br1 tap0 -- set Interface tap0 'external-ids:attached-mac="52:54:00:2a:06:e1"' --
set Interface tap0 'external-ids:iface-id="cb219442-93ba-496e-a93d-717beef4c88f"'
-- set Interface tap0 'external-ids:vm-id="0d728eea-bea0-4cfa-ae49-41367f0d65c6"' --
set Interface tap0 external-ids:iface-status=active) unexpected exit status 126:
libvirt: error : cannot execute binary ovs-vsctl: Permission denied


To use the OVS commands like ovs-vsctl you need to use sudo, so my user is in the sudoers group, but I can't manage to get this to work.



Any idea is welcome and kindly appreciated. Thank you, and have a nice day :)










share|improve this question





























    0















    I have an Ubuntu 18.04 on which I have installed OVS. I have created a bridge 'br1', and the output of



    $sudo ovs-vsctl show
    Bridge "br1"
    Port "enp0s25"
    Interface "enp0s25"
    Port "br1"
    Interface "br1"
    type: internal


    I am now trying to create VMs with virt-install and have them create a port on the OVS bridge and connect to it. Following the virt-install manual, in my VM configuration file I added:



      <interface type='bridge'>
    <source bridge='br1'/>
    <virtualport type='openvswitch'>
    </virtualport>
    <target dev='tap0'/>
    <model type='rtl8139'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </interface>


    And when I try to start the VM I get the following error:



    internal error: Unable to add port tap0 to OVS bridge br1


    And looking further into the libvirt logs I found:



    libvirtd[2926]: 2018-12-11 11:53:10.382+0000: 2930: error : virCommandWait:2601 : 
    internal error: Child process (ovs-vsctl --timeout=5 -- --if-exists del-port tap0 --
    add-port br1 tap0 -- set Interface tap0 'external-ids:attached-mac="52:54:00:2a:06:e1"' --
    set Interface tap0 'external-ids:iface-id="cb219442-93ba-496e-a93d-717beef4c88f"'
    -- set Interface tap0 'external-ids:vm-id="0d728eea-bea0-4cfa-ae49-41367f0d65c6"' --
    set Interface tap0 external-ids:iface-status=active) unexpected exit status 126:
    libvirt: error : cannot execute binary ovs-vsctl: Permission denied


    To use the OVS commands like ovs-vsctl you need to use sudo, so my user is in the sudoers group, but I can't manage to get this to work.



    Any idea is welcome and kindly appreciated. Thank you, and have a nice day :)










    share|improve this question



























      0












      0








      0








      I have an Ubuntu 18.04 on which I have installed OVS. I have created a bridge 'br1', and the output of



      $sudo ovs-vsctl show
      Bridge "br1"
      Port "enp0s25"
      Interface "enp0s25"
      Port "br1"
      Interface "br1"
      type: internal


      I am now trying to create VMs with virt-install and have them create a port on the OVS bridge and connect to it. Following the virt-install manual, in my VM configuration file I added:



        <interface type='bridge'>
      <source bridge='br1'/>
      <virtualport type='openvswitch'>
      </virtualport>
      <target dev='tap0'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
      </interface>


      And when I try to start the VM I get the following error:



      internal error: Unable to add port tap0 to OVS bridge br1


      And looking further into the libvirt logs I found:



      libvirtd[2926]: 2018-12-11 11:53:10.382+0000: 2930: error : virCommandWait:2601 : 
      internal error: Child process (ovs-vsctl --timeout=5 -- --if-exists del-port tap0 --
      add-port br1 tap0 -- set Interface tap0 'external-ids:attached-mac="52:54:00:2a:06:e1"' --
      set Interface tap0 'external-ids:iface-id="cb219442-93ba-496e-a93d-717beef4c88f"'
      -- set Interface tap0 'external-ids:vm-id="0d728eea-bea0-4cfa-ae49-41367f0d65c6"' --
      set Interface tap0 external-ids:iface-status=active) unexpected exit status 126:
      libvirt: error : cannot execute binary ovs-vsctl: Permission denied


      To use the OVS commands like ovs-vsctl you need to use sudo, so my user is in the sudoers group, but I can't manage to get this to work.



      Any idea is welcome and kindly appreciated. Thank you, and have a nice day :)










      share|improve this question
















      I have an Ubuntu 18.04 on which I have installed OVS. I have created a bridge 'br1', and the output of



      $sudo ovs-vsctl show
      Bridge "br1"
      Port "enp0s25"
      Interface "enp0s25"
      Port "br1"
      Interface "br1"
      type: internal


      I am now trying to create VMs with virt-install and have them create a port on the OVS bridge and connect to it. Following the virt-install manual, in my VM configuration file I added:



        <interface type='bridge'>
      <source bridge='br1'/>
      <virtualport type='openvswitch'>
      </virtualport>
      <target dev='tap0'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
      </interface>


      And when I try to start the VM I get the following error:



      internal error: Unable to add port tap0 to OVS bridge br1


      And looking further into the libvirt logs I found:



      libvirtd[2926]: 2018-12-11 11:53:10.382+0000: 2930: error : virCommandWait:2601 : 
      internal error: Child process (ovs-vsctl --timeout=5 -- --if-exists del-port tap0 --
      add-port br1 tap0 -- set Interface tap0 'external-ids:attached-mac="52:54:00:2a:06:e1"' --
      set Interface tap0 'external-ids:iface-id="cb219442-93ba-496e-a93d-717beef4c88f"'
      -- set Interface tap0 'external-ids:vm-id="0d728eea-bea0-4cfa-ae49-41367f0d65c6"' --
      set Interface tap0 external-ids:iface-status=active) unexpected exit status 126:
      libvirt: error : cannot execute binary ovs-vsctl: Permission denied


      To use the OVS commands like ovs-vsctl you need to use sudo, so my user is in the sudoers group, but I can't manage to get this to work.



      Any idea is welcome and kindly appreciated. Thank you, and have a nice day :)







      permissions sudo virtualization kvm






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 12 '18 at 9:42







      eguijarro

















      asked Dec 12 '18 at 9:31









      eguijarroeguijarro

      13




      13






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1100262%2fcannot-use-ovs-commands-with-libvirt%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1100262%2fcannot-use-ovs-commands-with-libvirt%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to send String Array data to Server using php in android

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

          Is anime1.com a legal site for watching anime?