3

In my ongoing war with WSL2/VSCODE I'm trying to completely remove the .vscode-insiders directory from my machine.

rm -rf wont work, neither will delete from windows. Anyone know How I can destroy this thing?

I'm trying to get a dev environment set up with WSL2 VS CODE and Docker in Windows 10 insiders (18965). I ran into problems trying to install the remote development pack, specifically the /ms-vscode-remote.remote-wsl-0.39.4 extension which is causing no end of problems. However When I try to remove all vs code-insiders residue I get permissions problems with: :/mnt/c/Users/micro/.vscode-insiders/extensions/ms-vscode-remote.remote-wsl-0.39.4/scripts/wslServer.sh

I cant delete it from the Ubuntu side with rm -rf cannot remove 'wslServer.sh': No such file or directory

I cant delete it from windows explorer - no permissions

I cant delete it from powershell as admin running Remove-item.

Looked at all the existing answers on stack and none have a solution as far as i can see.

Would love some help?

Remove-Item : Access is denied At line:1 char:1 + Remove-Item wslServer.sh + ~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : PermissionDenied: (C:\Users\micro...ts\wslServer.sh:String) [Remove-Item], Unauthorized AccessException + FullyQualifiedErrorId : ItemExistsUnauthorizedAccessError,Microsoft.PowerShell.Commands.RemoveItemCommand

Remove-Item : Cannot find path 'C:\Users\micro.vscode-insiders\extensions\ms-vscode-remote.remote-wsl-0.39.4\scripts\wslServer.sh' because it does not exist. At line:1 char:1 + Remove-Item wslServer.sh + ~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (C:\Users\micro...ts\wslServer.sh:String) [Remove-Item], ItemNotFoundEx ception + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand

Meelos
  • 31
  • 2

1 Answers1

1

Ctrl+alt+delete - right click 'Windows Subsystem For Linux' - end task.

Now try deleting the folder or let VScode do it for you.

Nico
  • 872
  • 10
  • 16
  • 1
    The reason is that WSL probably put a lock on the file, because it's a server so probably a long running process. It's really wacky that a file doesn't have any owners, but the developers must have a good reason for it. – Nico Sep 15 '19 at 22:12
  • 3
    Alternative is opening powershell and running `wsl --shutdown` – Nico Oct 03 '19 at 18:54