[systemd-devel] Pulseaudio & systemd-nspawn

Kai Hendry hendry at webconverger.com
Sun Nov 1 19:29:56 PST 2015


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 at 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 at 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 at 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


More information about the systemd-devel mailing list