Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't boot Ubuntu with systemd on WSL with genie #11266

Closed
AriFordsham opened this issue Aug 18, 2021 · 4 comments
Closed

Can't boot Ubuntu with systemd on WSL with genie #11266

AriFordsham opened this issue Aug 18, 2021 · 4 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@AriFordsham
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

A container with Ubuntu and systemd enabled won't start under WSL. I'm not able to confirm if this happens on regular Linux.

Steps to reproduce the issue:

  1. Dockerfile:

    FROM ubuntu
    
    RUN apt-get update \
        && apt-get install -y systemd systemd-sysv
    
    CMD ["/sbin/init"]
    
  2. podman build . --tag ubuntu-systemd

  3. podman run -ti ubuntu-systemd

Describe the results you received:

Terminal dump:

systemd 245.4-4ubuntu3.11 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid)
Detected virtualization wsl.
Detected architecture x86-64.
Failed to create symlink /sys/fs/cgroup/cpuacct: File exists
Failed to create symlink /sys/fs/cgroup/cpu: File exists
Failed to create symlink /sys/fs/cgroup/net_cls: File exists
Failed to create symlink /sys/fs/cgroup/net_prio: File exists

Welcome to Ubuntu 20.04.2 LTS!

Set hostname to <3da28590af85>.
Failed to create /init.scope control group: Read-only file system
Failed to allocate manager object: Read-only file system
[!!!!!!] Failed to allocate manager object.
Exiting PID 1...

Describe the results you expected:

A root prompt. top shows systemd as PID 1. systemctl shows system running normally.

Additional information you deem important (e.g. issue happens only occasionally):

Running on WSL, getting systemd via genie

Output of podman version:

podman version 3.2.3

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.21.3
  cgroupControllers: []
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: 'conmon: /usr/libexec/podman/conmon'
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.0.27, commit: '
  cpus: 4
  distribution:
    distribution: ubuntu
    version: "20.04"
  eventLogger: file
  hostname: DESKTOP-3GD61TE-wsl
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.10.16.3-microsoft-standard-WSL2
  linkmode: dynamic
  memFree: 3032293376
  memTotal: 9929285632
  ociRuntime:
    name: crun
    package: 'crun: /usr/bin/crun'
    path: /usr/bin/crun
    version: |-
      crun version 0.20.1.5-925d-dirty
      commit: 0d42f1109fd73548f44b01b3e84d04a279e99d2e
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    path: /tmp/podman-run-1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: 'slirp4netns: /usr/bin/slirp4netns'
    version: |-
      slirp4netns version 1.1.8
      commit: unknown
      libslirp: 4.3.1-git
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.4.3
  swapFree: 3043495936
  swapTotal: 3221225472
  uptime: 92h 38m 5.82s (Approximately 3.83 days)
registries:
  search:
  - docker.io
  - quay.io
store:
  configFile: /home/ari/.config/containers/storage.conf
  containerStore:
    number: 52
    paused: 0
    running: 1
    stopped: 51
  graphDriverName: overlay
  graphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: 'fuse-overlayfs: /usr/bin/fuse-overlayfs'
      Version: |-
        fusermount3 version: 3.9.0
        fuse-overlayfs: version 1.5
        FUSE library version 3.9.0
        using FUSE kernel interface version 7.31
  graphRoot: /home/ari/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 26
  runRoot: /tmp/podman-run-1000/containers
  volumePath: /home/ari/.local/share/containers/storage/volumes
version:
  APIVersion: 3.2.3
  Built: 0
  BuiltTime: Thu Jan  1 01:00:00 1970
  GitCommit: ""
  GoVersion: go1.15.2
  OsArch: linux/amd64
  Version: 3.2.3

Package info (e.g. output of rpm -q podman or apt list podman):

podman/unknown,now 100:3.2.3-1 amd64 [installed]

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

WSL with systemd via genie.

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Aug 18, 2021
@vrothberg
Copy link
Member

Thanks for reaching out.

Running systemd inside a container requires systemd on the host but WSL does not (yet) support systemd (see microsoft/WSL#994). I fear there's nothing we can do at the time.

@AriFordsham AriFordsham changed the title Can't boot Ubuntu with systemd in WSL Can't boot Ubuntu with systemd on WSL with genie Aug 19, 2021
@rhatdan
Copy link
Member

rhatdan commented Aug 20, 2021

We heard in yesterdays community meeting about systemd running in WSL2?

@vrothberg
Copy link
Member

We heard in yesterdays community meeting about systemd running in WSL2?

It's not officially supported yet. There are custom scripts on the web that claim to get it working though.

@AriFordsham
Copy link
Author

Update: this issue was opened in error, there was a problem with my configuration.

I am running WSL with systemd via genie.

With this Dockerfile:

FROM ubuntu

RUN apt-get update
RUN apt-get -y install systemd systemd-sysv

CMD [ "/sbin/init" ]

I can successfully run the container, get a systemd startup log and a login prompt.

Hope this helps someone - I can provide more details if needed.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

3 participants