You are not logged in.
I'm running a VGA passthrough setup with Qemu, and it has direct access to 2 hard drives in my pc. For this I need to run Qemu as root (sudo).
While in Xfce4 it works fine, with i3, Qemu fails to connect with the following error:
pulseaudio: pa_context_connect() failed
pulseaudio: Reason: Connection refused
pulseaudio: Failed to initialize PA contextaudio: Could not init 'pa' audio driver
Because it runs fine when not running Qemu as root, I'm thinking that it can not connect to the Pulseaudio daemon running as my user.
I just find it weird that it works when I'm in Xfce4.
How can I give Qemu as root access to Pulseaudio running as a daemon as my user?
Offline
See if https://bbs.archlinux.org/viewtopic.php … 9#p1568949 helps.
Offline
I've found a solution for this that works for me and doesn't need to run pulseaudio in system-mode (based on this blog post).
Steps I took:
1. Disabled system-mode (I was using a systemd unit)
2. Edit the /etc/pulse/default.pa. Find and update the following line to match below:
load-module module-native-protocol-unix auth-anonymous=1 socket=/tmp/pulseaudio.sock
3. Edit the /etc/pulse/client.conf and uncomment/update the following line to match below:
default-server = unix:/tmp/pulseaudio.sock
4. Added the following to my ~/.xinitrc
pulse -D
This may not be secure in a sense as I believe anything could write to the socket. However, this to me was a better solution than running in system-mode..
Hope this helps anyone struggling with the same issue..
Offline
the correct solution is to copy your users pulse cookie file to your root home folder
cp /home/YOUR_USER/.config/pulse/cookie /root/.config/pulse/cookie
of course create the destination directory
Last edited by Rasi (2015-10-10 08:18:59)
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline