Code Monkey home page Code Monkey logo

genie's People

Contributors

arlllk avatar cerebrate avatar chutzimir avatar danielatkrypton avatar ducksoft avatar gliptak avatar jovenlin0527 avatar joyfulmantis avatar mark-ignacio avatar martinodf avatar mavaddat avatar mikefarmer01 avatar nerumo avatar niclimcy avatar ongyx avatar rayfalling avatar skvskv avatar tomoyan596 avatar xuanruiqi avatar zhumos 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

genie's Issues

[BUG] Failed to install any service using systemctl

Hi,

I try to install Genie on my WSL2 Debian buster (Official)
But after the install, It's impossible to install another service using systemd

The exemple show the docker installation but it's not the only case (Try with open-jdk, etc....)


From a clean install on official Debian WSL

Lib installed : curl wget git golang python make gcc g++ apt-utils lsb-release

1°) .NET Dependencies installation

https://dotnet.microsoft.com/download/linux-package-manager/debian9/runtime-3.0.0

a)

  $ wget https://packages.microsoft.com/config/ubuntu/19.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
  $ sudo dpkg -i packages-microsoft-prod.deb

Passed

b)

  $ sudo apt-get update
  $ sudo apt-get install apt-transport-https
  $ sudo apt-get update
  $ sudo apt-get install dotnet-runtime-3.1

Passed

2°) Hostess

  $ git clone https://github.com/cbednarski/hostess
  $ cd hostess
  $ make install
go build -o bin/hostess .
sudo mv bin/hostess /usr/local/bin/hostess

Passed

3°) Genie Installation

Amd64 - Buster

  $ curl -s https://packagecloud.io/install/repositories/arkane-systems/wsl-translinux/script.deb.sh | sudo bash
  The repository is setup! You can now install packages.

  $ sudo apt install systemd-genie
  $ genie --version
  1.20

  $ genie -i 
  Deleted My-Rog
  Added My-Rog-wsl -> 127.0.0.1 (On)

Close terminal et restart

  user@My-Rog-wsl:~$ systemctl
  
  UNIT                                                                  LOAD   ACTIVE SUB       DESCRIPTION
  proc-sys-fs-binfmt_misc.automount                                     loaded active running   Arbitrary Executable File

Passed

4°) Docker Installation

$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
ok

$ sudo apt-key fingerprint 0EBFCD88
$ sudo apt update -y
$ sudo apt-get install docker-ce docker-ce-cli containerd.io

**Warning! D-Bus connection terminated.**
**Failed to restart systemd-modules-load.service: Connection reset by peer
See system logs and 'systemctl status systemd-modules-load.service' for details.
Failed to reload daemon: Connection reset by peer
Failed to retrieve unit state: Connection reset by peer
Warning! D-Bus connection terminated.
Failed to start docker.service: Connection reset by peer
See system logs and 'systemctl status docker.service' for details.**

If services are installed before, It seems to be ok. But I cannot install app or service after.

Do you have an idea ?

Thanks

This breaks pstree and other /proc-walking tools

You can log into the container by setting up ssh keys and then have the shell_start() part of your script call "ssh user@locahost" as alluded.

If that's not on the table, well, in the spirit of this exercise, how about a poor man's sshd using socat. After you've got systemd up, nsenter just the once to do:

$ sudo nsenter -t 449 -m -p systemd-run socat ABSTRACT-LISTEN:genie,reuseaddr exec:"/bin/login -f ken",pty,setsid,setpgid,stderr,ctty 

Normally you'd use your own target but systemd-run allows you to crash the party without the hassle of an invitation.

Now logging into the container becomes:

$ socat -,raw,echo=0 ABSTRACT-CLIENT:genie

Sorry no PR. Python butthurt.

Seems to break interop

Seems that you can't launch any windows programs from within the bottle:

  1. path isn't set to include Windows programs.
  2. There's segmentation fault with very little info...

For example calling strace explorer.exe (after fixing path:

execve("/win/c/WINDOWS/explorer.exe", ["/win/c/WINDOWS/explorer.exe"], 0x7fffaa809a00 /* 20 vars */) = 0
arch_prctl(ARCH_SET_FS, 0x29b7e0)       = 0
set_tid_address(0x29b818)               = 3357
brk(NULL)                               = 0x1bf7000
brk(0x1bf8000)                          = 0x1bf8000
sched_getaffinity(0, 128, [0, 1, 2, 3, 4, 5, 6, 7]) = 32
getpid()                                = 3357
getcwd("/home/zach", 4096)              = 11
uname({sysname="Linux", nodename="TB-wsl", ...}) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xfffffffffffffff9} ---
+++ killed by SIGSEGV +++
zsh: segmentation fault  strace /win/c/WINDOWS/explorer.exe

I'm going to assume this is simply a constraint of running inside the bottle, in which case is it still safe for me to run outside? That is, can I simply enter the bottle when I need to interact with systemd?

wsl genie -s and wsl genie -c bash hang

You guessed it, I'm running Arch. I arrived at genie from the Arch WSL git and managed to install genie, but it hangs no matter what option is used at "Adding hostname-wsl -> 127.0.0.1 (On)"

This happens with sudo and without.

Any logs I should provide or is this issue already known and I can move on?

genie: initializing bottle failed; removing old hostname returned 1.

Centos 8 on wls2
C:\Users\Yuntai1>wsl -l -v
NAME STATE VERSION

  • CentOS8 Running 2

when I run genie
[root@desktop-denglt ~]# sudo genie -i -v
genie: no bottle present.
genie: initializing bottle.
genie: dumping WSL environment variables.
genie: generating new hostname.
genie: removing old hostname.
invalid command
genie: initializing bottle failed; removing old hostname returned 1.

Error: cannot set terminal process group (-1)

Shell still seems to work, but I'm getting an error message. Perhaps because I'm running a shell via '-c'.

$ genie -c bash -v
genie: outside bottle 247.
genie: running command 'bash '
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell

Can't build in Arch Linux

I get this errors when I try to compile the project

Microsoft (R) Build Engine version 15.9.20.63311 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

Restoring packages for /home/arllk/genie/genie/genie.csproj...
Generating MSBuild file /home/arllk/genie/genie/obj/genie.csproj.nuget.g.props.
Generating MSBuild file /home/arllk/genie/genie/obj/genie.csproj.nuget.g.targets.
Restore completed in 7.26 sec for /home/arllk/genie/genie/genie.csproj.
Program.cs(75,50): error CS0121: The call is ambiguous between the following methods or properties: 'CommandHandler.Create(Func<T, int>)' and 'CommandHandler.Create(Func<T, Task>)' [/home/arllk/genie/genie/genie.csproj]
Program.cs(80,52): error CS0121: The call is ambiguous between the following methods or properties: 'CommandHandler.Create(Func<T, int>)' and 'CommandHandler.Create(Func<T, Task>)' [/home/arllk/genie/genie/genie.csproj]
Program.cs(87,47): error CS0121: The call is ambiguous between the following methods or properties: 'CommandHandler.Create(Func<T, int>)' and 'CommandHandler.Create(Func<T, Task>)' [/home/arllk/genie/genie/genie.csproj]
Program.cs(99,46): error CS0121: The call is ambiguous between the following methods or properties: 'CommandHandler.Create<T1, T2>(Func<T1, T2, int>)' and 'CommandHandler.Create<T1, T2>(Func<T1, T2, Task>)' [/home/arllk/genie/genie/genie.csproj]
cp: cannot stat 'bin/Debug/netcoreapp2.2/linux-x64/publish/genie': No such file or directory
cp: cannot stat 'bin/Debug/netcoreapp2.2/linux-x64/publish/.dll': No such file or directory
cp: cannot stat 'bin/Debug/netcoreapp2.2/linux-x64/publish/genie.runtimeconfig.json': No such file or directory
chown: cannot access '../systemd-genie/usr/bin/
': No such file or directory
chmod: cannot access '../systemd-genie/usr/bin/genie': No such file or directory
chmod: cannot access '../systemd-genie/usr/bin/genie': No such file or directory

With the version

dotnet --version
2.2.108

Support for Kali???

Detected operating system as kali/kali-rolling.
Checking for curl...
Detected curl...
Checking for gpg...
Detected gpg...
Running apt-get update... done.
Installing apt-transport-https... done.
Installing /etc/apt/sources.list.d/arkane-systems_wsl-translinux.list...curl: (22) The requested URL returned error: 404

Unable to download repo config from: https://packagecloud.io/install/repositories/arkane-systems/wsl-translinux/config_file.list?os=kali&dist=kali-rolling&source=script

