How do I mount a qcow2 disk image?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
18
down vote

favorite
2












I have a QEMU virtual machine that uses a qcow2 disk image.



How can I mount its filesystem without powering on the virtual machine?










share|improve this question

























    up vote
    18
    down vote

    favorite
    2












    I have a QEMU virtual machine that uses a qcow2 disk image.



    How can I mount its filesystem without powering on the virtual machine?










    share|improve this question























      up vote
      18
      down vote

      favorite
      2









      up vote
      18
      down vote

      favorite
      2






      2





      I have a QEMU virtual machine that uses a qcow2 disk image.



      How can I mount its filesystem without powering on the virtual machine?










      share|improve this question













      I have a QEMU virtual machine that uses a qcow2 disk image.



      How can I mount its filesystem without powering on the virtual machine?







      mount virtualization qemu






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 19 '10 at 22:36









      ændrük

      40.7k59190336




      40.7k59190336




















          4 Answers
          4






          active

          oldest

          votes

















          up vote
          15
          down vote



          accepted










          A quick google search turns up the qemu-nbd program, mentioned here. It is part of the qemu-kvm package, so you'll have to install KVM if you aren't using that already. Not sure about any direct GNOME/KDE solutions, if that is what you were looking for.






          share|improve this answer


















          • 2




            Looks like qemu-nbd is the best way to go, as long as I remember to modprobe nbd first. qemu-nbd fails silently if this module has not been loaded!
            – ændrük
            Sep 24 '10 at 16:03











          • That's unfortunate. You should be able to add nbd to /etc/modules, anyway.
            – Tim Yates
            Sep 24 '10 at 16:54










          • I wrote a little tool to wrap this up: github.com/JonathonReinhart/qcow2-explore
            – Jonathon Reinhart
            Nov 23 '16 at 1:49

















          up vote
          3
          down vote













          There's also libguestfs, but it's not yet available from official repositories1. There are binaries in libguestfs.org though.






          share|improve this answer






















          • While libguestfs looks really nice, but is heavyweight. It has a ton of dependencies (It recommends up to 55 dependencies, and installs an entire supermin appliance.
            – Stefan Lasiewski
            Mar 4 '13 at 5:53

















          up vote
          -1
          down vote













          xmount can make the disk images of some VMs look like a raw disk (which can then be partitioned with losetup, and the partitions mounted). I don't know if it supports qcow2, however.






          share|improve this answer




















          • The xmount manual states that only EWF and raw disk images can be used.
            – ændrük
            Sep 21 '10 at 2:21

















          up vote
          -2
          down vote













          you can directly mount as a normal mount like this



          mount /dev/sdb1 /mount-point


          But if u have n number of device mean you want again mount it to another directory for
          that you can follow this one:



          Mounting a partition from raw image is pretty simple:



          losetup /dev/loop0 image.img
          kpartx -a /dev/loop0
          mount /dev/mapper/loop0p1 /mnt/image





          share|improve this answer


















          • 1




            A qcow2 image is not a raw image, and can't be mounted through either of those approaches.
            – Twirrim
            Mar 15 at 23:03










          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',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          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%2f4396%2fhow-do-i-mount-a-qcow2-disk-image%23new-answer', 'question_page');

          );

          Post as a guest






























          4 Answers
          4






          active

          oldest

          votes








          4 Answers
          4






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          15
          down vote



          accepted










          A quick google search turns up the qemu-nbd program, mentioned here. It is part of the qemu-kvm package, so you'll have to install KVM if you aren't using that already. Not sure about any direct GNOME/KDE solutions, if that is what you were looking for.






          share|improve this answer


















          • 2




            Looks like qemu-nbd is the best way to go, as long as I remember to modprobe nbd first. qemu-nbd fails silently if this module has not been loaded!
            – ændrük
            Sep 24 '10 at 16:03











          • That's unfortunate. You should be able to add nbd to /etc/modules, anyway.
            – Tim Yates
            Sep 24 '10 at 16:54










          • I wrote a little tool to wrap this up: github.com/JonathonReinhart/qcow2-explore
            – Jonathon Reinhart
            Nov 23 '16 at 1:49














          up vote
          15
          down vote



          accepted










          A quick google search turns up the qemu-nbd program, mentioned here. It is part of the qemu-kvm package, so you'll have to install KVM if you aren't using that already. Not sure about any direct GNOME/KDE solutions, if that is what you were looking for.






          share|improve this answer


















          • 2




            Looks like qemu-nbd is the best way to go, as long as I remember to modprobe nbd first. qemu-nbd fails silently if this module has not been loaded!
            – ændrük
            Sep 24 '10 at 16:03











          • That's unfortunate. You should be able to add nbd to /etc/modules, anyway.
            – Tim Yates
            Sep 24 '10 at 16:54










          • I wrote a little tool to wrap this up: github.com/JonathonReinhart/qcow2-explore
            – Jonathon Reinhart
            Nov 23 '16 at 1:49












          up vote
          15
          down vote



          accepted







          up vote
          15
          down vote



          accepted






          A quick google search turns up the qemu-nbd program, mentioned here. It is part of the qemu-kvm package, so you'll have to install KVM if you aren't using that already. Not sure about any direct GNOME/KDE solutions, if that is what you were looking for.






          share|improve this answer














          A quick google search turns up the qemu-nbd program, mentioned here. It is part of the qemu-kvm package, so you'll have to install KVM if you aren't using that already. Not sure about any direct GNOME/KDE solutions, if that is what you were looking for.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jun 23 '15 at 9:28









          Cristian Ciupitu

          15112




          15112










          answered Sep 20 '10 at 1:08









          Tim Yates

          26623




          26623







          • 2




            Looks like qemu-nbd is the best way to go, as long as I remember to modprobe nbd first. qemu-nbd fails silently if this module has not been loaded!
            – ændrük
            Sep 24 '10 at 16:03











          • That's unfortunate. You should be able to add nbd to /etc/modules, anyway.
            – Tim Yates
            Sep 24 '10 at 16:54










          • I wrote a little tool to wrap this up: github.com/JonathonReinhart/qcow2-explore
            – Jonathon Reinhart
            Nov 23 '16 at 1:49












          • 2




            Looks like qemu-nbd is the best way to go, as long as I remember to modprobe nbd first. qemu-nbd fails silently if this module has not been loaded!
            – ændrük
            Sep 24 '10 at 16:03











          • That's unfortunate. You should be able to add nbd to /etc/modules, anyway.
            – Tim Yates
            Sep 24 '10 at 16:54










          • I wrote a little tool to wrap this up: github.com/JonathonReinhart/qcow2-explore
            – Jonathon Reinhart
            Nov 23 '16 at 1:49







          2




          2




          Looks like qemu-nbd is the best way to go, as long as I remember to modprobe nbd first. qemu-nbd fails silently if this module has not been loaded!
          – ændrük
          Sep 24 '10 at 16:03





          Looks like qemu-nbd is the best way to go, as long as I remember to modprobe nbd first. qemu-nbd fails silently if this module has not been loaded!
          – ændrük
          Sep 24 '10 at 16:03













          That's unfortunate. You should be able to add nbd to /etc/modules, anyway.
          – Tim Yates
          Sep 24 '10 at 16:54




          That's unfortunate. You should be able to add nbd to /etc/modules, anyway.
          – Tim Yates
          Sep 24 '10 at 16:54












          I wrote a little tool to wrap this up: github.com/JonathonReinhart/qcow2-explore
          – Jonathon Reinhart
          Nov 23 '16 at 1:49




          I wrote a little tool to wrap this up: github.com/JonathonReinhart/qcow2-explore
          – Jonathon Reinhart
          Nov 23 '16 at 1:49












          up vote
          3
          down vote













          There's also libguestfs, but it's not yet available from official repositories1. There are binaries in libguestfs.org though.






          share|improve this answer






















          • While libguestfs looks really nice, but is heavyweight. It has a ton of dependencies (It recommends up to 55 dependencies, and installs an entire supermin appliance.
            – Stefan Lasiewski
            Mar 4 '13 at 5:53














          up vote
          3
          down vote













          There's also libguestfs, but it's not yet available from official repositories1. There are binaries in libguestfs.org though.






          share|improve this answer






















          • While libguestfs looks really nice, but is heavyweight. It has a ton of dependencies (It recommends up to 55 dependencies, and installs an entire supermin appliance.
            – Stefan Lasiewski
            Mar 4 '13 at 5:53












          up vote
          3
          down vote










          up vote
          3
          down vote









          There's also libguestfs, but it's not yet available from official repositories1. There are binaries in libguestfs.org though.






          share|improve this answer














          There's also libguestfs, but it's not yet available from official repositories1. There are binaries in libguestfs.org though.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 20 '15 at 19:21









          Community♦

          1




          1










          answered Sep 16 '11 at 22:14









          sendmoreinfo

          21437




          21437











          • While libguestfs looks really nice, but is heavyweight. It has a ton of dependencies (It recommends up to 55 dependencies, and installs an entire supermin appliance.
            – Stefan Lasiewski
            Mar 4 '13 at 5:53
















          • While libguestfs looks really nice, but is heavyweight. It has a ton of dependencies (It recommends up to 55 dependencies, and installs an entire supermin appliance.
            – Stefan Lasiewski
            Mar 4 '13 at 5:53















          While libguestfs looks really nice, but is heavyweight. It has a ton of dependencies (It recommends up to 55 dependencies, and installs an entire supermin appliance.
          – Stefan Lasiewski
          Mar 4 '13 at 5:53




          While libguestfs looks really nice, but is heavyweight. It has a ton of dependencies (It recommends up to 55 dependencies, and installs an entire supermin appliance.
          – Stefan Lasiewski
          Mar 4 '13 at 5:53










          up vote
          -1
          down vote













          xmount can make the disk images of some VMs look like a raw disk (which can then be partitioned with losetup, and the partitions mounted). I don't know if it supports qcow2, however.






          share|improve this answer




















          • The xmount manual states that only EWF and raw disk images can be used.
            – ændrük
            Sep 21 '10 at 2:21














          up vote
          -1
          down vote













          xmount can make the disk images of some VMs look like a raw disk (which can then be partitioned with losetup, and the partitions mounted). I don't know if it supports qcow2, however.






          share|improve this answer




















          • The xmount manual states that only EWF and raw disk images can be used.
            – ændrük
            Sep 21 '10 at 2:21












          up vote
          -1
          down vote










          up vote
          -1
          down vote









          xmount can make the disk images of some VMs look like a raw disk (which can then be partitioned with losetup, and the partitions mounted). I don't know if it supports qcow2, however.






          share|improve this answer












          xmount can make the disk images of some VMs look like a raw disk (which can then be partitioned with losetup, and the partitions mounted). I don't know if it supports qcow2, however.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 20 '10 at 23:59









          Gilles

          43.6k1398137




          43.6k1398137











          • The xmount manual states that only EWF and raw disk images can be used.
            – ændrük
            Sep 21 '10 at 2:21
















          • The xmount manual states that only EWF and raw disk images can be used.
            – ændrük
            Sep 21 '10 at 2:21















          The xmount manual states that only EWF and raw disk images can be used.
          – ændrük
          Sep 21 '10 at 2:21




          The xmount manual states that only EWF and raw disk images can be used.
          – ændrük
          Sep 21 '10 at 2:21










          up vote
          -2
          down vote













          you can directly mount as a normal mount like this



          mount /dev/sdb1 /mount-point


          But if u have n number of device mean you want again mount it to another directory for
          that you can follow this one:



          Mounting a partition from raw image is pretty simple:



          losetup /dev/loop0 image.img
          kpartx -a /dev/loop0
          mount /dev/mapper/loop0p1 /mnt/image





          share|improve this answer


















          • 1




            A qcow2 image is not a raw image, and can't be mounted through either of those approaches.
            – Twirrim
            Mar 15 at 23:03














          up vote
          -2
          down vote













          you can directly mount as a normal mount like this



          mount /dev/sdb1 /mount-point


          But if u have n number of device mean you want again mount it to another directory for
          that you can follow this one:



          Mounting a partition from raw image is pretty simple:



          losetup /dev/loop0 image.img
          kpartx -a /dev/loop0
          mount /dev/mapper/loop0p1 /mnt/image





          share|improve this answer


















          • 1




            A qcow2 image is not a raw image, and can't be mounted through either of those approaches.
            – Twirrim
            Mar 15 at 23:03












          up vote
          -2
          down vote










          up vote
          -2
          down vote









          you can directly mount as a normal mount like this



          mount /dev/sdb1 /mount-point


          But if u have n number of device mean you want again mount it to another directory for
          that you can follow this one:



          Mounting a partition from raw image is pretty simple:



          losetup /dev/loop0 image.img
          kpartx -a /dev/loop0
          mount /dev/mapper/loop0p1 /mnt/image





          share|improve this answer














          you can directly mount as a normal mount like this



          mount /dev/sdb1 /mount-point


          But if u have n number of device mean you want again mount it to another directory for
          that you can follow this one:



          Mounting a partition from raw image is pretty simple:



          losetup /dev/loop0 image.img
          kpartx -a /dev/loop0
          mount /dev/mapper/loop0p1 /mnt/image






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 28 '14 at 5:52

























          answered Feb 28 '14 at 4:50









          Premkumar

          310211




          310211







          • 1




            A qcow2 image is not a raw image, and can't be mounted through either of those approaches.
            – Twirrim
            Mar 15 at 23:03












          • 1




            A qcow2 image is not a raw image, and can't be mounted through either of those approaches.
            – Twirrim
            Mar 15 at 23:03







          1




          1




          A qcow2 image is not a raw image, and can't be mounted through either of those approaches.
          – Twirrim
          Mar 15 at 23:03




          A qcow2 image is not a raw image, and can't be mounted through either of those approaches.
          – Twirrim
          Mar 15 at 23:03

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f4396%2fhow-do-i-mount-a-qcow2-disk-image%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          pylint3 and pip3 broken

          Missing snmpget and snmpwalk

          How to enroll fingerprints to Ubuntu 17.10 with VFS491