2
votes

I want to run qemu with command

qemu-system-x86_64 \
    -drive file=zso_cow.img,if=virtio \
    -enable-kvm \
    -smp 2 \
    -net nic,model=virtio -net user \
    -m 1G -balloon virtio \
    -fsdev local,id=hshare,path=hshare/,security_model=none -device virtio-9p-pci,fsdev=hshare,mount_tag=hshare \
    -chardev stdio,id=cons,signal=off -device virtio-serial-pci -device virtconsole,chardev=cons \
    -device harddoom

but I get an error: qemu-system-x86_64: -device virtio-9p-pci,fsdev=hshare,mount_tag=hshare: 'virtio-9p-pci' is not a valid device model name

qemu is compiled from sources on branch harddoom with configure options:

--target-list=i386-softmmu,x86_64-softmmu --python=$(which python2)
--audio-drv-list=alsa,pa

I do not have that problem with qemu installed from ubuntu repository, but I need to use one compiled from sources.

I can of course run without option -device virtio-9p-pci, but than I have no shared hshare folder

zso.img is created with:

qemu-img create -f qcow2 -o backing_file=zso.img zso_cow.img

where zso.img is debian image

1

1 Answers

10
votes

Since you built QEMU yourself, you probably didn't build it in an environment with the necessary libraries to support 9pfs. QEMU configure by default will enable features which it can build and disable those where the dependent libraries are not present. If you pass configure the --enable-virtfs option, this will cause it to fail if it can't find the right libraries for 9pfs support. You can then identify what libraries you need to install. (If you're building on an Ubuntu or Debian host, and your host has the necessary deb-src lines in its /etc/apt/sources.list, you can use "apt-get build-dep qemu" to install all the libraries that would be used to build the distro QEMU, which should include the ones you specifically care about.)