This usually happens if your operating system is not supported by
packagecloud.io, or this script's OS detection failed.

You can override the OS detection by setting os= and dist= prior to running this script.
You can find a list of supported OSes and distributions on our website: https://packagecloud.io/docs#os_distro_version

For example, to force Ubuntu Trusty: os=ubuntu dist=trusty ./script.sh

If you are running a supported OS, please email [email protected] and report this.

genie -s never returns

Workaround exists, so no biggie ( $ genie -c bash works perfectly)

But otherwise, I get only the following and need to kill the process to continue.

$ genie -v -s
genie: outside bottle 27.
genie: starting shell

PS - other than this, works perfectly with Arch Linux, if you want to update your README.md

Cannot start genie after upgrading to 1.4

After upgrading to 1.4 cannot start genie, output I get is:

bogdan@bogdan-PC /c/Users/bogdan $ genie -s --verbose
genie: no bottle present.
genie: initializing bottle.
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ComponentModel.Win32Exception: No such file or directory
at Interop.Sys.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setUser, UInt32 userId, UInt32 groupId, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean shouldThrow)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(String fileName, String arguments)
at ArkaneSystems.WindowsSubsystemForLinux.Genie.Program.InitializeBottle(Boolean verbose)
at ArkaneSystems.WindowsSubsystemForLinux.Genie.Program.ShellHandler(Boolean verbose)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass2_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__16_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c__DisplayClass8_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__7_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__4_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__6_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__14_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass3_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__17_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c__DisplayClass5_0.<b__0>d.MoveNext()

I'm using Windows 10 Pro Insider Preview, build 18970.1005, WSL 2 Ubuntu 18.04.

Failed to restart systemd-journald.service: Connection reset by peer in ubuntu18.04

when I run genie in my ubuntu18.04 with commands like that:

$ sudo systemctl restart systemd-journald

I get warning and the operation failed.

Warning! D-Bus connection terminated.
Failed to restart systemd-journald.service: Connection reset by peer

Actually I can not use systemctl for almost everything……I am very sure that I fellowed the guide....

/usr/bin/hostess: No such file or directory, In Arch Linux with 1.8

When I run genie -v -i with 1.8 I get this

genie: no bottle present.
genie: initializing bottle.
/bin/sh: /usr/bin/hostess: No such file or directory
/bin/sh: /usr/bin/hostess: No such file or directory

And when i try to run
genie -c "systemctl status --no-pager"
I get

/sbin/runuser: unrecognized option '--no-pager'
Try 'runuser --help' for more information.
genie: running command failed; nsenter returned 1.

Seems like using options triggers the bug because when I use
genie -c "systemctl status"
It works fine

Install fails: 404 not found, no release file

Hi,

While trying to install to Ubuntu 20.04 under WSL2, I get the following errors.

Could you please consider adding a release file?

user@host:/usr/local/bin$ sudo apt-add-repository https://packagecloud.io/arkane-systems/wsl-translinux
sudo apt-add-repository https://packagecloud.io/arkane-systems/wsl-translinux
Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB]
Hit:2 https://download.docker.com/linux/ubuntu focal InRelease
Hit:3 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:5 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Ign:7 https://packagecloud.io/arkane-systems/wsl-translinux focal InRelease
Ign:8 https://packagecloud.io/arkane-systems/wsl-translinux/ubuntu focal InRelease
Err:9 https://packagecloud.io/arkane-systems/wsl-translinux focal Release
404 Not Found [IP: 2600:1f1c:2e5:6901:aca0:1b7:b360:75fe 443]
Err:10 https://packagecloud.io/arkane-systems/wsl-translinux/ubuntu focal Release
404 Not Found [IP: 2600:1f1c:2e5:6901:aca0:1b7:b360:75fe 443]
Reading package lists... Done
E: The repository 'https://packagecloud.io/arkane-systems/wsl-translinux focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'https://packagecloud.io/arkane-systems/wsl-translinux/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Thanks,
Jelle

Using -c argument and passing 2 values or more fails genie

When trying to use genie -c with 2 or more values fails

