New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Closed
CasterWx opened this issue
May 21, 2020
· 9 comments
Comments
Microsoft Windows [Version10.0.19628.1]
WSL 2
After installing Ubuntu18.04, you are prompted for a username, which is invalid。
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: antzuhl
Enter new UNIX username: abcsdasd
Enter new UNIX username: wangssds
Enter new UNIX username: fdfdas
Make sure you have this option in Settings -> System -> Storage pointing to the C: system drive. You may need to uninstall the distro and install it again.
There are these options.
It was unloaded and reloaded many times, There is no problem with the WSL. However, after converting to WSL2, problems arise.
wsl --set-version Ubuntu-18.04 2
Is that Windows Chinese version? You have same problem as #4900
Try this from cmd:
wsl.exe -d Ubuntu-18.04 -u root
and from bash:
adduser antzuhl
usermod -aG adm,cdrom,sudo,dip,plugdev antzuhl
People seeing this might file an issue with the disto maintainer similar #3273 (message).
hi, I can not follow, how was this fixed ? I am getting same issues with all distros WSL2 on Azure VM. Content is saved to C: where I have full access to.
wsl.exe -d Ubuntu-18.04 -u root
even this didn’t work. Whats the work around ? , thanks
@naren3k What’s the Windows version in the Azure VM? What’s your output for wsl.exe -l -v
and wsl.exe --status
?
I had the same problem on my laptop. Looks like it was blocked by McAfee, configured with company-wide antivirus policy.
There’s a message about that in McAfee Event Log:
So, need to contact guys who are in charge of that.
Is that Windows Chinese version? You have same problem as #4900
Try this from cmd:
wsl.exe -d Ubuntu-18.04 -u root
and from bash:
adduser antzuhl
usermod -aG adm,cdrom,sudo,dip,plugdev antzuhl
This worked for me, but for some reason with Ubuntu-20.04.6 i wasn’t able to do that. Even wsl --list
did not show anything. Im on win10 and Ubuntu-18.04 fits good.
So, I’ve been using the new(ish) Bash on Ubuntu on Windows (WSL) for a while now and all has been top-notch, until yesterday.
I git-pushed from Bash by accident, so it asked me for my repo-destination account details like normal. I decided to ignore this, terminate Bash and try to just use powershell instead (can’t ever remember passwords!). Terminating Bash however caused the shell to freeze. I forced closed and restarted my comp (I’ve had to force close and restart several times before for various reasons and everything was fine).
After boot up, I just tried to check if Bash was working again, but it wasn’t. It just failed to start with no error message. For example:
PS C:\WINDOWS\system32> bash
PS C:\WINDOWS\system32>
Has anyone else had a similar situation/knows how to help?
EDIT: Only solved through reinstalling bash, using
lxrun /uninstall /full
then
lxrun /install
asked May 18, 2017 at 13:26
oblongoblong
6252 gold badges6 silver badges8 bronze badges
1
I had the same issue but my solution was different. I found that my (Default) WSL distribution was set to docker-desktop-data instead of my Ubuntu distribution, e.g.
In PowerShell (Windows Shell): wslconfig /L
This lists WSL distributions. For me «docker-desktop-data (Default)» was listed as default not my Ubuntu distribution.
To change this:
In PowerShell (Windows Shell): wslconfig /setdefault Ubuntu-20.04
David Buck
3,75335 gold badges31 silver badges35 bronze badges
answered Jun 25, 2020 at 17:46
MarkMark
5414 silver badges2 bronze badges
0
Came here with a similar issue, but a different solution, so I’ll post in case it helps anyone else.
The difference in my situation was that, when running bash
through Command Prompt, it complained about Legacy Mode being enabled.
- Open a regular command prompt (
win+r
thencmd
) - Right-click the title bar and select
Properties
- Deselect «Use legacy console (requires restart)»
Now it should work either by launching the standalone app, or typing bash
into a regular cmd
window after restarting Command Prompt.
This and other causes can be found in this Github issue.
answered Sep 11, 2017 at 1:19
Dave SDave S
7881 gold badge11 silver badges30 bronze badges
0
The solutions listed also did not work for me. I found a solution here.
Essentially, navigate to Control Panel > System > Advanced System Settings > Advanced > Settings > Advanced > Virtual memory, Change ...
, and set a Custom size for the paging file size: 800 min and 1024 max. Restarted, and the command prompt came back.
answered Sep 30, 2018 at 5:19
Robert YiRobert Yi
1,5631 gold badge14 silver badges18 bronze badges
2
Do a FULL REBOOT. That worked for me. Windows 10 fast boots system to save memory. TO do a Full Reboot Hold Shift and Click on Restart/Shutdown.
answered May 5, 2020 at 10:21
0
Linux Distribution should be installed additionally to Windows Subsystem for Linux.
See Install WSL on Windows 10 or Install WSL on Windows Server for detailed steps and explanations. In case mentioned manuals are moved or not available I’ll put below main steps for Windows 10 that helped me:
- Open PowerShell as Administrator and run
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- Restart computer if prompted.
- Open PowerShell and run
Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile Ubuntu.appx -UseBasicParsing
- Execute the downloaded
Ubuntu.appx
. - Enjoy running bash on Windows again.
answered Apr 15, 2019 at 9:49
1
I’ve had similar issues. The solution for me was to disable fast startup in powers settings.
answered Jun 11, 2019 at 23:03
0
I had the same issue the following fix worked for me:
Fix:
- restart by clicking shift + restart button.
- it will load recovery options, just click on continue to windows.
- once pc starts open the terminal by start search for ubuntu click enter
- once terminal gets open it might show cursor blinking and does nothing.
- just press cntrl+c or cntrl+z and you will have problem solved.
answered Apr 23, 2020 at 14:28
See my comment to original poster.
Your fix did not work for me. here is the PowerShell [as admin] listing:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\WINDOWS\system32> lxrun /uninstall /full
Warning: lxrun.exe is only used to configure the legacy Windows Subsystem for Linux distribution.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
This will uninstall Ubuntu on Windows.
This will remove the Ubuntu environment as well as any modifications, new applications, and user data.
Type "y" to continue: y
Uninstalling...
Error: 0x80070002
PS C:\WINDOWS\system32>
I went to https://aka.ms/wslstore
- chose ubuntu
- it downloaded
- clicked ‘pin to start’
- clicked ‘Launch’
Ubuntu [window]:
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: joe
Enter new UNIX password: joepw202
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: joe
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Installation successful!
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
joe@joethinks:~$
Please note: BUMMER! None of my shortcuts or installs were moved over from my last version. Here i am running BASH from vscode:
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
joe@joethinks:/mnt/c/1d/TrinitySundayMusicPj$ cdtsm
cdtsm: command not found
joe@joethinks:/mnt/c/1d/TrinitySundayMusicPj$ cd trinitySundayMusic
joe@joethinks:/mnt/c/1d/TrinitySundayMusicPj/trinitySundayMusic$ node wizard.js
The program 'node' is currently not installed. You can install it by typing:
sudo apt install nodejs-legacy
joe@joethinks:/mnt/c/1d/TrinitySundayMusicPj/trinitySundayMusic$
At least it works.
answered May 26, 2018 at 19:29
4
Right after Windows Updates KBB4471324 and a reboot, Bash wouldn’t launch. No messages.
In event viewer I saw messages about
The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
I didn’t bother trying to figure out if the SID, CLSID and APPID were associated with bash.
I launched Bash as administrator, which worked, and then bash as a normal user, which worked.
It seems to be fine, now.
answered Dec 15, 2018 at 21:54
Section i: other error messages.
-
This error is closely followed by a second error, code 0x80070057 (see section 2)!
-
This error also manifests as «Windows Subsystem for Linux has no installed distributions. Distributions can be installed by visiting the Microsoft Store: https://aka.ms/wslstore» by typing
Bash
at cmd/powershell. Use Section 1 then Section 2.
Section ii: verify your installation and restart.
Be sure that WSL (Windows Subsystem Linux) is checked/installed and your computer had a proper restart: {⊞START} → type «features
» (ensure «Turn Windows features on or off» is selected). → {ENTER}. → Turn Windows Subsystem for Linux on. → Press OK. → Restart your computer immediately after the installation has finished.
Section 1a: Install Linux [via the Microsoft Store].
- Press {⊞START} on your keyboard.
- Type «
store
» ensure «Microsoft Store» is selected. → {ENTER}}. - {SHIFT}-{TAB} twice (highlight search). → {ENTER}.
- type «
subsystem
«. → {ENTER}. - Select your flavor of Linux (i.e., «Ubuntu LTS 18.04») and click «Install».
- {⊞START}. -> Type «
ubuntu
» (ensure Ubuntu App is selected). → {ENTER}.
Section 1b: Side-load Linux.
*This is a placeholder—you can manually install WLS—https://learn.microsoft.com/en-us/windows/wsl/install-manual. I have not done this, yet. If you have done this, please add instructions by editing my answer; otherwise, I will post this section after performing this operation myself.
Section 2: if launching Ubuntu throws ‘WslRegisterDistribution failed with error: 0x80070057’**
After installing a linux flavor:
- {⊞START} → type «
features
» (ensure «Turn Windows features on or off» is selected). → {ENTER}. - Turn Windows Subsystem for Linux off. → Press OK.
- Turn Windows Subsystem for Linux on.
- Restart your computer.
- {⊞START}. → type «
ubuntu
» (ensure «Ubuntu App» is selected). → {ENTER}
**This is the most-accepted solution for this issue is the last answer on page two at Microsoft Answers.
answered Jan 4, 2020 at 20:42
Wolfpack’08Wolfpack’08
3,98211 gold badges47 silver badges78 bronze badges
What worked for me was to disable and enable WSL feature from control panel:
- Control Panel —> Programs and Features —> Turn Windows Feature on or off
- Uncheck «Windows Subsystem for Linux»
- Uninstall Ubuntu from Windows
- Restart
- In (1), check «Windows Subsystem for Linux»
- Install Ubuntu
- Success!
answered May 6, 2021 at 10:24
OrozcoOrozco
3752 silver badges8 bronze badges
If none of the previuos answers worked for you, try this workaround, after trying different alternatives, this one worked for me.
- Run windows + R
- type SystemPropertiesAdvanced
- click settings in performance group
- In advanced tab, deselect the automatically manage paging file size for all drives
- Select custom size and enter 800 for initial size, 1024 for maximum size.
- Apply changes and restart.
answered May 8, 2021 at 17:02
try
wsl --list --verbose
to see a list of all installed distributions and their names
assume you have a result that looks like this
NAME STATE VERSION
* Ubuntu-22.04 Running 2
docker-desktop Running 2
docker-desktop-data Running 2
start the Ubuntu distribution, you can run
wsl --distribution Ubuntu-22.04 --verbose
If you want to make sure that the Ubuntu distribution starts automatically when you launch the WSL subsystem
wsl --set-default Ubuntu-22.04
answered May 15 at 1:00
You may meet errors when trying to install Linux with WSL even your Windows has satisfied the prerequisites:
Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11.
Why using WSL
WSL allows you have a Linux distribution, Linux applications, a Bash command line tool without the overload of the traditional virtual machine or dual-systems.
wsl --install
error – Invalid command line option: –install
C:WINDOWSsystem32>wsl --install
Invalid command line option: --install
Usage: wsl.exe [option] ...
Options:
...
That’s because your Windows version is not recent enough. According to Set up a WSL development environment:
To use the simplified –install command, you must be running a recent build of Windows (Build 20262+). To check your version and build number, select Windows logo key + R, type winver, select OK. You can update using the Settings menu or Windows Update Assistant.
If you do not intend to update your Windows, try WSL manual installation steps for older versions. Just follow its step1-step6 to install WSL2 if your Windows version satisfy the needs in step2, otherwise do step1 and jump to do step6 to install WSL1.
Error – The packaged version of WSL is not supported by windows-version 10.0.19041.xxx
If you try to install WSL from Windows Store and meet below error:
The packaged version of WSL is not supported by windows-version
10.0.19041.xxx.
Try manual install with step1-step5 (or just step1 if your windows do not meet the needs in step2) introduced in WSL manual installation steps for older versions. Then jump to the bottom “Downloading distributions” section to manually download a Linux distribution.
Like to download the Ubuntu 20.04, direct to the folder you want to put the distribution file and run:
$ curl.exe -L -o ubuntu-2004.appx https://aka.ms/wslubuntu2004
The download may fail, try a few more times.
When the download is done, use Add-AppxPackage .ubuntu-2004.appx
or double click the ubuntu-2004.appx
file to install it.
You will see a Ubuntu command line to prompt you it is installing and then prompt you to set a username and password for the Linux:
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new Unix username:
Note you won’t see the newly installed instance command line in Windows Terminal for a manual install. You need to manually set up a profile for the new instance to see its command line in Windows Terminal.
See more at Set up a WSL development environment for more settings like Visual Studio Code, Git, MySQL, etc.
Install Windows Terminal
It is recommended to install Windows Terminal. Windows Terminal can run any command line tool and open them in multiple tabs. Then you are able to easily switch between multiple tasks like between Linux distribution command line and Windows Command Prompt.
It can be installed from Windows Store. Once it is stalled, you can see many command lines in it like PowerShell, Windows Prompt and any Linux instance command line (if it is not a manual WSL install).
For manual Linux install WSL, manually set up a profile for it to integrate it in Windows Terminal.
Set up a profile for a manual install of Linux instance
To set up a profile for Ubuntu:
- Windows Terminal > Drop down button > Settings.
-
New empty profile
-
Set the name like “Ubuntu” and command line (the path of ubuntu.exe).
-
Save
Then the command line tool will present in Windows Terminal menu.
Resource
-
Install WSL
-
Manual installation steps for older versions of WSL
-
Set up a WSL development environment
Make the user only root
After installing from the Microsoft Store, on first boot,
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username:
and is prompted to enter a name for the new user. where if you type root
,
Enter new UNIX username: root
adduser: The user `root' already exists.
Enter new UNIX username:
and cannot proceed, but pressing Ctrl + C
here closes the window.
When started from the start menu again, it starts with the root
user logged in.
Normal Installation
Typing a username here usually prompts you for a password, and typing the same password twice completes the installation.
Installing, this may take a few minutes...
Installation successful!
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: username
New password:
Retype new password:
passwd: password updated successfully
Use same password for root user?
Type "y" to approve, any other key to reject: y
Default UNIX user set to: username
username@HOSTNAME:~>
I am attempting to configure a new laptop (Windows 10 Enterprise Version 20H2). I have installed WSL with the wsl --install
command recommended by Microsoft.
I have managed to import a backup of my previous WSL2 Ubuntu 20.04 configuration and have set that as the default distribution.
PS C:\Windows\System32> wsl --list --verbose
NAME STATE VERSION
* Ubuntu-20.04 Stopped 2
However, when I attempt to launch Ubuntu (wanting my old config) from the launcher in the start menu, it installs a fresh version of Ubuntu and launches that
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username:
I’ve tried removing the unwanted instance with
PS C:\Windows\System32> wsl --unregister Ubuntu
But the problem persists. So how can I get the launcher (or whatever the correct term is in Windows) to launch the default version?