最近使用wsl安装了centOS7镜像,在系统中安装了docker服务,但是在执行systemctl start docker的时候遇到了:Failed to get D-Bus connection: Operation not permitted问题,查阅了很多资料都没有效果,最终找到了一种解决方案。
1、备份文件
mv /usr/bin/systemctl /usr/bin/systemctl.old
2、下载systemctl文件
curl https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl.py > /usr/bin/systemctl
3、赋予权限
给脚本赋予执行权限
chmod +x /usr/bin/systemctl