{"id":224,"date":"2017-03-22T14:27:26","date_gmt":"2017-03-22T13:27:26","guid":{"rendered":"http:\/\/owncloud.gonscak.sk\/?p=224"},"modified":"2018-10-23T13:35:15","modified_gmt":"2018-10-23T11:35:15","slug":"how-to-resize-virtualbox-fixed-vdi-storage-to-dynamic-or-fixed-larger-file","status":"publish","type":"post","link":"https:\/\/www.gonscak.sk\/?p=224","title":{"rendered":"How to resize virtualbox fixed vdi storage to dynamic or fixed larger file"},"content":{"rendered":"<p>This short post show you, how to resize small vhd\/vdi file to one bigger file. And this bigger file can be dynamic or fixed size on hard drive. I working on SSD disk, so it is very fast \ud83d\ude42 I use comnad line in windows (start &gt; run &gt; cmd). And enter into virtualbox directory:<\/p>\n<pre>C:\\Users\\user&gt;cd c:\\\r\nc:\\&gt;cd \"Program Files\\Oracle\\VirtualBox\"\\<\/pre>\n<p>So, the input file is &#8220;e:\\virtual_small.vhd&#8221; :<\/p>\n<pre>c:\\Program Files\\Oracle\\VirtualBox&gt;VBoxManage.exe showhdinfo e:\\virtual_small.vhd\r\nUUID:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 617f112b-dac5-4e96-b435-437203992efa\r\nParent UUID:\u00a0\u00a0\u00a0 base\r\nState:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 created\r\nType:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 normal (base)\r\nLocation:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 e:\\virtual_small.vhd\r\nStorage format: VHD\r\nFormat variant: fixed default\r\nCapacity:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 15360 MBytes\r\nSize on disk:\u00a0\u00a0 15360 MBytes\r\nEncryption:\u00a0\u00a0\u00a0\u00a0 disabled<\/pre>\n<p>So, input file is small and we want larger. We must clone it into new one file, dynamically allocated:<\/p>\n<pre>c:\\Program Files\\Oracle\\VirtualBox&gt;VBoxManage.exe clonehd e:\\virtual_small.vhd e:\\virtual_dyn.vhd\r\n0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%\r\nClone medium created in format 'VHD'. UUID: b48eebd1-daa5-4020-9774-d5ca4b985b45\r\nc:\\Program Files\\Oracle\\VirtualBox&gt;VBoxManage.exe showhdinfo e:\\virtual_dyn.vhd\r\nUUID:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 b48eebd1-daa5-4020-9774-d5ca4b985b45\r\nParent UUID:\u00a0\u00a0\u00a0 base\r\nState:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 created\r\nType:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 normal (base)\r\nLocation:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 e:\\virtual_dyn.vhd\r\nStorage format: VHD\r\nFormat variant: dynamic default\r\nCapacity:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 15360 MBytes\r\nSize on disk:\u00a0\u00a0 15245 MBytes\r\nEncryption:\u00a0\u00a0\u00a0\u00a0 disable<\/pre>\n<p>Now, we can resize it to new size, perhaps 25000MB:<\/p>\n<pre>c:\\Program Files\\Oracle\\VirtualBox&gt;VBoxManage.exe modifyhd e:\\virtual_dyn.vhd --resize 25000\r\n0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%\r\nc:\\Program Files\\Oracle\\VirtualBox&gt;VBoxManage.exe showhdinfo e:\\virtual_dyn.vhd\r\nUUID:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 fe1c2a26-39d4-4f31-b4da-bc688b4a3c22\r\nParent UUID:\u00a0\u00a0\u00a0 base\r\nState:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 created\r\nType:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 normal (base)\r\nLocation:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 e:\\virtual_dyn.vhd\r\nStorage format: VHD\r\nFormat variant: dynamic default\r\nCapacity:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 25000 MBytes\r\nSize on disk:\u00a0\u00a0 15247 MBytes\r\nEncryption:\u00a0\u00a0\u00a0\u00a0 disabled<\/pre>\n<p>And now, we can clone it into fixed size. Fixed size of this disk is better for performance on classic disk. Dynamic is better on SSD disks, because there is never-ending resize of this file and virtualbox must allocate new space if the virtual machine grows in lifetime. So dynamic file allocate its space at the beginning. It ok for me, because I don&#8217;t care about the space of this file on beginning.<\/p>\n<pre>c:\\Program Files\\Oracle\\VirtualBox&gt;VBoxManage.exe clonehd e:\\virtual_dyn.vhd e:\\virtual_static.vhd --variant Fixed\r\n0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%\r\nClone medium created in format 'VHD'. UUID: 3ddb4a53-a767-478f-8dc7-f670610320ca\r\nc:\\Program Files\\Oracle\\VirtualBox&gt;VBoxManage.exe showhdinfo e:\\virtual_static.vhd\r\nUUID:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3ddb4a53-a767-478f-8dc7-f670610320ca\r\nParent UUID:\u00a0\u00a0\u00a0 base\r\nState:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 created\r\nType:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 normal (base)\r\nLocation:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 e:\\virtual_static.vhd\r\nStorage format: VHD\r\nFormat variant: fixed default\r\nCapacity:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 25000 MBytes\r\nSize on disk:\u00a0\u00a0 25000 MBytes\r\nEncryption:\u00a0\u00a0\u00a0\u00a0 disabled<\/pre>\n<p>Have a nice day.<\/p>\n ","protected":false},"excerpt":{"rendered":"<p>This short post show you, how to resize small vhd\/vdi file to one bigger file. And this bigger file can be dynamic or fixed size on hard drive. I working on SSD disk, so it is very fast \ud83d\ude42 I use comnad line in windows (start &gt; run &gt; cmd). And enter into virtualbox directory: &hellip; <a href=\"https:\/\/www.gonscak.sk\/?p=224\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">How to resize virtualbox fixed vdi storage to dynamic or fixed larger file<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[61,62,63,64,65,66,67],"class_list":["post-224","post","type-post","status-publish","format-standard","hentry","category-centos","tag-dynamic","tag-fixed","tag-larger","tag-resize","tag-vdi","tag-vhd","tag-virtualbox"],"_links":{"self":[{"href":"https:\/\/www.gonscak.sk\/index.php?rest_route=\/wp\/v2\/posts\/224","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gonscak.sk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gonscak.sk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gonscak.sk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gonscak.sk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=224"}],"version-history":[{"count":2,"href":"https:\/\/www.gonscak.sk\/index.php?rest_route=\/wp\/v2\/posts\/224\/revisions"}],"predecessor-version":[{"id":435,"href":"https:\/\/www.gonscak.sk\/index.php?rest_route=\/wp\/v2\/posts\/224\/revisions\/435"}],"wp:attachment":[{"href":"https:\/\/www.gonscak.sk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gonscak.sk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gonscak.sk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}