importing metasploitable to KVM using virsh












0















I am trying to install metasploitable on KVM. I am quite new to the linux environment, and therefore I Struggle with things that might be somewhat trivial. I am using this guide http://linux-hacking-guide.blogspot.com/2015/05/convert-vmware-virtual-machine-to-kvm.html
and are currently stuck on stage 6.



I am trying to install metasploitable 2 on KVM so I can boot it up in Virtual Machine Manager. So far I have done the following:



Installed metasploitable2.zip



I extracted Metasploitable.vmdk and converted to Metasploitable.qcow2
I created a directory on home/user/desktop called iso. And moved the Metasploitable.qcow2 inside of it



created a new user called qemu, and gave that user the rights to use the file with chown qemu:qemu Metasploitable.qcow2



i granted the new user qemu access to the iso directory with setfacl -m u:qemu:x /iso



I extracted Metasploitable.vmx from the Metasploitable.zip into the iso directory and converted it to xml with python vmware2libvirt -f Metasploitable.vmx > Metasploitable.xml



So far my iso directory has



Metasploitable.qcow2  Metasploitable.vmdk  Metasploitable.xml


Now comes the part where I am stuck, the guide says:




6) Use 'virsh' to import into KVM. Unfortunately, in this step, virsh
is looking for /usr/bin/kvm and the binary is actually installed as
/usr/libexec/qemu-kvm, so we need to make a symlink first.



[root@meru iso]# ln -s /usr/libexec/qemu-kvm /usr/bin/kvm



[root@meru iso]# virsh -c qemu:///system define Metasploitable.xml
Domain Metasploitable2-Linux defined from Metasploitable.xml




think the important part is the phrase the




binary is actually installed as /usr/libexec/qemu-kvm




However, I tried to continue with the steps to see if it granted any insight into the issue.



I checked to see if it existed, and it did not. There is no libexec inside of the usr directory.



ln -s /usr/libexec/qemu-kvm /usr/bin/kvm prompted me with: ln: failed to create symbolic link '/usr/bin/kvm': File exists



I controlled the usr/bin/kvm what it included and this is the inside of the kvm file.



#!/bin/sh
exec qemu-system-x86_64 -enable-kvm "$@"


However I tried to skip to the next part, and tried



virsh -c qemu:///system define Metasploitable.xml Domain Metasploitable2-Linux defined from Metasploitable.xml


and got prompted with ined from Metasploitable.xml
error: unexpected data 'Domain'



How can I work around this, is it obvious what to do, or should i abandon this and try to install it on virtualbox instead? (please no)










