AP2 on Windows WSL2 #1242
Replies: 3 comments 3 replies
-
I forgot to add, you need to have WSL set to run on your host network. To do this:
Now in the WSL instance run these commands so it will pick up an IP from DHCP on the host network: sudo ip addr flush dev eth0
sudo dhclient eth0 |
Beta Was this translation helpful? Give feedback.
-
This utility will get systemd working in WSL so then you can run nqptp and shairport-sync as services in WSL just as you would a normal Linux distro. |
Beta Was this translation helpful? Give feedback.
-
I just took a stab at this on Windows 11 23H2 and the process is easier now. Microsoft made it really easy to put WSL directly on your real network. You just need to make a VM switch that is a bridged to one of your network adapters. You can do this in powershell like this: New-VMSwitch -Name "Bridge" -NetAdapterName (Get-NetAdapter|Sort ifIndex)[0].Name -AllowManagementOs $true Then tell wsl to use bridge mode and bind it to the VM switch you just created like this:
Then restart wsl: wsl --shutdown From this point you can build and run shairport-sync however you would natively using PulseAudio as the backend. I also had to set this option in shairport-sync.conf:
My guess is sync would not work at all. |
Beta Was this translation helpful? Give feedback.
-
Insider builds of Windows 10 have functioning audio out of the box. No trickery is needed. I haven't tried but you may be able to get SPS working on non-insider builds too by installing pulseaudio server in windows and then configuring WSL2 to point to it. But if you are on the insider dev build, these steps worked for me on Umbuntu in WSL2. Haven't looked into a way to keep it alive though.
Build/Install
Run
sudo service dbus start sudo service avahi-daemon start sudo nqptp & shairport-sync
Beta Was this translation helpful? Give feedback.
All reactions