Coder Social home page Coder Social logo

Comments (27)

chetgurevitch avatar chetgurevitch commented on July 23, 2024 8

util-linux 2.36 causes it

edit: You can get the system to boot again by shutting down wsl (wsl --shutdown in powershell), creating a hyper-v vm with ext4.vhdx attached, booting to the arch installation media, mounting the drive, copying /usr/bin/nsenter to /mnt/usr/.bin/, shutting down, and detaching the drive from the vm. After that you should add libutil-linux and util-linux to pacman's ignore list and downgrade both of them to 2.35.2 (files here https://archive.archlinux.org/repos/2020/07/20/core/os/x86_64/)

from container-systemd-init-tool.

yuk7 avatar yuk7 commented on July 23, 2024 6

I fixed script.
apply this commit change please...: 7f93f5e
to /boot/init_wsl2/script.sh

from container-systemd-init-tool.

Dormanil avatar Dormanil commented on July 23, 2024 2

I got a similar bug today

nsenter: cannot open /proc/6/ns/time: No such file or directory

[process exited with code 1]

Your fix unfortunately didn't fix this particular one.

I also updated the kernel of my WSL2 distros, so maybe that is the cause for this one.

from container-systemd-init-tool.

scrouthtv avatar scrouthtv commented on July 23, 2024 1

Okay I fixed it for now, although this is a very poor fix.
For everyone facing the same nsenter: cannot open /proc/6/ns/time: No such file or directory (although keep in mind that this is a very bad fix)

wsl -u root --exec "/usr/.bin/bash"
bash-5.0# export PATH=/usr/.bin:$PATH

To get into an emergency shell as root.

Then, copy over an old copy of util-linux. /var/cache/pacman/pkg/ is pacman's package cache. If that one file does not exist for you, look for any one older than 2.36 and copy this one over.

bash-5.0# cp /var/cache/pacman/pkg/util-linux-2.35.2-1-x86_64.pkg.tar.zst /tmp/
bash-5.0# cd /tmp
bash-5.0# unzstd util-linux-2.35.2-1-x86_64.pkg.tar.zst
bash-5.0# tar xf util-linux-2.35.2-1-x86_64.pkg.tar.zst
bash-5.0# cp nsenter /usr/.bin/nsenter

