Can not setup rootless docker

Hi,
i’m trying to setup rootless docker. I followed Run the Docker daemon as a non-root user (Rootless mode).
But the installation has some problems:

bernd@docker:~$ dockerd-rootless-setuptool.sh install
[INFO] systemd not detected, dockerd-rootless.sh needs to be started manually:

PATH=/usr/bin:/sbin:/usr/sbin:$PATH dockerd-rootless.sh

[INFO] CLI context "rootless" already exists
[INFO] Use CLI context "rootless"
Current context is now "rootless"

[INFO] Make sure the following environment variables are set (or add them to ~/.bashrc):

# WARNING: systemd not found. You have to remove XDG_RUNTIME_DIR manually on every logout.
export XDG_RUNTIME_DIR=/home/bernd/.docker/run
export PATH=/usr/bin:$PATH
Some applications may require the following environment variable too:
export DOCKER_HOST=unix:///home/bernd/.docker/run/docker.sock

bernd@docker:~$ ll .docker/run/
total 8
drwx------ 2 bernd bernd 4096 Mar 23 13:50 ./
drwxrwxr-x 4 bernd bernd 4096 Mar 23 13:50 ../
bernd@docker:~$
bernd@docker:~$ dockerd-rootless.sh
+ [ -w  ]
+ echo XDG_RUNTIME_DIR needs to be set and writable
XDG_RUNTIME_DIR needs to be set and writable
+ exit 1
bernd@docker:~$ ll .docker/run/
total 8
drwx------ 2 bernd bernd 4096 Mar 23 13:50 ./
drwxrwxr-x 4 bernd bernd 4096 Mar 23 13:50 ../

It says it does not find systemd although i have it. And although starting dockerd-rootless.sh manually i don’t have a socket file in /home/bernd/.docker/run.
Can anyone help ?

System is:
bernd@docker:~$ docker version
Client: Docker Engine - Community
Version: 23.0.1
API version: 1.42
Go version: go1.19.5
Git commit: a5ee5b1
Built: Thu Feb 9 19:47:01 2023
OS/Arch: linux/amd64
Context: rootless
Cannot connect to the Docker daemon at unix:///home/bernd/.docker/run/docker.sock. Is the docker daemon running?

bernd@docker:~$ cat /etc/os-release
PRETTY_NAME=“Ubuntu 22.04.2 LTS”
NAME=“Ubuntu”
VERSION_ID=“22.04”
VERSION=“22.04.2 LTS (Jammy Jellyfish)”
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL=“https://www.ubuntu.com/
SUPPORT_URL=“https://help.ubuntu.com/
BUG_REPORT_URL=“Bugs : Ubuntu
PRIVACY_POLICY_URL=“Data privacy | Ubuntu
UBUNTU_CODENAME=jammy

Thanks.

Bernd

Hi,
found it out by myself. I need to switch to the user “bernd” with “ssh bernd@localhost”, not via su.
Then installation runs fine.

Bernd