Mapping a socket into /run

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:

config:
  environment.PULSE_SERVER: unix:/run/pulse_native
description: Pulseaudio Incus profile
devices:
  PASocket1:
    bind: container
    connect: unix:/run/user/1111/pulse/native
    listen: unix:/run/pulse_native
    mode: "0777"
    type: proxy
name: pulseaudio

When I try to create a container:

incus launch -p pulseaudio -p default images:ubuntu/22.04 ubu2204-pa

The file is not there:

incus exec ubu2204-pw -- ls -l /run

In Unable to create pulseaudio socket in container · Issue #856 · lxc/incus · GitHub it was suggested that systemd would overmount /run, but I don’t understand then why it worked with LXD, since systemd is from the guest OS and I had issues with a container that I exported from LXD and imported into incus.

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.

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…