public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eliot Moss <moss@cs.umass.edu>
To: Cary Lewis <cary.lewis@gmail.com>, cygwin@cygwin.com
Subject: Re: Access WSL files from cygwin
Date: Sun, 7 Feb 2021 13:08:14 -0500	[thread overview]
Message-ID: <fd16b38b-4048-1a8f-e58d-062c76d907e5@cs.umass.edu> (raw)
In-Reply-To: <CAEF1h+VM8hHaf_ncb99udUewWz03LuZ6O2b-L6_134Qvn4V2jw@mail.gmail.com>

On 2/7/2021 9:40 AM, Cary Lewis via Cygwin wrote:
 > Is there a way to access files from a WSL 2 Linux distro from Cygwin?

 >>From Windows:

 > \\wsl$\Ubuntu is accessible from Windows Explorer, but cygwin does not seem
 > to recogonize:

 > //wsl\$

 > nor does it recognize //HOSTNAME/wsl\$

 > but //HOSTNAME/c\$ works.

 > Thanks for any help you can provide.

On my system it lives in:

/c/Users/moss/AppData/Local/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs

(Yuck.)  There may be (probably is) a link somewhere.  //wsl is probably some
"magical" active link.

By searching for ubuntu in the registry I found:

Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\{d10ee784-05b0-4c00-be54-cba0d7e7a471}

Its key BasePath has to path to that rootfs.  I don;t know how stable that hex
package id is, or whether it matters which Linux you've installed, etc.  Also,
I am running WSL 1, not WSL 2.  I would think that WSL maintains a file
somewhere with the information about distros and where they are, but I am not
sure where that might be.

A StakcOverflow posting said to look in:

C:\Users\"yourusername">\AppData\Local\Packages\"xxxxx"\LocalState\root\fs

The xxxxx varies by specific Linux distro/version.

Naturally I would be careful *writing* anything down there, but I expect
reading would be ok.

HTH -- EM

  reply	other threads:[~2021-02-07 18:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-07 14:40 Cary Lewis
2021-02-07 18:08 ` Eliot Moss [this message]
2021-03-04 19:44 ` Oleksandr Gavenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fd16b38b-4048-1a8f-e58d-062c76d907e5@cs.umass.edu \
    --to=moss@cs.umass.edu \
    --cc=cary.lewis@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).