-
Notifications
You must be signed in to change notification settings - Fork 822
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
wsl --install : A specified logon session does not exist. It may already have been terminated. #9521
Comments
/logs |
Hello! Could you please provide more logs to help us better diagnose your issue? To collect WSL logs, download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The scipt will output the path of the log file once done. Once completed please upload the output files to this Github issue. Click here for more info on logging Thank you! |
Thanks @JWray27. Which context are you running the command from ? Are you logged in to the machine interactively, or via RDP / SSH / PSRemote ? Also, which user account are you running the command from ? |
Interactively. In a command prompt launched from my (unprivileged) local account using "Run As Administrator". |
Following this issue too. |
I got the same error message too using my non local administrator Windows account when I used "Run as Administrator". For me workaround was to log into Windows with local admin account, open Powershell "Run as Admin" -> "wsl --install" |
The issue occurs even when using local admin rights |
I was unable to install WSL or Ubuntu from PowerShell. However, I was able to install WSL and Ubuntu from the Microsoft Store, restart my computer, and then launch Ubuntu from Windows Terminal to finish the setup process. (Without restarting, I got an error message when trying to start Ubuntu.) |
Hi, I had the same issue, could not install wsl whether with powershell, cdm, ran as admin or not, I figured out (when uninstalling everything) that I could turn on both 'Virtual Machine Plateform' and 'Windows Subsystem for Linux' in Settings >Apps > Apps and features > more windows. Then, without having to run PowerShell as admin, running |
I have the same problem when trying to install WSL on my Windows
I'm using a user account instead of the main (administrator) account. I tried both, by entering the PIN to elevate my privileges and opening a Powershell as administrator, and the result was the same:
The suggestion of TheophileKikleo worked for me: by adding a new feature to Windows. After installing WSL, I was able to install Ubuntu.
|
I have the same issue while installing WSA with local admin rights. |
Same issue using WSL with local admin rights |
I had the same problem:
After looking around I found that Virtual Machine Platform is needed to be activated to run it. You have to enable this in the 'Turn windows features on and off'. But turns out I also had to enable HyperV (not so sure why) on that same panel for the above command to work. After a restart and installation of the required packages by the system, I could successfully run:
After that the Ubuntu CLI opened for user & password setup. PD: I also had to install the Linux kernel update manually as seen in this post. |
I encountered this same problem on Windows 11. |
Windows 11 Pro 22H2 22621.1413 same issue |
Hi JWray27 I was also puzzled by the borked installation of wsl on a new Windows 11 system. There is no mention of the follow procedure in the Microsoft wsl installation guides - and I think it should be because this is what caused my install to fail in the same manner as yours: Mine was not checked - perhaps this it checked by default (i would think so, though). However with this checked and after a restart, the wsl --installl command in powershell (as admin) exited cleanly. Best of luck. |
wsl --update, then wsl --install -d Ubuntu |
It appears that the developers may have overlooked adding the It seems that the This is speculative. After running the My advice is to reboot after running Cheers! |
What worked for me was to install WSL2 frome the Windows Store : https://aka.ms/wslstore |
What worked for me was : on non-admin user, with powershell.exe run as admin
I switched user then logged on the admin session :
Switched back to non-admin user with powershell.exe run as non-admin :
and it worked. |
Same issue, possibly related to locking my screen while the install was ongoing. A reboot and rerunning the command UPDATE: I had to be logged in as an admin, not just using a powershell with admin, got it working |
Encountered the same issue on a fresh installed Windows 11 22H2. Installing WSL in Windows Store seems the solution to me: |
'Virtual Machine Plateform' and 'Windows Subsystem for Linux' were already active but I had to also check Hyper-V in 'Windows feature'. After a reboot I was able to use wsl 2 and install a distro. |
I had the same issue and this thread helped me to almost solve the problem but with a bit of a twist: After activating WSL in Windows features and rebooting I could not install wsl as an administrator (also wsl --update did not work) and also the error messages were just generic. Only when I then tried to install as a user did I get an error message pointing me to a site (https://aka.ms/wsl2kernel) where I could download a necessary kernel update. After that it worked. I noticed that that site is just the one for manually installing WSL2 and it seems to contain the steps outlined in this thread as shell commands so perhaps that would have been faster. |
This worked for me. Thanks. |
B
Hi @TheophileKikleo, |
The issue is because you do not have enabled the WSL in Control Panel\All Control Panel Items\Programs and Features\Turn Windows Features on or off. Check the feature "Windows Subsystem for Linux", and restart you machine. |
encountered the same issue. I am logged in as a non-admin user. Windows Subsystem for Linux and Hyper-V features are enabled and machine was rebooted after they were enabled. I opened cmd terminal with 'Run as administrator' and tried to run 'wsl --update' I am on Windows 11 Build 22631.3447 |
Figured out the above error happens only if you are not a local user. At least in my case, I had logged in as a domain user. |
I got a replacement laptop for work and had the similar error. The Problem
The Cause The Solution:
This allowed Windows to create the missing profile information that was being requested. Afterwards, I was able to run theseommands successfully as a regular user using admin elevation.
|
I just had the same issue trying wsl --install as a standard user with a termianl running as administrator. Resolved using tip from zxcvxzcv-johndoe. Login as local admin user, run wsl --install, then log back in as standard user and run wsl --install. |
In my case, the solution was to check the "windows subsystem for linux" checkbox in the "Turn Windows Features On Or Off" dialog box. Note that it was not necessary (in my case) to log on as the administrator. I only logged on with my regular user account, and then elevated to admin when prompted. Someone at Microsoft apparently believes that installing WSL and enabling WSL are entirely unrelated concepts, and it wouldn't make sense to enable WSL while installing WSL. And someone at Microsoft also believes that the error message in the title of this thread is an acceptable way to (attempt to) inform the customer that they need to enable WSL before installing WSL. It's been this way for over a year, so I'm guessing there's a ticket somewhere inside Microsoft with properties like: |
I had the same issue with wsl installation on a machine that is managed by an admin team that I do have an administrator p/w for. restart my machine ask the IT adminstrator to login again as described here: #9521 (comment) |
Version
Microsoft Windows [Version 10.0.22621.1105]
WSL Version
Kernel Version
No response
Distro Version
No response
Other Software
No response
Repro Steps
Initial install. Downloaded wsl from MS store. Stared admin command shell. Typed wsl --install.
wsl install virtual machine support, and then terminated with the message:
A specified logon session does not exist. It may already have been terminated.
Attempting to rerun wsl now just give the error about logon session:
C:\Windows\System32>wsl --install
Installing: Windows Subsystem for Linux
A specified logon session does not exist. It may already have been terminated.
Expected Behavior
Expecting to successfully install wsl
Actual Behavior
Got the error message above
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: