delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/11/26/14:23:16

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8E75A3944833
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1606418542;
bh=qBT2ZaX06PmoTVT6YKkk34nU/0gooJcvDDXf7uHBmgU=;
h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=BKW+BrXSBdrtHnZo5uNUN6aCHBsLG1unMWJ/gYsUXTDMeGnDbvxONq/6usJz2gBkL
iVJNonBP7QUz/HtvDyaLIUq2HozM5NJ4j3ONp3YOQxbAorbUwCrBRygE+FtMuIB1Bg
YW0yiVSqyrpSQ2CBWKigZDiUEw3CWBlFthmmPa3E=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 622BC384B106
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc;
bh=9PBrkH0GhP4FPxuCBQy6ZSknIBzh1xITVJwFhBDngik=;
b=n6LW1o5IqG+jWbypYFITFpcQH/ypVzMUWk336kQnvdltjcpFnjaCMQV4f76sRJJ/6e
12c/oCz5VuU2b4oMgHQV0rglkpo5mvtKv+5Ig+D1gRiW/JQdlC+o8BqtRDZ4q1cF/dRo
e6CsHnPxpcpcpx1qhdTcq/NVOm/6G0dYJLLZTE2Dsi0EceCcwiSXhkWWmPESggHlJfeA
QKWVT1b4xyEvlcLtLMLiLrQuZlExXU5Od2NWvG5zKaqk1woAe8vV53YCCo2o/j/fY0LD
cllWHoilG2+DSoG2uwtk+upRRFLI1TpLyJvwtaQhclbw8jUGmkA7DsKTHU5/avdMWqpc
hPqA==
X-Gm-Message-State: AOAM530UI7l/GaTZcEtPaTW+8w3IQk36Eb6/iKK3qjTb3BPDamSJj5DC
Ws2aWLc879zuf5wZl7CxIg0747BeajmCfKDQ1sI=
X-Google-Smtp-Source: ABdhPJxxi/h1THB7I9kaXSmbdpJFhJE1I+TellSswC8rxyilnpvX/0LoiHTdDWzkfYprHr6MJ/QIRWR043YHbrBpKo0=
X-Received: by 2002:a05:6830:1dab:: with SMTP id
z11mr3204712oti.247.1606418539837;
Thu, 26 Nov 2020 11:22:19 -0800 (PST)
MIME-Version: 1.0
References: <CAFNJpniCb6AMojTH=MCK=tNqWuOxS64ie=5UV5A8zyJAY2UWYw AT mail DOT gmail DOT com>
<f5bblfkdkos DOT fsf AT ecclerig DOT inf DOT ed DOT ac DOT uk>
In-Reply-To: <f5bblfkdkos.fsf@ecclerig.inf.ed.ac.uk>
Date: Thu, 26 Nov 2020 21:22:08 +0200
Message-ID: <CAFNJpnifghu=f65dRmXZtieEanNowYzA8FMFbD0x75qk-0Q=PQ@mail.gmail.com>
Subject: Re: Help with setting Cygwin's Emacs W32 TRAMP to WSL 1
To: "Henry S. Thompson" <ht AT inf DOT ed DOT ac DOT uk>
X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_NUMSUBJECT,
RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS,
TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Oleksandr Gavenko via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Oleksandr Gavenko <gavenkoa AT gmail DOT com>
Cc: cygwin AT cygwin DOT com, Oleksandr Gavenko <gavenkoa AT gmail DOT com>
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

On Thu, Nov 26, 2020 at 8:42 PM Henry S. Thompson <ht AT inf DOT ed DOT ac DOT uk> wrote:
>
> Oleksandr Gavenko via Cygwin writes:
>
> > ...
> > WSL1 files are "hidden" for regular access.
>
> I probably misunderstand, but I can see my WSL/Ubuntu files via this
> path from Cygwin:
>
>  /c/Users/ht/AppData/Local/Packages/CanonicalGroupLimited.../LocalState/rootfs
>
You are not allowed to edit them from the "Windows" process. Only from LXSS:

https://devblogs.microsoft.com/commandline/do-not-change-linux-files-using-windows-apps-and-tools/

> DO NOT, under ANY circumstances, access, create, and/or modify Linux files inside
> of your `%LOCALAPPDATA%` folder using Windows apps, tools, scripts, consoles, etc.

You'll face:

https://github.com/microsoft/WSL/issues/1524
changes made in Windows File System - not seen in Bash

Though I forgot about their announce of P9 fileserver (dated May 2019
Windows 10 version 1903):

> WSL hosts a new 9P fileserver, which exposes distro filesystems to Windows apps and tools via \\wsl$\<DistroName>\!

Details are here:

https://devblogs.microsoft.com/commandline/whats-new-for-wsl-in-windows-10-version-1903/

I tried in elevated cmd:

cmd# cd \\wsl$\debian\
'\\wsl$\debian\'
CMD does not support UNC paths as current directories.

cmd# net use x: \\wsl$\debian\
System error 67 has occurred.
The network name cannot be found.

It is only available in Explorer and some "cool" editors, like Code.

I do not know if Cygwin allows to "mount" that P9 fileserver...

There is an example of network mounting:
https://cygwin.com/cygwin-ug-net/mount.html

so I tried it:

bash# mount '//wsl$/debian' /mnt
mount: defaulting to 'notexec' mount option for speed since native path
       references a remote share.  Use '-f' option to override.

bash# ls /mnt
ls: cannot access '/mnt/initrd.img': Input/output error
ls: cannot access '/mnt/initrd.img.old': Input/output error
ls: cannot access '/mnt/vmlinuz': Input/output error
ls: cannot access '/mnt/vmlinuz.old': Input/output error
bin  boot  c  d  dev  etc  home  init  initrd.img  initrd.img.old  lib
 lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr
var  vmlinuz  vmlinuz.old

Cool! Let's make it permanent.

$ cat /etc/fstab

//wsl$/debian /wsl/debian      ntfs binary,noacl,posix=0 0 0
//wsl$/ubuntu /wsl/ubuntu      ntfs binary,noacl,posix=0 0 0
//wsl$/alpine /wsl/alpine      ntfs binary,noacl,posix=0 0 0

$ mkdir -p /wsl/{ubuntu,debian,alpine}
$ mount /wsl/debian
$ mount /wsl/ubuntu
$ mount /wsl/wsl

And the final step it testing with Cygwin's Emacs W32:

I can read files, but on save I've got:

Saving file /wsl/debian/opt/sa-batch-am-dbsync/run.env...
basic-save-buffer-2: Unlocking file: Invalid argument,
/wsl/debian/opt/sa-batch-am-dbsync/run.env

Trying in Cygwin's bash:

bash# cd /wsl/debian/home/user/
bash# touch test.txt
bash# ls -l test.txt
-rw-r--r-- 1 user user 0 2020-11-26 21:18 test.txt

bash# echo 123 >test.txt
bash# echo 456 >>test.txt
bash# cat test.txt
123
456

So Emacs tries to make some "smart" locking on dumb FS... Need to
waste another few hours to make Emacs work.

At least I have something!
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019