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

x11docker --share not working on WSL2 #424

Closed
raisen opened this issue Mar 21, 2022 · 4 comments
Closed

x11docker --share not working on WSL2 #424

raisen opened this issue Mar 21, 2022 · 4 comments
Labels

Comments

@raisen
Copy link

raisen commented Mar 21, 2022

I've been using x11docker from an Ubuntu host and has been working fine. Recently I tried to run it from a WSL2 setup and noticed the --share parameter is not working properly. x11docker claims the folder doesn't exist when I run something like: x11docker --share=/mnt/c . It doesn't give me an error when I do either:
a. --share=\mnt\c
b. --share=//mnt//c
but the folder isn't visible on the container.

The error I receive is:
x11docker ERROR: Option --share: File or folder does not exist:
/c

It seems that x11docker is parsing the parameter as a regular expression?

Any suggestions on how to troubleshoot this further?

Versions tried: 7.1.4-beta-3 and 7.1.3

@raisen raisen changed the title x11docker --shared not working on WSL2 x11docker --share not working on WSL2 Mar 21, 2022
@mviereck mviereck added the bug label Mar 21, 2022
@mviereck
Copy link
Owner

mviereck commented Mar 21, 2022

Thank you for the report!
Unfortunately i don't have a Windows test environment yet.

Any suggestions on how to troubleshoot this further?

Could you please try --share=/mnt/c/ instead of --share=/mnt/c? Appending / might make a difference if you try to share entire drive c. (x11docker might parse wrong in that case.)

And, for comparision: Could you try to share a subfolder of c instead of the entire partition?

a. --share=\mnt\c

Always use / instead of \ to avoid escape errors.
This one would be seen as --share=mntc and mounts (and creates) a docker volume instead of a host directory. It would appear as /mntc in container.

It seems that x11docker is parsing the parameter as a regular expression?

Not a regular expression. But it tries to detect different possible ways a path can be given, e.g. as c:\, c:/, /c/, and to detect if it points into the WSL system or into Windows. x11docker also supports Cygwin and MSYS2 where the paths look a bit different. So several parsing attempts are done to fit them all. In x11docker function convertpath() does this job.

@mviereck
Copy link
Owner

I've uploaded a commit that likely fixes the issue. Please try out.

As I don't have a Windows test environment, I am interested in your general feedback how x11docker works for you. Please also report any issues you see.

mviereck added a commit that referenced this issue Mar 21, 2022
@raisen
Copy link
Author

raisen commented Mar 22, 2022

Thank you @mviereck , that indeed fixed the problem. I actually moved back to a *nix environment, but I switched back to WSL2 to try your change and that fixed the problem.
Thank you for your commitment to this project.

@raisen raisen closed this as completed Mar 22, 2022
@raisen
Copy link
Author

raisen commented Mar 22, 2022

FYI, I tried with:

x11docker --version
7.1.4-beta-7

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

No branches or pull requests

2 participants