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

Bug with mila init ssh path in WSL #109

Open
MyriamLizotte opened this issue Apr 5, 2024 · 1 comment
Open

Bug with mila init ssh path in WSL #109

MyriamLizotte opened this issue Apr 5, 2024 · 1 comment

Comments

@MyriamLizotte
Copy link

MyriamLizotte commented Apr 5, 2024

Make sure you can reproduce the issue with the latest version available

pip install milatools --upgrade
[milatools command e.g. mila code ...]

What command did you run?

mila init

Describe the bug

For windows, with some accounts, the $env:UserName used to create the path to the home directory does not match the actual home directory. See this. The current code here creates the home path as "/mnt/c/Users/Myriam" when it should be "/mnt/c/Users/Myria". To fix this, I just did a hack of:

def get_windows_home_path_in_wsl() -> Path:
    assert running_inside_WSL()
    windows_username = subprocess.getoutput("powershell.exe '$env:HomePath'").strip()
    windows_username = windows_username.replace('\\', '/')
    return Path(f"/mnt/c/{windows_username}")

Also, a separate thing, I just set up WSL, and in order to get the command to work that changed the permission of the ssh folder, I had to follow the steps here.

Desktop (please complete the following information):

  • OS: Windows 11 with WSL
@lebrice
Copy link
Collaborator

lebrice commented Apr 17, 2024

Hi @MyriamLizotte, thanks for posting this. That's very helpful info. I'll take a look.

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

No branches or pull requests

2 participants