0

I am running and interactive docker container and I need to run system commands to makes changes to my Bluetooth connection and sometimes WiFi connection from the interactive docker terminal. Example: sudo systemctl restart bluetooth

When I run this in the interactive docker container I get this error

root@NX3:~# sudo systemctl restart bluetooth
System has not been booted with systemd as init system (PID 1). Can't operate.

Can someone please help me with this. How do I enable docker to use systemd

se7en
  • 671
  • 4
  • 18
  • In general you run things in containers so that they _can't_ do things like control the host's hardware devices. Running `sudo -i` on the host (without Docker) will get you an interactive root shell where you can run these kinds of commands. – David Maze Aug 18 '21 at 10:22
  • Thanks @David, all my project has to happen in the docker environment including turning the bluetooth on and off. The only solution I have now is to ssh into the host machine and run the command. But I can't use that in production. – se7en Aug 18 '21 at 10:35
  • You want to access hardware (Bluetooth) on the Host from within a Container running on that Host? https://stackoverflow.com/questions/28868393/accessing-bluetooth-dongle-from-inside-docker – BertC Aug 18 '21 at 11:13

0 Answers0