{"id":99,"date":"2022-07-14T16:20:30","date_gmt":"2022-07-14T16:20:30","guid":{"rendered":"https:\/\/brainlessideas.com\/?p=99"},"modified":"2022-07-14T16:20:30","modified_gmt":"2022-07-14T16:20:30","slug":"mounting-drives-physical-image-on-virtualbox","status":"publish","type":"post","link":"https:\/\/brainlessideas.com\/index.php\/2022\/07\/14\/mounting-drives-physical-image-on-virtualbox\/","title":{"rendered":"Mounting drives (physical &#038; image) on VirtualBox"},"content":{"rendered":"\n<p>To mount a physical hard disk onto a VirtualBox guest, we need to first create a VMDK configuration file which points to the physical disk, and then attach this VMDK file to the VirtualBox guest.<\/p>\n\n\n\n<p><strong>VirtualBox running on Linux:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">VBoxManage internalcommands createrawvmdk -filename ~\/sdd.vmdk -rawdisk \/dev\/sdd<\/pre>\n\n\n\n<p>Now attach ~\/sdd.vmdk to your guest as normal<\/p>\n\n\n\n<p><strong>VirtualBox running on Windows:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">VBoxManage internalcommands createrawvmdk -filename c:\\PhysicalDrive0.vmdk -rawdisk \\ \\ . \\PhysicalDrive0<\/pre>\n\n\n\n<p>\u201c\\ \\ . \\PhysicalDrive0\u2033 Is the DeviceID as seen by Windows, it can be found from the command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wmic diskdrive list brief<\/pre>\n\n\n\n<p>Now attach c:\\PhysicalDrive0.vmdk to your guest as normal<\/p>\n\n\n\n<p><strong>Mounting a disk image (made with dd):<\/strong><\/p>\n\n\n\n<p>Create a .vmdk config file as above. Use any attached hard disk. Even one in use. Then tweak it to point to your dd image file.<\/p>\n\n\n\n<p>The .vmdk config file is a simple text file. Here\u2019s my tweaked version with some comments.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Disk DescriptorFile\n\n##MYC## So the only things I actually changed were the CID, the number of sectors and the file location\n##MYC## Then I commented out the original uuid lines \n\n##MYC## CID must be different for each device mounted\nversion=1\nCID=6efb06b0\nparentCID=ffffffff\ncreateType=\"fullDevice\"\n\n# Extent description\n##MYC## This number is the number of 512 byte sectors. The dd image filesize_in_bytes \/ 512 \nRW 625142528 FLAT \"\/3tb\/ryph-newpc-images\/eden-pc-final.dd\" 0\n\n# The disk Data Base \n#DDB\n\nddb.virtualHWVersion = \"4\"\nddb.adapterType=\"ide\"\n\n##MYC## Apparently the geometry parameters don't matter if the disk is greater than 8GB. Just leave them as they were\n\nddb.geometry.cylinders=\"16383\"\nddb.geometry.heads=\"16\"\nddb.geometry.sectors=\"63\"\n\n##MYC## I commented out the uuid params. But I think they will get created again when you attach it\n##MYC## ddb.uuid.image=\"6b29d83e-c656-40cf-919d-f8b2219761d2\"\n##MYC## ddb.uuid.parent=\"00000000-0000-0000-0000-000000000000\"\n##MYC## ddb.uuid.modification=\"5b4f167c-9bab-4e6a-935a-9dcf2ee9bc20\"\n##MYC## ddb.uuid.parentmodification=\"00000000-0000-0000-0000-000000000000\"\n\nddb.geometry.biosCylinders=\"1024\"\nddb.geometry.biosHeads=\"255\"\nddb.geometry.biosSectors=\"63\"<\/pre>\n","protected":false},"excerpt":{"rendered":"\n<p>To mount a physical hard disk onto a VirtualBox guest, we need to first create a VMDK configuration file which points to the physical disk, and then attach this VMDK file to the VirtualBox guest.<\/p>\n<p>VirtualBox running on Linux:<\/p>\n<p> VBoxManage internalcommands createrawvmdk -filename ~\/sdd.vmdk -rawdisk \/dev\/sdd <\/p>\n<p>Now attach ~\/sdd.vmdk to your guest as normal<\/p>\n<p> [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2,10],"tags":[],"class_list":["post-99","post","type-post","status-publish","format-standard","hentry","category-it","category-linuxses","odd"],"_links":{"self":[{"href":"https:\/\/brainlessideas.com\/index.php\/wp-json\/wp\/v2\/posts\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/brainlessideas.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/brainlessideas.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/brainlessideas.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/brainlessideas.com\/index.php\/wp-json\/wp\/v2\/comments?post=99"}],"version-history":[{"count":1,"href":"https:\/\/brainlessideas.com\/index.php\/wp-json\/wp\/v2\/posts\/99\/revisions"}],"predecessor-version":[{"id":100,"href":"https:\/\/brainlessideas.com\/index.php\/wp-json\/wp\/v2\/posts\/99\/revisions\/100"}],"wp:attachment":[{"href":"https:\/\/brainlessideas.com\/index.php\/wp-json\/wp\/v2\/media?parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/brainlessideas.com\/index.php\/wp-json\/wp\/v2\/categories?post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/brainlessideas.com\/index.php\/wp-json\/wp\/v2\/tags?post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}