Are you connecting to the VM from HOST( promxox) or from 3rd Computer remotely?
There is a solution for that without using SPICE.
( If you on the HOST - proxmox, your soundcard directly connected to you )
We using directly the HOST's pulseaudio for the audio ( it is faster than the SPICE ).
(If you connect from 3rd Computer remotely to the VM, more extra configuration needed! )
Proxmox HOST:
Code:
$> apt-get install pulseaudio
Code:
# We need a separate user for the Pulseaudio daemon.
# The "pulse" user created by the "pulseaudio" package, but we dont use this user, need a separate user with HOME directory, without shell.
# $> id pulse
$> useradd -g pulse -G audio -s /sbin/nologin -m pulseaudio
Code:
# We need to add the "root" user to the "audio" group, because otherwise the qemu can't connect to the pulseaudio socket file
$> usermod -G audio root
Code:
# Modify the file:
/etc/pulse/default.pa
load-module module-native-protocol-unix auth-group=audio socket=/tmp/pulseserver
Code:
# Modify the file:
/etc/pulse/daemon.conf
exit-idle-time=-1
Code:
# Modify the file:
/etc/pulse/client.conf
default-server = unix:/tmp/pulseserver
autospawn = no
Code:
# Create following new file:
/etc/systemd/system/pulsedaemon.service
[Unit]
Description=Sound Server
[Service]
User=pulseaudio
ExecStart=/usr/bin/pulseaudio
Restart=on-failure
[Install]
WantedBy=sound.target
Code:
# Systemd daemon for the "pulsedaemon.service" that we created
$> systemctl enable pulsedaemon.service
$> systemctl restart pulsedaemon.service
$> systemctl status pulsedaemon.service
Code:
# Edit your VM config file, add to following:
# Before, remove all sound related device from the VM using the proxmox WEBGUI.
/etc/pve/qemu-server/<vmid>.conf
args: -device ich9-intel-hda,bus=pci.0,addr=0x1b -device hda-micro,audiodev=hda -audiodev pa,id=hda,server=unix:/tmp/pulseserver,out.mixing-engine=off
Code:
# Start you VM
$> qm start <vmid>
Done.