0

Is it possible to somehow access WSL2 filesystem (say \\wsl.localhost\Ubuntu\home\foo\bar) when WinRM remoting into localhost using certificate based authentication method?

I am trying to do so from Ansible playbook I'd like to use to setup both WSL2 and Windows host, executing it locally from within WSL2 running on that host. I have working playbook that runs win_* commands just fine but anything referring to UNC paths like the one above would end with error:

Cannot find path '\\wsl.localhost\Ubuntu\home\foo\' because it does not exist.

I am trying to work with files in that path directly in e.g. win_shell task (e.g. ls or Get-ChildItem that works in interactive PowerShell does not work over WinRM).

Is it because of credential delegation not working with certificate method? Unfortunately because of other constraints I can't switch to CredSSP which is general recommendation I found all around internet. I am aware of this certificate method restriction mentioned in Ansible Documentation but not sure if double-hop or delegation comes into play in my scenario on localhost.

3
  • \\wsl.localhost\\ should be the correct path. The service responsible should of course be running.
    – Ramhound
    Commented Apr 10, 2023 at 14:50
  • 1
    I can access \\wsl.localhost\Ubuntu\home. This answer might be related, and it counsels connecting over HTTP with NTLM auth.
    – harrymc
    Commented Apr 10, 2023 at 15:01
  • @harrymc Thank you, that answer was actually very useful for debugging. It seems (as stated in Ansible docs) that this qualifies as privilege delegation and it can be solved by using become: True and become: DOMAIN\user in Ansible (I thought thats granted by simply connecting but its not).
    – blami
    Commented Apr 10, 2023 at 16:11

0

You must log in to answer this question.

Browse other questions tagged .