Dongles on the Host
I know, I know, never touch the PM host, BUT I have been having all sorts of problems getting RTL_anything to work well in containers, let alone a VM for some damn reason. That said, I opted to just let the sticks live on the host, and TCP them for the containers to use.
What I did was get a powered USB hub and slap the sticks on there. Blacklisted the RTL stuff on the host (modprobe) and rebooted everything.
With that, I installed rtl_sdr on the host, and it showed my sticks just fine - I was able to eeprom them to ID them easier, so the manufacturer and product name now are SDR-0X and the serial is the number of the stick, like 11111111 and 22222222, etc.
I opted to set up a systemd serivce to have it run on boot, and allow me to start stop the sticks as needed.
/etc/systemd/system/[email protected]¶
# /etc/systemd/system/[email protected]
[Unit]
Description=rtl_tcp instance on port %i
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
EnvironmentFile=-/etc/default/rtl_tcp
ExecStart=/usr/bin/rtl_tcp -a 0.0.0.0 -p %i -s 2400000 -g 36 -d ${SERIAL_%i}
Restart=always
RestartSec=2
[Install]
WantedBy=multi-user.target
/etc/default/rtl_tcp¶
After getting those files created, reload with systemctl daemon-reload and then enable what you want (as needed)
Enable, Start and Stop¶
You can enable them all at once, or one by one, up to you
Once enabled, start them all or one by one
Check it out
Run a smoke check from any container/VM or even the host itself (just change the IP to the host, if you are checking from another container). You should see something like listening on [::]:7777
Services¶
Now that the host is serving the sticks, in your services (containers, VMs, whatever), you can now connect to the enabled sticks by pointing it at the host's IP and port for the individual stick you want to use
dsd-neo¶
This is an example launch command for dsd-neo in another container: