nullpo-head / wsl-distrod

Distrod is a meta-distro for WSL 2 which installs Ubuntu, Arch, Debian, Gentoo, etc. with systemd in a minute for you. Distrod also has built-in auto-start feature on Windows startup and port forwarding ability.
MIT License
1.9k stars 90 forks source link

[Bug]: systemd not working #76

Open colemar opened 1 year ago

colemar commented 1 year ago

Describe the bug

Installed Distrod (via install.sh) in an existing WSL2 distro Ubuntu 22.04.1 LTS (Jammy Jellyfish). There is a pre-existing Debian distro with Distrod (via install.sh) that seems to work OK.

As soon as the Ubuntu distro is started vmmem process gets about 15% CPU as stated by Windows Task Manager. Inside the distro:

I installed another Ubuntu 22.04 distro via distrod_wsl_launcher.exe and it works as expected.

Steps to reproduce

See above.

Expected behavior

systemd works

Windows version

Windows 10 21H2 19044.2006

Linux kernel version

5.10.102.1-microsoft-standard-WSL2

Distro

Ubuntu 22.04

How did you install that distro?

Enabled distrod in an existing WSL2 distro

Logs

[Distrod][DEBUG] distrod-exec: exec_command_in_distro [Distrod][DEBUG] starting /init from distrod-exec [Distrod][DEBUG] WSL envs: "WSL_DISTRO_NAME" = "Ubuntu" [Distrod][DEBUG] WSL envs: "WSL_INTEROP" = "/run/WSL/12_interop" [Distrod][DEBUG] WSL envs: "WSLENV" = "WT_SESSION::WT_PROFILE_ID" [Distrod][DEBUG] Container::with_mount source: Some(HostPath("/run/distrod/cmdline")), target: ContainerPath("/proc/cmdline"), fstype: None, flags: MS_BIND, is_file: true [Distrod][TRACE] mount_distrod_run_files: path: "/opt/distrod/run/systemd" [Distrod][TRACE] mount_distrod_run_files: path: "/opt/distrod/run/systemd/system" [Distrod][TRACE] mount_distrod_run_files: path: "/opt/distrod/run/systemd/system/portproxy.service" [Distrod][DEBUG] Container::with_mount source: Some(HostPath("/opt/distrod/run/systemd/system/portproxy.service")), target: ContainerPath("/run/systemd/system/portproxy.service"), fstype: None, flags: MS_BIND, is_file: true [Distrod][TRACE] mount_distrod_run_files: path: "/opt/distrod/run/systemd/system/systemd-tmpfiles-clean.service.d" [Distrod][TRACE] mount_distrod_run_files: path: "/opt/distrod/run/systemd/system/systemd-tmpfiles-clean.service.d/exclude_wslg_sockets.conf" [Distrod][DEBUG] Container::with_mount source: Some(HostPath("/opt/distrod/run/systemd/system/systemd-tmpfiles-clean.service.d/exclude_wslg_sockets.conf")), target: ContainerPath("/run/systemd/system/systemd-tmpfiles-clean.service.d/exclude_wslg_sockets.conf"), fstype: None, flags: MS_BIND, is_file: true [Distrod][TRACE] mount_distrod_run_files: path: "/opt/distrod/run/systemd/system/systemd-tmpfiles-setup.service.d" [Distrod][TRACE] mount_distrod_run_files: path: "/opt/distrod/run/systemd/system/systemd-tmpfiles-setup.service.d/exclude_wslg_sockets.conf" [Distrod][DEBUG] Container::with_mount source: Some(HostPath("/opt/distrod/run/systemd/system/systemd-tmpfiles-setup.service.d/exclude_wslg_sockets.conf")), target: ContainerPath("/run/systemd/system/systemd-tmpfiles-setup.service.d/exclude_wslg_sockets.conf"), fstype: None, flags: MS_BIND, is_file: true [Distrod][TRACE] mount_distrod_run_files: path: "/opt/distrod/run/tmpfiles.d" [Distrod][TRACE] mount_distrod_run_files: path: "/opt/distrod/run/tmpfiles.d/x11.conf" [Distrod][DEBUG] Container::with_mount source: Some(HostPath("/opt/distrod/run/tmpfiles.d/x11.conf")), target: ContainerPath("/run/tmpfiles.d/x11.conf"), fstype: None, flags: MS_BIND, is_file: true [Distrod][DEBUG] DistroLauncher::launch [Distrod][DEBUG] Container::with_mount source: Some(HostPath("/run/distrod/distrod_wsl_env-uid1000")), target: ContainerPath("/run/distrod/distrod_wsl_env-uid1000"), fstype: None, flags: MS_BIND, is_file: true [Distrod][DEBUG] Spawning the command or the waiter. [Distrod][DEBUG] Executing a command in the distro. [Distrod][DEBUG] Failed to ignore signal Sys(EINVAL) [Distrod][DEBUG] Failed to ignore signal Sys(EINVAL) [Distrod][DEBUG] Distro::exec_command. [Distrod][DEBUG] Container::exec_command. [Distrod][DEBUG] Triple fork done. [Distrod][TRACE] mounting source: Some( ContainerPath( "/run/distrod/cmdline", ), ), mount: ContainerMount { source: Some(HostPath("/run/distrod/cmdline")), target: ContainerPath("/proc/cmdline"), fstype: None, flags: MS_BIND, data: None, is_file: true } [Distrod][TRACE] mounting source: Some( ContainerPath( "/opt/distrod/run/systemd/system/portproxy.service", ), ), mount: ContainerMount { source: Some(HostPath("/opt/distrod/run/systemd/system/portproxy.service")), target: ContainerPath("/run/systemd/system/portproxy.service"), fstype: None, flags: MS_BIND, data: None, is_file: true } [Distrod][DEBUG] dropping privilege. kmsg logging in the child ends here. [Distrod][TRACE] mounting source: Some( ContainerPath( "/opt/distrod/run/systemd/system/systemd-tmpfiles-clean.service.d/exclude_wslg_sockets.conf", ), ), mount: ContainerMount { source: Some(HostPath("/opt/distrod/run/systemd/system/systemd-tmpfiles-clean.service.d/exclude_wslg_sockets.conf")), target: ContainerPath("/run/systemd/system/systemd-tmpfiles-clean.service.d/exclude_wslg_sockets.conf"), fstype: None, flags: MS_BIND, data: None, is_file: true } [Distrod][DEBUG] The parent of the second of three forks exits. [Distrod][TRACE] mounting source: Some( ContainerPath( "/opt/distrod/run/systemd/system/systemd-tmpfiles-setup.service.d/exclude_wslg_sockets.conf", ), ), mount: ContainerMount { source: Some(HostPath("/opt/distrod/run/systemd/system/systemd-tmpfiles-setup.service.d/exclude_wslg_sockets.conf")), target: ContainerPath("/run/systemd/system/systemd-tmpfiles-setup.service.d/exclude_wslg_sockets.conf"), fstype: None, flags: MS_BIND, data: None, is_file: true } [Distrod][DEBUG] Spawning the command or the waiter. [Distrod][TRACE] mounting source: Some( ContainerPath( "/opt/distrod/run/tmpfiles.d/x11.conf", ), ), mount: ContainerMount { source: Some(HostPath("/opt/distrod/run/tmpfiles.d/x11.conf")), target: ContainerPath("/run/tmpfiles.d/x11.conf"), fstype: None, flags: MS_BIND, data: None, is_file: true } [Distrod][DEBUG] Spawning the waiter. [Distrod][TRACE] skipping an identical mount: Some( ContainerPath( "/run/distrod/distrod_wsl_env-uid1000", ), ), ContainerMount { source: Some( HostPath( "/run/distrod/distrod_wsl_env-uid1000", ), ), target: ContainerPath( "/run/distrod/distrod_wsl_env-uid1000", ), fstype: None, flags: MS_BIND, data: None, is_file: true, } [Distrod][DEBUG] Failed to ignore signal Sys(EINVAL) [Distrod][DEBUG] Failed to ignore signal Sys(EINVAL)

additional comment

No response

psmolkin commented 1 year ago

What version of the systemd package?

It seems the last one (250.*) is broken: https://github.com/microsoft/WSL/issues/8879

colemar commented 1 year ago

@psmolkin systemd 249.11-0ubuntu3.6 And it is the same version that is working in the other ubuntu distro which was installed via distrod_wsl_launcher.exe.