share|improve this question





























    0















    I am trying to install metasploitable on KVM. I am quite new to the linux environment, and therefore I Struggle with things that might be somewhat trivial. I am using this guide http://linux-hacking-guide.blogspot.com/2015/05/convert-vmware-virtual-machine-to-kvm.html
    and are currently stuck on stage 6.



    I am trying to install metasploitable 2 on KVM so I can boot it up in Virtual Machine Manager. So far I have done the following:



    Installed metasploitable2.zip



    I extracted Metasploitable.vmdk and converted to Metasploitable.qcow2
    I created a directory on home/user/desktop called iso. And moved the Metasploitable.qcow2 inside of it



    created a new user called qemu, and gave that user the rights to use the file with chown qemu:qemu Metasploitable.qcow2



    i granted the new user qemu access to the iso directory with setfacl -m u:qemu:x /iso



    I extracted Metasploitable.vmx from the Metasploitable.zip into the iso directory and converted it to xml with python vmware2libvirt -f Metasploitable.vmx > Metasploitable.xml



    So far my iso directory has



    Metasploitable.qcow2  Metasploitable.vmdk  Metasploitable.xml


    Now comes the part where I am stuck, the guide says:




    6) Use 'virsh' to import into KVM. Unfortunately, in this step, virsh
    is looking for /usr/bin/kvm and the binary is actually installed as
    /usr/libexec/qemu-kvm, so we need to make a symlink first.



    [root@meru iso]# ln -s /usr/libexec/qemu-kvm /usr/bin/kvm



    [root@meru iso]# virsh -c qemu:///system define Metasploitable.xml
    Domain Metasploitable2-Linux defined from Metasploitable.xml




    think the important part is the phrase the




    binary is actually installed as /usr/libexec/qemu-kvm




    However, I tried to continue with the steps to see if it granted any insight into the issue.



    I checked to see if it existed, and it did not. There is no libexec inside of the usr directory.



    ln -s /usr/libexec/qemu-kvm /usr/bin/kvm prompted me with: ln: failed to create symbolic link '/usr/bin/kvm': File exists



    I controlled the usr/bin/kvm what it included and this is the inside of the kvm file.



    #!/bin/sh
    exec qemu-system-x86_64 -enable-kvm "$@"


    However I tried to skip to the next part, and tried



    virsh -c qemu:///system define Metasploitable.xml Domain Metasploitable2-Linux defined from Metasploitable.xml


    and got prompted with ined from Metasploitable.xml
    error: unexpected data 'Domain'



    How can I work around this, is it obvious what to do, or should i abandon this and try to install it on virtualbox instead? (please no)










    share|improve this question



























      0












      0








      0








      I am trying to install metasploitable on KVM. I am quite new to the linux environment, and therefore I Struggle with things that might be somewhat trivial. I am using this guide http://linux-hacking-guide.blogspot.com/2015/05/convert-vmware-virtual-machine-to-kvm.html
      and are currently stuck on stage 6.



      I am trying to install metasploitable 2 on KVM so I can boot it up in Virtual Machine Manager. So far I have done the following:



      Installed metasploitable2.zip



      I extracted Metasploitable.vmdk and converted to Metasploitable.qcow2
      I created a directory on home/user/desktop called iso. And moved the Metasploitable.qcow2 inside of it



      created a new user called qemu, and gave that user the rights to use the file with chown qemu:qemu Metasploitable.qcow2



      i granted the new user qemu access to the iso directory with setfacl -m u:qemu:x /iso



      I extracted Metasploitable.vmx from the Metasploitable.zip into the iso directory and converted it to xml with python vmware2libvirt -f Metasploitable.vmx > Metasploitable.xml



      So far my iso directory has



      Metasploitable.qcow2  Metasploitable.vmdk  Metasploitable.xml


      Now comes the part where I am stuck, the guide says:




      6) Use 'virsh' to import into KVM. Unfortunately, in this step, virsh
      is looking for /usr/bin/kvm and the binary is actually installed as
      /usr/libexec/qemu-kvm, so we need to make a symlink first.



      [root@meru iso]# ln -s /usr/libexec/qemu-kvm /usr/bin/kvm



      [root@meru iso]# virsh -c qemu:///system define Metasploitable.xml
      Domain Metasploitable2-Linux defined from Metasploitable.xml




      think the important part is the phrase the




      binary is actually installed as /usr/libexec/qemu-kvm




      However, I tried to continue with the steps to see if it granted any insight into the issue.



      I checked to see if it existed, and it did not. There is no libexec inside of the usr directory.



      ln -s /usr/libexec/qemu-kvm /usr/bin/kvm prompted me with: ln: failed to create symbolic link '/usr/bin/kvm': File exists



      I controlled the usr/bin/kvm what it included and this is the inside of the kvm file.



      #!/bin/sh
      exec qemu-system-x86_64 -enable-kvm "$@"


      However I tried to skip to the next part, and tried



      virsh -c qemu:///system define Metasploitable.xml Domain Metasploitable2-Linux defined from Metasploitable.xml


      and got prompted with ined from Metasploitable.xml
      error: unexpected data 'Domain'



      How can I work around this, is it obvious what to do, or should i abandon this and try to install it on virtualbox instead? (please no)










      share|improve this question
















      I am trying to install metasploitable on KVM. I am quite new to the linux environment, and therefore I Struggle with things that might be somewhat trivial. I am using this guide http://linux-hacking-guide.blogspot.com/2015/05/convert-vmware-virtual-machine-to-kvm.html
      and are currently stuck on stage 6.



      I am trying to install metasploitable 2 on KVM so I can boot it up in Virtual Machine Manager. So far I have done the following:



      Installed metasploitable2.zip



      I extracted Metasploitable.vmdk and converted to Metasploitable.qcow2
      I created a directory on home/user/desktop called iso. And moved the Metasploitable.qcow2 inside of it



      created a new user called qemu, and gave that user the rights to use the file with chown qemu:qemu Metasploitable.qcow2



      i granted the new user qemu access to the iso directory with setfacl -m u:qemu:x /iso



      I extracted Metasploitable.vmx from the Metasploitable.zip into the iso directory and converted it to xml with python vmware2libvirt -f Metasploitable.vmx > Metasploitable.xml



      So far my iso directory has



      Metasploitable.qcow2  Metasploitable.vmdk  Metasploitable.xml


      Now comes the part where I am stuck, the guide says:




      6) Use 'virsh' to import into KVM. Unfortunately, in this step, virsh
      is looking for /usr/bin/kvm and the binary is actually installed as
      /usr/libexec/qemu-kvm, so we need to make a symlink first.



      [root@meru iso]# ln -s /usr/libexec/qemu-kvm /usr/bin/kvm



      [root@meru iso]# virsh -c qemu:///system define Metasploitable.xml
      Domain Metasploitable2-Linux defined from Metasploitable.xml




      think the important part is the phrase the




      binary is actually installed as /usr/libexec/qemu-kvm




      However, I tried to continue with the steps to see if it granted any insight into the issue.



      I checked to see if it existed, and it did not. There is no libexec inside of the usr directory.



      ln -s /usr/libexec/qemu-kvm /usr/bin/kvm prompted me with: ln: failed to create symbolic link '/usr/bin/kvm': File exists



      I controlled the usr/bin/kvm what it included and this is the inside of the kvm file.



      #!/bin/sh
      exec qemu-system-x86_64 -enable-kvm "$@"


      However I tried to skip to the next part, and tried



      virsh -c qemu:///system define Metasploitable.xml Domain Metasploitable2-Linux defined from Metasploitable.xml


      and got prompted with ined from Metasploitable.xml
      error: unexpected data 'Domain'



      How can I work around this, is it obvious what to do, or should i abandon this and try to install it on virtualbox instead? (please no)







      virtualbox kvm metasploit






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 26 at 10:57







      Jonas Grønbek

















      asked Feb 26 at 10:50









      Jonas GrønbekJonas Grønbek

      1507




      1507






















          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%2f1121367%2fimporting-metasploitable-to-kvm-using-virsh%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%2f1121367%2fimporting-metasploitable-to-kvm-using-virsh%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

          flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

          Mangá

          Eduardo VII do Reino Unido