AP2 on proxmox in LXC containers #1237
Replies: 2 comments
-
I wrote up some directions and then started from scratch and went through my notes and was successful. It survives reboots of the container and the host. I'm going to streamline the notes a little and then I will post them. It isn't as simple as running a docker but it's better than not being able to host multiple instances at all. |
Beta Was this translation helpful? Give feedback.
-
I just realized Debian will natively do LXC containers. If you already have a Debian server handling several instances of shairport-sync then this is the easy route to take. I just set this up on my server which is currently handling shairport-sync for AP1. Took a bit to figure out how to setup the network so the containers all a have their own MACs and IPs on the host network. This doc explains how to do it: Once the bridge is setup you create a container and then go through the AP2 build process like it's a native Debian machine. Once one instance is complete you stop the container and make a copy of it. Then edit the config a little and start it up. I'm still using pulseaudio. Tomorrow I will take a stab at getting ALSA to work in a Debian LXC. I had no luck on Proxmox. So now all my rooms are running AP2 all on one machine. Sync seems good but it's late and everyone is asleep so it's hard to get a good test. I will post more details tomorrow morning. |
Beta Was this translation helpful? Give feedback.
-
I finally made some progress running multiple instances of shairport-sync in LXC containers. I could never get ALSA working in the containers so I've had to resort to pulseaudio and set the containers to use a socket to talk to pulseaudio on the host. I used this guide:
https://github.com/mviereck/x11docker/wiki/Container-sound:-ALSA-or-Pulseaudio
It's a bit convoluted but it's working. I typically only work with headless linux servers so pulseaudio isn't something I've spent much time with. Pulse typically runs in the user space. I just need to figure out how to make it all run as a systemd service and survive a reboot of the container or host.
For testing I built an asound.conf on the host that takes a single stereo output and busts it into two alsa outputs which I then created matching pulse sinks. I then have one container pointing to one sink and another container pointing to the other sink. Then I put on some headphones and tell my phone to output to both instances and you can hear they are both in perfect sync.
Beta Was this translation helpful? Give feedback.
All reactions