WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Cannot start wsl in ssh session.

Open Domain opened this issue 4 years ago • 42 comments

Version

Microsoft Windows [版本 10.0.22523.1000]

WSL Version

  • [X] WSL 2
  • [ ] WSL 1

Kernel Version

5.10.74.3

Distro Version

Ubuntu 21.10

Other Software

OpenSSH_for_Windows_8.6p1, LibreSSL 3.3.3

Repro Steps

  1. Connect to windows 10 over ssh
  2. type wsl to start

Expected Behavior

wsl start successful

Actual Behavior

Only output: the file cannot be accessed by the system

Diagnostic Logs

No response

Domain avatar Jan 07 '22 17:01 Domain

Are you using the version of WSL from the Microsoft Store?

benhillis avatar Jan 11 '22 23:01 benhillis

If so, this is a known issue: https://docs.microsoft.com/en-us/windows/wsl/store-release-notes#known-issues

benhillis avatar Jan 11 '22 23:01 benhillis

Are you using the version of WSL from the Microsoft Store? If so, this is a known issue: https://docs.microsoft.com/en-us/windows/wsl/store-release-notes#known-issues

Oh, yes, I just upgrade to the store version.

Domain avatar Jan 13 '22 02:01 Domain

I successfully reverted uninstalling from "Apps and Features" the 2 apps WSL and gWSL installed with the Microsoft Store "Windows Subsystem for Linux Preview" (after exporting my distros as backup).

ppigazzini avatar Jan 13 '22 12:01 ppigazzini

I successfully reverted uninstalling from "Apps and Features" the 2 apps WSL and gWSL installed with the Microsoft Store "Windows Subsystem for Linux Preview" (after exporting my distros as backup).

👍, thanks for the tips!

Domain avatar Jan 14 '22 01:01 Domain

Will this ever be fixed?

kansson avatar Apr 08 '22 11:04 kansson

I would like to be able to use WSL2g when i am using the machine locally and SSH when I need to remote in. It's a better experience than having to RDP into my windows machine to access the WSL filesystem. Is this likely to be fixed?

barak14 avatar Aug 01 '22 01:08 barak14

Uninstall from store version, and install wsl from command line works, but windows 11 will automated upgrade to store version after some update leases. Any update here to reslove https://docs.microsoft.com/en-us/windows/wsl/store-release-notes#known-issues ?

zzjin avatar Aug 29 '22 07:08 zzjin

Any update on this issue? I need systemd and ssh!

Domain avatar Sep 22 '22 10:09 Domain

I'm running into this issue after upgrading to Win11 22H2

mg-christian-esser avatar Sep 29 '22 07:09 mg-christian-esser

Just to clarify an earlier comment, it's only necessary to remove the Windows Store app to restore SSH capability. After doing a backup with wsl --export, open Start, search for Windows Subsystem for Linux Preview, and select Uninstall from the bottom right.

It's not necessary to remove (or at least it wasn't for me) Windows Subsystem for Linux Update nor Windows Subsystem for Linux WSLg Preview from Apps > Installed Apps.

You can check by running wsl --status. With the Windows Store app installed, it should look similar to:

Default Distribution: Ubuntu
Default Version: 2
WSL version: 0.66.2.0
Kernel version: 5.15.57.1
WSLg version: 1.0.42
MSRDC version: 1.2.3401
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.521

Without it installed:

Default Distribution: Ubuntu
Default Version: 2

Windows Subsystem for Linux was last updated on 3/25/2022
WSL automatic updates are on.

Kernel version: 5.10.102.1

gurnec avatar Sep 29 '22 12:09 gurnec

I'm running into this issue after upgrading to Win11 22H2

I do too after upgrading to 22H2 and wsl2 kernel 5.15

ddddavid-he avatar Oct 03 '22 16:10 ddddavid-he

Is there some technical limitation why this isn't worked on?

kansson avatar Nov 08 '22 12:11 kansson

I need to use the store version for the stick keys bug (https://github.com/microsoft/wslg/issues/899). And I need to ssh into my machine. Can we fix both bugs? It has been more than a year.

lxg208 avatar Dec 12 '22 02:12 lxg208

Confirming this issue still exists on Windows 11 22H2 22621.1105. I was prompted inside WSL2 to update to the store version, and did so, then lost the ability to ssh. Uninstalling the store version fixed the problem. This was the non-preview GA version.

davidleechen avatar Jan 15 '23 06:01 davidleechen

Not sure if there is anyway of getting this voted for, so I'll leave a comment.

To run a docker daemon in WSL you need systemd, which as you may have guessed it, needs the store version of WSL to enable. And yep, once that's done you can no longer access WSL via the Windows SSH host.

Dash avatar Jan 31 '23 12:01 Dash

Not sure if there is anyway of getting this voted for, so I'll leave a comment.

To run a docker daemon in WSL you need systemd, which as you may have guessed it, needs the store version of WSL to enable. And yep, once that's done you can no longer access WSL via the Windows SSH host.

You don't need systemd to run daemons. Stick something like

[boot]
command = service docker start

into /etc/wsl.conf and it will work. I'm not arguing that it's more pretty or better than a systemd setup but it gets the job done.

mg-christian-esser avatar Jan 31 '23 13:01 mg-christian-esser

Confirming this issue still exists on Windows 11 22H2 22621.1105. I was prompted inside WSL2 to update to the store version, and did so, then lost the ability to ssh. Uninstalling the store version fixed the problem. This was the non-preview GA version.

Exactly same situation here. I was prompted to upgrade:

Windows Subsystem for Linux is now available in the Microsoft Store!
You can upgrade by running 'wsl.exe --update' or by visiting https://aka.ms/wslstorepage
Installing WSL from the Microsoft Store will give you the latest WSL updates, faster.
For more information please visit https://aka.ms/wslstoreinfo

and this disabled my access.

ndevenish avatar Feb 01 '23 12:02 ndevenish

My workaround worked as follows:

  1. Remove all subsystems and linux distributions from Apps and Features (aka Store installs)
  2. (Re-)install wsl using the steps for older versions of WSL

I wish you luck :four_leaf_clover:

Adelrisk avatar Feb 16 '23 22:02 Adelrisk

My workaround worked as follows:

  1. Remove all subsystems and linux distributions from Apps and Features (aka Store installs)
  2. (Re-)install wsl using the steps for older versions of WSL

I wish you luck 🍀

Confirming that this worked for me. The only difference was that I removed the "Window subsystem for linux" app from the Start Menu.

shusso avatar Feb 25 '23 07:02 shusso