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 91 forks source link

Distrod won't start #16

Open dantesun opened 2 years ago

dantesun commented 2 years ago

Describe the bug A clear and concise description of what the bug is. Executing wsl has no effect. It exits without any message.

Logs Please share the output of the trace logs, following the reference

[Distrod][DEBUG] distrod-exec: exec_command_in_distro    
[Distrod][DEBUG] starting /init from distrod-exec    
[Distrod][DEBUG] WSL envs: "WSL_DISTRO_NAME" = "Distrod"    
[Distrod][DEBUG] WSL envs: "WSLENV" = ""    
[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/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-uid1001")), target: ContainerPath("/run/distrod/distrod_wsl_env-uid1001"), fstype: None, flags: MS_BIND, is_file: true    
[Distrod][DEBUG] Spawning the command or the waiter.    
[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][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][TRACE] skipping an identical mount: Some(
    ContainerPath(
        "/run/distrod/distrod_wsl_env-uid1001",
    ),
), ContainerMount {
    source: Some(
        HostPath(
            "/run/distrod/distrod_wsl_env-uid1001",
        ),
    ),
    target: ContainerPath(
        "/run/distrod/distrod_wsl_env-uid1001",
    ),
    fstype: None,
    flags: MS_BIND,
    data: None,
    is_file: true,
}    
[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][DEBUG] dropping privilege. kmsg logging in the child ends here.    
[Distrod][DEBUG] The parent of the second of three forks exits.    
[Distrod][DEBUG] Spawning the command or the waiter.    
[Distrod][DEBUG] Spawning the waiter.    
[Distrod][DEBUG] Failed to ignore signal Sys(EINVAL)    
[Distrod][DEBUG] Failed to ignore signal Sys(EINVAL)    
[Distrod][DEBUG] The pipe for wait has been closed. Possibly the proxy process has been killed by SIGKILL.    
nullpo-head commented 2 years ago

Thanks for the report! Hmm.. possibly this is the same issue as https://github.com/nullpo-head/wsl-distrod/issues/9 Could you share the information about your environment?

Environment

  • Windows Version: [output of winver on Windows]
  • Linux kernel version [output of uname -a on any WSL distro]
  • Distro version [e.g. "Ubuntu 20.04" ]

Could you also share the result of the this, please?

To check whether Systemd crashes or not, could you share the result of ps aux after Distrod crashes, by wsl -e ps aux command? The name of the systemd process is like /sbin/init ....setenv=... it systemd exists, could you share the output of wsl -e ls /proc/[pid of the systemd you found]/ns as well, please?

I

pelepelin commented 2 years ago

I just had seemingly the same log output on a fresh Windows+WSL. It turned out even though I think wsl --status said default version 2, new distros were created with version 1.

nullpo-head commented 2 years ago

It turned out even though I think wsl --status said default version 2, new distros were created with version 1.

Well, I hadn't thought of that. Some other issues also seem to be this problem. Thanks for your information @pelepelin !