Giter Site home page Giter Site logo

nullpo-head / wsl-distrod Goto Github PK

View Code? Open in Web Editor NEW
1.8K 21.0 89.0 44.67 MB

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.

License: MIT License

Rust 88.46% Batchfile 1.10% Python 4.22% Makefile 1.11% PowerShell 0.31% Shell 4.16% Handlebars 0.64%
wsl wsl2 wsl-environment wsl-installation ubuntu arch-linux debian gentoo rockylinux almalinux

wsl-distrod's Introduction

Distrod - WSL2 Distros with Systemd!

CI

Distrod is a systemd-based meta-distro for WSL2 that allows you to install Ubuntu, Arch Linux, Gentoo and many other distros with systemd in a minute, or make your current distro run systemd.

Distrod also provides built-in auto-start feature and port forwarding service. This allows you to start systemd-managed services, such as ssh, on Windows startup and make it accessible from outside Windows.

Arch, Debian, and Gentoo are running on WSL 2 with systemd running Demo gif

With Distrod, you can

  1. Run systemd in WSL 2
    You can do the both of the following

    • Install a new distro with systemd running
    • Make your current WSL 2 distro run systemd
  2. Install any image available from linuxcontainers.org as a WSL 2 distro in 1 minute1.

    • The following distros are continuously tested
      • Ubuntu, Debian, Arch Linux, Fedora, CentOS, AlmaLinux, Rocky Linux, Kali Linux, Linux Mint, openSUSE, Amazon Linux, Oracle Linux, Gentoo Linux
        CI (See Integration test on Linux (distro_name))
    • Other distros may or may not work

    * linuxcontainers.org is a vendor-neutral project that offers distro images for containers, which is unrelated to Distrod. LXC/LXD is one of its projects. Systemd runs in the installed distro, so you can also try LXC/LXD in WSL!

  3. Start WSL on Windows Startup.
    This means that you can manage your ssh server and other services with systemd and start them automatically without any hassle!

    • Distrod also provides a port proxy service managed by systemd, allowing you to expose your Linux server to the outside world of Windows easily.

Feature under development

  1. Make your dual-booted physical Linux distro on a separate disk run as a WSL instance.

Install

Option 1: Install a New Distro.

  1. Make sure that your default WSL version is 2.

    > wsl --set-default-version 2
  2. Download and unzip the latest distrod_wsl_launcher-x86_64.zip from release, and double-click the extracted .exe file.

  3. Follow the wizard to install a new distro.

  4. [Optional] To make your distro start on Windows startup, run the following command.

    sudo /opt/distrod/bin/distrod enable --start-on-windows-boot

    You also might want to forward ports of services such as ssh to the outside of Windows. In that case, you can enable the built-in port proxy service provided by Distrod.

    NOTE: On Windows 11, portproxy.service doesn't work on Windows startup, which should be fixed soon. See Known bus.

    echo 22 | sudo tee /opt/distrod/conf/tcp4_ports  # update the portproxy.service's configuration
    sudo systemctl enable --now portproxy.service  # enable and start it

    For more detailed instruction, see Forward Ports to outside of Windows.

See also

Option 2: Make your Current Distro Run Systemd

By this installation, systemd is enabled in your WSL 2 distro.

  1. Download and run the latest installer script.

    curl -L -O "https://raw.githubusercontent.com/nullpo-head/wsl-distrod/main/install.sh"
    chmod +x install.sh
    sudo ./install.sh install

    This script installs distrod, but doesn't enable it yet.

  2. Enable distrod in your distro

    You have two options. If you want to automatically start your distro on Windows startup, enable distrod by the following command

    /opt/distrod/bin/distrod enable --start-on-windows-boot

    Otherwise,

    /opt/distrod/bin/distrod enable

    You can run enable with --start-on-windows-boot again if you want to enable autostart later.

  3. Restart your distro

    Close your WSL's terminal. Open a new Command Prompt window, and run the following command.

    wsl --terminate Distrod

    After re-opening a new WSL window, your shell runs in a systemd session.

See also

Usage

If you are using Windows Terminal, Windows Terminal will automatically find and register Distrod for you. Just open the tab named "Distrod".

If you are using other terminals, please update your terminal settings to launch the Distrod. For reference, the following command launches a distro by name in WSL

> wsl --distribution Distrod

Update Distrod

  1. Inside a Distrod session, download and run the latest installer script.

    curl -L -O "https://raw.githubusercontent.com/nullpo-head/wsl-distrod/main/install.sh"
    chmod +x install.sh
    sudo ./install.sh update

How Distrod Works

In a nutshell, Distrod is a binary that creates a simple container that runs systemd as an init process, and starts your WSL sessions within that container. To realize that, Distrod does the following things.

  • Modify the rootfs of the concrete distro you chose so that it is compatible with both WSL and systemd.
    • Modify systemd services so that they are compatible with WSL
    • Configure networks for WSL
    • Put /opt/distrod/bin/distrod and other resources in the rootfs.
    • Register the Distrod's binary as the login shell
  • When Distrod is launched by WSL's init as a login shell, Distrod
    1. Starts systemd in a simple container
    2. Launches your actual shell within that container
    3. Bridges between the systemd sessions and the WSL interop environment.

Other Notes

  1. Does WSLg works on Distrod?

    Yes! Distrod doesn't prevent anything about WSLg. Distrod sets up sockets for X11 and environment variables properly.

    However, WSLg itself has some quirks even on non-Distrod WSL2 distros. Try many things until a GUI app runs. For example, to run xeyes without failure, I had to run it three times on the non-Distrod official Ubuntu 20.04.

See also

Footnotes

  1. as long as your network connection is fast enough :)

wsl-distrod's People

Contributors

agam778 avatar github-actions[bot] avatar locietta avatar nullpo-head avatar thinca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wsl-distrod's Issues

useradd command not found on Alpine

If you choose Alpine (choice n2), the addition of a user throws an error that the command 'useradd' does not exist.

I think on Alpine, it is 'adduser'.

[Bug]: The 0.1.5 package version reports 0.1.4

Describe the bug

EDIT: As explained in the mesasge below, most of the information reported here was my fault, only the displayed version reports wrong wrong

The v0.1.5 package seems to be the same as 0.1.4.

Steps to reproduce

❯ wget https://github.com/nullpo-head/wsl-distrod/releases/download/v0.1.5/opt_distrod.tar.gz && tar -xf opt_distrod.t
ar.gz && bin/distrod --version && sha512sum opt_distrod.tar.gz
--2022-03-10 17:54:46--  https://github.com/nullpo-head/wsl-distrod/releases/download/v0.1.5/opt_distrod.tar.gz
SSL_INIT
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Resolving github.com (github.com)... 140.82.114.3
Connecting to github.com (github.com)|140.82.114.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/369828607/cce6132e-a945-4c45-96
09-78e92ab1cec9?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220310%2Fus-east-1%2Fs3%2Fa
ws4_request&X-Amz-Date=20220310T155444Z&X-Amz-Expires=300&X-Amz-Signature=e7fc5deb53d77bd1f3a2acf0554da1eef91ea2350d92
740aeaef359300877ed9&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=369828607&response-content-disposition=attac
hment%3B%20filename%3Dopt_distrod.tar.gz&response-content-type=application%2Foctet-stream [following]
--2022-03-10 17:54:47--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/369828607/cce613
2e-a945-4c45-9609-78e92ab1cec9?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220310%2Fus-
east-1%2Fs3%2Faws4_request&X-Amz-Date=20220310T155444Z&X-Amz-Expires=300&X-Amz-Signature=e7fc5deb53d77bd1f3a2acf0554da
1eef91ea2350d92740aeaef359300877ed9&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=369828607&response-content-di
sposition=attachment%3B%20filename%3Dopt_distrod.tar.gz&response-content-type=application%2Foctet-stream
SSL_INIT
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.111.133, 185.199.109.133, 185.199.1
10.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12240213 (12M) [application/octet-stream]
Saving to: ‘opt_distrod.tar.gz’

opt_distrod.tar.gz            100%[===============================================>]  11.67M  9.50MB/s    in 1.2s

2022-03-10 17:54:48 (9.50 MB/s) - ‘opt_distrod.tar.gz’ saved [12240213/12240213]

distrod 0.1.4
d6ba0e84439bbf4e3457e082ab9f5900709aa2d70ecfe79cd6ae870dcd3693a992e717c5af973f858ca7f1b3318dbdca831130c009c9b76f940ac7
40279016d3  opt_distrod.tar.gz



❯ wget https://github.com/nullpo-head/wsl-distrod/releases/download/v0.1.4/opt_distrod.tar.gz && tar -xf opt_distrod.t
ar.gz && bin/distrod --version && sha512sum opt_distrod.tar.gz
--2022-03-10 17:54:57--  https://github.com/nullpo-head/wsl-distrod/releases/download/v0.1.4/opt_distrod.tar.gz
SSL_INIT
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Resolving github.com (github.com)... 140.82.114.3
Connecting to github.com (github.com)|140.82.114.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/369828607/0cd15a83-96ad-4ddd-91
00-74c0e686a92e?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220310%2Fus-east-1%2Fs3%2Fa
ws4_request&X-Amz-Date=20220310T155455Z&X-Amz-Expires=300&X-Amz-Signature=1d4506ce64c72b176df7eefecec07b76c2f35fb19e67
b5a7a4da31b3138ec63e&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=369828607&response-content-disposition=attac
hment%3B%20filename%3Dopt_distrod.tar.gz&response-content-type=application%2Foctet-stream [following]
--2022-03-10 17:54:58--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/369828607/0cd15a
83-96ad-4ddd-9100-74c0e686a92e?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220310%2Fus-
east-1%2Fs3%2Faws4_request&X-Amz-Date=20220310T155455Z&X-Amz-Expires=300&X-Amz-Signature=1d4506ce64c72b176df7eefecec07
b76c2f35fb19e67b5a7a4da31b3138ec63e&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=369828607&response-content-di
sposition=attachment%3B%20filename%3Dopt_distrod.tar.gz&response-content-type=application%2Foctet-stream
SSL_INIT
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.111.133, 185.199.109.133, 185.199.1
10.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12218965 (12M) [application/octet-stream]
Saving to: ‘opt_distrod.tar.gz.1’

opt_distrod.tar.gz.1          100%[===============================================>]  11.65M  43.3MB/s    in 0.3s

2022-03-10 17:54:59 (43.3 MB/s) - ‘opt_distrod.tar.gz.1’ saved [12218965/12218965]

distrod 0.1.4
d6ba0e84439bbf4e3457e082ab9f5900709aa2d70ecfe79cd6ae870dcd3693a992e717c5af973f858ca7f1b3318dbdca831130c009c9b76f940ac7
40279016d3  opt_distrod.tar.gz

Expected behavior

I expect the 0.1.5 package to be different than the 0.1.4 one and report a different version and sha512 hash.

Windows version

22000.493

Linux kernel version

5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 GNU/Linux

Distro

Arch Linux

How did you install that distro?

Installed by Distrod wizard

Logs

No logs, since I don't even need to install distrod to see the problem

additional comment

No response

[Bug]: snap GUI applications not working on Ubuntu WSL2 win 11

Describe the bug

I cannot run GUI apps installed via snap.
Installing and running snap-store yields:

update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/tmp/.X11-unix /tmp/.X11-unix none bind,ro 0 0): cannot use "/var/lib/snapd/hostfs/tmp/.X11-unix" as bind-mount source: not a directory
mkdir: cannot create directory ‘/run/user/1000’: Permission denied
Unable to init server: Could not connect: Connection refused
22:17:06:0160 Gtk cannot open display: :0

The same final Gtk error exists for Chromium

Steps to reproduce

  1. Install Ubuntu from Microsoft app store on Windows 11
  2. Install distrod, option 2 on already installed distro
  3. sudo snap install snap-store
  4. snap-store

Expected behavior

Snap store GUI opens

Windows version

11

Linux kernel version

Linux DESKTOP-HUAWEI 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Distro

Ubuntu 20.04

How did you install that distro?

Enabled distrod in an existing WSL2 distro

Logs

-- Logs begin at Sat 2021-12-25 20:12:34 CET, end at Sun 2021-12-26 23:22:21 CET. --
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [DEBUG] distrod-exec: exec_command_in_distro    
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [DEBUG] starting /init from distrod-exec    
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [DEBUG] WSL envs: "WSLENV" = "BASH_ENV/u"    
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [DEBUG] WSL envs: "WSL_DISTRO_NAME" = "Ubuntu"    
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [DEBUG] WSL envs: "WSL_INTEROP" = "/run/WSL/14_interop"    
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [DEBUG] Container::with_mount source: Some(HostPath("/run/distrod/cmdline")), target: ContainerPath("/proc/cmdline"), fstype: None, flags: MS_BIND, is_file: true    
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [TRACE] mount_distrod_run_files: path: "/opt/distrod/run/systemd"    
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [TRACE] mount_distrod_run_files: path: "/opt/distrod/run/systemd/system"    
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [TRACE] mount_distrod_run_files: path: "/opt/distrod/run/systemd/system/portproxy.service"    
Dec 26 23:21:36 DESKTOP-HUAWEI 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    
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [TRACE] mount_distrod_run_files: path: "/opt/distrod/run/tmpfiles.d"    
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [TRACE] mount_distrod_run_files: path: "/opt/distrod/run/tmpfiles.d/x11.conf"    
Dec 26 23:21:36 DESKTOP-HUAWEI 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    
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [DEBUG] DistroLauncher::launch    
Dec 26 23:21:36 DESKTOP-HUAWEI 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    
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [DEBUG] Spawning the command or the waiter.    
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [DEBUG] Executing a command in the distro.    
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [DEBUG] Failed to ignore signal Sys(EINVAL)    
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [DEBUG] Failed to ignore signal Sys(EINVAL)    
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [DEBUG] Distro::exec_command.    
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [DEBUG] Container::exec_command.    
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [DEBUG] Triple fork done.    
Dec 26 23:21:36 DESKTOP-HUAWEI 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 }    
Dec 26 23:21:36 DESKTOP-HUAWEI Distrod: [DEBUG] dropping privilege. kmsg logging in the child ends here.    
Dec 26 23:21:36 DESKTOP-HUAWEI 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 }    
Dec 26 23:21:36 DESKTOP-HUAWEI 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 }    
Dec 26 23:21:36 DESKTOP-HUAWEI 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,
                                        }    
Dec 26 23:21:35 DESKTOP-HUAWEI Distrod: [DEBUG] distrod-exec: exec_command_in_distro    
Dec 26 23:21:35 DESKTOP-HUAWEI Distrod: [DEBUG] Executing a command in the distro.    
Dec 26 23:21:35 DESKTOP-HUAWEI Distrod: [DEBUG] Failed to ignore signal Sys(EINVAL)    
Dec 26 23:21:35 DESKTOP-HUAWEI Distrod: [DEBUG] Failed to ignore signal Sys(EINVAL)    
Dec 26 23:21:35 DESKTOP-HUAWEI Distrod: [DEBUG] Distro::exec_command.    
Dec 26 23:21:35 DESKTOP-HUAWEI Distrod: [DEBUG] Container::exec_command.    
Dec 26 23:21:35 DESKTOP-HUAWEI Distrod: [DEBUG] Triple fork done.    
Dec 26 23:21:35 DESKTOP-HUAWEI Distrod: [DEBUG] dropping privilege. kmsg logging in the child ends here.    

additional comment

No response

Discussion about distro auto shutdown

In normal use cases, when no more process is running, wsl automatically shuts down the distro. That is obviously won't be possible with distrod, as systemd processes keep running after closing terminal.

Wanted to brainstorm if something similar would be possible with distrod.

[Question or Bug]: Only first WSL Distro can enable systemd user mode, but not for rest distros

Describe the bug

I use distrod to make one distro by using the ubuntu cloudimg 22.04, then export it into tar file, and import it into 2 distros. In each distro, I created the default nromal user which id is 1000 obviously.

I find I only can enable the systemd user mode in one distro, but not in second, it dose not depend which distro, it depends on the the first one been launched.

Steps to reproduce

For example, distro A and B.

Step 1. I open A firstly, then use the way sudo login -f $(whoami) to enable systemd user mode, and then input command systemctl --user is-active dbus to check it, and get 'inactive' which is right because no user service yet.

Step 2. I open B secondly, use the same way to enable systemd user mode, but I get error message "Failed to connect to bus: No such file or directory" from 'systemctl --user is-active dbus'. Then I check the status in B, like this:

sudo systemctl status [email protected]
Failed to dump process list for '[email protected]', ignoring: Input/output error
○ [email protected] - User Manager for UID 1000
     Loaded: loaded (/lib/systemd/system/[email protected]; static)
    Drop-In: /etc/systemd/system/[email protected]
             └─delegate.conf
             /usr/lib/systemd/system/[email protected]
             └─timeout.conf
     Active: inactive (dead) since Sun 2022-02-06 20:13:29 CST; 9min ago
       Docs: man:[email protected](5)
    Process: 423 ExecStart=/lib/systemd/systemd --user (code=exited, status=219/CGROUP)
   Main PID: 423 (code=exited, status=219/CGROUP)
      Tasks: 40
     Memory: 118.8M
        CPU: 2.057s
     CGroup: /user.slice/user-1000.slice/[email protected]

Feb 06 20:13:29 DESKTOP-4SSBAGS systemd[1]: Starting User Manager for UID 1000...
Feb 06 20:13:29 DESKTOP-4SSBAGS systemd[1]: [email protected]: Main process exited, code=exited, status=219/CGROUP
Feb 06 20:13:29 DESKTOP-4SSBAGS systemd[1]: [email protected]: Failed to kill control group /user.slice/user-1000.slice/[email protected], ignoring: Input/output error
Feb 06 20:13:29 DESKTOP-4SSBAGS systemd[1]: [email protected]: Failed to kill control group /user.slice/user-1000.slice/[email protected], ignoring: Input/output error
Feb 06 20:13:29 DESKTOP-4SSBAGS systemd[1]: [email protected]: Failed with result 'exit-code'.
Feb 06 20:13:29 DESKTOP-4SSBAGS systemd[1]: Failed to start User Manager for UID 1000.

But I find it is same in reverse between A and B. If I open A in second step, will get same error.

PS: during the testing, I use 'wsl -t A | B' to terminate the distro, then open the distro again by using Windows terminal.

Expected behavior

Actually, I found the root cause is because A and B have same user id(1000), if I create a new user in B which UID is 1001, then A and B can bothly enable the systemd user mode successfully. So it seems the same UID cause the systemd resource conflicts.

Can u explain something for this finding? Is it a bug or not ?

Windows version

Windows 21H2 19044.1503

Linux kernel version

Linux DESKTOP-4SSBAGS 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Distro

ubuntu 22.04 current

How did you install that distro?

Installed by Distrod wizard

Logs

Sorry, didn't know the setting from reference during the tests. This question is want to solve my curiousness.

additional comment

No response

WSL2 crashes at launch after enabling distrod `[Distrod][ERROR] Failed to spawn the command.`

Here is the error when launching wsl2


Caused by:
    No such file or directory (os error 2)
[Distrod][ERROR] Pre_second_fork failed.

Caused by:
    0: Failed to enter the init's namespace
    1: Failed to open ns/uts
    2: ESRCH: No such process

[プロセスはコード 137 (0x00000089) で終了しました]

my distro sort of becomes borked after that.. the only way to get back in was to use wsl --exec to get back in and disable distrod

I am on archlinux and I was using systemd-genie (I uninstalled it to use this)
would somebody know how to fix this ?

Thank you very much

"Failed to enable the autostart on Windows boot." Caused by: C drive not found.

Unable to autostart distrod, C drive not found. Using WSL Arch.

$ sudo /opt/distrod/bin/distrod enable --start-on-windows-boot
[Distrod] Distrod has been enabled. Now your shell will start under systemd.
[Distrod] Enabling atuomatic startup of Distrod. UAC dialog will appear because scheduling
a task requires the admin privilege. Please hit enter to proceed.

[Distrod][ERROR] Failed to enable the autostart on Windows boot.

Caused by:
C drive not found.

[Bug]: Distrod causes X11 to not work under wslg.

Describe the bug

XWayland under WSLg doesn't work anymore when installing Distrod. It seems like systemd is ignoring the x11.conf that allows the distro to bind-mount /mnt/wslg/.X11-unix to /tmp/.X11-unix

Otherwise, wayland apps run fine.

I am using systemd 251.2-1
Also, I'm using the Windows Store version of WSL.

Steps to reproduce

  1. Install distrod
  2. Run a X11 application under WSLg.
  3. The application complains that it cannot find :0.

Expected behavior

For .X11-unix to be properly bind-mounted in /tmp and run XWayland apps.

Windows version

Microsoft Windows 11 21H2 [Version 10.0.22000.708]

Linux kernel version

5.10.102.1-microsoft-standard-WSL2

Distro

ArchWSL 22.3.18.0

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_INTEROP" = "/run/WSL/8_interop"
[Distrod][DEBUG] WSL envs: "WSL_DISTRO_NAME" = "ArchLinux"
[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/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][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-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] 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)

additional comment

No response

Request to share your successful setup/configuration

I would like to ask all of you to share your successful setup/configuration for Distrod.

Please include:

  • the baseline of your host as given via systeminfo (freed from personal data)
  • the reduced/simplified step-by-step you took to get Distrod running for the given options mentioned in the README
  • include a proof regarding a task that requires systemd is working correctly, for example lxc, lxd, snap - feel free to mention what is not working at the end.

Why i am asking for it?

Because it helps everyone interested to use Distrod and might show up issues with the README, the general process, issues yet not identified although vaguely discovered with the core-routines, and so on.

Thank you.

help with running `docker-ce-cli`

I have followed instructions and installed Debian with distrod, now i've tried to install docker-ce-cli

manually dockerdis running but service cannot be started, how can i debug or analyse more?

systemctl status docker.service
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2021-11-25 19:24:50 CET; 32s ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
    Process: 2930 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
   Main PID: 2930 (code=exited, status=1/FAILURE)

Nov 25 19:24:50 md3fhv6c systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Nov 25 19:24:50 md3fhv6c systemd[1]: Stopped Docker Application Container Engine.
Nov 25 19:24:50 md3fhv6c systemd[1]: docker.service: Start request repeated too quickly.
Nov 25 19:24:50 md3fhv6c systemd[1]: docker.service: Failed with result 'exit-code'.
Nov 25 19:24:50 md3fhv6c systemd[1]: Failed to start Docker Application Container Engine.
Nov 25 19:25:16 md3fhv6c systemd[1]: docker.service: Start request repeated too quickly.
Nov 25 19:25:16 md3fhv6c systemd[1]: docker.service: Failed with result 'exit-code'.
Nov 25 19:25:16 md3fhv6c systemd[1]: Failed to start Docker Application Container Engine.

[Bug]: Distrod fails with error when it was launched via GWSL

Describe the bug

I've installed Arch + Qtile (also BSPWM). Everything was working good (Qtile was launching via GWSL). I've started configuring system, but now GWSL starts Qtile it works for a second-two and the window closes. I've enabled debugging on distrod and following error occur when I try to launch GWSL:
When I run manually following command I don't get any errors. How can I find the cause of issue?

Steps to reproduce

N/A

Expected behavior

No response

Windows version

Windows 10 - 21H1 (19043.1387)

Linux kernel version

Linux ICT-020L 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 GNU/Linux

Distro

Archlinux

How did you install that distro?

Installed by Distrod wizard

Logs

[farid@ICT-020L ~]$ systemctl list-unit-files | grep enabled
cntlm.service                           enabled   disabled
[email protected]                          enabled   enabled
portproxy.service                       enabled   disabled
sshd.service                            enabled   disabled
systemd-homed.service                   disabled  enabled
systemd-networkd.service                disabled  enabled
systemd-pstore.service                  disabled  enabled
systemd-resolved.service                disabled  enabled
systemd-timesyncd.service               disabled  enabled
systemd-userdbd.socket                  disabled  enabled
machines.target                         disabled  enabled
reboot.target                           disabled  enabled
remote-cryptsetup.target                disabled  enabled
remote-fs.target                        enabled   enabled

[farid@ICT-020L ~]$ /opt/distrod/bin/distrod-exec /bin/bash bash
[Distrod][DEBUG] distrod-exec: exec_command
[farid@ICT-020L ~]$

[farid@ICT-020L ~]$ sudo journalctl -f -b -k -t Distrod
-- Journal begins at Fri 2021-12-24 12:25:12 +04. --
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] distrod-exec: exec_command_in_distro
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] Executing a command in the distro.
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] Failed to ignore signal Sys(EINVAL)
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] Failed to ignore signal Sys(EINVAL)
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] Distro::exec_command.
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] Container::exec_command.
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] Triple fork done.
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] dropping privilege. kmsg logging in the child ends here.
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] distrod-exec: exec_command_in_distro
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] Executing a command in the distro.
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] Failed to ignore signal Sys(EINVAL)
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] Failed to ignore signal Sys(EINVAL)
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] Distro::exec_command.
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] Container::exec_command.
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] dropping privilege. kmsg logging in the child ends here.
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] Triple fork done.
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] distrod-exec: exec_command_in_distro
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] Executing a command in the distro.
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] Failed to ignore signal Sys(EINVAL)
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] Failed to ignore signal Sys(EINVAL)
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] Distro::exec_command.
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] Container::exec_command.
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] Triple fork done.
Dec 24 16:55:59 ICT-020L Distrod: [DEBUG] dropping privilege. kmsg logging in the child ends here.
Dec 24 16:56:01 ICT-020L Distrod: [DEBUG] distrod-exec: exec_command_in_distro
Dec 24 16:56:01 ICT-020L Distrod: [DEBUG] Executing a command in the distro.
Dec 24 16:56:01 ICT-020L Distrod: [DEBUG] Failed to ignore signal Sys(EINVAL)
Dec 24 16:56:01 ICT-020L Distrod: [DEBUG] Failed to ignore signal Sys(EINVAL)
Dec 24 16:56:01 ICT-020L Distrod: [DEBUG] Distro::exec_command.
Dec 24 16:56:01 ICT-020L Distrod: [DEBUG] Container::exec_command.
Dec 24 16:56:01 ICT-020L Distrod: [DEBUG] Triple fork done.
Dec 24 16:56:01 ICT-020L Distrod: [DEBUG] dropping privilege. kmsg logging in the child ends here.

List of installed packages:

[farid@ICT-020L ~]$ p -Q
acl 2.3.1-1
adobe-source-code-pro-fonts 2.038ro+1.058it+1.018var-1
adwaita-icon-theme 41.0-1
alacritty 0.9.0-3
alsa-card-profiles 1:0.3.42-2
alsa-lib 1.2.6.1-1
alsa-topology-conf 1.2.5.1-1
alsa-ucm-conf 1.2.6.3-1
alsa-utils 1.2.6-1
aom 3.2.0-1
apr 1.7.0-3
apr-util 1.6.1-9
arch-install-scripts 24-2
archlinux-keyring 20211028-1
argon2 20190702-4
asp 8-1
at-spi2-atk 2.38.0-1
at-spi2-core 2.42.0-1
atk 2.36.0-1
attr 2.5.1-1
audit 3.0.6-5
autoconf 2.71-1
autoconf-archive 1:2021.02.19-4
automake 1.16.5-1
avahi 0.8+22+gfd482a7-3
base 2-2
bash 5.1.012-1
bash-completion 2.11-2
bat 0.18.3-1
binutils 2.36.1-3
bison 3.8.2-1
bluez-libs 5.62-1
boost-libs 1.78.0-1
box2d 2.4.1-1
breezy 3.2.1-1
brotli 1.0.9-7
bspwm 0.9.10-1
bzip2 1.0.8-4
c-ares 1.18.1-1
ca-certificates 20210603-1
ca-certificates-mozilla 3.73.1-1
ca-certificates-utils 20210603-1
cairo 1.17.4-5
cantarell-fonts 1:0.303.1-1
celt 0.11.3-4
clucene 2.3.3.4-11
cntlm 0.92.3-5
code 1.62.0-1
code-server 3.12.0-0
coreutils 9.0-2
cryptsetup 2.4.2-1
curl 7.80.0-1
dav1d 0.9.2-1
db 5.3.28-5
dbeaver 21.3.1-1
dbeaver-plugin-apache-poi 4.1.1-2
dbeaver-plugin-batik 1.14.0-1
dbeaver-plugin-office 1.1.105.202110151816-1
dbeaver-plugin-svg-format 1.0.103.202110151816-1
dbus-glib 0.112-2
dbus-x11 1.12.20-1
dconf 0.40.0-1
desktop-file-utils 0.26-1
device-mapper 2.03.14-2
devtools 20211129-1
dhcpcd 9.4.1-1
diffutils 3.8-1
dnssec-anchors 20190629-3
docbook-xml 4.5-9
docbook-xsl 1.79.2-7
doxygen 1.9.2-1
e2fsprogs 1.46.4-1
electron13 13.6.3-1
elfutils 0.186-1
exo 4.16.3-1
expat 2.4.1-1
fakeroot-tcp 1.25.3-2
ffmpeg 2:4.4.1-1
file 5.41-1
filesystem 2021.12.07-1
findutils 4.8.0-1
firefox 95.0.2-1
flac 1.3.3-3
flex 2.6.4-3
fontconfig 2:2.13.94-2
freetype2 2.11.1-1
fribidi 1.0.11-1
gawk 5.1.1-1
gc 8.2.0-2
gcc 11.1.0-3
gcc-libs 11.1.0-3
gcr 3.41.0-1
gdbm 1.22-1
gdk-pixbuf2 2.42.6-2
gettext 0.21-1
giflib 5.2.1-2
git 2.34.1-1
glib-networking 1:2.70.1-1
glib2 2.70.2-1
glibc 2.33-5
gmp 6.2.1-1
gnome-keyring 1:40.0-1
gnupg 2.2.32-2
gnutls 3.7.2-2
gobject-introspection-runtime 1.70.0-4
google-chrome 96.0.4664.110-1
gpgme 1.16.0-3
gpm 1.20.7.r38.ge82d1a6-4
graphite 1:1.3.14-1
grep 3.7-1
groff 1.22.4-6
gsettings-desktop-schemas 41.0-1
gsm 1.0.19-1
gtk-update-icon-cache 1:4.4.1-1
gtk3 1:3.24.31-1
guile 2.2.7-2
gzip 1.11-1
harfbuzz 3.2.0-1
harfbuzz-icu 3.2.0-1
hicolor-icon-theme 0.17-2
hidapi 0.11.0-1
hunspell 1.7.0-3
hwids 20210613-1
hyphen 2.8.8-3
iana-etc 20211203-1
icedtea-web 1.8.8-1
icu 70.1-1
inetutils 2.2-1
iproute2 5.15.0-1
iptables 1:1.8.7-1
iputils 20211215-1
iso-codes 4.8.0-1
itstool 1:2.0.7-1
jack2 1.9.19-2
jansson 2.14-1
java-runtime-common 3-3
jq 1.6-4
jre-openjdk 17.0.1.u12-1
jre-openjdk-headless 17.0.1.u12-1
js78 78.15.0-1
json-c 0.15-2
json-glib 1.6.6-1
kbd 2.4.0-2
keyutils 1.6.3-1
khal 0.10.4-2
kmod 29-1
krb5 1.19.2-2
l-smash 2.14.5-2
lame 3.100-3
lcms2 2.12-1
ldns 1.7.1-2
less 1:590-1
libabw 0.1.3-2
libappindicator-gtk3 12.10.0.r296-1
libarchive 3.5.2-2
libass 0.15.2-1
libassuan 2.5.5-1
libasyncns 0.8+3+g68cd5af-3
libatomic_ops 7.6.12-1
libavc1394 0.5.4-4
libbluray 1.3.0-1
libcanberra 0.30+2+gc0620e4-5
libcap 2.62-1
libcap-ng 0.8.2-6
libcdr 0.1.7-3
libcloudproviders 0.3.1-2
libcolord 1.4.5-4
libcroco 0.6.13-2
libcups 1:2.4.0-4
libdaemon 0.14-5
libdatrie 0.2.13-1
libdbusmenu-glib 16.04.0-4
libdbusmenu-gtk3 16.04.0-4
libdrm 2.4.109-1
libe-book 0.1.3-10
libedit 20210910_3.1-1
libelf 0.186-1
libepoxy 1.5.9-1
libepubgen 0.1.1-2
libetonyek 0.1.10-1
libevdev 1.12.0-1
libevent 2.1.12-1
libexttextcat 3.4.6-1
libfdk-aac 2.0.2-1
libffi 3.4.2-4
libfontenc 1.1.4-3
libfreeaptx 0.1.1-1
libfreehand 0.1.2-3
libgcrypt 1.9.4-1
libglvnd 1.3.4-1
libgpg-error 1.43-1
libgtop 2.40.0+2+g31db82ef-2
libgudev 237-1
libibus 1.5.25-5
libice 1.0.10-3
libidn2 2.3.2-1
libiec61883 1.2.0-6
libindicator-gtk3 12.10.1-9
libinput 1.19.3-1
libixion 0.16.1-9
libjpeg-turbo 2.1.2-1
libksba 1.6.0-1
liblangtag 0.6.3-2
libldac 2.0.2.3-1
libldap 2.6.0-2
libmfx 21.3.5-1
libmm-glib 1.18.4-1
libmnl 1.0.4-3
libmodplug 0.8.9.0-3
libmpc 1.2.1-1
libmspub 0.1.4-11
libmwaw 0.3.21-1
libndp 1.8-1
libnet 1:1.1.6-1
libnetfilter_conntrack 1.0.8-1
libnewt 0.52.21-8
libnfnetlink 1.0.1-4
libnftnl 1.2.1-1
libnghttp2 1.46.0-1
libnl 3.5.0-3
libnm 1.32.12-2
libnma 1.8.32-1
libnotify 0.7.9-2
libnsl 2.0.0-1
libnumbertext 1.0.7-1
libodfgen 0.1.8-1
libogg 1.3.5-1
libomxil-bellagio 0.9.3-3
liborcus 0.16.1-10
libp11-kit 0.24.0-2
libpagemaker 0.0.4-2
libpcap 1.10.1-1
libpciaccess 0.16-2
libpgm 5.3.128-1
libpipeline 1.5.4-1
libpng 1.6.37-3
libproxy 0.4.17-6
libpsl 0.21.1-1
libpulse 15.0-1
libqxp 0.0.2-7
libraw1394 2.1.2-3
libreoffice-fresh 7.2.4-3
librevenge 0.0.4-3
librsvg 2:2.52.5-1
libsamplerate 0.2.2-1
libsasl 2.1.27-3
libseccomp 2.5.3-3
libsecret 0.20.4-1
libsm 1.2.3-2
libsndfile 1.0.31-1
libsodium 1.0.18-2
libsoup 2.74.2-1
libsoup3 3.0.3-1
libsoxr 0.1.3-2
libssh 0.9.6-1
libssh2 1.10.0-1
libstaroffice 0.0.7-1
libstemmer 2.2.0-1
libtasn1 4.18.0-1
libteam 1.31-5
libthai 0.1.29-1
libtheora 1.1.1-5
libtiff 4.3.0-1
libtirpc 1.3.2-1
libtommath 1.2.0-3
libtool 2.4.6+42+gb88cebd5-16
libunistring 0.9.10-3
libunwind 1.5.0-1
libusb 1.0.24-2
libutempter 1.2.1-1
libutf8proc 2.6.1-1
libuv 1.42.0-1
libva 2.13.0-1
libvdpau 1.4-1
libvisio 0.1.7-6
libvorbis 1.3.7-2
libvpx 1.11.0-1
libwacom 1.12-1
libwebp 1.2.1-2
libwpd 0.10.3-3
libwpg 0.3.3-2
libwps 0.4.12-1
libx11 1.7.3.1-1
libxau 1.0.9-3
libxaw 1.0.14-1
libxcb 1.14-1
libxcomposite 0.4.5-3
libxcrypt 4.4.27-1
libxcursor 1.2.0-2
libxcvt 0.1.1-1
libxdamage 1.1.5-3
libxdg-basedir 1.2.3-1
libxdmcp 1.1.3-3
libxext 1.3.4-3
libxfce4ui 4.16.1-1
libxfce4util 4.16.0-1
libxfixes 6.0.0-1
libxfont2 2.0.5-1
libxft 2.3.4-1
libxi 1.8-1
libxinerama 1.1.4-3
libxkbcommon 1.3.1-1
libxkbcommon-x11 1.3.1-1
libxkbfile 1.1.0-2
libxml2 2.9.12-5
libxmu 1.1.3-2
libxpm 3.5.13-2
libxrandr 1.5.2-3
libxrender 0.9.10-4
libxshmfence 1.3-2
libxslt 1.1.34-6
libxss 1.2.3-3
libxt 1.2.1-1
libxtst 1.2.3-4
libxv 1.0.11-4
libxxf86vm 1.1.4-4
libzmf 0.0.2-11
licenses 20200427-1
lilv 0.24.12-4
linux-api-headers 5.12.3-1
llvm-libs 13.0.0-6
lm_sensors 1:3.6.0.r41.g31d1f125-1
logrotate 3.18.1-1
lpsolve 5.5.2.11-1
luit 20210218-1
lv2 1.18.2-1
lz4 1:1.9.3-2
lzo 2.10-3
m4 1.4.19-1
mailcap 2.1.53-1
make 4.3-3
mallard-ducktype 1.0.2-8
man-db 2.9.4-2
man-pages 5.13-1
mercurial 6.0-3
mesa 21.3.2-1
minizip 1:1.2.11-4
mobile-broadband-provider-info 20210805-1
mpfr 4.1.0.p13-1
mtdev 1.1.6-1
nano 6.0-1
ncurses 6.3-1
neon 0.32.1-1
nerd-fonts-dejavu-complete 2.1.0-3
netctl 1.26-1
nettle 3.7.3-1
network-manager-applet 1.24.0-1
networkmanager 1.32.12-2
nm-connection-editor 1.24.0-1
nodejs 17.3.0-1
noto-fonts 20201226-2
noto-fonts-emoji 20211101-1
noto-fonts-extra 20201226-2
npth 1.6-3
nspr 4.33-1
nss 3.73.1-1
oniguruma 6.9.7.1-1
opencore-amr 0.1.5-5
openjpeg2 2.4.0-1
openresolv 3.12.0-1
openssh 8.8p1-1
openssl 1.1.1.m-1
opus 1.3.1-2
p11-kit 0.24.0-2
pacman 6.0.1-2
pacman-mirrorlist 20211212-1
pam 1.5.2-1
pambase 20211210-1
pango 1:1.50.3-1
paru-bin 1.9.2-1
patch 2.7.6-8
pciutils 3.7.0-1
pcre 8.45-1
pcre2 10.39-1
perl 5.34.0-3
perl-error 0.17029-3
perl-mailtools 2.21-5
perl-timedate 2.33-3
pinentry 1.2.0-1
pipewire 1:0.3.42-2
pipewire-alsa 1:0.3.42-2
pipewire-media-session 1:0.4.1-1
pipewire-pulse 1:0.3.42-2
pixman 0.40.0-1
pkgconf 1.8.0-1
polkit 0.120-3
poppler 21.11.0-1
popt 1.18-1
procps-ng 3.3.17-1
psmisc 23.4-1
python 3.10.1-1
python-appdirs 1.4.4-6
python-atomicwrites 1.4.0-7
python-cairocffi 1.3.0-1
python-cffi 1.15.0-3
python-click 8.0.3-3
python-click-log 0.3.2-9
python-configobj 5.0.6.r110.g3e2f4cc-3
python-dateutil 2.8.2-4
python-dbus-next 0.2.3-3
python-gobject 3.42.0-3
python-icalendar 4.0.9-3
python-iwlib 1.7.0-4
python-lxml 4.6.4-3
python-more-itertools 8.10.0-4
python-ordered-set 4.0.2-6
python-packaging 20.9-7
python-patiencediff 0.2.2-3
python-ply 3.11-10
python-psutil 5.8.0-4
python-pycparser 2.21-3
python-pyparsing 2.4.7-6
python-pytz 2021.3-4
python-pytz-deprecation-shim 0.1.0.post0-3
python-pyxdg 0.27-4
python-setuptools 1:57.4.0-6
python-setuptools-scm 6.3.2-3
python-six 1.16.0-5
python-tomli 1.2.2-4
python-tzdata 2021.5-3
python-tzlocal 4.0.1-3
python-urwid 2.1.2-3
python-xcffib 0.11.1-3
qtile-git 0.19.0.r3.ga56eb115-1
raptor 2.0.15-17
rasqal 1:0.9.33-4
rav1e 0.4.1-1
re2 1:20211101-1
readline 8.1.001-1
redland 1:1.0.17-8
rest 0.8.1-3
ripgrep 13.0.0-2
rofi 1.7.2-1
rsync 3.2.3-4
rtkit 0.13-1
sbc 1.5-2
sdl2 2.0.18-2
sed 4.8-1
serd 0.30.10-1
serf 1.3.9-5
shadow 4.8.1-4
shared-mime-info 2.0+115+gd74a913-1
slang 2.3.2-2
snappy 1.1.9-2
sord 0.16.8-1
sound-theme-freedesktop 0.8-4
speex 1.2.0-3
speexdsp 1.2.0-2
sqlite 3.37.0-1
sratom 0.6.8-3
srt 1.4.4-1
startup-notification 0.12-7
subversion 1.14.1-5
sudo 1.9.8.p2-3
svt-av1 0.8.7-1
sxhkd 0.6.2-1
sysfsutils 2.1.1-1
systemd 249.7-2
systemd-libs 249.7-2
systemd-sysvcompat 249.7-2
tar 1.34-1
tdb 1.4.5-3
terminus-font 4.49.1-2
texinfo 6.8-2
tracker3 3.2.1-2
trash-cli 0.21.10.24-2
ttf-dejavu 2.37+18+g9b5d1b2f-3
ttf-iosevka-nerd 2.1.0-1
ttf-liberation 2.1.5-1
ttf-nerd-fonts-symbols 2.1.0+36+gd0bf73a1-4
ttf-ubuntu-font-family 0.83-7
tzdata 2021e-1
util-linux 2.37.2-4
util-linux-libs 2.37.2-4
v4l-utils 1.22.1-1
vi 1:070224-5
vid.stab 1.1-3
vim 8.2.3582-3
vim-plug 0.10.0-1
vim-runtime 8.2.3582-3
vmaf 1.5.3-1
volumeicon 0.5.1-5
vulkan-icd-loader 1.2.202-1
wayland 1.20.0-1
webrtc-audio-processing 0.3.1-3
which 2.21-5
wireless_tools 30.pre9-3
wpa_supplicant 2:2.9-8
x11-ssh-askpass 1.2.4.1-7
x264 3:0.163.r3060.5db6aa6-1
x265 3.5-1
xbitmaps 1.1.2-2
xcb-proto 1.14.1-5
xcb-util 0.4.0-3
xcb-util-cursor 0.1.3-3
xcb-util-image 0.4.0-3
xcb-util-keysyms 0.4.0-3
xcb-util-renderutil 0.3.9-3
xcb-util-wm 0.4.1-3
xcb-util-xrm 1.3-2
xdg-utils 1.1.3+19+g9816ebb-1
xf86-input-libinput 1.2.0-2
xf86-video-vesa 2.5.0-2
xfconf 4.16.0-2
xkeyboard-config 2.34-1
xmlsec 1.2.33-1
xmlto 0.0.28-4
xorg-bdftopcf 1.1-2
xorg-docs 1.7.1-3
xorg-font-util 1.3.2-2
xorg-fonts-100dpi 1.0.3-7
xorg-fonts-75dpi 1.0.3-7
xorg-fonts-alias-100dpi 1.0.4-1
xorg-fonts-alias-75dpi 1.0.4-1
xorg-fonts-encodings 1.0.5-2
xorg-iceauth 1.0.8-2
xorg-mkfontscale 1.2.1-2
xorg-server 21.1.2-2
xorg-server-common 21.1.2-2
xorg-server-devel 21.1.2-2
xorg-server-xephyr 21.1.2-2
xorg-server-xnest 21.1.2-2
xorg-server-xvfb 21.1.2-2
xorg-sessreg 1.1.2-2
xorg-setxkbmap 1.3.2-2
xorg-smproxy 1.0.6-3
xorg-util-macros 1.19.3-1
xorg-x11perf 1.6.1-2
xorg-xauth 1.1.1-1
xorg-xbacklight 1.2.3-2
xorg-xcmsdb 1.0.5-3
xorg-xcursorgen 1.0.7-2
xorg-xdpyinfo 1.3.2-4
xorg-xdriinfo 1.0.6-2
xorg-xev 1.2.4-1
xorg-xgamma 1.0.6-3
xorg-xhost 1.0.8-2
xorg-xinput 1.6.3-2
xorg-xkbcomp 1.4.5-1
xorg-xkbevd 1.1.4-3
xorg-xkbutils 1.0.4-4
xorg-xkill 1.0.5-2
xorg-xlsatoms 1.1.3-2
xorg-xlsclients 1.1.4-2
xorg-xmodmap 1.0.10-2
xorg-xpr 1.0.5-2
xorg-xprop 1.2.5-1
xorg-xrandr 1.5.1-2
xorg-xrdb 1.2.1-1
xorg-xrefresh 1.0.6-2
xorg-xset 1.2.4-2
xorg-xsetroot 1.1.2-2
xorg-xvinfo 1.1.4-2
xorg-xwayland 21.1.4-1
xorg-xwd 1.0.8-1
xorg-xwininfo 1.1.5-2
xorg-xwud 1.0.5-2
xorgproto 2021.5-1
xterm 370-1
xvidcore 1.3.7-2
xxhash 0.8.1-1
xz 5.2.5-2
yelp-tools 41.0-1
yelp-xsl 41.1-1
zeromq 4.3.4-2
zimg 3.0.3-1
zita-alsa-pcmi 0.3.2-3
zita-resampler 1.8.0-1
zlib 1:1.2.11-4
zstd 1.5.0-1
[farid@ICT-020L ~]$

additional comment

No response

How to change default shell

Is it safe to use a different shell with a user?
As the default shell is set to /opt/distrod/alias/usr/bin/bash and I'd like to use fish as the shell for my default user.

Is it changing it to /usr/bin/fish okay, or will this break any distrod functionality?

systemctl reboot gives error Failed to spawn the command status.code() is None unexpectedly

I installed ArchLinux using Distrod. I have enabled it upon being given a prompt. I install xorg-server and xorg-xinit. I installed lightdm and lightdm-gtk-greeter and enabled it using systemctl enable lightdm. I also installed qtile using pacman -S qtile. After that, to start lightdm at startup, I did systemctl reboot. I got the following error:

Hangup
[Distrod][ERROR] Failed to spawn the command.
Caused by:
status.code() is None unexpectedly.

I then tried to start x server manually by doing startx which gave the following error:
Xorg.1.log

I had also install alacritty terminal emulator and when I ran alacritty, it worked fine and a terminal instance spawned.

I also tried starting qtile directly by running qtile start but got the error

2021-11-22 16:49:34,139 libqtile core.py:init():L106 not starting; existing window manager Weston WM
Traceback (most recent call last):
File "/usr/sbin/qtile", line 33, in
sys.exit(load_entry_point('qtile==0.18.1', 'console_scripts', 'qtile')())
File "/usr/lib/python3.9/site-packages/libqtile/scripts/main.py", line 55, in main
options.func(options)
File "/usr/lib/python3.9/site-packages/libqtile/scripts/start.py", line 87, in start
q = make_qtile(options)
File "/usr/lib/python3.9/site-packages/libqtile/scripts/start.py", line 50, in make_qtile
kore = libqtile.backend.get_core(options.backend)
File "/usr/lib/python3.9/site-packages/libqtile/backend/init.py", line 15, in get_core
return importlib.import_module(f"libqtile.backend.{backend}.core").Core(*args)
File "/usr/lib/python3.9/site-packages/libqtile/backend/x11/core.py", line 107, in init
raise ExistingWMException(existing_wmname)
libqtile.backend.x11.core.ExistingWMException: Weston WM

meaning that Weston WM (which I guess wsl is built on) was already running

I am on windows build 22504.1010

Failed to register the distribution

System: Windows 10 Pro, WSL version 2. Here's the log:

[Distrod] Choose a linuxcontainers.org image from the list above.
[Distrod] Type the name or the index of your choice.
[Default: ubuntu]: 4
[Distrod] Fetching from linuxcontainers.org...
[1] 2.0.20210525.0
[2] current
[Distrod] Choose a version from the list above.
[Distrod] Type the name or the index of your choice.
[Default: current]:
[Distrod] Fetching from linuxcontainers.org...
[Distrod] Downloading 'https://images.linuxcontainers.org/images/amazonlinux/current/amd64/default/20211109_05:09/rootfs.tar.xz'...
  [00:00:02] [#########################################################################] 52.27MiB/52.27MiB (25.77MiB/s, 0s)
[Distrod] Download done.
[Distrod] Unpacking and merging the given rootfs to the distrod rootfs. This may take a while...
[Distrod] Now Windows is installing the new distribution. This may take a while...
Unspecified error
[Distrod][ERROR] Failed to register the distribution.
Caused by:
    Failed: cmd.exe /C wsl --import Distrod %LocalAppData%\Distrod "C:\\Users\\me\\AppData\\Local\\Temp\\.tmpdmQenr\\install.tar.gz"

Failed to register distribution

Not sure what is happening here it makes the file in that location then as it completed the extract and starts the import it fails.

[Distrod] Choose a linuxcontainers.org image from the list above.
[Distrod] Type the name or the index of your choice.
[Default: ubuntu]: archlinux
[Distrod] Fetching from linuxcontainers.org...
[1] current
[Distrod] Choose a version from the list above.
[Distrod] Type the name or the index of your choice.
[Default: current]:
[Distrod] Fetching from linuxcontainers.org...
[Distrod] Downloading 'https://images.linuxcontainers.org/images/archlinux/current/amd64/default/20220525_04:18/rootfs.tar.xz'...
  [00:00:01] [#################################################] 146.42MiB/146.42MiB (86.70MiB/s, 0s)
[Distrod] Download done.
[Distrod] Unpacking and merging the given rootfs to the distrod rootfs. This may take a while...
[Distrod] Now Windows is installing the new distribution. This may take a while...
Unspecified error
[Distrod][ERROR] Failed to register the distribution.

Caused by:
    Failed: cmd.exe /C wsl --import Distrod %LocalAppData%\Distrod "C:\\Users\\jphadmin\\AppData\\Local\\Temp\\.tmpQVfSkF\\install.tar.gz"

Install (Option 2) failed - fallback to normal WSL2 command execution without using systemd

Following the README choosing Option 2 with no automatic start on boot:

  1. curl -L -O "https://raw.githubusercontent.com/nullpo-head/wsl-distrod/main/install.sh"
cldsrphl@D11MMWNX0SDPS66ENGUS:/mnt/c/Users/cldsrphl$ curl -L -O "https://raw.githubusercontent.com/nullpo-head/wsl-distrod/main/install.sh"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2784  100  2784    0     0   1916      0  0:00:01  0:00:01 --:--:--  1926
  1. chmod +x install.sh
cldsrphl@D11MMWNX0SDPS66ENGUS:/mnt/c/Users/cldsrphl$ chmod +x install.sh
  1. sudo ./install.sh install
cldsrphl@D11MMWNX0SDPS66ENGUS:/mnt/c/Users/cldsrphl$ sudo ./install.sh install
[sudo] password for cldsrphl:
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   152  100   152    0     0    391      0 --:--:-- --:--:-- --:--:--   390
100   626  100   626    0     0   1092      0 --:--:-- --:--:-- --:--:--  1092
100 11.6M  100 11.6M    0     0  4143k      0  0:00:02  0:00:02 --:--:-- 7050k
alias/
bin/
bin/adduser
bin/portproxy
bin/useradd
bin/portproxy.exe
bin/chsh
bin/distrod-exec
bin/distrod
conf/
conf/tcp4_ports
conf/distrod.toml
ld/
ld/ld-linux-x86-64.so.2
lib/
lib/libc.so.6
lib/libssl.so.1.1
lib/libgcc_s.so.1
lib/librt.so.1
lib/libcrypto.so.1.1
lib/libm.so.6
lib/libdl.so.2
lib/liblzma.so.5
lib/libpthread.so.0
misc/
misc/licenses/
misc/licenses/crate-license.html
misc/licenses/libs/
misc/licenses/libs/libgcc-s1/
misc/licenses/libs/libgcc-s1/libgcc_s.so.1.LICENSE
misc/licenses/libs/libgcc-s1/copyright
misc/licenses/libs/libssl1.1/
misc/licenses/libs/libssl1.1/libcrypto.so.1.1.LICENSE
misc/licenses/libs/libssl1.1/copyright
misc/licenses/libs/libssl1.1/libssl.so.1.1.LICENSE
misc/licenses/libs/liblzma5/
misc/licenses/libs/liblzma5/copyright
misc/licenses/libs/liblzma5/liblzma.so.5.LICENSE
misc/licenses/libs/libc6/
misc/licenses/libs/libc6/libc.so.6.LICENSE
misc/licenses/libs/libc6/libpthread.so.0.LICENSE
misc/licenses/libs/libc6/ld-linux-x86-64.so.2.LICENSE
misc/licenses/libs/libc6/copyright
misc/licenses/libs/libc6/libdl.so.2.LICENSE
misc/licenses/libs/libc6/librt.so.1.LICENSE
misc/licenses/libs/libc6/libm.so.6.LICENSE
misc/distrod-post-update
run/
run/tmpfiles.d/
run/tmpfiles.d/x11.conf
run/systemd/
run/systemd/system/
run/systemd/system/portproxy.service
Installation is complete!
  1. /opt/distrod/bin/distrod enable
cldsrphl@D11MMWNX0SDPS66ENGUS:/mnt/c/Users/cldsrphl$ /opt/distrod/bin/distrod enable
[Distrod][ERROR] Distrod needs the root permission.

[TODO]: Update the README - sudo is required_

  1. sudo /opt/distrod/bin/distrod enable
cldsrphl@D11MMWNX0SDPS66ENGUS:/mnt/c/Users/cldsrphl$ sudo /opt/distrod/bin/distrod enable
[Distrod] Distrod has been enabled. Now your shell will start under systemd.
  1. 'systemctl status`
cldsrphl@D11MMWNX0SDPS66ENGUS:/mnt/c/Users/cldsrphl$ systemctl status
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
  1. 'exit'
cldsrphl@D11MMWNX0SDPS66ENGUS:/mnt/c/Users/cldsrphl$ exit
  1. wsl --terminate Distrod
C:\Users\cldsrphl>wsl --terminate Distrod
C:\Users\cldsrphl>wsl -d Distrod
[Distrod][ERROR] Failed to run the given command in the Systemd container. Fall back to normal WSL2 command execution without using Systemd. Failed to launch the distro.

Caused by:
    0: Failed to make mountpoint shared.
    1: Failed to make the /tmp mountpoint shared.
    2: EINVAL: Invalid argument

_ Please advise on how to investigate further._

NOTE: for system-related info please have a look at the issue Install (Option 1) failed - fallback to normal WSL2 command execution without using systemd

[minor] errors on shell startup

Hi,
when I boot up the first shell in Ubuntu Community Preview, I get:
grep: /proc/sys/fs/binfmt_misc/WSLInterop: No such file or directory
grep: /proc/sys/fs/binfmt_misc/WSLInterop: No such file or directory
In the stable Ubuntu, however, I get:
Failed to connect to bus: No such file or directory
Failed to connect to bus: No such file or directory

However, nothing seems to be broken.

steps to reproduce: wsl --shutdown and then open up a new shell

distrod doesn't run user.slice?

After installing distrod, systemctl status only showed init.scope and system.slice running - there is no user.slice (and user-1000.slice, etc). Have I done something wrong? Or if not, there is a way perhaps to configure it to run the user systemd units? I was hoping to get gvfs-daemon running to allow nautilus to connect to sftp:// locations.

I installed distrod as per the instructions to add it to my existing distro, ie I downloaded and ran install.sh with the install argument and then ran "/opt/distrod/bin/distrod enable" (both as sudo, as the commands complain if not run as sudo). I then terminated wsl with "wsl --shutdown" (note that "wsl --terminate Distrod" as per the instructions didn't work, since I had only added distrod to my existing distro, so Distrod did not exist) and re-ran wsl.

Start distrod in the os ~/home instead of under /mnt/c/

Describe the bug

When start the distro, the home dir is under /mnt/c. I always have to cd ~, and then source ~/.bashrc to get what I want. How can set this up so it's always in the ~ ?

Steps to reproduce

When start the distro, the home dir is under /mnt/c. I always have to cd ~, and then source ~/.bashrc to get what I want. How can set this up so it's always in the ~ ?

Expected behavior

No response

Windows version

V21H2

Linux kernel version

Linux HB3H6D3 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Distro

Centos8

How did you install that distro?

Installed by Distrod wizard

Logs

.

additional comment

No response

[Bug]: network connectivity not working

Describe the bug

i installed ubuntu 20.04 by pressing enter 3 times in the installer, and when i logged in to wsl there was no internet

Steps to reproduce

install any distro using on wsl-distrod

Expected behavior

no issues

Windows version

Windows 10 21H1

Linux kernel version

Linux epikstation 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Distro

Ubuntu 20.04

How did you install that distro?

Installed by Distrod wizard

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: "WSLENV" = "WT_SESSION::WT_PROFILE_ID"
[Distrod][DEBUG] WSL envs: "WSL_INTEROP" = "/run/WSL/17_interop"
[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][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][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,
}

additional comment

No response

[Bug]: Can't list systemd services

Describe the bug

I'm using opensuse-tumbleweed on WSL2. I installed distrod, and things seem okay except that systemctl status gives me the following:

❯ systemctl status
Failed to dump process list for 'DESKTOP-OT5165E', ignoring: Input/output error
● DESKTOP-OT5165E
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Mon 2022-04-04 16:29:24 EDT; 12min ago
   CGroup: /

Steps to reproduce

systemctl status

Expected behavior

List of systemd services

Windows version

11 21H2 22000.593

Linux kernel version

Linux DESKTOP-OT5165E 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Distro

opensuse-tumbleweed

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" = "openSUSE-Tumbleweed"
[Distrod][DEBUG] WSL envs: "WSL_INTEROP" = "/run/WSL/8_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/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-uid0")), target: ContainerPath("/run/distrod/distrod_wsl_env-uid0"), 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][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][DEBUG] Triple fork done.
[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/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-uid0",
    ),
), ContainerMount {
    source: Some(
        HostPath(
            "/run/distrod/distrod_wsl_env-uid0",
        ),
    ),
    target: ContainerPath(
        "/run/distrod/distrod_wsl_env-uid0",
    ),
    fstype: None,
    flags: MS_BIND,
    data: None,
    is_file: true,
}
[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)

additional comment

I don't have any Distrod entries in journalctl, it doesn't appear to be set up for it. I got them from the boot.

gdb not working with distrod

When I run a program in gdb I get the following error message:

[Distrod][ERROR] Failed to drop_privilege. Aborting.

If I disable distrod debugging goes fine without any problems.

For the time being I simply disable distrod whenever I have to use gdb however a permanent solution would be greatly appreciated.

[Distrod][ERROR] Initialization command exited with error. error: 126 cmd: WslCommand { distribution_name: "Distrod", command: Some("/opt/distrod/bin/distrod"), args: ["enable", "-d"] }

Describe the bug

When i try to install https://github.com/fedora-cloud/docker-brew-fedora/blob/33/aarch64/fedora-33.20211125-aarch64.tar.xz i get the following error after entering my user:

"[Distrod][ERROR] Initialization command exited with error. error: 126 cmd: WslCommand { distribution_name: "Distrod", command: Some("/opt/distrod/bin/distrod"), args: ["enable", "-d"] }"

this is becaue /opt/distrod/bin/distrod is not an arm64 binary.

file /opt/distrod/bin/distrod
distrod: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /opt/distrod/ld/ld-linux-x86-64.so.2, BuildID[sha1]=b0f96f234969faf62ffe970de63edd16aadffa2c, for GNU/Linux 3.2.0, with debug_info, not stripped

How can i get this compiled by myself for arm64, since I have a arm64 pc ?

Thanks
Miro

Steps to reproduce

see above

Expected behavior

recognizes arm64 and uses arm64 binaries instead of x86/x64 binaries

Windows version

22000.469

Linux kernel version

5.10.74.3-microsoft-standard-WSL2 #1 SMP Mon Oct 18 19:27:44 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

Distro

Fedora-33

How did you install that distro?

Installed by Distrod wizard

Logs

sudo journalctl -b -k -t Distrod
sudo: journalctl: command not found

additional comment

No response

[Bug]: Sanity check of "WSLENV" failed

Describe the bug

Getting this error upon starting a new session. It seems to work, but curious about the error. Here's the contents of my $ENV.

[Distrod][WARN] sanity check of "WSLENV" failed.
❯ echo $WSLENV
WT_SESSION:%WSLENV%:GIT_EXEC_PATH/wp:GIT_EXEC_PATH/wp:WT_PROFILE_ID

Running Arch. Thanks.

Steps to reproduce

Upon opening a new terminal. Happens after wsl --shutdown distro and reopen terminal as well. Error first thing to appear on screen.

Expected behavior

No response

Windows version

19043.1466

Linux kernel version

Linux DESKTOP-I7VTT9N 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 GNU/Linux

Distro

Arch

How did you install that distro?

Enabled distrod in an existing WSL2 distro

Logs

Do not have logs.

additional comment

No response

[Bug]: `systemctl status` failed after upgrading systemd to version 250

Describe the bug

After upgrading the version of systemd to 250, systemctl status doesn't work in Distrod and shows Failed to dump process list for 'PC', ignoring: Input/output error.

Steps to reproduce

  1. Upgrade systemd to version 250.
    ❯  systemctl --version
    systemd 250 (250.1-1-arch)
    +PAM +AUDIT -SELINUX -APPARMOR -IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -BPF_FRAMEWORK +XKBCOMMON +UTMP -SYSVINIT default-hierarchy=unified
    
  2. Run systemctl status, and the error is as below.
    ❯ sudo systemctl status
    Failed to dump process list for 'PC', ignoring: Input/output error
    ● PC
        State: running
         Jobs: 0 queued
       Failed: 0 units
        Since: Fri 2022-01-07 00:21:11 CST; 41min ago
       CGroup: /
    
  3. Downgrade systemd to 249 and it works again.
❯  systemctl --version
systemd 249 (249rc3-2-arch)
+PAM +AUDIT -SELINUX -APPARMOR -IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +XKBCOMMON +UTMP -SYSVINIT default-hierarchy=unified
❯ sudo systemctl status
● PC
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Fri 2022-01-07 00:21:11 CST; 41min ago
   CGroup: /
           ├─init.scope
           └─system.slice
             ├─systemd-networkd.service
             │ └─922 /usr/lib/systemd/systemd-networkd
             ├─systemd-udevd.service
             ├─systemd-homed.service
             │ └─129 /usr/lib/systemd/systemd-homed
             ├─cronie.service
             │ └─116 /usr/bin/crond -n
             ├─docker.service …
             │ ├─125 /usr/bin/dockerd -H fd://
             │ └─209 containerd --config /var/run/docker/containerd/containerd.toml --log-level info
             ├─systemd-journald.service
             ├─sshd.service
             │ └─128 sshd: /usr/bin/sshd -D [listener] 0 of 10-100 startups
             ├─systemd-userdbd.service
             │ ├─1062 /usr/lib/systemd/systemd-userdbd
             │ ├─1178 systemd-userwork
             │ ├─1179 systemd-userwork
             │ └─1180 systemd-userwork

Expected behavior

systemctl status shouldn't fail. Actually, version 250 works fine on my another Arch Linux machine.

Windows version

Windows 11 (Build 22523.1000)

Linux kernel version

Linux PC 5.10.74.3-microsoft-standard-WSL2 #1 SMP Mon Oct 18 19:27:44 UTC 2021 x86_64 GNU/Linux

Distro

Arch Linux

How did you install that distro?

Installed by Distrod wizard

Logs

[Distrod][DEBUG] distrod-exec: exec_command_in_distro
[Distrod][DEBUG] starting /init from distrod-exec
[Distrod][DEBUG] WSL envs: "WSLENV" = "WT_SESSION::WT_PROFILE_ID"
[Distrod][DEBUG] WSL envs: "WSL_DISTRO_NAME" = "Distrod"
[Distrod][DEBUG] WSL envs: "WSL_INTEROP" = "/run/WSL/8_interop"
[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-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][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][DEBUG] dropping privilege. kmsg logging in the child ends here.
[Distrod][DEBUG] Triple fork done.
[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][DEBUG] The parent of the second of three forks exits.
[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] 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)

additional comment

No response

[TUTORIAL] WSL2 + DISTROD + FULL SYSTEMD + GUI DESKTOP

https://gist.github.com/mgood7123/cb1669169d67218a8518a42e6c585241

COPY

first install distrod

select archlinux

install it

systemd is not fully working yet, lets fix that

next create /etc/wsl.conf with the contents

[user]
default=root

next edit /etc/profile.d/distrod-user-wsl-envs.sh to look like the following

#!/bin/sh

# Load additional WSL session environment variables at runtime by sourcing
# a script Distrod creates at runtime. A Linux user who launches Distrod first
# can manipulte the contents of this script, so the script file is per-user one
# to prevent the user from manipulating other user's environment variables.

if [ -e "/run/distrod/distrod_wsl_env-uid$(id -u)" ]; then
    . "/run/distrod/distrod_wsl_env-uid$(id -u)"
fi

# If the creator of the script is root, a non-root user loading it is harmless
if [ "$(id -u)" != 0 ] && [ -e "/run/distrod/distrod_wsl_env-uid0" ]; then
    . "/run/distrod/distrod_wsl_env-uid0"
fi

if [ "$(id -u)" == 0 ]; then
    echo
    echo "!!! INFO START !!!"
    echo
    echo "To start up the X11 server, please enter the following:"
    echo
    echo "sudo systemctl restart xrdp ; sudo systemctl status xrdp ; startx"
    echo
    echo
    echo
    echo "look for the following lines:"
    echo
    echo "Jul 16 18:14:06 DESKTOP-VJSURS0 xrdp[250]: [INFO ] address [0.0.0.0] port [3389] mode 1"
    echo "Jul 16 18:14:06 DESKTOP-VJSURS0 xrdp[250]: [INFO ] listening to port 3389 on 0.0.0.0"
    echo
    echo
    echo
    echo "then in a new windows terminal:"
    echo
    echo "mstsc.exe /v localhost:3389"
    echo
    echo "with 3389 being the port number you see in the lines above"
    echo
    echo "!!! INFO END !!!"
    echo
    # replace `archlinux` with your username
    su - archlinux -p -c "sudo -S login -f archlinux"
fi

replace archlinux with your username, this will spawn /run/user/ID and the [email protected], enabling systemctl --user commands

next exit wsl

then in terminal

wsl --shutdown
wsl -s Distrod
wsl

now we have systemd working, lets get xorg working

wsl xorg requires a headerless xorg setup

install xorg

sudo pacman -S xorg xf86-video-dummy --noconfirm --needed

create /etc/X11/xorg.conf.d/10-headless.conf with the following content

Section "Monitor"
        Identifier "dummy_monitor"
        HorizSync 28.0-80.0
        VertRefresh 48.0-75.0
        Modeline "1920x1080" 172.80 1920 2040 2248 2576 1080 1081 1084 1118
EndSection

Section "Device"
        Identifier "dummy_card"
        VideoRam 256000
        Driver "dummy"
EndSection

Section "Screen"
        Identifier "dummy_screen"
        Device "dummy_card"
        Monitor "dummy_monitor"
        SubSection "Display"
        EndSubSection
EndSection

next, allow X11 to start as normal user

sudo bash -c "echo allowed_users = anybody > /etc/X11/Xwrapper.config"

next, create ~/.xinitrc with the following contents

#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"
fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some nice programs

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

/usr/lib/plasma-dbus-run-session-if-needed startplasma-x11

next, install yay, xrpc, and xorgxrdp

pacman -S git base-devel --noconfirm
cd
git clone https://aur.archlinux.org/yay-bin.git
cd yay-bin
makepkg -si
yay -S xrpc
yay -S xorgxrpc

next, open ~/.bashrc and add the following

## test for an existing bus daemon, just to be safe
if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
  ## if not found, launch a new one
  eval `dbus-launch --sh-syntax`
fi

if test -z "$XDG_RUNTIME_DIR" ; then
  export XDG_RUNTIME_DIR=/run/user/$(id -u)
fi

export EDITOR=nano

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
    alias pacman='pacman --color=auto'
    alias yay='yay --color=auto'
fi

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

next, we install the plasma desktop

sudo pacman -S kde-desktop konsole dolphin kate konversation firefox discover

next, start xrdp

sudo systemctl start xrdp
sudo systemctl status xrdp

take note of the port number, refer to it as $PORT

and now start X11

startx

next, open a new terminal and login with your LINUX username and password

mstsc.exe /v localhost:$PORT

replace $PORT with the number from earlier

Distrod won't start

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.    

[Bug]: State considered as degraded when running systemctl status

Describe the bug

I followed the exact same instruction to enable systemd using option 2, but I keep getting this(state: degraded):

[sudo] password for floodcode:
[Distrod] Distrod has been enabled. Now your shell will start under systemd.
floodcode@Amos:~$ systemctl status
● Amos
State: degraded
Jobs: 0 queued
Failed: 1 units
Since: Wed 2021-12-22 01:05:30 WAT; 9min ago
CGroup: /
├─init.scope
│ └─1 /sbin/init systemd.setenv=WSL_INTEROP=/run/WSL/113_interop systemd.setenv=WSL_DISTRO_NAME=Ubuntu-20.04>
├─system.slice
│ ├─snap-lxd-21029.mount
│ │ └─90 snapfuse /var/lib/snapd/snaps/lxd_21029.snap /snap/lxd/21029 -o ro,nodev,allow_other,suid
│ ├─systemd-udevd.service
│ │ └─79 /lib/systemd/systemd-udevd
│ ├─cron.service
│ │ └─119 /usr/sbin/cron -f
│ ├─polkit.service
│ │ └─893 /usr/lib/policykit-1/polkitd --no-debug
│ ├─networkd-dispatcher.service
│ │ └─122 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers
│ ├─systemd-journald.service
│ │ └─61 /lib/systemd/systemd-journald
│ ├─snap-snapd-12704.mount
│ │ └─89 snapfuse /var/lib/snapd/snaps/snapd_12704.snap /snap/snapd/12704 -o ro,nodev,allow_other,suid
│ ├─atd.service
│ │ └─137 /usr/sbin/atd -f
│ ├─unattended-upgrades.service
│ │ └─239 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
│ ├─snapd.service
│ │ └─125 /usr/lib/snapd/snapd
│ ├─rsyslog.service
│ │ └─124 /usr/sbin/rsyslogd -n -iNONE
│ ├─dbus.service
│ │ └─120 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslo>
│ ├─systemd-logind.service
│ │ └─128 /lib/systemd/systemd-logind
│ └─snap-core18-2128.mount
│ └─91 snapfuse /var/lib/snapd/snaps/core18_2128.snap /snap/core18/2128 -o ro,nodev,allow_other,suid
└─restricted
lines 10-38/38 (END)

Steps to reproduce

I followed the instructions, made sure I exited wsl's terminal and ran wsl --terminate Distro on windows cmd, but nothing works, says 'There is no distribution with the supplied name.' then again I ran wsl --terminate Ubuntu-20.04 before opening my wsl terminal. Running systemctl status produced the above logs.

Expected behavior

I expected the status to be active or running but not degraded. Hope nothing has been broken

Windows version

21H1 (OS Build 19043.1415)

Linux kernel version

Linux Amos 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Distro

Ubuntu 20.04

How did you install that distro?

Enabled distrod in an existing WSL2 distro

Logs

[sudo] password for floodcode:
[Distrod] Distrod has been enabled. Now your shell will start under systemd.
floodcode@Amos:~$ systemctl status
● Amos
State: degraded
Jobs: 0 queued
Failed: 1 units
Since: Wed 2021-12-22 01:05:30 WAT; 9min ago
CGroup: /
├─init.scope
│ └─1 /sbin/init systemd.setenv=WSL_INTEROP=/run/WSL/113_interop systemd.setenv=WSL_DISTRO_NAME=Ubuntu-20.04>
├─system.slice
│ ├─snap-lxd-21029.mount
│ │ └─90 snapfuse /var/lib/snapd/snaps/lxd_21029.snap /snap/lxd/21029 -o ro,nodev,allow_other,suid
│ ├─systemd-udevd.service
│ │ └─79 /lib/systemd/systemd-udevd
│ ├─cron.service
│ │ └─119 /usr/sbin/cron -f
│ ├─polkit.service
│ │ └─893 /usr/lib/policykit-1/polkitd --no-debug
│ ├─networkd-dispatcher.service
│ │ └─122 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers
│ ├─systemd-journald.service
│ │ └─61 /lib/systemd/systemd-journald
│ ├─snap-snapd-12704.mount
│ │ └─89 snapfuse /var/lib/snapd/snaps/snapd_12704.snap /snap/snapd/12704 -o ro,nodev,allow_other,suid
│ ├─atd.service
│ │ └─137 /usr/sbin/atd -f
│ ├─unattended-upgrades.service
│ │ └─239 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
│ ├─snapd.service
│ │ └─125 /usr/lib/snapd/snapd
│ ├─rsyslog.service
│ │ └─124 /usr/sbin/rsyslogd -n -iNONE
│ ├─dbus.service
│ │ └─120 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslo>
│ ├─systemd-logind.service
│ │ └─128 /lib/systemd/systemd-logind
│ └─snap-core18-2128.mount
│ └─91 snapfuse /var/lib/snapd/snaps/core18_2128.snap /snap/core18/2128 -o ro,nodev,allow_other,suid
└─restricted
lines 10-38/38 (END)

additional comment

Pls help. Thanks

[Bug]: distrod_wsl_launcher fails if the user profile folder within Windows includes a space in name

Describe the bug

Import of the rootfs-image fails if the user profile folder within Windows includes a space such as Test User (derivated from a local user account name).

Steps to reproduce

Prerequisites:
distrod_wsl_launcher v0.1.5
Profile folder in Windows consisting out of two words.

Steps:
Start distrod_wsl_launcher an select an image or use a local file.

Expected behavior

WSL distro will be imported and installed.

Windows version

Microsoft Windows [Version 10.0.22000.466]

Linux kernel version

Linux 5.10.93.3-microsoft-WSL2 #1 SMP Sun Jan 23 18:53:16 CET 2022 x86_64 GNU/Linux

Distro

archlinux

How did you install that distro?

Installed by Distrod wizard

Logs

[Distrod][ERROR] Failed to register the distribution.
Caused by:
Failed: cmd.exe /C wsl --import Distrod %LocalAppData%\Distrod "C:\TEMP\system\.tmp2OMAbF\install.tar.gz"

additional comment

Fix:
Put the install location inside brackets.
%LocalAppData%\Distrod -> "%LocalAppData%\Distrod"

[Bug]: Failed to connect to bus: No such file or directory systemctl --user flag

Describe the bug

Bug happens when I try to run systemctl with --user flag

normal systemctl enable service works fine but I would like to run as user, is this possible?

Steps to reproduce

systemctl --user enable service

Expected behavior

No response

Windows version

21H2 19044.1348

Linux kernel version

Linux win 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Distro

Ubuntu Focal

Logs

a

additional comment

No response

Install (Option 1) failed - fallback to normal WSL2 command execution without using systemd

Following the README, choosing Option 1 i checked that default for WSL is version 2, then downloaded the .zip linked in Step 1 and executed the .exe to run Distrod. The following is the (self-explaining) output:

        ██████╗ ██╗███████╗████████╗██████╗  ██████╗ ██████╗
        ██╔══██╗██║██╔════╝╚══██╔══╝██╔══██╗██╔═══██╗██╔══██╗
        ██║  ██║██║███████╗   ██║   ██████╔╝██║   ██║██║  ██║
        ██║  ██║██║╚════██║   ██║   ██╔══██╗██║   ██║██║  ██║
        ██████╔╝██║███████║   ██║   ██║  ██║╚██████╔╝██████╔╝
        ╚═════╝ ╚═╝╚══════╝   ╚═╝   ╚═╝  ╚═╝ ╚═════╝ ╚═════╝
=================================================================================
Thanks for trying Distrod! Choose your distribution to install.
You can install a local .tar.xz, or download an image from linuxcontainers.org.

* linuxcontainers.org is a vendor-neutral project that offers distro images for
  containers, which is not related to Distrod. LXC/LXD is one of its projects.
  BTW, you can run Systemd with distrod, so you can try LXC/LXD with distrod!
=================================================================================
[1] Use a local tar.xz file
[2] Download an image from linxcontainers.org
[Distrod] Choose the way to get a distro image from the list above.
[Distrod] Type the name or the index of your choice.
[Default: Download an image from linxcontainers.org]: 2
[Distrod] Fetching from linuxcontainers.org...
[1] almalinux
[2] alpine
[3] alt
[4] amazonlinux
[5] apertis
[6] archlinux
[7] busybox
[8] centos
[9] debian
[10] devuan
[11] fedora
[12] funtoo
[13] gentoo
[14] kali
[15] mint
[16] opensuse
[17] openwrt
[18] oracle
[19] plamo
[20] pld
[21] rockylinux
[22] sabayon
[23] springdalelinux
[24] ubuntu
[25] voidlinux
[Distrod] Choose a linuxcontainers.org image from the list above.
[Distrod] Type the name or the index of your choice.
[Default: ubuntu]: 11
[Distrod] Fetching from linuxcontainers.org...
[1] 33
[2] 34
[3] 35
[Distrod] Choose a version from the list above.
[Distrod] Type the name or the index of your choice.
[Default: 35]: 35
[Distrod] Fetching from linuxcontainers.org...
[Distrod] Downloading 'https://images.linuxcontainers.org/images/fedora/35/amd64/default/20211118_20:33/rootfs.tar.xz'...
  [00:00:13] [####################################################] 85.36MiB/85.36MiB (6.23MiB/s, 0s)
[Distrod] Download done.
[Distrod] Unpacking and merging the given rootfs to the distrod rootfs. This may take a while...
[Distrod] Now Windows is installing the new distribution. This may take a while...
[Distrod] Distrod is installed in %LocalAppData%\Distrod
[Distrod] Done!
[Distrod] Please input the new Linux user name. This doesn't have to be the same as your Windows user name.
[Input user name]: cldsrphl
Changing password for user cldsrphl.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[Distrod] Querying the generated uid. This may take some time depending on your machine.
[Distrod] Initializing the new Distrod distribution. This may take a while...
[Distrod] Distrod has been enabled. Now your shell will start under systemd.
[Distrod] Setting the default user to uid: 1000
[Distrod] Installation of Distrod is now complete.
[Distrod][ERROR] Failed to run the given command in the Systemd container. Fall back to normal WSL2 command execution without using Systemd. Failed to launch the distro.

Caused by:
    0: Failed to make mountpoint shared.
    1: Failed to make the /tmp mountpoint shared.
    2: EINVAL: Invalid argument
[cldsrphl@D11MMWNX0SDPS66ENGUS distrod_wsl_launcher-x86_64]$

The following is (redacted/freed from personal data) info about my system - commands executed in CMD:

  1. SystemInfo:
C:\Users\cldsrphl>systeminfo
Host Name:                 D11MMWNX0SDPS66
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.19044 N/A Build 19044
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
Original Install Date:     9/16/2021, 3:20:20 AM
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: AMD64 Family 16 Model 2 Stepping 3 AuthenticAMD ~2300 Mhz
Windows Directory:         C:\Windows
System Directory:          C:\Windows\system32
Boot Device:               \Device\HarddiskVolume1
System Locale:             en-us;English (United States)
Input Locale:              en-us;English (United States)
Time Zone:                 (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
Total Physical Memory:     7,678 MB
Available Physical Memory: 1,221 MB
Virtual Memory: Max Size:  15,337 MB
Virtual Memory: Available: 2,595 MB
Virtual Memory: In Use:    12,742 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    WORKGROUP
Logon Server:              \\D11MMWNX0SDPS66
Hotfix(s):                 5 Hotfix(s) Installed.
                           [01]: KB5006365
                           [02]: KB5003791
                           [03]: KB5007186
                           [04]: KB5006753
                           [05]: KB5005699
Network Card(s):           4 NIC(s) Installed.
                           [01]: Realtek 8185 Extensible 802.11b/g Wireless Device
                                 Connection Name: Wi-Fi
                                 Status:          Media disconnected
                           [02]: Broadcom NetXtreme 57xx Gigabit Controller
                                 Connection Name: Ethernet
                                 DHCP Enabled:    Yes
                                 DHCP Server:     192.168.2.1
                                 IP address(es)
                                 [01]: 192.168.2.136
                                 [02]: fe80::545:81ae:63c6:a9fc
                                 [03]: 2003:cd:70c:bd6f:c551:a499:d529:d25c
                                 [04]: 2003:cd:70c:bd6f:7cfb:63a1:995f:7c7
                                 [05]: 2003:cd:70c:bd6f:545:81ae:63c6:a9fc
                           [03]: VirtualBox Host-Only Ethernet Adapter
                                 Connection Name: VirtualBox Host-Only Network
                                 DHCP Enabled:    No
                                 IP address(es)
                                 [01]: 192.168.56.1
                                 [02]: fe80::34ba:1c8b:7b2:8608
                           [04]: Bluetooth Device (Personal Area Network)
                                 Connection Name: Bluetooth Network Connection 2
                                 Status:          Media disconnected
Hyper-V Requirements:      A hypervisor has been detected. Features required for Hyper-V will not be displayed.
  1. WSL --status:
C:\Users\cldsrphl>wsl --status
Default Distribution: Ubuntu-20.04
Default Version: 2

Windows Subsystem for Linux was last updated on 11/3/2021
WSL automatic updates are on.

Kernel version: 5.10.60.1
  1. WSL --list:
C:\Users\cldsrphl>wsl --list
Windows Subsystem for Linux Distributions:
Ubuntu-20.04 (Default)
Distrod
Ubuntu
  1. WSL -d distrod:
C:\Users\cldsrphl>wsl -d distrod
[Distrod][ERROR] Failed to run the given command in the Systemd container. Fall back to normal WSL2 command execution without using Systemd. Failed to launch the distro.

Caused by:
    0: Failed to make mountpoint shared.
    1: Failed to make the /tmp mountpoint shared.
    2: EINVAL: Invalid argument
[cldsrphl@D11MMWNX0SDPS66ENGUS cldsrphl]$
  1. SystemCtl status (executed inside distrod):
[cldsrphl@D11MMWNX0SDPS66ENGUS cldsrphl]$ systemctl status
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

Please advise how to go on, what commands/procedures might help to investigate the issue.

Note: I was already running the default Ubuntu wsl-distro as installed originally via wsl --install (not the Ubuntu-20.04 - this one was added later). After the initial setup (specifying user/passwd) i ran sudo apt update and sudo apt full-upgrade - the latter was processing when i executed distrod - mentioning in case there is a need to not have a wsl-distro already running when doing the install via distrod.

I will now try Option 2, by applying it to the fresh setup and updated Ubuntu wsl-distro.

[Bug]: fakeroot doesn't start without $SHELL modification

Describe the bug

I tried to use fakeroot in distrod container but it failed with such error:

$ fakeroot
/opt/distrod/alias/bin/bash: /opt/distrod/lib/libc.so.6: version `GLIBC_2.34' not found (required by /usr/lib/libfakeroot/libfakeroot.so)

This was caused the following line in fakeroot script:

FAKEROOTKEY=$FAKEROOTKEY LD_LIBRARY_PATH="$PATHS"  LD_PRELOAD="$FAKEROOT_LIB" ${SHELL:-/bin/sh}

Modifing $SHELL seemed solving the issue:

$ SHELL=/usr/bin/bash fakeroot
$                                # No Error

Is this correct way to execute fakeroot? Thanks.

Steps to reproduce

$ pacman -S fakeroot
$ fakeroot

(In the first place, I was going to use debtap. I encountered this issue because debtap uses fakeroot internally)

Expected behavior

fakeroot works without $SHELL modification.

Windows version

22H2 (Build 22610.1)

Linux kernel version

Linux acm-envy3-win 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 GNU/Linux

Distro

Arch Linux

How did you install that distro?

Installed by Distrod wizard

Logs

The behavior of distrod itself is not problem.

additional comment

No response

Option 2's `dstros enable --start-on-windows-boot` seems to require restarting WSL2

I followed the steps in Option 2 of README.

Step 1, downloading and installing scripts succeeded.

In step 2, I got this error.

[Distrod][WARN] whoami.exe had an error:
[Distrod][ERROR] Failed to enable the autostart on Windows boot.

Caused by:
    wslpath -w '/tmp/.tmpTQ234D' exited with error. stderr: /bin/wslpath: /tmp/.tmpTQ234D: Invalid argument

I checked whoami.exe and wslpath, and I found these commands do not work with sudo.

> /mnt/c/Windows/System32/whoami.exe
desktop-xxxxxx\tomyk
~
> sudo /mnt/c/Windows/System32/whoami.exe
((no output with exit status code 255))
> wslpath -w /tmp/.tmpTQ234D
\\wsl.localhost\Ubuntu\tmp\.tmpTQ234D
~
> sudo wslpath -w /tmp/.tmpTQ234D
wslpath: /tmp/.tmpTQ234D: Invalid argument

This is fixed by running /opt/distrod/bin/distrod enable, wsl --termiante Ubuntu, and wsl zsh, then run /opt/distrod/bin/distrod enable --start-on-windows-boot again.
Here these commands return the same results with and without sudo.

I suggest to put instructions to restart WSL2 for --start-on-windows-boot if it fails.

[Feature Request] Install DistroD through script

Hello,

I don´t know if this feature is already developed but instaead of going through an .exe file and install a WSL distro step by step I find quite interesting the idea of installing the distro with something like:
install.sh --os=ubuntu

[Bug]: --start-on-windows-boot results in confusing user flow with Windows Hello.

Describe the bug

When using the --start-on-windows-boot flag, the UAC password requirement uses the user account password, not PIN. If windows Hello is setup, the pin is used in most typical auth flows as the Microsoft account password is the true user password, which is rarely required.

Steps to reproduce

Enable Windows Hello with a local account linked to microsoft account

sudo /opt/distrod/bin/distrod enable --start-on-windows-boot

Expected behavior

Either have clearer messaging in the output prompt, on the cli or add a note in the README. Let me know which you'd prefer and I'll send a PR.

Windows version

11

Linux kernel version

5.10.60.1-microsoft-standard-WSL2

Distro

Ubuntu 21.10

How did you install that distro?

Installed by Distrod wizard

Logs

n/a

additional comment

No response

schedule_autostart_task.ps1 regex does not work when PS language is JA

If ([bool](schtasks /query /fo list | Select-String -pattern "TaskName:\s+\\{{TASK_NAME}}" -quiet)) {

This part requires the system language is English, because the regex has TaskName literal.
However, when OS language settings is Japanese, the schtasks command puts something like this:

タスク名:        \StartWSL_Ubuntu_for_desktop-xxxxxx-tomyk

How about just removing TaskName: because \s+\\{{TASK_NAME}} is enough to identify the newly registered task?

[Bug]: start-on-windows-boot fills disk with logs

Describe the bug

Perhaps just on my system, but I had enabled Distrod on Windows startup as a new distribution with the following command:
sudo /opt/distrod/bin/distrod enable --start-on-windows-boot
My Windows system drive was being filled up with thousands of 8MB files in the following directory:
C:\Users\username\AppData\Local\Temp\DiagOutputDir\RdClientAutoTrace
The rapid creation of files stopped once I disabled Distrod on Windows startup with the following commands and then restarted Windows (afterwards, only a few files are created, at least one for each distro started):
sudo /opt/distrod/bin/distrod disable
sudo /opt/distrod/bin/distrod enable

Steps to reproduce

  1. In Windows Terminal, from the drop down select Distrod
  2. Enter the following command: sudo /opt/distrod/bin/distrod enable --start-on-windows-boot
  3. Enter your Distrod password
[Distrod] Distrod has been enabled. Now your shell will start under systemd.
[Distrod] Enabling atuomatic startup of Distrod. UAC dialog will appear because scheduling
a task requires the admin privilege. Please hit enter to proceed.
  1. Press Enter to start the UAC dialog entry
  2. Press Yes on the Task Scheduler UAC dialog
  3. Enter your Windows password
  4. Restart your Windows PC
  5. Check the following directory for log files with the type of ETL being created at a rapid rate
    C:\Users\username\AppData\Local\Temp\DiagOutputDir\RdClientAutoTrace

Expected behavior

Distrod starts on Windows startup without thousands of files being created in C:\Users\username\AppData\Local\Temp\DiagOutputDir\RdClientAutoTrace

Windows version

Microsoft Windows [Version 10.0.22000.348]

Linux kernel version

Linux RAZER 5.10.74.3-microsoft-standard-WSL2 #1 SMP Mon Oct 18 19:27:44 UTC 2021 x86_64 GNU/Linux

Distro

Debian

Logs

[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)
-- Journal begins at Fri 2021-11-19 18:58:10 AEDT, ends at Mon 2021-11-29 23:01:18 AEDT. --
-- No entries --

additional comment

It looks like the files still get created for every distro started from Windows Terminal but this is at a much lower rate.
I am seeing more than one 8MB file being created per second when Distrod starts on Windows startup

Cinnamon desktop on Distrod?

Hello, I'm not sure if I can ask here and I hope you can forgive me if this is not the right place.
I have installed Linux Mint Uma with Distrod on Windows 11 and WSL2 and it's working fine.
I'm trying to start the cinnamon desktop environment on a vcxsrv display but it's not working.
I can start the Ubuntu desktop environment from the same vcxsrv display from another standard wsl installation, so I'm wondering if it is possible to start also cinnamon.
Is it possible to have some instructions?

[Bug]: Internet speed is absolutely horrible

Describe the bug

After I installed Distrod, ubuntu focal, I tried installing some programs, but the internet speed is crazy slow.

I had normal WSL 2 installed previously, and the internet speed was fine, just wondering if this issue is well known or?

Kindly

Steps to reproduce

Install distrod, run a sudo apt-get install command

Expected behavior

No response

Windows version

21H2 19044.1348

Linux kernel version

Linux win 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Distro

Ubuntu 20.04

Logs

.

additional comment

No response

[Bug]: `network-online.target` not available

Describe the bug

Some unit configurations won't be able to exist due to missing network target.

systemctl status
● DESKTOP-S8SIUD6
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Sat 2022-05-21 12:31:34 MDT; 5min ago
   CGroup: /
           ├─user.slice
           │ └─user-1000.slice
           │   ├─[email protected]
           │   │ ├─init.scope
           │   │ │ ├─867 /lib/systemd/systemd --user
           │   │ │ └─868 (sd-pam)
           │   │ └─dbus.service
           │   │   └─1125 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
           │   └─session-c1.scope
           │     ├─ 714 login -f
           │     ├─ 874 -zsh
           │     ├─1159 systemctl status
           │     └─1160 less
           ├─init.scope
           │ └─1 /sbin/init systemd.setenv=WSL_DISTRO_NAME=Ubuntu systemd.setenv=WSL_INTEROP=/run/WSL/11_interop systemd.setenv=WSLENV=WT_SESSION::WT_PROFILE_ID --unit=multi-user.target
           └─system.slice
             ├─snap-lxd-19188.mount
             │ └─101 snapfuse /var/lib/snapd/snaps/lxd_19188.snap /snap/lxd/19188 -o ro,nodev,allow_other,suid
             ├─systemd-udevd.service
             │ └─89 /lib/systemd/systemd-udevd
             ├─cron.service
             │ └─160 /usr/sbin/cron -f
             ├─polkit.service
             │ └─169 /usr/lib/policykit-1/polkitd --no-debug
             ├─systemd-timedated.service
             │ └─1158 /lib/systemd/systemd-timedated
             ├─networkd-dispatcher.service
             │ └─167 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers
             ├─ModemManager.service
             │ └─288 /usr/sbin/ModemManager
             ├─systemd-journald.service
             │ └─69 /lib/systemd/systemd-journald
             ├─atd.service
             │ └─190 /usr/sbin/atd -f
             ├─unattended-upgrades.service
             │ └─282 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
             ├─ssh.service
             │ └─290 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
             ├─snapd.service
             │ └─178 /usr/lib/snapd/snapd
             ├─rsyslog.service
             │ └─173 /usr/sbin/rsyslogd -n -iNONE
             ├─snap-core18-1988.mount
             │ └─102 snapfuse /var/lib/snapd/snaps/core18_1988.snap /snap/core18/1988 -o ro,nodev,allow_other,suid
             ├─snap-snapd-11036.mount
             │ └─103 snapfuse /var/lib/snapd/snaps/snapd_11036.snap /snap/snapd/11036 -o ro,nodev,allow_other,suid
             ├─dbus.service
             │ └─161 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
             └─systemd-logind.service
               └─182 /lib/systemd/systemd-logind

I don't think WSL2 needs a network-online.target, but it might help to simulate it for units which need it.

Steps to reproduce

Given this service file:

# consul.service
[Unit]
Description="HashiCorp Consul - A service mesh solution"
Documentation=https://www.consul.io/
Requires=network-online.target
After=network-online.target

[Service]
User=consul
Group=consul
ExecStart=/opt/homebrew/opt/consul/bin/consul agent -server -ui -datacenter dc1 -bind 127.0.0.1
ExecReload=/bin/kill --signal HUP $MAINPID
KillMode=process
KillSignal=SIGTERM
Restart=on-failure
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target

When this command is run under a user slice (see #13):

# install homebrew for linux: https://brew.sh
# install consul with `brew install consul`
brew services start -v consul --file consul.service

Then this is the expected result:

/usr/bin/systemctl --user daemon-reload
/usr/bin/systemctl --user start homebrew.consul
Failed to start homebrew.consul.service: Unit network-online.target not found.
Error: Failure while executing; `/usr/bin/systemctl --user start homebrew.consul` exited with 5.

Expected behavior

The unit consul.service should run.

Windows version

19044.1706

Linux kernel version

Linux DESKTOP-S8SIUD6 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Distro

Ubuntu 20.04

How did you install that distro?

Enabled distrod in an existing WSL2 distro

Logs

12,414,1322381248,-;Distrod: [DEBUG] distrod-exec: exec_command_in_distro
12,415,1322381360,-;Distrod: [DEBUG] Executing a command in the distro.
12,416,1322381596,-;Distrod: [DEBUG] Failed to ignore signal Sys(EINVAL)
12,417,1322381894,-;Distrod: [DEBUG] Failed to ignore signal Sys(EINVAL)
12,418,1322382025,-;Distrod: [DEBUG] Distro::exec_command.
12,419,1322385124,-;Distrod: [DEBUG] Container::exec_command.
12,420,1322385724,-;Distrod: [DEBUG] Triple fork done.
12,421,1322386068,-;Distrod: [DEBUG] dropping privilege. kmsg logging in the child ends here.
12,423,1341357189,-;Distrod: [DEBUG] distrod-exec: exec_command

additional comment

Interestingly, if you remove the network-online.target and then run the command again, brew thinks it starts, but the unit isn't actually running:

$ brew services start -v consul --file ref-configs/consul.service
/usr/bin/systemctl --user daemon-reload
/usr/bin/systemctl --user start homebrew.consul
/usr/bin/systemctl --user enable homebrew.consul
Created symlink /home/sienna/.config/systemd/user/multi-user.target.wants/homebrew.consul.service → /home/sienna/.config/systemd/user/homebrew.consul.service.
==> Successfully started `consul` (label: homebrew.consul)
$ brew services list
Name   Status User   File
consul none   sienna
$ systemctl status
● DESKTOP-S8SIUD6
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Sat 2022-05-21 12:31:34 MDT; 24min ago
   CGroup: /
           ├─user.slice
           │ └─user-1000.slice
           │   ├─[email protected]
           │   │ ├─init.scope
           │   │ │ ├─2788 /lib/systemd/systemd --user
           │   │ │ └─2789 (sd-pam)
           │   │ └─dbus.service
           │   │   └─3040 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
           │   └─session-c3.scope
           │     ├─2733 login -f
           │     ├─2794 -zsh
           │     ├─3288 systemctl status
           │     └─3289 less
           ├─init.scope
           │ └─1 /sbin/init systemd.setenv=WSL_DISTRO_NAME=Ubuntu systemd.setenv=WSL_INTEROP=/run/WSL/11_interop systemd.setenv=WSLENV=WT_SESSION::WT_PROFILE_ID --unit=multi-user.target
           └─system.slice
             ├─snap-lxd-19188.mount
             │ └─101 snapfuse /var/lib/snapd/snaps/lxd_19188.snap /snap/lxd/19188 -o ro,nodev,allow_other,suid
             ├─systemd-udevd.service
             │ └─89 /lib/systemd/systemd-udevd
             ├─cron.service
             │ └─160 /usr/sbin/cron -f
             ├─polkit.service
             │ └─169 /usr/lib/policykit-1/polkitd --no-debug
             ├─networkd-dispatcher.service
             │ └─167 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers
             ├─ModemManager.service
             │ └─288 /usr/sbin/ModemManager
             ├─systemd-journald.service
             │ └─69 /lib/systemd/systemd-journald
             ├─atd.service
             │ └─190 /usr/sbin/atd -f
             ├─unattended-upgrades.service
             │ └─282 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
             ├─ssh.service
             │ └─290 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
             ├─snapd.service
             │ └─178 /usr/lib/snapd/snapd
             ├─rsyslog.service
             │ └─173 /usr/sbin/rsyslogd -n -iNONE
             ├─snap-core18-1988.mount
             │ └─102 snapfuse /var/lib/snapd/snaps/core18_1988.snap /snap/core18/1988 -o ro,nodev,allow_other,suid
             ├─snap-snapd-11036.mount
             │ └─103 snapfuse /var/lib/snapd/snaps/snapd_11036.snap /snap/snapd/11036 -o ro,nodev,allow_other,suid
             ├─dbus.service
             │ └─161 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
             └─systemd-logind.service
               └─182 /lib/systemd/systemd-logind
$ ps uax
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root           1  0.0  0.0 169424 13428 ?        Ss   12:31   0:00 /sbin/init systemd.setenv=WSL_DISTRO_NAME=Ubuntu systemd.setenv=WSL_INTEROP=/run/WSL/11_interop systemd.setenv=WSLENV=WT_SESSION::WT_PROFILE_ID --unit=multi-user.target
sienna         3  0.0  0.0  10536  2532 pts/0    S    12:31   0:00 distrod-exec -- /usr/bin/zsh -zsh
sienna         4  0.0  0.0  15612  7564 pts/0    S    12:31   0:00 -zsh
root          69  0.0  0.0  53248 20804 ?        S<s  12:31   0:00 /lib/systemd/systemd-journald
root          89  0.0  0.0  21616  6956 ?        Ss   12:31   0:00 /lib/systemd/systemd-udevd
root         101  0.0  0.0   3704  1592 ?        Ss   12:31   0:00 snapfuse /var/lib/snapd/snaps/lxd_19188.snap /snap/lxd/19188 -o ro,nodev,allow_other,suid
root         102  0.0  0.0   3760  1780 ?        Ss   12:31   0:00 snapfuse /var/lib/snapd/snaps/core18_1988.snap /snap/core18/1988 -o ro,nodev,allow_other,suid
root         103  0.0  0.0   3644  1604 ?        Ss   12:31   0:00 snapfuse /var/lib/snapd/snaps/snapd_11036.snap /snap/snapd/11036 -o ro,nodev,allow_other,suid
root         160  0.0  0.0   8540  2796 ?        Ss   12:31   0:00 /usr/sbin/cron -f
message+     161  0.0  0.0   7560  4696 ?        Ss   12:31   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
root         167  0.0  0.0  29900 18316 ?        Ss   12:31   0:00 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers
root         169  0.0  0.0 232716  6724 ?        Ssl  12:31   0:00 /usr/lib/policykit-1/polkitd --no-debug
syslog       173  0.0  0.0 224348  6512 ?        Ssl  12:31   0:00 /usr/sbin/rsyslogd -n -iNONE
root         178  0.0  0.1 1390152 47600 ?       Ssl  12:31   0:00 /usr/lib/snapd/snapd
root         182  0.0  0.0  16820  7808 ?        Ss   12:31   0:00 /lib/systemd/systemd-logind
daemon       190  0.0  0.0   3796  2352 ?        Ss   12:31   0:00 /usr/sbin/atd -f
root         282  0.0  0.0 108116 20432 ?        Ssl  12:31   0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
root         288  0.0  0.0 314332 10576 ?        Ssl  12:31   0:00 /usr/sbin/ModemManager
root         290  0.0  0.0  12176  6852 ?        Ss   12:31   0:00 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
root        2732  0.0  0.0  11032  4592 pts/0    S    12:55   0:00 sudo login -f sienna
root        2733  0.0  0.0  10440  4680 pts/0    S    12:55   0:00 login -f
sienna      2788  0.1  0.0  21360 10868 ?        Ss   12:55   0:00 /lib/systemd/systemd --user
sienna      2789  0.0  0.0 170784  5540 ?        S    12:55   0:00 (sd-pam)
sienna      2794  0.1  0.0  15088  7104 pts/0    S    12:55   0:00 -zsh
sienna      3040  0.0  0.0   7108  3920 ?        Ss   12:55   0:00 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
sienna      4171  0.0  0.0  10616  3260 pts/0    R+   12:57   0:00 ps uax

Not quite sure why it's not registered, but it doesn't error out.

[Bug]: cannot access '/proc/sys/fs/binfmt_misc': Too many levels of symbolic links

Describe the bug

/proc/sys/fs/binfmt_misc cannot be accessed due too many levels of symbolic links.

Steps to reproduce

Install a WSL distro through distrod_wsl_launcher or update one through install script.

Expected behavior

/proc/sys/fs/binfmt_misc is still available.

Windows version

Microsoft Windows [Version 10.0.22000.466]

Linux kernel version

Linux 5.10.93.3-microsoft-WSL2 #1 SMP Sun Jan 23 18:53:16 CET 2022 x86_64 GNU/Linux

Distro

archlinux

How did you install that distro?

Enabled distrod in an existing WSL2 distro

Logs

[andi@ANDI distrod_wsl_launcher-x86_64]$ ls -al /proc/sys/fs/binfmt_misc
ls: cannot access '/proc/sys/fs/binfmt_misc': Too many levels of symbolic links

additional comment

Should be the same issue as in DamionGans/ubuntu-wsl2-systemd-script#17.

[Bug]: Distrod replaced my ZSH shell with its own Bash

Describe the bug

Distrod replaced its own Bash

The following shell is there now

kruse:x:1000:1000:create with care by Ansible:/home/kruse:/opt/distrod/alias/bin/bash

It used to be:

kruse:x:1000:1000:create with care by Ansible:/home/kruse:/usr/bin/zsh

Why was this change needed? Can I change it back without losing systemd? Is there a zsh alternative?
Can this behavour at least be documented?

I would rather not do an exec zsh in my bashrc.

Steps to reproduce

  1. Install Distrod in an existing Debian destribution.
  2. Enable it.

Expected behavior

I have:

  • a zsh alias as alternative
  • just my own defined shell but with running systemd

Windows version

11 21h2

Linux kernel version

Linux xios 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 GNU/Linux

Distro

Debian 11

How did you install that distro?

Enabled distrod in an existing WSL2 distro

Logs

I think this is default programmed behaviour by distrod. No reason to include any non related logs.

additional comment

My distro was created from the default store version with [WSL debian boxes Powershell scripts]( (https://github.com/nicenemo/wsl-debian-boxes). Except changing the Debian mirror and updating the image it does nothing special. It allows me to create multiple Debian instances side by side.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.