I suspect it may be because the linux-virtual kernel we’re using doesn’t include it.
You may need to install the matching linux-modules-extra package for the kernel and reboot for it to show up.
@stgraber My LXD host is running Linux Kernel 5.15. From what you have said, I should have sound support at the Linux kernel and we know that the QEMU version supports it because my Win 11 LXD VM has sound.
No, QEMU doesn’t have support for virtio-sound, it only has support for the intel audio or realtek type virtual sound cards which LXD won’t use.
In general, LXD doesn’t use virtualized hardware like those, only paravirtualized hardware from virtio. So until QEMU grows support for virtio-sound, your only option is to use raw.qemu as you described above.
Ok, that explains a lot. So, is it possible for me to get sound on using raw.qemu, because my efforts were unsuccessful. I tried: lxc config set test-vm raw.qemu -- "-device intel-hda -device hda-duplex"
with no luck. Can you make a suggestion?
FYI, I found that the zabbly incus packages ship qemu 8.2 and when I was using lxc config set vm-name raw.qemu -- "-device intel-hda -device hda-duplex" with LXD 5.0.x (which has qemu 8.0), with incus 0.5.1 I need to use incus config set vm-name raw.qemu -- "-device intel-hda -device hda-duplex -audio spice".
Without -audio spice the VM doesn’t start and incus info --show-log vm-name shows:
qemu-system-x86_64: -device hda-duplex: no default audio driver available
Can see /opt/incus/bin/qemu-system-x86_64 -audio help for available drivers in addition to spice. CC @stgraber
An issue with -audio spice is that the audio of the host stops working while the VM is running. I do not remember, was that also the case previously?
This is probably system dependent? On my Ubuntu 22.04 system (pulseaudio) using virt-viewer, multiplexing works (that said, perhaps my sound card supports hardware multiplexing).