{"id":582,"date":"2014-09-14T17:12:59","date_gmt":"2014-09-14T23:12:59","guid":{"rendered":"http:\/\/rrbits.com\/epb\/?p=582"},"modified":"2014-09-14T17:16:08","modified_gmt":"2014-09-14T23:16:08","slug":"mount-a-vhd-or-vdi-in-linux-with-vdfuse","status":"publish","type":"post","link":"https:\/\/rrbits.com\/epb\/2014\/09\/14\/mount-a-vhd-or-vdi-in-linux-with-vdfuse\/","title":{"rendered":"Mount a VHD or VDI in Linux with vdfuse"},"content":{"rendered":"<p>My old post on mounting VHDs in Linux is rather outdated.  I don&#8217;t think it even works anymore.  So revisiting this on a newer Ubuntu version now.  These instructions are for Ubuntu 14.04, so for other OS installs.  You&#8217;ll also need your compiler installed, so you may need to run <code><strong>sudo apt-get install build-essential<\/strong><\/code> to get them before proceeding.<\/p>\n<p><!--more--><\/p>\n<p>First we need some prequisites, you&#8217;ll need the virtualbox and libfuse-dev packages to be installed.<\/p>\n<pre>sudo apt-get install virtualbox libfuse-dev<\/pre>\n<p>Now you should get vdfuse for the newer versions of VirtualBox.  It&#8217;s available in this github repo here: <a href=\"https:\/\/github.com\/Thorsten-Sick\/vdfuse\">https:\/\/github.com\/Thorsten-Sick\/vdfuse<\/a><\/p>\n<p>If you have git, simply run this command:<\/p>\n<pre>git clone https:\/\/github.com\/Thorsten-Sick\/vdfuse.git<\/pre>\n<p>Next change directory into vdfuse (e.g. <code><strong>cd vdfuse<\/strong><\/code>)<\/p>\n<blockquote><p>NOTE: The following example commands reference a specific version of VirtualBox, if you download a different version, be sure to replace the version number in the following commands.<\/p><\/blockquote>\n<p>Now we need the includes folder from the source.  Again, this uses VirtualBox 4.3.16, so replace with the current version number. (Instead of using wget, you can also download the source with your browser which removes the need to figure out what the current version of VirtualBox is. <a href=\"https:\/\/www.virtualbox.org\/wiki\/Downloads\"><\/a>)<\/p>\n<pre>\r\nwget http:\/\/download.virtualbox.org\/virtualbox\/4.3.16\/VirtualBox-4.3.16.tar.bz2\r\ntar xvjf VirtualBox-4.3.16.tar.bz2 VirtualBox-4.3.16\/include\r\n<\/pre>\n<p>Now, we build vdfuse.<\/p>\n<pre>sh vdbuild_new VirtualBox-4.3.16\/include vdfuse.c<\/pre>\n<p>If all went well, you should now have an executable called <code>vdfuse<\/code> in your vdfuse folder.  Optionally, you can now copy it to \/usr\/local\/bin or \/usr\/bin so any user on the system can use it.  We&#8217;re almost done, there&#8217;s one fuse configuration change that is required.<\/p>\n<p>First, we make sure that users other than root can read <code>\/etc\/fuse.conf<\/code><\/p>\n<pre>sudo chmod o+r \/etc\/fuse.conf<\/pre>\n<p>And then you need to edit <code>\/etc\/fuse.conf<\/code> to have a line that reads <code>user_allow_other<\/code>.<\/p>\n<p>Once you have done that, you should now be able to actually run your <code>vdfuse<\/code> executable.  The entire disk and it&#8217;s partions are exposed as regular files in the target mount point.  These can be loopback mounted like any other file.<\/p>\n<p>An example from my machine:<\/p>\n<pre>vdfuse -f \"~\/VirtualBox VMs\/Test\/Test.vdi\" ~\/Test\r\nls -l ~\/Test\r\n-rw------- 1 1001 1001 144570624 Sep 14 12:18 EntireDisk\r\n-rw------- 1 1001 1001  93214208 Sep 14 12:18 Partition1\r\n-rw------- 1 1001 1001  51323392 Sep 14 12:18 Partition2<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>My old post on mounting VHDs in Linux is rather outdated. I don&#8217;t think it even works anymore. So revisiting this on a newer Ubuntu version now. These instructions are for Ubuntu 14.04, so for other OS installs. You&#8217;ll also need your compiler installed, so you may need to run sudo apt-get install build-essential to&#8230;  <a class=\"excerpt-read-more\" href=\"https:\/\/rrbits.com\/epb\/2014\/09\/14\/mount-a-vhd-or-vdi-in-linux-with-vdfuse\/\" title=\"ReadMount a VHD or VDI in Linux with vdfuse\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42],"tags":[4263,3997,4261,154],"class_list":["post-582","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux","tag-problem","tag-vdi","tag-vhd"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/posts\/582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/comments?post=582"}],"version-history":[{"count":3,"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/posts\/582\/revisions"}],"predecessor-version":[{"id":585,"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/posts\/582\/revisions\/585"}],"wp:attachment":[{"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/media?parent=582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/categories?post=582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/tags?post=582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}