{"id":33851,"date":"2021-05-28T16:46:05","date_gmt":"2021-05-28T16:46:05","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=33851"},"modified":"2021-05-28T16:46:05","modified_gmt":"2021-05-28T16:46:05","slug":"mount-virtualbox-vdi-ubuntu","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2021\/05\/mount-virtualbox-vdi-ubuntu\/","title":{"rendered":"How to Mount VirtualBox Disk Image (VDI) to Access VM File-System in Ubuntu"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2016\/07\/virtualbox-icon245.png\" alt=\"Virtualbox\" width=\"245\" height=\"250\" class=\"alignleft size-full wp-image-6036\" \/><\/p>\n<p>This tutorial shows how to mount the VirtualBox virtual disk image in Ubuntu, so you can access the Guest OS file system with read and write permission, if it does not boot.<\/p>\n<p>After misconfigured my VirtualBox Guest OS, it does not longer work. I know how to correct the issue to make it boot again, but firstly accessing to the file system is required!<\/p>\n<p>Since the VBox user manual does not work, here&#8217;s what I did in Ubuntu 20.04 host with VirtualBox 6.1.x:<\/p>\n<div class=\"arconix-box arconix-box-red\"><i class='fa fa-2x pull-left fa-exclamation-triangle'><\/i><div class=\"arconix-box-content\">Before getting started, make sure Guest OS is shutdown. And the disk image is not in use. Also UN-MOUNT the disk once the job done.<\/div><\/div>\n<p><b>1.)<\/b> Firstly open terminal from system application launcher. When it opens, run command:<\/p>\n<pre style=\"border:none;\">vboximg-mount --list<\/pre>\n<p>vboximg-mount is a utility to make VBox disk images available to the host. With <code>--list<\/code>, it list all Disk Images as well as the UUID.<\/p>\n<p>In the case, I have all Guest OSes on single Disk Image (.vdi). And the uuid is: &#8220;3db5fd91-fd56-46af-a2d2-98cd62b05ea3&#8221;<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/list-vm-uuid.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/list-vm-uuid-600x388.jpg\" alt=\"\" width=\"600\" height=\"388\" class=\"aligncenter size-large wp-image-33852\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/list-vm-uuid-600x388.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/list-vm-uuid-300x194.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/list-vm-uuid-768x497.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/list-vm-uuid.jpg 838w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p><b>2.)<\/b> Next perform a FUSE mount of the virtual disk image:<\/p>\n<ul>\n<li>First create a folder as mount point, <i>vbox_sysdisk<\/i> for instance:\n<pre style=\"border:none;\">mkdir vbox_sysdisk<\/pre>\n<\/li>\n<li>Then mount it via command (<i>remember to change the UUID to yours<\/i>):\n<pre style=\"border:none;\">vboximg-mount -i 3db5fd91-fd56-46af-a2d2-98cd62b05ea3 -o allow_root vbox_sysdisk<\/pre>\n<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/mount-vdi.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/mount-vdi-600x349.jpg\" alt=\"\" width=\"600\" height=\"349\" class=\"aligncenter size-large wp-image-33853\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/mount-vdi-600x349.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/mount-vdi-300x175.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/mount-vdi-768x447.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/mount-vdi.jpg 863w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>NOTE: You may need to edit the &#8220;\/etc\/fuse.conf&#8221; to make the <code>-o allow_root<\/code> flag work. To do so, run command <i><b>sudo gedit \/etc\/fuse.conf<\/b><\/i> and enable (remove # at its beginning) &#8220;user_allow_other&#8221; line.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/fuse-allownonroot.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/fuse-allownonroot-600x278.jpg\" alt=\"\" width=\"600\" height=\"278\" class=\"aligncenter size-large wp-image-33854\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/fuse-allownonroot-600x278.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/fuse-allownonroot-300x139.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/fuse-allownonroot-768x356.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/fuse-allownonroot.jpg 813w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p><b>3.)<\/b> As the previous picture shows, I have 5 disk partitions: vol0, vol1, &#8230;, vol4. Now mount either partition (<i>vol4 for instance<\/i>) to <b>\/mnt<\/b> via command:<\/p>\n<pre style=\"border:none;\">sudo mount vbox_sysdis\/vol4 \/mnt<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/mount-vdi-partition.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/mount-vdi-partition-600x265.jpg\" alt=\"\" width=\"600\" height=\"265\" class=\"aligncenter size-large wp-image-33855\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/mount-vdi-partition-600x265.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/mount-vdi-partition-300x133.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/mount-vdi-partition-768x339.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/mount-vdi-partition.jpg 801w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Finally go to \/mnt directory and there you are.<\/p>\n<h3>Unmount:<\/h3>\n<p>To un-mount the guest os file system, run command:<\/p>\n<pre style=\"border:none;\">sudo umount \/mnt<\/pre>\n<p>To un-mount the VBox disk image, run command:<\/p>\n<pre style=\"border:none;\">umount ~\/vbox_sysdisk<\/pre>\n<p>And you may finally remove that folder either from file manager or by running command in terminal:<\/p>\n<pre style=\"border:none;\">rm -r ~\/vbox_sysdisk<\/pre>","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to mount the VirtualBox virtual disk image in Ubuntu, so you can access the Guest OS file system with read and write permission, if it does not boot. After misconfigured my VirtualBox Guest OS, it does not longer work. I know how to correct the issue to make it boot again, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":33750,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[38],"class_list":["post-33851","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-virtualbox"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/33851","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=33851"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/33851\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/33750"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=33851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=33851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=33851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}