Paths and restrictions
Path-wise is the easiest one.
- Accessing Windows from WSL is always?? possible via
'/mnt/' + windowsPath
.replace(/^(\S+):/, (_, p: string) => p.toLocaleLowerCase())
.replace(/\\/g, '/')
- Accession WSL from Windows is possible via
'\\\\wsl$\\' + osName + wslPath.replace(/\//g, '\\')
Now, I have qualms about forward slashes in Windows paths (seems not the be possible at all); vs backward slashes in Linux paths (seems to be possible, via \\
).
Accessing environmental variables (beyond PATH)
This seems to be possible via either
spawnSync('wsl', ['echo', ENVVAR])
and
spawnSync('cmd.exe', ['/c', 'echo', ENVVAR])
Accessing ports
This is where I stumbled. For Windows' Edge browser accessing WSL, it seems to use PORT + 1
; but I cannot access Windows spawning ports from WSL (trying with Ankiconnect).
Not sure how does it compare with Docker container vs Host?
Top comments (0)