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

WSL Support #55

Closed
aklinker1 opened this issue Jul 21, 2023 · 6 comments · Fixed by #123
Closed

WSL Support #55

aklinker1 opened this issue Jul 21, 2023 · 6 comments · Fixed by #123

Comments

@aklinker1
Copy link
Collaborator

aklinker1 commented Jul 21, 2023

WXT supports windows CMD, but not Windows Subsystem for Linux (WSL). It should also supports WSL.

I don't expect to have any problems with paths like what #50 fixed, instead, it will probably be an issue with web-ext and opening the browser. Maybe everything is working fine and we can just close this issue. I haven't even tried it yet.

@aklinker1 aklinker1 added this to the v1.0 milestone Jul 21, 2023
@aklinker1 aklinker1 added contribution welcome good first issue Want to contribute to WXT? This is a good place to start labels Jul 30, 2023
@aklinker1 aklinker1 removed the good first issue Want to contribute to WXT? This is a good place to start label Sep 23, 2023
@aklinker1
Copy link
Collaborator Author

Tested WSL2 today, and got the following errors:

image

image

It appears to be trying to use the linux paths prefixed with C:\? An issue with web-ext, not WXT.

For now, I'm going to disable opening the browser automatically when WSL is detected.

@bogdano2
Copy link

bogdano2 commented Dec 3, 2023

Could this be solved with wsplath from WSLU which is installed by default with the Ubuntu distribution?

WSL Utilities package provides ability to use the wslpath command.

Example usage:

cd $(wslpath 'C:\Users\Documents')
... will change to /mnt/c/Users//Documents.

The reverse conversion is also possible with the -w option:

mspaint.exe $(wslpath -w ~/profile.jpg)
... will open the file \wsl$\home\profile.jpg in the Paint application.

@aklinker1
Copy link
Collaborator Author

aklinker1 commented Dec 3, 2023

@bogdano2 I didn't know those existed, thanks for sharing.

This is still an issue with web-ext, not WXT, but I'll try it out and open a PR over there if I have time.

Edit: I see you already left a comment on the web-ext's relevant issue . Thanks

@bogdano2
Copy link

bogdano2 commented Dec 3, 2023

@aklinker1 In the meantime, using a 'junction' mklink approach to the C:\ prefix issue that does not require waiting on web-ext which could simply be added to wxt documentation (and reverting the current fix).

For example, the following command should fix the second error you encountered in this thread:
mklink /d c:\mnt\c \\wsl$\\Ubuntu

@bogdano2
Copy link

Tested WSL2 today, and got the following errors:

image

image

It appears to be trying to use the linux paths prefixed with C:\? An issue with web-ext, not WXT.

For now, I'm going to disable opening the browser automatically when WSL is detected.

To allow the browser to launch in Windows 11 from a wsl environment (and auto-load the plugin):

  1. Open a cmd prompt with admin privileges.
  2. For the first error, issue the following command: mklink /D "c:\tmp" "\wsl$\Ubuntu\tmp"
  3. For the second error, create a folder called mnt (mkdir c:\mnt) and then: mklink /D "c:\mnt\c" "\wsl$\Ubuntu"

Seems like this instruction can be provided in documentation (followed by mod of the error and allowing the browser launch attempt).

@aklinker1
Copy link
Collaborator Author

Thanks for the full details, I'll add this to the docs tomorrow, or you can open a PR if you'd like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants