netbrain / zwift

Easily zwift on linux
The Unlicense
238 stars 27 forks source link

Check or set permissions on pulseaudo directory #51

Closed hobeone closed 8 months ago

hobeone commented 8 months ago

When setting this up on my machine (Debian Sid) I couldn't get audio working at first. Debugging it showed that the pulse directory being mapped into the container didn't have permissive enough permissions for the user inside the container to open it.

My UID is 1010 where the user inside the container is UID 1000

/run/user/1010/pulse was set as 0700 so the container user couldn't open it to get to the /run/user/1010/pulse/native socket (which is set as 0666).

I added a line with chmod 755 "/run/user/$UID/pulse" to the zwift.sh file which fixes the issue. I'm not sure if this is the best way or might open potential security issues.

Instead of this would it be possible to set the UID & GID of the user created in the container?

netbrain commented 8 months ago

Yes, this is one of the limitations of this solution. it works the best if you have uid 1000. Im not sure what the best solution is here. But i think chmod as you did is fine. A better solution would probably to grant access on group level.

Alternatively you can build the container from scratch and edit the uids of the default user created in the wine-base container, it could probably be a container build arg aswell.

I'm open for PR's if you wish to improve this aspect :+1: