Share a Host Directory with VM Instance
Using the VM [name] page, Cockpit Administrators can share files on the managed host system with a VM instance.
Note:
To share files between the host and a VM instance, Cockpit uses thevirtiofs
virtualization feature. Virtiofs is a shared file
system feature that lets virtual machines access a directory tree on the managed host
system.
What Do You Need?
- The Cockpit web console must be installed and accessible.
For details, see these topics: Install and Enable Cockpit and Log in to the Cockpit Web Console.
- The Cockpit-machines add-on application must be installed in the web console and the
Oracle Linux virtualization packages must be installed and enabled on the host system.
Note:
Virtiofs is available in most Linux distributions. It works with the virtualization packages (libvirt).For more information, see Install Cockpit-Machines and Enable Virtualization.
- The VM instance that you want to share host files with must have a Linux guest OS.
- The VM instance must be in a Shut off state to add shared directories.
- The host directory that you want to share must already exist.
- The shared host directory must be manually mounted inside the VM. For example:
mount -t virtiofs hostshare [mount point]
In the command, mount point in the mount point inside the VM instance.
For more details, click the question mark icon [?] next to the Shared directories title on the VM [name] page.
Steps
Using the Cockpit web console, follow these steps to add a shared host directory to a VM instance.