Proxy device not connecting to Pulseaudio on LXD host

I can confirm precisely the same errors. I can also confirm that quater’s workaround is effective.

I have also effectively worked around the problem by splitting the profile into two pieces with the X11 component following Simos’s original profile and the PulseAudio component following an earlier profile created by Simos in which PulseAudio is defined as a disk device rather than a proxy:

X11 component:

config:
  environment.DISPLAY: :0
  user.user-data: |
    #cloud-config
    packages:
      - x11-apps
      - mesa-utils
description: GUI LXD profile
devices:
  X0:
    bind: container
    connect: unix:@/tmp/.X11-unix/X0
    listen: unix:@/tmp/.X11-unix/X0
    security.gid: "1000"
    security.uid: "1000"
    type: proxy
  mygpu:
    type: gpu
name: x11
used_by: []

pa component:

config:
  raw.idmap: "both 1000 1000"
  user.user-data: |
    #cloud-config
    runcmd:
      - 'sed -i "s/; enable-shm = yes/enable-shm = no/g" /etc/pulse/client.conf'
      - 'echo export PULSE_SERVER=unix:/tmp/.pulse-native | tee --append /home/ubuntu/.profile'
    packages:
      - pulseaudio
description: pulseaudio LXD profile
devices:
  PASocket:
    path: /tmp/.pulse-native
    source: /run/user/1000/pulse/native
    type: disk
name: pa
used_by:

Containers are launched by combining both profiles along with default. Both methods get the job done, but I prefer quater’s as being more elegant.

1 Like