I have created a profile to get pulseaudio access in the container using device of type proxy. This has been working fine in the past with LXD but I am not able to make it work with incus. The device is not created in the container.
This is the profile I am using:
Here, your pulseaudio Incus profile worked for me. I changed the order of the profiles. First, do the default profile and then do the pulseaudio profile. The second profile is supposed to override stuff from the first.
$ incus launch images:ubuntu/22.04 pulsecontainer --ephemeral --profile default --profile pulseaudio
Launching pulsecontainer
$ incus exec pulsecontainer -- sudo --user ubuntu --login
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
ubuntu@pulsecontainer:~$ ls -l /run/pulse_native
srwxrwxrwx 1 root root 0 May 8 20:41 /run/pulse_native
ubuntu@pulsecontainer:~$
Also, since you specify the PULSE_SERVER variable, you can change the location to somewhere outside of /run.
Thank you for your answer. I took the original solution from some other source that was working with LXD, but I don’t remember where I took it. The guide you mention maps the files in /mnt. I tried to map it outside of /run and it works! Thanks!
Changing the order of the profiles did not help…