{"id":68862,"date":"2025-08-04T20:42:03","date_gmt":"2025-08-04T19:42:03","guid":{"rendered":"https:\/\/ekiwi-blog.de\/68862\/linux-qemu-data-exchange-with-linux-guest-system\/"},"modified":"2025-08-07T09:19:32","modified_gmt":"2025-08-07T08:19:32","slug":"linux-qemu-data-exchange-with-linux-guest-system","status":"publish","type":"post","link":"https:\/\/ekiwi-blog.de\/en\/68862\/linux-qemu-data-exchange-with-linux-guest-system\/","title":{"rendered":"Linux &#8211; Qemu &#8211; Data exchange with Linux guest system"},"content":{"rendered":"<p>Data exchange between Linux guest and Linux host with Qemu.<\/p>\n<p><!--more--><\/p>\n<p>Exchanging data between the host and guest system under Linux is relatively simple. Let&#8217;s go!<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 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\/68862\/linux-qemu-data-exchange-with-linux-guest-system\/#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\/68862\/linux-qemu-data-exchange-with-linux-guest-system\/#Installation_on_the_host_system\" >Installation on the host system<\/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\/68862\/linux-qemu-data-exchange-with-linux-guest-system\/#Add_file_system_in_the_guest\" >Add file system in the guest<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ekiwi-blog.de\/en\/68862\/linux-qemu-data-exchange-with-linux-guest-system\/#Use_sharing_in_the_guest_system\" >Use sharing in the guest system<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ekiwi-blog.de\/en\/68862\/linux-qemu-data-exchange-with-linux-guest-system\/#Include_automatically_at_system_startup\" >Include automatically at system startup<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ekiwi-blog.de\/en\/68862\/linux-qemu-data-exchange-with-linux-guest-system\/#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\/AVAoVC80fNs?si=avj-7g8jRLLaUWUj\" 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=\"Installation_on_the_host_system\"><\/span>Installation on the host system<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>We install the following package on the host, if not already installed:<\/p>\n<pre>\r\nsudo apt install virtiofsd\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_1.webp\" alt=\"\" width=\"837\" height=\"426\" class=\"aligncenter size-full wp-image-68844\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_1.webp 837w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_1-300x153.webp 300w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_1-768x391.webp 768w\" sizes=\"auto, (max-width: 837px) 100vw, 837px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Add_file_system_in_the_guest\"><\/span>Add file system in the guest<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In Virt-Manager we can edit the virtual machine and add a new hardware.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_2.webp\" alt=\"\" width=\"822\" height=\"439\" class=\"aligncenter size-full wp-image-68846\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_2.webp 822w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_2-300x160.webp 300w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_2-768x410.webp 768w\" sizes=\"auto, (max-width: 822px) 100vw, 822px\" \/><\/p>\n<p>Here we add a file system\/file system. As the source, we enter the folder that we want to make available in the virtual machine. As the target path, we enter a name that we need immediately for the assignment. The name can be freely chosen here.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_3.webp\" alt=\"\" width=\"672\" height=\"585\" class=\"aligncenter size-full wp-image-68848\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_3.webp 672w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_3-300x261.webp 300w\" sizes=\"auto, (max-width: 672px) 100vw, 672px\" \/><\/p>\n<p>If the following error message appears:<\/p>\n<blockquote><p>\nUnable to add device: unsupported configuration: &#8216;virtiofs&#8217; requires shared memory\n<\/p><\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_4.webp\" alt=\"\" width=\"481\" height=\"453\" class=\"aligncenter size-full wp-image-68850\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_4.webp 481w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_4-300x283.webp 300w\" sizes=\"auto, (max-width: 481px) 100vw, 481px\" \/><\/p>\n<p>Then we need to enable shared memory.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_5.webp\" alt=\"\" width=\"573\" height=\"329\" class=\"aligncenter size-full wp-image-68852\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_5.webp 573w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_5-300x172.webp 300w\" sizes=\"auto, (max-width: 573px) 100vw, 573px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Use_sharing_in_the_guest_system\"><\/span>Use sharing in the guest system<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>First, we create a folder in which we want to integrate our share.<\/p>\n<pre>\r\nsudo mkdir \/mnt\/shared\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_6.webp\" alt=\"\" width=\"500\" height=\"72\" class=\"aligncenter size-full wp-image-68854\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_6.webp 500w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_6-300x43.webp 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/p>\n<p>We can then integrate the release:<\/p>\n<pre>\r\nsudo mount -t virtiofs shared \/mnt\/shared\r\n<\/pre>\n<p>&#8220;shared&#8221; is the name we assigned above.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_7.webp\" alt=\"\" width=\"900\" height=\"405\" class=\"aligncenter size-full wp-image-68856\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_7.webp 900w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_7-300x135.webp 300w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_7-768x346.webp 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Include_automatically_at_system_startup\"><\/span>Include automatically at system startup<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The share is now included, but the next time the system is started, the input is gone again. By editing the file &#8220;<code>\/etc\/fstab<\/code>&#8220;, we can automatically include the share at startup.<\/p>\n<pre>\r\nshared \/mnt\/shared virtiofs defaults 0 0\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_8.webp\" alt=\"\" width=\"598\" height=\"320\" class=\"aligncenter size-full wp-image-68858\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_8.webp 598w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_8-300x161.webp 300w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The share is now also available when the guest system is started. Basically everything is quite simple and problem-free.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_9.webp\" alt=\"\" width=\"805\" height=\"363\" class=\"aligncenter size-full wp-image-68860\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_9.webp 805w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_9-300x135.webp 300w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2025\/08\/exchange_linux_9-768x346.webp 768w\" sizes=\"auto, (max-width: 805px) 100vw, 805px\" \/><\/p>","protected":false},"excerpt":{"rendered":"<p>Data exchange between Linux guest and Linux host with Qemu.<\/p>\n","protected":false},"author":1,"featured_media":12289,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1555],"tags":[3230,2443,2795,3779,1559],"class_list":["post-68862","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\/68862","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=68862"}],"version-history":[{"count":0,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/68862\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media\/12289"}],"wp:attachment":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media?parent=68862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/categories?post=68862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/tags?post=68862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}