[arllk@Arley ~]$ genie -c -v "systemctl --no-pager status"                                                                                               genie: outside bottle 62.
genie: running command 'systemctl --no-pager status '
runuser: failed to execute systemctl --no-pager status: No such file or directory
genie: running command failed; nsenter returned 1.
[arllk@Arley ~]$ genie -c -v "systemctl status"                                                                                                          genie: outside bottle 62.
genie: running command 'systemctl status '
runuser: failed to execute systemctl-proper status: No such file or directory
genie: running command failed; nsenter returned 1.
[arllk@Arley ~]$ genie -c -v "systemctl"                                                                                                                 genie: outside bottle 62.
genie: running command 'systemctl '
**HERE IT WORKS**

Using

[arllk@Arley ~]$ genie --version
1.10

Ubuntu 20.04 sopport please

Microsoft's apt source no longer provide dotnet-runtime-3.0, it provide dotnet-runtime-3.1 now, So I can't install systemd-genie

Now default installation of Ubuntu is Ubuntu 20.04 in Microsoft Store. Rebuild dependence tree and republish it, please~

It was not possible to find any compatible framework version -Arch Linux -WSL2

I have followed the installation process, but the installation cannot find .NET.

[arllk@Arley bin]$ genie -i
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.2.6' was not found.

but i have the .NET installed

[arllk@Arley bin]$ dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 2.2.108
Commit: 33ed5b90ce

