Normally you would use a definitive guide for such a GUI Incus container, and currently that guide is Incus / LXD profile for GUI apps: Wayland, X11 and Pulseaudio.
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
.