I have tried to make the sound work between host as a debian + pipewire with KVM using SPICE and pipewire in the guest, i wasnt successful, no sound is ported to the host. Tested this with debian-12 .iso on KVM but result was the same.
If i change SPICE to ALSA in VM configs, it will result into the same situation of virtualbox mentioned here:
If i change it to pipewire <audio id='1' type='pipewire'/> it will not be acceptable by QEMU:
Error starting domain: internal error: process exited while connecting to monitor: 2024-09-04T18:13:40.241754Z qemu-system-x86_64: Unknown audio driver pipewire'. Perhaps you want to install qemu-system-gui package?
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 108, in tmpcb
callback(*args, **kwargs)
File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 57, in newfn
ret = fn(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/virt-manager/virtManager/object/domain.py", line 1402, in startup
self._backend.create()
File "/usr/lib/python3/dist-packages/libvirt.py", line 1379, in create
raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: internal error: process exited while connecting to monitor: 2024-09-04T18:13:40.241754Z qemu-system-x86_64: Unknown audio driver pipewire'. Perhaps you want to install qemu-system-gui package?
So the user is without sound if he use pipewire on host and guest with KVM at the moment.
how u use SPICE for audio redirection?virt-manager or sudo virt-manager?
if u use spice + sudo virt-manager:
for pulseaudio backend ,spice first use /var/run/pulse/native,no found.then use pulseaudio alsa, fallback to /dev/snd,audio works normally.
for pipewire backend ,spice first use pipewire-pulse,and not found /var/run/pulse/native.then use /run/pipewire/pipewire-0,no found. then use pipewire-alsa,but pipewire-alsa not support fallback to /dev/snd,no sound.
if u use spice + virt-manager
for pulseaudio backend ,spice first use /run/user/1000/pulse/native,audio works normally.
for pipewire backend ,spice first use pipewire-pulse,found /run/user/1000/pulse/native,audio works normally.
if u use spice + sudo -E virt-manager
for pulseaudio backend ,spice first use /var/run/pulse/native,no found.then use pulseaudio alsa, fallback to /dev/snd,audio works normally.
for pipewire backend ,spice first use pipewire-pulse,and not found /var/run/pulse/native.then use /run/user/1000/pipewire-0,audio works normally.
audio is working properly in virt-manager/KVM in current Kicksecure and debian. Issue here was apparmor profiles blocker as i posted in the last reply.