Share folder between guest and host: Difference between revisions
From LinuxizeNet
(Created page with "<div style = "line-height: 1.2"> {{clear}}</div></div><div style = "margin-top: 1.5em; border: 3px solid #ae8c55; border-radius: .5em; padding: 1em 1.5em; font-size: 1.2em"> <strong></strong> ==Share Folder Between Guest and Host in virt-manager (KVM/Qemu/libvirt)== ===Host directory=== mkdir /path/to/directory/of/host/machine ===Edit VM's XML=== This article explains how to share a folder using virsh-edit from host machine in a guest virsh destroy <guest><ref>Stops VM...") |
(Remove inert legacy #ae8c55 wrapper (superseded by site CSS)) |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{clear}} | |||
{{clear}} | |||
==Share Folder Between Guest and Host in virt-manager (KVM/Qemu/libvirt)== | ==Share Folder Between Guest and Host in virt-manager (KVM/Qemu/libvirt)== | ||
This article explains how to share a folder using virsh-edit from host machine into a guest | |||
===Host directory=== | ===Host directory=== | ||
mkdir /path/to/directory/of/host/machine | mkdir /path/to/directory/of/host/machine | ||
===Edit VM's XML=== | ===Edit VM's XML=== | ||
virsh destroy <guest><ref>Stops VM</ref> | virsh destroy <guest><ref>Stops VM</ref> | ||
virsh edit <guest><ref>Edit VM's configuration XML File</ref> | virsh edit <guest><ref>Edit VM's configuration XML File</ref> | ||
| Line 28: | Line 27: | ||
[[Category:Virtualization]] | [[Category:Virtualization]] | ||
[[Category:QEMU]] | |||
[[Category:libvirt]] | [[Category:libvirt]] | ||
[[Category:Linux]] | [[Category:Linux]] | ||
Latest revision as of 21:02, 9 August 2026
[edit]
This article explains how to share a folder using virsh-edit from host machine into a guest
Host directory[edit]
mkdir /path/to/directory/of/host/machine
Edit VM's XML[edit]
virsh destroy <guest>[1] virsh edit <guest>[2]
<filesystem type="mount" accessmode="passthrough">
<driver type="virtiofs"/>
<binary path="/usr/libexec/virtiofsd"/>
<source dir="/path/to/directory/of/host/machine"/>
<target dir="user_frendly_name_goes_here"/>
<alias name="fs1"/>
<address type="pci" domain="0x0000" bus="0x08" slot="0x00" function="0x0"/>
</filesystem>
[edit]
virsh start <guest> mkdir /path/to/shared/folder/to/bo/mount mount -t virtiofs user_frendly_name_goes_here /path/to/shared/folder/to/bo/mount
Note[edit]
All those commands should be run by user root, or using sudo