From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 622BC384B106 for ; Thu, 26 Nov 2020 19:22:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 622BC384B106 Received: by mail-ot1-x331.google.com with SMTP id k3so2675030otp.12 for ; Thu, 26 Nov 2020 11:22:20 -0800 (PST) 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: In-Reply-To: From: Oleksandr Gavenko Date: Thu, 26 Nov 2020 21:22:08 +0200 Message-ID: Subject: Re: Help with setting Cygwin's Emacs W32 TRAMP to WSL 1 To: "Henry S. Thompson" Cc: cygwin@cygwin.com, Oleksandr Gavenko Content-Type: text/plain; charset="UTF-8" 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@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 19:22:21 -0000 On Thu, Nov 26, 2020 at 8:42 PM Henry S. Thompson 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$\\! 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!