Skip to content
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

VScode using problem of WSL #4367

Closed
dawnli139 opened this issue Jan 26, 2021 · 4 comments
Closed

VScode using problem of WSL #4367

dawnli139 opened this issue Jan 26, 2021 · 4 comments
Labels
wsl Issue in vscode-remote WSL

Comments

@dawnli139
Copy link

When I was using WSL with VS Code, I was initially able to use the "code." command in WSL to interact with VS Code, but shell tell me "zsh: permission denied: code".Yes, I am using ZSH, but this does not seem to be related to the common "PATH" problem. At first I configured the PATH in "/.zshrc" and was able to use vscode, but later I suddenly found the "/.vscode" file was cleared. Then I uninstalled and reinstalled the deb of vscode, but it didn't seem to make any sense.Finally, keep repeating the following:
To use Visual Studio Code with the Windows Subsystem for Linux,please install Visual Studio Code in Windows and uninstall the Linux version in WSL. You can then use the code command in a WSL terminal just as you would in a normal command prompt.
Do you want to continue anyway? [y/N] y
To no longer see this prompt, start Visual Studio Code with the environment variable DONT_PROMPT_WSL_INSTALL defined.
code .
To use Visual Studio Code with the Windows Subsystem for Linux, please install Visual Studio Code in Windows and uninstall the Linux version in WSL. You can then use the code command in a WSL terminal just as you would in a normal command prompt.
Do you want to continue anyway? [y/N] y
To no longer see this prompt, start Visual Studio Code with the environment variable DONT_PROMPT_WSL_INSTALL defined.
code .
To use Visual Studio Code with the Windows Subsystem for Linux, please install Visual Studio Code in Windows and uninstall the Linux version in WSL. You can then use the code command in a WSL terminal just as you would in a normal command prompt.
Do you want to continue anyway? [y/N] y
To no longer see this prompt, start Visual Studio Code with the environment variable DONT_PROMPT_WSL_INSTALL defined."

I installed Anaconda (I choose "No" on whether to install VS Code), zsh, oh-my-zsh, and some basic environment configurations

Now I can't use vscode in wsl, I hope to repair it because I don't want to reinstall WSL for the fourth time!

@dawnli139
Copy link
Author

I make sure that have problem in wsl, because ".vscode" folder is empted. I want to know if there is a way to initialize only this part, or to allow me to use VS Code interactions normally in WSL.

@github-actions github-actions bot added the wsl Issue in vscode-remote WSL label Jan 26, 2021
@bamurtaugh
Copy link
Member

Hi @dawnli-github, thanks for writing this up. Just to make sure I understand:

  • You had VS Code + Remote - WSL working, and you were able to connect to new Remote - WSL + VS Code instances with code . from a remote terminal
  • You then wanted to use zsh bash shells with code . to open new Remote - WSL instance, but got permission denied errors
  • To mitigate the zsh permission issue, you tried setting the path in zsh, and it initially worked, and you could use VS Code + Remote - WSL in zsh shells
  • But since the "/.vscode" file was cleared, you reinstalled VS Code (the Debian version?)
  • You keep getting prompted to uninstall a Linux-based VS Code in WSL and instead install a Windows-based version and connect via Remote-WSL

Does it seem like the following could help with your permission issues, so that you can just have a Windows installation of VS Code, correct permissions, and connect to it via Remote-WSL? microsoft/vscode#85778 microsoft/WSL#3833 ohmyzsh/ohmyzsh#8964 I do recognize you mention it seems unrelated to paths, though that's what several solutions would seem to suggest investigating.

I make sure that have problem in wsl, because ".vscode" folder is empted. I want to know if there is a way to initialize only this part, or to allow me to use VS Code interactions normally in WSL.

Could you help clarify this for me? What are you looking to initialize?

@dawnli139
Copy link
Author

Hi @dawnli-github, thanks for writing this up. Just to make sure I understand:

  • You had VS Code + Remote - WSL working, and you were able to connect to new Remote - WSL + VS Code instances with code . from a remote terminal
  • You then wanted to use zsh bash shells with code . to open new Remote - WSL instance, but got permission denied errors
  • To mitigate the zsh permission issue, you tried setting the path in zsh, and it initially worked, and you could use VS Code + Remote - WSL in zsh shells
  • But since the "/.vscode" file was cleared, you reinstalled VS Code (the Debian version?)
  • You keep getting prompted to uninstall a Linux-based VS Code in WSL and instead install a Windows-based version and connect via Remote-WSL

Does it seem like the following could help with your permission issues, so that you can just have a Windows installation of VS Code, correct permissions, and connect to it via Remote-WSL? microsoft/vscode#85778 microsoft/WSL#3833 ohmyzsh/ohmyzsh#8964 I do recognize you mention it seems unrelated to paths, though that's what several solutions would seem to suggest investigating.

I make sure that have problem in wsl, because ".vscode" folder is empted. I want to know if there is a way to initialize only this part, or to allow me to use VS Code interactions normally in WSL.

Could you help clarify this for me? What are you looking to initialize?

Now I have solved this problem by reinstall, I install the order "zsh", "conda", "vscode".I can use it normally, but to my surprise, after installing "vscode", I only have "home/dawnli/.vscode-server" in the folder under "home/dawnli" (I am using wsl-ubuntu20.04). When I had problems at first, there were "home/dawnli/.vscode" and "home/dawnli/.vscode-server" in the folder under "home/dawnli".I think the reason can be explored.As for the "Permission Denied" issue you mentioned, I was able to run "conda list" and "python" in terminal by editing "~/.zshrc." It was a bit more hassled, but at least I was able to set the correct environment variables via zsh.Therefore, the problem may also be in the Win10 "VScode" and WSL "VScode" communication problems.Thank you for your attention, and I hope that those of you who are experiencing problems can learn to step by step backup WSL, which is fast and doesn't take too much time.It took me two or three reloads to fix the problem, and if I had backed it up in the first place, I wouldn't have wasted a lot of time.

@bamurtaugh
Copy link
Member

Thank you for the updates and insights on your fixes @dawnli-github. If you face any other issues or have further questions, please feel free to let us know.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wsl Issue in vscode-remote WSL
Projects
None yet
Development

No branches or pull requests

2 participants