{"id":3263,"date":"2024-01-20T08:21:50","date_gmt":"2024-01-20T08:21:50","guid":{"rendered":"https:\/\/voodoo.business\/?p=3263"},"modified":"2024-01-20T11:30:13","modified_gmt":"2024-01-20T11:30:13","slug":"mounting-various-image-files-in-linux","status":"publish","type":"post","link":"https:\/\/www.voodoo.business\/blog\/2024\/01\/20\/mounting-various-image-files-in-linux\/","title":{"rendered":"Mounting various image files in Linux"},"content":{"rendered":"\n<p>Hyper-v disk files, with extensions such as vhdx and vhd can be mounted under linux directly with the  libguestfs-tools tool, mind you, many packages will be installed&#8230; mostly libraries relating to the formats it is capable of mounting<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get install libguestfs-tools<\/pre>\n\n\n\n<p>Now, the following command should mount the disk inside the virtual machine<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">guestmount --add diskname.vhdx --inspector \/mount\/dir\/name<\/pre>\n\n\n\n<p>If the system does not detect a system, you will need to tell guestmount what partition to mount, to explore the partitions, you will need &#8230;.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> virt-filesystems -a disk.vhdx<\/pre>\n\n\n\n<p>Once you know your partitions<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">guestmount --add disk_d.vhdx -m \/dev\/sda1  \/hds\/loop<\/pre>\n\n\n\n<p>If you would rather mount the disk as read only, you can add the &#8211;ro switch<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">guestmount --add yourVirtualDisk.vhdx --inspector --ro \/mnt\/anydirectory<\/pre>\n\n\n\n<p>To unmount, you will need to use the following command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">guestunmount \/mnt\/anydirectory<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Hyper-v disk files, with extensions such as vhdx and vhd can be mounted under linux directly with the libguestfs-tools tool, mind you, many packages will be installed&#8230; mostly libraries relating to the formats it is capable of mounting sudo apt-get install libguestfs-tools Now, the following command should mount the disk inside the virtual machine guestmount [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,156],"tags":[],"class_list":["post-3263","post","type-post","status-publish","format-standard","hentry","category-linux","category-storage"],"_links":{"self":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/3263","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/comments?post=3263"}],"version-history":[{"count":6,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/3263\/revisions"}],"predecessor-version":[{"id":3271,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/3263\/revisions\/3271"}],"wp:attachment":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/media?parent=3263"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/categories?post=3263"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/tags?post=3263"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}