{"id":32,"date":"2010-09-07T20:46:41","date_gmt":"2010-09-08T01:46:41","guid":{"rendered":"http:\/\/soljerome.com\/blog\/?p=32"},"modified":"2010-09-07T20:46:41","modified_gmt":"2010-09-08T01:46:41","slug":"using-lvm-volumes-with-virtualbox","status":"publish","type":"post","link":"https:\/\/www.soljerome.com\/blog\/2010\/09\/07\/using-lvm-volumes-with-virtualbox\/","title":{"rendered":"Using LVM volumes with VirtualBox"},"content":{"rendered":"<p>I have been used to using <a href=\"http:\/\/www.linux-kvm.org\" target=\"_blank\">KVM<\/a> when doing virtualization. However, I ran into some performance issues when trying to setup my home machine to run KVM as a normal user. Therefore, I decided to try out <a href=\"http:\/\/www.virtualbox.org\/\" target=\"_blank\">VirtualBox<\/a> again. One issue I had was trying to use an lvm volume as a physical device for the virtual machine. Here is how I solved the problem.<\/p>\n<p>First, I created the lvm volume<\/p>\n<pre>lvcreate --name www --size 10G images<\/pre>\n<p>Next, I created a vmdk file which describes the disk properties using the VBoxManage command:<\/p>\n<pre>VBoxManage internalcommands createrawvmdk -filename \/vbox\/www.vmdk -rawdisk \/dev\/images\/www\r\n<\/pre>\n<p>Here are the contents of the vmdk file after running that command:<\/p>\n<pre># Disk DescriptorFile\r\nversion=1\r\nCID=e5ee218c\r\nparentCID=ffffffff\r\ncreateType=\"fullDevice\"\r\n\r\n# Extent description\r\nRW 20971520 FLAT \"\/dev\/images\/www\" 0\r\n\r\n# The disk Data Base\r\n#DDB\r\n\r\nddb.virtualHWVersion = \"4\"\r\nddb.adapterType=\"ide\"\r\nddb.geometry.cylinders=\"16383\"\r\nddb.geometry.heads=\"16\"\r\nddb.geometry.sectors=\"63\"\r\nddb.uuid.image=\"46527bd3-f962-43cc-8a43-11aafd3425aa\"\r\nddb.uuid.parent=\"00000000-0000-0000-0000-000000000000\"\r\nddb.uuid.modification=\"00000000-0000-0000-0000-000000000000\"\r\nddb.uuid.parentmodification=\"00000000-0000-0000-0000-000000000000\"\r\nddb.geometry.biosCylinders=\"1024\"\r\nddb.geometry.biosHeads=\"255\"\r\nddb.geometry.biosSectors=\"63\"\r\n<\/pre>\n<p>Lastly, I made sure the permissions were set so my user could read the file<\/p>\n<pre>chown solj. \/vbox\/www.vmdk\r\n<\/pre>\n<p>After this, I was able to add the file as a storage device as if I were adding the lvm volume itself. This is great since now I can grow the volume as needed if I end up storing more on the machine than initially planned.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been used to using KVM when doing virtualization. However, I ran into some performance issues when trying to setup my home machine to run KVM as a normal user. Therefore, I decided to try out VirtualBox again. One issue I had was trying to use an lvm volume as a physical device for <a href='https:\/\/www.soljerome.com\/blog\/2010\/09\/07\/using-lvm-volumes-with-virtualbox\/' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,6],"tags":[],"_links":{"self":[{"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/posts\/32"}],"collection":[{"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/comments?post=32"}],"version-history":[{"count":5,"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/posts\/32\/revisions"}],"predecessor-version":[{"id":64,"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/posts\/32\/revisions\/64"}],"wp:attachment":[{"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/media?parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/categories?post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/tags?post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}