Container refuses to start with other profile

Okay, I will try to run it on another host and check these configurations.

Thank you or your time :slight_smile:

But once again I might disturb you.

Thanks

There is an issue with PulseAudio being used in a container.
The way you can get audio from an application running in a container, is to share the host’s PulseAudio Unix socket to the container. In this case, it’s /home/ubuntu/pulse-native.
There is another option, to place it in /tmp/, another writable directory in a container.

The issue with /home/ubuntu/pulse-native is that when you start a GUI LXD container (using the above LXD profile), you get into a race condition. The race is between the Ubuntu container image trying to create the ubuntu non-root account (therefore, the /home/ubuntu/ directory), and LXD trying to create the proxy device in /home/ubuntu/pulse-native.

In my case on my system, the non-root account tends to get created first, therefore LXD is happy to create the proxy device for PulseAudio in /home/ubuntu/.

The reason why you would need to put the proxy device for PulseAudio, is to be able to play audio in snap package in the container, should you decide to install a snap package in there.

But if you are losing often on the race condition and do not use snap packages, then you can edit the LXD profile (in two places) and change /home/ubuntu/pulse-native into /tmp/pulse-native. And that’s it. You will not get race conditions for the specific case of the ubuntu account vs proxy device.

1 Like