Code Monkey home page Code Monkey logo

Comments (4)

itsabadcode avatar itsabadcode commented on July 20, 2024 1

Go to %appdata%\..\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\rootfs\etc\passwd
and change shell command for user to default /bin/bash
Also you can run wsl.exe --user root if you already changed default-user

from wsl2-hacks.

ericlief avatar ericlief commented on July 20, 2024

@itsabadcode . Unfortunately I have tried that, and for me, ubuntu is mounted at wsl$, and when I go to edit passwd there and save like above, even with admin privileges it won't allow me to save with notepad.
The files in localstate are only
Mode LastWriteTime Length Name


d----- 6/5/2020 11:01 AM temp
-a---- 7/8/2020 3:19 AM 50345279488 ext4.vhdx
-a---l 6/5/2020 10:51 AM 0 fsserver
and I can't access them here.
The wsl command does not do anything for me.

from wsl2-hacks.

MarkL4YG avatar MarkL4YG commented on July 20, 2024

In theory, you could just uninstall the application, delete the package folder and then re-install the app for a clean install.
That is, if that is an option for you, of course.

from wsl2-hacks.

SirLouen avatar SirLouen commented on July 20, 2024

The default instructions are made for ubuntu1804, which corrupt bash for ubuntu2004
These are the instructions for ubuntu2004
https://github.com/chcoders/wsl2-hacks-ubunutu2004

I haven't been able to recover my ubuntu2004 after following the ubuntu1804 instructions, so had to do a clear reinstall.
I would like to discovery a way to enter some kind of "recovery mode" in WSL like common linux distros. I could not manage to undo changes via \$wsl\Ubuntu-20.04 since most files are write protected 👎

Essentially I was able to backup all the files I had in WSL via \$wsl but had to reinstall all the system from the beginning. I hope I find a way to access a full R/W mode with a recovery system in WSL in the future, because I tend to mess up with system files like these pretty frequently.

from wsl2-hacks.

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.