{"id":68720,"date":"2025-07-12T12:26:00","date_gmt":"2025-07-12T11:26:00","guid":{"rendered":"https:\/\/ekiwi-blog.de\/68720\/virt-manager-create-and-convert-dynamically-growing-hard-drives-with-qcow2\/"},"modified":"2025-07-12T14:19:30","modified_gmt":"2025-07-12T13:19:30","slug":"virt-manager-create-and-convert-dynamically-growing-hard-drives-with-qcow2","status":"publish","type":"post","link":"https:\/\/ekiwi-blog.de\/en\/68720\/virt-manager-create-and-convert-dynamically-growing-hard-drives-with-qcow2\/","title":{"rendered":"Virt-Manager \/ Qemu: Create and convert dynamically growing hard drives with qcow2"},"content":{"rendered":"<p>If you create virtual machines under QEMU\/KVM with Virt-Manager, it can happen that the virtual hard disc immediately occupies the entire storage space &#8211; even if you use the .qcow2 format.<\/p>\n<p><!--more--><\/p>\n<p>This is not only annoying, but can quickly waste valuable space on the SSD. In this article, I&#8217;ll show you how to correctly create dynamically growing data carriers, what the different storage formats are all about and how you can efficiently convert existing hard drive images. This will help you get the most out of your system and avoid unnecessary memory wastage.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_1.webp\" alt=\"\" width=\"548\" height=\"85\" class=\"aligncenter size-full wp-image-68706\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_1.webp 548w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_1-300x47.webp 300w\" sizes=\"auto, (max-width: 548px) 100vw, 548px\" \/><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of content<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ekiwi-blog.de\/en\/68720\/virt-manager-create-and-convert-dynamically-growing-hard-drives-with-qcow2\/#Video\" >Video<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ekiwi-blog.de\/en\/68720\/virt-manager-create-and-convert-dynamically-growing-hard-drives-with-qcow2\/#Reduce_the_size_of_existing_virtual_disks\" >Reduce the size of existing virtual disks<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ekiwi-blog.de\/en\/68720\/virt-manager-create-and-convert-dynamically-growing-hard-drives-with-qcow2\/#Creating_a_new_virtual_machine\" >Creating a new virtual machine<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ekiwi-blog.de\/en\/68720\/virt-manager-create-and-convert-dynamically-growing-hard-drives-with-qcow2\/#Create_virtual_disk_via_terminal\" >Create virtual disk via terminal<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ekiwi-blog.de\/en\/68720\/virt-manager-create-and-convert-dynamically-growing-hard-drives-with-qcow2\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Video\"><\/span>Video<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/VYipHUnKaug?si=Dc8jTHuPOUMQ38E2\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Reduce_the_size_of_existing_virtual_disks\"><\/span>Reduce the size of existing virtual disks<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>I have already created two virtual machines, which now occupy 128 GB of storage space. As I don&#8217;t want to install the virtual Windows again, I would like to convert the existing virtual discs.<\/p>\n<p>Fortunately, this can be done with the following command:<\/p>\n<pre>\r\nqemu-img convert -O qcow2 win11.qcow2 win11-small.qcow2\r\n<\/pre>\n<p>The file then only uses the memory actually required.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_2.webp\" alt=\"\" width=\"576\" height=\"104\" class=\"aligncenter size-full wp-image-68708\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_2.webp 576w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_2-300x54.webp 300w\" sizes=\"auto, (max-width: 576px) 100vw, 576px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Creating_a_new_virtual_machine\"><\/span>Creating a new virtual machine<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>When creating a new virtual machine, the entire memory space is used by default. Basically a rarely stupid default setting.<\/p>\n<p>Instead of accepting the default values, we create a customised medium.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_3.webp\" alt=\"\" width=\"510\" height=\"543\" class=\"aligncenter size-full wp-image-68710\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_3.webp 510w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_3-282x300.webp 282w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/p>\n<p>This takes us to the administration. Here we have the option of creating a new data carrier. There is also the option to use only the required storage space.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_4.webp\" alt=\"\" width=\"1105\" height=\"572\" class=\"aligncenter size-full wp-image-68712\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_4.webp 1105w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_4-300x155.webp 300w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_4-1024x530.webp 1024w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_4-768x398.webp 768w\" sizes=\"auto, (max-width: 1105px) 100vw, 1105px\" \/><\/p>\n<p>In my case, however, this did not work. The setting was ignored and the file was created with the full size. Not cool.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_5.webp\" alt=\"\" width=\"515\" height=\"105\" class=\"aligncenter size-full wp-image-68714\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_5.webp 515w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_5-300x61.webp 300w\" sizes=\"auto, (max-width: 515px) 100vw, 515px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Create_virtual_disk_via_terminal\"><\/span>Create virtual disk via terminal<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The alternative: create the data carrier in advance via the terminal:<\/p>\n<pre>\r\nqemu-img create -f qcow2 \/var\/lib\/libvirt\/images\/win11-new.qcow2 128G\r\n<\/pre>\n<p>Adjust file name and size if necessary. After creation, the file initially only takes up a small amount of memory.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_6.webp\" alt=\"\" width=\"546\" height=\"89\" class=\"aligncenter size-full wp-image-68716\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_6.webp 546w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_6-300x49.webp 300w\" sizes=\"auto, (max-width: 546px) 100vw, 546px\" \/><\/p>\n<p>We can now select the file in the administration.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_7.webp\" alt=\"\" width=\"580\" height=\"316\" class=\"aligncenter size-full wp-image-68718\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_7.webp 580w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/07\/virtmanager_7-300x163.webp 300w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Cumbersome, but at least there is the option of downsizing existing VMs or data carriers and thus saving the time needed to set them up again. Why the memory-consuming default setting is the standard in the software is not clear to me.<\/p>","protected":false},"excerpt":{"rendered":"<p>If you create virtual machines under QEMU\/KVM with Virt-Manager, it can happen that the virtual hard disc immediately occupies the<\/p>\n","protected":false},"author":1,"featured_media":18426,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1555],"tags":[3230,2443,2795,3779,1559],"class_list":["post-68720","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-en","tag-instructions-en","tag-linux-en-2","tag-manual","tag-qemu-en","tag-tutorial-en"],"_links":{"self":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/68720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/comments?post=68720"}],"version-history":[{"count":0,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/68720\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media\/18426"}],"wp:attachment":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media?parent=68720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/categories?post=68720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/tags?post=68720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}