Runtime Environment:
OS Name: arch
OS Version:
OS Platform: Linux
RID: arch-x64
Base Path: /opt/dotnet/sdk/2.2.108/
Host (useful for support):
Version: 2.2.6
Commit: 7dac9b1b51 >.NET Core SDKs installed:
2.2.108 [/opt/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.6 [/opt/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.6 [/opt/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.6 [/opt/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

invalid command genie: initializing bottle failed; "The old hostname returned 1.

When I used the command "genie-i", the terminal displayed "invalid command genie: initializing bottle failed; "The old hostname returned 1."
And then I ran "genie - I --verbose true" the terminal displays as follows

$ sudo genie -i --verbose true 
genie: no bottle present.
genie: initializing bottle.
genie: dumping WSL environment variables.
genie: generating new hostname.
genie: removing old hostname.
invalid command
genie: initializing bottle failed; removing old hostname returned 1.

By looking at the source code I found that the error occurred at here
But I've installed hostess correctly, and the add command works fine

$ sudo hostess add 'hostname'-wsl 127.0.0.1
Added hostname-wsl -> 127.0.0.1 (On)

How to solve this problem

Can't access MySQL after installing with Genie except sudoing through Genie

I installed MySQL server under WSL2 using Genie so that the system services would properly register as background processes in WSL. I did the same for PHP. Both services are now up and running. Yay! But, I can't access MySQL unless I go through Genie as a sudoer. If I try to access MySQL on the command line, it fails unless I preface the command with sudo genie -c. If I try to access the database via PHP or via a DB administration GUI, it fails to connect. Here's some command-line output to illustrate the problem.

wiki on  release [✘] via ⬢ v12.18.0 via 🐘 v7.4.7
❯ mysql -u root -p
Enter password: 
ERROR 1698 (28000): Access denied for user 'root'@'localhost'

wiki on  release [✘] via ⬢ v12.18.0 via 🐘 v7.4.7 took 2s
❯ genie -c mysql -u root -p
Enter password: 
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
genie: running command failed; nsenter returned 1.

wiki on  release [✘] via ⬢ v12.18.0 via 🐘 v7.4.7 took 3s
❯ sudo genie -c mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 429
Server version: 5.7.30-0ubuntu0.18.04.1 (Ubuntu)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> exit
Bye

Last changes to check if its running in WSL are too strict

Using the latest git version, and in the check of

private static bool IsWsl()
        {
            var osrelease = File.ReadAllText("/proc/sys/kernel/osrelease");

            return osrelease.Contains ("Microsoft");
        }

isn't case sensitive, I have a recompiled custom kernel and the name that the kernel is
4.19.79-microsoft-custom-arllk-g9203c937e-dirty
from what I see is just to make a caseless comparison

Missing dll with .NET Core version

Trying to install from the new release I'm getting the following error

user@xyz /tmp/genie-1.2 % sudo cp * /usr/local/bin
user@xyz /tmp/genie-1.2 % genie -s
A fatal error occurred, the required library libhostfxr.so could not be found.
If this is a self-contained application, that library should exist in [/usr/local/bin/].
If this is a framework-dependent application, install the runtime in the default location [/usr/share/dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location.

I guess .NET Core can't produce binaries which only depend on libc like it's the default for e.g. Go?

genie -c is run outside of systemd session

Whereas genie -s runs inside a scoped systemd user session (because it's run as a login shell), genie -c runs completely outside of it. This can be verified by running systemd-cgls in the shell while a genie -c command is still running.

I patched my fork to run genie -c commands inside a scoped systemd user session, but it suffers the same issues as the genie -s command, mainly that it loses the working directory. If this solution is considered acceptable I can create a pull request.

Breaks networking

After starting genie the network is broken. I can't reach hosts via ip and namespace resolution fails.
Restarting networking daemon doesn't help.

can there be a option for no output?

what I mean is that I add one line "commandline": "wsl.exe genie -s" to my windows terminal's profile, and it did work while I boot my wsl, but there is always an output on the top of shell.
"Deleted newton
Added newton-wsl -> 127.0.0.1 (On)"
May there be an option like "-q" for no output?
thank lots for your development.

systemctl --user: Failed to connect to bus: No such file or directory

I'm using genie with Arch Linux in WSL2 (genie-systemd AUR package). It's been working great for some time, but in the last few days, I've noticed that running systemctl in user mode (--user) often does not work. I always get the error:

Failed to connect to bus: No such file or directory

As root, everything works fine. I can sudo systemctl start docker, etc. The usermode problem persists until I kill WSL (by running wsl --shutdown or poweroff from WSL), then in a new WSL session, it tends to work fine.

Is there any log file that I can inspect to debug genie's initialization?

Lastly, thanks for this package, it's immensely useful to me. ❤️

Edit: A bit more info on my setup: My WSL sessions are always in genie, as my terminal command is wsl.exe genie -c tmux.

Invalid runtimeconfig.json [/usr/local/bin/genie.runtimeconfig.json] [/usr/local/bin/genie.runtimeconfig.dev.json]

Followed the instructions, and now getting the error message:

Invalid runtimeconfig.json [/usr/local/bin/genie.runtimeconfig.json] [/usr/local/bin/genie.runtimeconfig.dev.json]

$ sudo cat /usr/local/bin/genie.runtimeconfig.json
{
  "runtimeOptions": {
    "tfm": "netcoreapp2.2",
    "framework": {
      "name": "Microsoft.NETCore.App",
      "version": "2.2.0"
    },
    "configProperties": {
      "System.Globalization.Invariant": true
    }
  }
}

Any help would be appreciated - thanks.
MJR

Fails for Debian docker image as follows:

daniel@b66f1839d1e0:~$ genie -v
genie: one of the commands -i, -s, or -c must be supplied.
daniel@b66f1839d1e0:~$ genie -i -v
genie: no bottle present.
genie: initializing bottle.
genie: dumping WSL environment variables.
genie: generating new hostname.
genie: removing old hostname.
Deleted b66f1839d1e0
genie: setting new hostname.
mount: /etc/hostname: mount point is not a directory.
genie: initializing bottle failed; bind mounting hostname returned 32.

FileNotFoundException for Newtonsoft.Json

Hi, I have installed genie-systemd from Arch AUR repository.

The package was flagged out of date for a long time, but now it seems to be update to the latest version, but after the update, when I try to start WSL, I get the following error:

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. The system cannot find the file specified.

File name: 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
   at ArkaneSystems.WindowsSubsystemForLinux.Genie.Locations..ctor()
   at ArkaneSystems.WindowsSubsystemForLinux.Genie.Program.Main(String[] args)

Can you please tell me how I can fix this? It's basically rendered my WSL as unusable 😓

crashed

Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ComponentModel.Win32Exception: No such file or directory
at Interop.Sys.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setUser, UInt32 userId, UInt32 groupId, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean shouldThrow)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(String fileName, String arguments)
at ArkaneSystems.WindowsSubsystemForLinux.Genie.Program.InitializeBottle(Boolean verbose)
at ArkaneSystems.WindowsSubsystemForLinux.Genie.Program.InitializeHandler(Boolean verbose)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass2_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__16_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c__DisplayClass8_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__7_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__4_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__6_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__14_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass3_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__17_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c__DisplayClass5_0.<b__0>d.MoveNext()

Version number not updated to reflect 1.4

After updating to latest (1.4)

$ genie --version
1.2

I'm happy to put together a pull request, but thought you may prefer to build it into your release process - let me know.

Removes Windows PATH directories

Hi,

I upgraded to WSL 2 today, and I installed genie-systemd; it seems to be working perfectly. There's only one issue that I found.

I have configured my Windows Terminal to run wsl -d ArchLinux genie -s, however one thing I noticed is that when I do that, I'm not able to run my Windows applications from within my WSL (PATH is not updated to contain Windows-related paths).

If I run normally (wsl -d ArchLinux), PATH is set correctly

Can't use explorer nor code in genie shell

(Re)installed genie, now service works but I can no longer do explorer.exe . and code . on my genie shell. Works with genie -i and non-genie shells. Only shells initialized with genie -s doesn't work

image
(w is my alias to wsl genie -s)

Genie fails to start

Just ran through the installation process as per the README file, and ran the following command and received the following error.

> wsl genie -s
/sbin/runuser: invalid option -- 'w'
Try 'runuser --help' for more information.

I am using an Insider Build, with Build number 18999.vb_release.191004-1432, running Ubuntu 18.04.3 in WSL 2.

When I run genie in WSL, I also get the following output after what was also returned above:

genie: starting shell failed; nsenter returned 1.

Preferred locale is not set when running `genie -s`

Reproduction

  1. Install Ubuntu via Microsoft Store (I use 20.04)
  2. Install genie via instructions from README
  3. Configure deviation file via https://github.com/arkane-systems/genie#deviations-file
  4. Run dpkg-configure locales as root in the WSL2 Ubuntu session, select a non en_US locale (I use zh_TW.UTF-8 UTF-8)
  5. In the "select default locale" step, select a non en_US locale(I use zh_TW.UTF-8)
  6. Exit Ubuntu session
  7. Run wsl --shutdown in the Windows terminal
  8. Run wsl genie -s command in the Windows terminal
  9. Run locale in the bottle'd environment

Expected Behavior

The following output is printed:

LANG=zh_TW.UTF-8
LANGUAGE=
LC_CTYPE="zh_TW.UTF-8"
LC_NUMERIC="zh_TW.UTF-8"
LC_TIME="zh_TW.UTF-8"
LC_COLLATE="zh_TW.UTF-8"
LC_MONETARY="zh_TW.UTF-8"
LC_MESSAGES="zh_TW.UTF-8"
LC_PAPER="zh_TW.UTF-8"
LC_NAME="zh_TW.UTF-8"
LC_ADDRESS="zh_TW.UTF-8"
LC_TELEPHONE="zh_TW.UTF-8"
LC_MEASUREMENT="zh_TW.UTF-8"
LC_IDENTIFICATION="zh_TW.UTF-8"
LC_ALL=

Current behavior

The following output is printed:

LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

Environment

Windows

10.0.19042.330 (Insiders 20H2)

Additional information

wsl genie -c locale doesn't seem to reproduce this issue

Support for dotnet-runtime > 3.0

 # apt install systemd-genie
Reading package lists... Done
Building dependency tree
Reading state information... Done
...
The following packages have unmet dependencies:
systemd-genie : Depends: dotnet-runtime-3.0 but it is not installable
E: Unable to correct problems, you have held broken packages.
 # dpkg -l | grep dotnet-runtime
ii  dotnet-runtime-3.1  3.1.5-1  amd64  Microsoft .NET Core Runtime - 3.1.5 Microsoft.NETCore.App 3.1.5
ii  dotnet-runtime-deps-3.1  3.1.5-1  amd64  dotnet-runtime-deps-3.1 3.1.5

'/lib/genie/dumpwslenv.sh ': No such file or directory

I'm on Arch WSL, zsh.

izzues% git clone https://github.com/arkane-systems/genie/
izzues% cd genie
izzues% make install
izzues% /usr/local/bin/genie -s  # Happens with or without sudo
genie: error executing command '/lib/genie/dumpwslenv.sh ':
No such file or directory

Hangs on `Updated MYPC-wsl -> 127.0.0.1 (On)`

Whatever option I choose, it hangs. Running sudo genie -s -v, this is what I see:

genie: no bottle present.
genie: initializing bottle.
genie: dumping WSL environment variables.
genie: generating new hostname.
genie: removing old hostname.
MYPC not found in /etc/hosts
genie: setting new hostname.
Updated MYPC-wsl -> 127.0.0.1 (On)
genie: starting systemd.

So I have to press Ctrl+C to leave.

Notes:

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.