Now you've overwritten nsenter with the 2.35 version.
If you really want to make sure, everything worked correctly (although you don't have to):

bash-5.0# sha1sum nsenter
f7df362fb45c9c03bb1cd93713e33fc8ef5c043c  nsenter
bash-5.0# sha1sum /usr/.bin/nsenter
f7df362fb45c9c03bb1cd93713e33fc8ef5c043c  /usr/.bin/nsenter

compare the two files.

I can get back into my wsl installation now.

You still have to blacklist util-linux from pacman until this bug is fixed:

 > grep util-linux /etc/pacman.conf
IgnorePkg     = util-linux lib-util-linux

And keep in mind that you're now running a partially upgraded version of util-linux which might cause bugs.
I would suggest to downgrade both util-linux and lib-util-linux using pacman.

EDIT: It's not HoldPkg (that one only disables uninstalling certain packages) but rather IgnorePkg

from container-systemd-init-tool.

tindzk avatar tindzk commented on July 23, 2024

I am getting the same error with WSL2 after running the following commands:

pacman-key --init
pacman-key --populate archlinux
pacman -Syu

from container-systemd-init-tool.

Lunchb0ne avatar Lunchb0ne commented on July 23, 2024

util-linux 2.36 causes it

edit: You can get the system to boot again by shutting down wsl (wsl --shutdown in powershell), creating a hyper-v vm with ext4.vhdx attached, booting to the arch installation media, mounting the drive, copying /usr/bin/nsenter to /mnt/usr/.bin/, shutting down, and detaching the drive from the vm. After that you should add libutil-linux and util-linux to pacman's ignore list and downgrade both of them to 2.35.2 (files here https://archive.archlinux.org/repos/2020/07/20/core/os/x86_64/)

This does work, but it's not really an optimal solution.

from container-systemd-init-tool.

Lunchb0ne avatar Lunchb0ne commented on July 23, 2024

I got a similar bug today

nsenter: cannot open /proc/6/ns/time: No such file or directory

[process exited with code 1]

Your fix unfortunately didn't fix this particular one.

I also updated the kernel of my WSL2 distros, so maybe that is the cause for this one.

Yep, I'm getting this now.

from container-systemd-init-tool.

Sherlock-Holo avatar Sherlock-Holo commented on July 23, 2024

I got a similar bug today

nsenter: cannot open /proc/6/ns/time: No such file or directory

[process exited with code 1]

Your fix unfortunately didn't fix this particular one.

I also updated the kernel of my WSL2 distros, so maybe that is the cause for this one.

I got this problem too but I don't update kernel

from container-systemd-init-tool.

kerojiang avatar kerojiang commented on July 23, 2024

I got this problem too when I start the wsl2 second time

nsenter: cannot open /proc/13/ns/time: No such file or directory

from container-systemd-init-tool.

Neurognostic avatar Neurognostic commented on July 23, 2024

I fixed script.
apply this commit change please...: 7f93f5e

you can enter emergency console with this command:

wsl -d Arch2 --exec "/usr/.bin/bash"
export PATH=/usr/.bin:$PATH
vim /boot/init_wsl2/script.sh

Applying this patch appears to have resolved the issue for me. Thanks @yuk7 !

from container-systemd-init-tool.

Sherlock-Holo avatar Sherlock-Holo commented on July 23, 2024

@yuk7 hello, is there any new way could fix this problem?

from container-systemd-init-tool.

rafsb avatar rafsb commented on July 23, 2024

I fixed script.
apply this commit change please...: 7f93f5e

you can enter emergency console with this command:

wsl -d Arch2 --exec "/usr/.bin/bash"
export PATH=/usr/.bin:$PATH
vim /boot/init_wsl2/script.sh

worked well

from container-systemd-init-tool.

heller390 avatar heller390 commented on July 23, 2024

I fixed script.
apply this commit change please...: 7f93f5e
you can enter emergency console with this command:

wsl -d Arch2 --exec "/usr/.bin/bash"
export PATH=/usr/.bin:$PATH
vim /boot/init_wsl2/script.sh

Applying this patch appears to have resolved the issue for me. Thanks @yuk7 !

Need to compile from source for applying that patch? I am kinda confused

from container-systemd-init-tool.

Neurognostic avatar Neurognostic commented on July 23, 2024

Need to compile from source for applying that patch? I am kinda confused

@heller390, You can manually edit the /boot/init_wsl2/script.sh script and change the line to match what is shown in commit 7f93f5e.

from container-systemd-init-tool.

heller390 avatar heller390 commented on July 23, 2024

Need to compile from source for applying that patch? I am kinda confused

@heller390, You can manually edit the /boot/init_wsl2/script.sh script and change the line to match what is shown in commit 7f93f5e.

It seems patched in the latest download. But exporting the path is giving error " /boot../*.sh not a valid identifier"

from container-systemd-init-tool.

heller390 avatar heller390 commented on July 23, 2024

@yuk7 hello, is there any new way could fix this problem?

I tried with patching the latest commit also . But still not working!

from container-systemd-init-tool.

Sherlock-Holo avatar Sherlock-Holo commented on July 23, 2024

from container-systemd-init-tool.

mtkleet avatar mtkleet commented on July 23, 2024

Yup, works fine after updating. No need to reinstall.

from container-systemd-init-tool.

scrouthtv avatar scrouthtv commented on July 23, 2024

For some reason, the startup script is located for me not in /boot/init_wsl2/script.sh but /init_wsl2/script.sh.

I got this error when running wsl:
nsenter: cannot open /proc/6/ns/time: No such file or directory

  • Applying the patch provided by @yuk7 didn't work
  • Downloading the latest relase & overwriting Arch2.exe and rootfs.tar.gz did not work

I can get into the bash but that's it.

from container-systemd-init-tool.

scrouthtv avatar scrouthtv commented on July 23, 2024

@yuk7 This still happens with newest util-linux and I can't find any suitable fix. Kindly reopen.

from container-systemd-init-tool.

gardar avatar gardar commented on July 23, 2024

@yuk7 This still happens with newest util-linux and I can't find any suitable fix. Kindly reopen.

In case someone is still running into this issue or has util-linux and lib-util-linux in IgnorePkg, then it seems to be fixed now on master branch (d1deab1).
You can simply overwrite the files in /boot/init_wsl2 with the ones from master and then you can update util-linux, etc.

mkdir /boot/init_wsl2/backup
cp /boot/init_wsl2/{isocon_sh.sh,script.sh,syncbin.sh,wsl2_isocond.sh} /boot/init_wsl2/backup/
cd /tmp
git clone https://github.com/yuk7/container-systemd-init-tool.git
cp /tmp/container-systemd-init-tool/{isocon_sh.sh,script.sh,syncbin.sh,wsl2_isocond.sh} /boot/init_wsl2/
chmod +x /boot/init_wsl2/{isocon_sh.sh,script.sh,syncbin.sh,wsl2_isocond.sh}

from container-systemd-init-tool.

scrouthtv avatar scrouthtv commented on July 23, 2024

@gardar

  • /boot/init_wsl2 didn't even exist in the first place
  • I simply copied the files you mentioned from master into the newly created folder
  • I updated util-linux to the newest version
  • I am getting the same error again (nsenter: cannot open /proc/6/ns/time: No such file or directory)

from container-systemd-init-tool.

gardar avatar gardar commented on July 23, 2024

@gardar

  • /boot/init_wsl2 didn't even exist in the first place
  • I simply copied the files you mentioned from master into the newly created folder
  • I updated util-linux to the newest version
  • I am getting the same error again (nsenter: cannot open /proc/6/ns/time: No such file or directory)

Hmm, are you using the (now deprecated) Arch2 systemd version that was in this repo? Or are you using https://github.com/yuk7/ArchWSL?

I'm using the deprecated version myself

EDIT:
I see that previously you mentioned that the scripts were located under /init_wsl2/ and not /boot/init_wsl2/
Does copying the files from master over /init_wsl2/ change anything for you?

from container-systemd-init-tool.

scrouthtv avatar scrouthtv commented on July 23, 2024

I am running ArchWSL2, how this repository was previously named (#30). I don't know, how ArchWSL2 is related to this repo anymore...

Copying the file changes the error message, now I get runuser: failed to execute : No such file or directory instead.

EDIT: It seems that the original ArchWSL also supports wsl2, and it is not broken with the newer util-linux versions, I think I just have to delete my current wsl installation and create a new one based on ArchWSL

from container-systemd-init-tool.

gardar avatar gardar commented on July 23, 2024

The scripts on master have hard coded links to /boot/init_wsl2, perhaps your issues are related to that, you can try replacing /boot/init_wsl2 with /init_wsl2

cd /init_wsl2
sed -i -- 's/\/boot\/init_wsl2/\/init_wsl2/g' *.sh

My understanding was that while ArchWSL also supports wsl2, it doesn't contain systemd like ArchWSL2 did

from container-systemd-init-tool.

scrouthtv avatar scrouthtv commented on July 23, 2024

you can try replacing /boot/init_wsl2 with /init_wsl2

Same error.

EDIT: The error is that isocon_sh.sh is called without a parameter, because $INIT_WSL_UID is empty (script.sh)

My understanding was that while ArchWSL also supports wsl2, it doesn't contain systemd like ArchWSL2 did

As far as I remember, ArchWSL didn't support wsl2 back when this repo was created.

(btw did you know that you can also use | instead of / for as the command seperator in sed, so you don't need the \/ for path elements: sed -i -- 's|/boot/init_wsl2|/init_wsl2|g' *.sh)

from container-systemd-init-tool.

scrouthtv avatar scrouthtv commented on July 23, 2024

@gardar I'm currently trying to create a fresh Arch installation based yuk7/ArchWSL and for that I need my old data from the borked installation. Do you have any idea where the home folder normally would be mounted from? Because in my borked installation, the home folder is now empty. Also, installing the old nsenter doesn't fix it either

from container-systemd-init-tool.

Related Issues (20)

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.