Re: [systemd-devel] Pulseaudio & systemd-nspawn

2015-11-09 Thread Poncho
On 09.11.2015 11:29, Kai Hendry wrote:
> On Mon, 2 Nov 2015, at 09:46 PM, Felipe Sateler wrote:
>> Maybe the better option is to load the tcp pulseaudio module, allow 
>> connections from the container ip, and inject PULSE_SERVER envvar into 
>> the container.
> 
> Using tcp will not work since I'm using OpenVPN which seems to usurp all
> network traffic.
> 
> Any other ideas?
> 
> Many thanks,
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> 

This works for me:

--bind=/run/user/1000/pulse:/run/user/host/pulse

/run/user/1000 gets mounted as tmpfs in the container as soon as you
login with the id 1000 user, therefore bind mount it to /run/user/host

then, use systemd-run with
--setenv=PULSE_SERVER=unix:/run/user/host/pulse/native
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Pulseaudio & systemd-nspawn

2015-11-09 Thread Kai Hendry
On Mon, 2 Nov 2015, at 09:46 PM, Felipe Sateler wrote:
> Maybe the better option is to load the tcp pulseaudio module, allow 
> connections from the container ip, and inject PULSE_SERVER envvar into 
> the container.

Using tcp will not work since I'm using OpenVPN which seems to usurp all
network traffic.

Any other ideas?

Many thanks,
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Pulseaudio & systemd-nspawn

2015-11-02 Thread Felipe Sateler
On Mon, 02 Nov 2015 11:29:56 +0800, Kai Hendry wrote:

> Hi there,
> 
> I'm trying to have a super simple way of launching a browser in a VPN.
> 
> I am on Archlinux with systemd 227-1 with pulseaudio 7.1-1 & I have
> another Arch container configured like so:

Do you have the pulseaudio server installed in the container? I think you 
shouldn't, so that the client inside the container connects to the server 
in the host.

Otherwise, what you need it to make the pulseaudio server in the 
container talk to the server in the host, and for that you should not 
bind /dev/snd nor /run/user/1000/pulse

> 
> X1C3:~$ cat
> /etc/systemd/system/systemd-nspawn@firefox.service.d/override.conf
> [Service]
> ExecStart=
> ExecStart=/usr/bin/systemd-nspawn
> --bind-ro=/home/hendry/.Xauthority:/root/.Xauthority \
> --bind=/tmp/.X11-unix \
> --bind=/dev/snd \

I don't think this is appropriate. There should be no sound card on the 
container.

> --bind=/run/user/1000/pulse:/run/user/1000/pulse

Won't this get hidden by the tmpfs in /run/user ?

Maybe the better option is to load the tcp pulseaudio module, allow 
connections from the container ip, and inject PULSE_SERVER envvar into 
the container.



-- 
Saludos,
Felipe Sateler

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Pulseaudio & systemd-nspawn

2015-11-01 Thread Kai Hendry
Hi there,

I'm trying to have a super simple way of launching a browser in a VPN.

I am on Archlinux with systemd 227-1 with pulseaudio 7.1-1 & I have
another Arch container configured like so:

X1C3:~$ cat
/etc/systemd/system/systemd-nspawn@firefox.service.d/override.conf
[Service]
ExecStart=
ExecStart=/usr/bin/systemd-nspawn
--bind-ro=/home/hendry/.Xauthority:/root/.Xauthority \
--bind=/tmp/.X11-unix \
--bind=/dev/snd \
--bind=/run/user/1000/pulse:/run/user/1000/pulse
\
-D /home/hendry/containers/firefox \
--bind /dev/shm \
--bind /etc/machine-id \
--network-veth -b

I then have a script like so:
sudo systemctl start systemd-nspawn@firefox
sudo systemd-run -M firefox --setenv=DISPLAY=:0 firefox

This usually fails on first invocation with:
Failed to create bus connection: No such file or directory

I guess because the container isn't ready yet. Not sure what the fix is
there.


The main issue is sound playback. Sound works in Youtube, but not within
flashplugin.

sudo machinectl -M firefox shell
Connected to the local host. Press ^] three times within 1s to exit
session.
[root@firefox ~]# aplay -l
aplay: device_list:268: no soundcards found...

Furthermore once I do have sound playback in Youtube in the "firefox"
container, my pulseaudio server stops working on my host system:
http://s.natalian.org/2015-11-02/1446434406_765x1058.png

Any ideas how to share my audio playback device between host and
container(s)?

Many thanks,

p.s. I will update http://dabase.com/e/12009/ when I have found a
working setup
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel