I try to run a qemu virtual machine having a folder shared with host. No matter what I do, I have always the same error: 9pnet_virtio: no channels available for device share.

Host machine is under Linux.

Kernel was compiled with all 9P and virtio options enabled (https://wiki.qemu.org/Documentation/9psetup).

Here's my script to run qemu:

#! /bin/bash


if [ -n "${KDB}" ]; then

CMDLINE="root=/dev/sda1 rw vga=792 console=ttyS0 kgdboc=ttyS1 ${KGD_WAIT}"

FLAGS="--enable-kvm -s"
VIRTFS+=" --virtfs local,path=./share/,mount_tag=share,security_model=passthrough,id=share "

exec qemu-system-x86_64 ${FLAGS} \
     -hda "${HDA}" -hdb "${HDB}" \
     ${VIRTFS} \
     -net user -net nic \
     -serial stdio -serial tcp::1234,server,nowait \
     -boot c -m 1G \
     -kernel "${KERNEL}" -append "${CMDLINE}"

When I mount the folder manually (https://www.linux-kvm.org/page/9p_virtio)

mkdir share_folder
mount -t 9p -o trans=virtio,version=9p2000.L share share_folder

The result is the same.


In my case it was failing due to missing virtio_pci module and I fixed it with:

modprobe virtio_pci

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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