2

With virt-manager 2.2.1, I'm trying to create a shared directory between an Arch Linux host and a Kali guest.

I went to "Add New Virtual Hardware" → "Filesystem":

virt-manager screenshot

Clicking "Finish", I get this error message:

Error adding device: unsupported configuration: only supports passthrough accessmode

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/addhardware.py", line 1351, in _add_device
    self.vm.add_device(dev)
  File "/usr/share/virt-manager/virtManager/object/domain.py", line 408, in add_device
    self._redefine_xmlobj(xmlobj)
  File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 417, in _redefine_xmlobj
    self._redefine_xml_internal(origxml, newxml)
  File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 395, in _redefine_xml_internal
    self._define(newxml)
  File "/usr/share/virt-manager/virtManager/object/domain.py", line 999, in _define
    self.conn.define_domain(xml)
  File "/usr/share/virt-manager/virtManager/connection.py", line 612, in define_domain
    return self._backend.defineXML(xml)
  File "/usr/lib/python3.8/site-packages/libvirt.py", line 4048, in defineXML
    if ret is None:raise libvirtError('virDomainDefineXML() failed', conn=self)
libvirt.libvirtError: unsupported configuration: only supports passthrough accessmode

Is there a way to fix this and have a shared directory?

3

I had to change the driver from "Handle" to "Path":

virt-manager shared dir config

These are the settings and commands that made the shared directory work:

In virt-manager:

  • Driver: Path
  • Mode: Mapped
  • Write Policy: Immediate

Permissions set on host for the shared directory:

  • sudo chgrp kvm shared/
  • chmod 770 shared/

Mount the shared directory in the guest:

sudo mount -t 9p -o trans=virtio /hostshare /home/guest/shared

The /hostshare part is the "Target Path" defined with virt-manager.

In the guest, the shared directory is at /home/guest/shared.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.