Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Windows Operating Systems IT Linux Technology

Linux Subsystem Files To Become Accessible via Windows File Explorer (zdnet.com) 123

One of Windows Subsystem for Linux's more annoying tricks is it's hard to get at your Linux files from Windows. From a report: Oh, you can do it, but you take a real chance of ruining the files. To quote Microsoft, "DO NOT, under ANY circumstances, access, create, and/or modify files in your distro's filesystem using Windows apps, tools, scripts, consoles, etc." In the forthcoming Windows 10 April 2019 Update, aka Windows 10 19H1, this Linux file problem will finally be fixed. According to Craig Loewen, a Microsoft programming manger working on Windows Subsystem for Linux (WSL), "The next Windows update is coming soon and we're bringing exciting new updates to WSL with it! These include accessing the Linux file system from Windows, and improvements to how you manage and configure your distros in the command line."
This discussion has been archived. No new comments can be posted.

Linux Subsystem Files To Become Accessible via Windows File Explorer

Comments Filter:
  • Funny (Score:4, Insightful)

    by Anonymous Coward on Tuesday February 19, 2019 @05:51PM (#58147954)

    I could access Windows files on Linux just fine. Some OSs are behind the times I guess.

    • by rednip ( 186217 )

      Actually, the difference is that Windows works just fine with the standard UNIX line ending (\n'), but many unix programs will crash if they see a DOS line ending ('\r\n'). I'm guessing that Microsoft simply made sure to preserve the line endings already present in a file (like the regular setting in all better text editors), or changed the default to the UNIX endings, which is already handled in Windows (as best as I know) . In fact a recent article annouces UNIX EOL support in notepad [microsoft.com]

      When you see '^M'

      • by Kremmy ( 793693 )
        If Windows worked just fine with UNIX line endings, they wouldn't have waited until 2018 to patch support into Notepad...
      • I haven't seen that. I use CR in my linux programs to create a running tally of the number of records my program has processed. Of course I don't cat that to other programs, but I can't imagine crashing a program if I did.

        What *really* bothers me on Linux tools is how hard it is to use most such tools with non-ASCII Unicode characters. Try grepping Devanagari or Arabic characters, for example, or using sed to modify such text. (I'm not saying Windows is better, in fact I've never really tried to do such

  • It's trivially easy setting up a proper VM and doesn't cost a dime.

    If you know how to use Linux, installation is nothing. If you don't, you don't need Linux or WSL.

    • uses a lot more RAM though.
      • Yes, a Linux VM will need 128-256 MB of RAM. (WSL isn't competing with Gnome).
        Also, we're talking about people who use *Windows*, where some dialog boxes use that much RAM by themselves.

        • Twenty four years ago (when it launched) Cygwin got reputation of being a bit flakey; but it's come a long way in the past two and a half decades.

          If you haven't tried it recently, you can think of it as a lighter-weight and more complete version of WSL.

          • by cdwiegand ( 2267 ) <chris@wiegandfamily.com> on Tuesday February 19, 2019 @10:22PM (#58149650) Homepage

            Hahaha. Wow... really? you know that WSL comes with full, real distros, like Ubuntu, right? Cygwin still doesn't have a command line way to install packages. No apt-get install anything, or (ugh) rpm -ivh some.rpm. Updates are non-trivial, you have to use a GUI, instead of just do-release-upgrade (or whatever Suse/Redhat/etc. use). Give me WSL any day of the week over Cygwin.

          • More complete? Err, not even close, son.

          • by Kremmy ( 793693 )
            Cygwin is SLOW.
            WSL must have significantly less overhead than cygwin to be so fast.
            WSL is lighter weight and more complete, offering the userland of multiple distributions.
            It's weird and all but you can't beat the native Linux support :P
            • I once compared WSL and MSYS2 git checkout times. Practically equal.
              Then I compared Ubuntu in VirtualBox and WSL. The latter 20-fold slower. Until I excluded the folder from Security Essentials scanning ..

          • by Anonymous Coward

            It is definitely not 'lighter weight'. WSL is actually lighter weight because it is doing syscall emulation at the kernel level; Cygwin has to emulate things in userspace, which for instance leads to absolutely horrible forking performance because that's just not something the Win32 API is designed to do.

          • by pnutjam ( 523990 )
            If your stuck on windows, and you haven't tried MobaXterm, your missing out. It's got an Xserver, cygwin, scp browser, etc., all baked in. There is an install version and a portable version.

            It's only free as in beer, but your already using windows.
          • Lighter weight? Undoubtedly

            More complete? ... hahahhahahaha. Oh man. You had such an air of authority about you until you announced to the world that you've never compared the 20 year old baby of Cygwin to WSL.

        • The point is that wsl uses zero ram when youâ(TM)re not running anything in it. Whereas a vm is either using ram doing nothing, or is taking time to boot. Why bother with that unnecessary nonsense?

          • > Why bother with that unnecessary nonsense?

            My use case may be different, but sometimes I like to do weird things, like open a file. Microsoft says WSL will destroy my files if I do that. I have no problems opening files in either Windows or Linux when using Virtualbox.

            I happen to have 256MB available, maybe you don't. People with only 512MB of physical memory probably don't want to use Virtualbox. Or Windows.

            I do have a machine running some Perl scripts on Windows which were designed for Linux. We've be

            • by pnutjam ( 523990 )
              Is WSL an option on Windows versions that will function on 512mb of RAM?
            • If you mount your file system in vbox so both machines can see the same file and you modify it at the same time with programs on both machines then youâ(TM)ll get corruption.

              Same thing in wsl.

              I recommend thinking a little more before posting.

              • Not at all the same thing in WSL. Let me quote the summary for you, and then explain further:

                "DO NOT, under ANY circumstances, access, create, and/or modify files in your distro's filesystem using Windows apps, tools, scripts, consoles, etc." says Microsoft.

                Here's the next sentence from MSDN:

                Creating/changing Linux files from Windows will likely result in data corruption and/or damage your Linux environment requiring you to uninstall & reinstall your distro!

                The issue is that creating a file or opening a

                • no. if you edit wsl distro files with windows tools, you might mess things up if you're not careful. but similarly if you mess with a native linux distros system files and you're not careful you can also mess things up. i edit my own wsl files in both ubuntu & wsl tools all day long and i have never run into any issues. i even have some files open in editors in both environments and i see updates in one tool (eg ubuntu vim) appear in the other tool (eg win32 vscode). but i don't edit sensitive system fi

                  • So there are two possibilities here. Either:

                    A) Microsoft is horribly wrong, and is strongly warning people about a major problem with their software that doesn't actually exist.

                    B) Your first guess when you soon the summary wasn't quite right. Once you got an idea, you refuse to learn any new information because that would mean you were DUN DUN DUN wrong! Omg that's not possible that you don't already know everything!

                    Here's the thing, all of us had to learn how to count, and how to use the potty. We weren'

                    • I think you misunderstood spongman. He said he could edit wsl files in ubuntu and wsl tools, but he did not edit wsl files with *windows* tools. That seems to correspond with the Microsoft statement.

                      For the record, I do the same as spongman: I edit my .bashrc etc. wsl files with vi in a wsl terminal (Ubuntu bash), no problem. I would not attempt to edit those files using, for example, my Windows jEdit editor. That said, I have a link from my /home/ dir to the dir I keep my Windows data in (for the recor

                    • I wish I did misunderstand. But here are his exact words:

                      --
                      you modify it at the same time with programs on both machines then you'll get corruption.
                      Same thing in wsl.
                      --

                      He in fact said that of you simultaneously modify it in both operating systems at once, that could corrupt the file. Of course two programs writing to the same file at the same time without coordinating will result in garbage - that's not a bug for which Microsoft is issuing a major fix. There is no find for that.

                      The truth is that opening o

    • I do. I use Windows for most of my job, but once in a while running bash and other scripts is just easier than Windows.
    • by kqs ( 1038910 )

      I can see a few reasons for using WSL. Installing and maintaining a whole Linux VM is more effort/support/danger than needed for people who just need a program or two and have little Linux experience.

      My bigger question is: "wait, linux files were visible to windows programs, but accessing them could cause corruption? WHY WAS THIS EVER A THING???". This seems like a terrible implementation. I could see it for a "this is really beta, here play with it, but we'll be fixing this terrible feature within a mo

      • [...]

        My bigger question is: "wait, linux files were visible to windows programs, but accessing them could cause corruption? WHY WAS THIS EVER A THING???". This seems like a terrible implementation.[...]

        In reality, by default, you were supposed to see the files read only. Just like in a mac with bootcamp, were from the macOS side you can see the NTFS files read only, and from the Windows side, you could se the HFS+ files read only. If you bypased the protections (say, by installing FUSE on macOS, or, in this case, fumbling with the WSL configuration) and got RW access, corruption could ensure.

        This release seems to finally fix that.

      • Itâ(TM)s a single operating system, remember, windows. It just happens to be able
        To run elf binaries. The same issues arise if you run any two applications that mess with the same files without adequate locking.

    • I use WSL quite a bit on my work laptop. Why?

      - It complies with our security policy

      - I can use things like linux-based microcontroller tool chains exactly as I would on my Linux boxes at home

      - I don't have problems with USB passthrough with serial adapters

      - I can awk, grep, cut and sed files in my windows file system without any file sharing hassles

      - I can use gcc to build little utilities as needed

      - ssh and scp are easier to use from WSL

      - it is always there - one click away on the task bar

      Sure, it has a fe

      • I use WSL quite a bit on my work laptop. Why?

        - ssh and scp are easier to use from WSL

        And because it is running under MS Windows, the telemetry gets to send all your keystrokes, including passwords, back to Microsoft HQ ... lord knows where they go beyond that!

        If you want to run both operating systems on the same machine: install Linux first and run MS Windows is a VM --- it is much safer that way.

        • My employer mandates Windows OS for corporate laptops. Not my data, not my call.

          • by pnutjam ( 523990 )
            Grab a copy of MobaXterm, it's runs off a USB and gives you access to all the bash tools along with an Xserver and some other nice stuff. I used it alot when I was in a controlled environment.
    • Many linux users do care. Those that use Linux at home (or used it at a previous job, or learned it in the university), and would like to use linux at work, but their company policy forbids it. Also, may, many, windows users care about it too...

      There are a bunch of reasons to use this WSL thing. But before we get to those reasons, let's clarify something. If someone is already happyly using Linux, WSL will not make them go back to Windows. WSL is targeted to people who must use windows, or want to use Windo

      • by AmiMoJo ( 196126 )

        One use case WSL works well for is cross compilation using a Linux based toolchain. Similarly when building .NET based software you can compile and test Linux binaries using Mono without the hassle of a VM.

        Clearly the desire to have all this stuff has been there for many years, hence the existence of CygWin and several others.

  • Re: (Score:2, Insightful)

    Comment removed based on user account deletion
    • by Anonymous Coward

      They hope to achieve EEE.

    • by Anonymous Coward

      It's about keeping their user base and expanding their other business *cough 365 cough*

      Linux doesn't even have proper AD replacements, and now it's all moving out of your datacenters, and soon, your datacenter is *poof* gone.

      Meanwhile geeks will wonder why they delivered all the changes required to undermine their very existence.

    • I don't know if there is a general use case but there are definitely niche use cases. The niche use cases where I've seen it useful are, amusingly, the same as using WINE on Linux. A lot of the data scientist where I work use WSL because the products we engineer don't have a Windows API and will never have a Windows API. So, we tell them to install WSL, then point them at a README that shows them how to apt-get some stuff, git clone some stuff and off they go doing... whatever data scientist do when conf

    • by AmiMoJo ( 196126 )

      It's primarily aimed at developers, especially web devs who want to run a Linux based stack for local testing. Also great if you want to do cross-development for a Linux target.

      Why not use a VM? WSL consumes far fewer resources, and makes it easier to share files between the two sides with native performance.

  • by Anonymous Coward

    What is the big deal over WSL? There is nothing that WSL can do that I can not already do with VirtualBox and Putty with X forwarding.

    https://www.howtogeek.com/112888/3-ways-to-access-your-linux-partitions-from-windows/

    If Microsoft was not so focused on file system incompatibility, it would have supported EXT2,3,4 a long time ago. It also would have made NTFS more easily accessible from Linux. It also would not have encumbered its file systems with patents and extort money from everyone from TomTom to US

    • by halivar ( 535827 )

      If Microsoft was not so focused on file system incompatibility, it would have supported EXT2,3,4 a long time ago.

      You're faulting the folks who picked an FS and stuck with it for 26 years, during which time Linux has at least 5 (that I can think of and used, at least) different file-systems that were the "new standard" all new installs should be on. Look, MS made a lot of boneheaded architectural decisions, but consistent backwards compatibility in their file system (regardless of how awful it is [and it is]) is not one of them.

      • Comment removed based on user account deletion
        • by halivar ( 535827 )

          It's absolutely fair to collapse Ext like that; after all, Ext, at least, kept a chain of compatibility over the same period NTFS did (both began in '93). But it has had, over the last 15 years, plenty of large-share competition with which it was incompatible (this is what I was addressing about GGP's gripe about Microsoft introducing system incompatibility), such as ReiserFS, XFS, JFS, etc.

          Again, not trying to put NTFS on a pedestal; just addressing the notion that is was MS who fragmented the FS ecosystem

      • Look, MS made a lot of boneheaded architectural decisions, but consistent backwards compatibility in their file system (regardless of how awful it is [and it is]) is not one of them.

        Why not?

        It's not like the ext2-ext3-ext4 switchover had any meaningful effect on anything I did except that things got faster and more stable in the event of a power outage, and much more tolerant of me doing stupid shit like having tons of files in one directory. About the main "downside" is I couldn't plug a storage device int

      • Um, that's why NFS was developed. And all the Linux file systems, indeed all the *nix file systems conform to certain basic standards which delivers a pretty high degree of interoperability. I get why DOS used crlf , for instance, but I can't sort out why MS has ridden that horse this long.

    • by novakyu ( 636495 )

      There is nothing that WSL can do that I can not already do with VirtualBox and Putty with X forwarding.

      Really? Can your VirtualBox and putty with X forwarding prevent the overhead of having to run two separate operating systems in order to do a single task?

      WSL accomplishes the same thing that WINE has been trying to do (except, of course, Microsoft gets more assistance with its evil plans than WineHQ ever has).

    • Why would you want to run a whole other OS with all its overhead just to run a few user-mode programs once in a while?

  • Education use cases (Score:5, Interesting)

    by godrik ( 1287354 ) on Tuesday February 19, 2019 @06:13PM (#58148136)

    I teach computer science at a state school. And some students laptop can not quite run VMs, for a bunch a reasons (that range from shitty hardware, to not enough memory, and through the virtualization bit got disabled in the BIOS because the constructor wanted to sell a more expensive laptop for developpers).

    I had used WSL for the class. And that was a complete catastrophe. The filesystem interaction were just not working right. I am guessing it is because students went editting the file through the file explorer. But we were getting the strangest bugs.

    So I have told students to absolutely use the VM and we are working around the few cases of laptops that are not quite good enough. And the clas goes fine so far.

    If MS can deliver a working WSL, I may consider using it again.

    • by rednip ( 186217 )
      Unix vs DOS line endings should have always been the 'go to problem check' for a weird error in a Windows to Linux environment, sadly I've seen it in a professional environment dozens of times. Any decent text editor (including those in IDEs) will handle both and resist changing when saving, but notepad had until recently always 'automagically' converted the file to DOS which was the only way to save.
    • by pnutjam ( 523990 )
      I feel like I'm spamming this, but I hope it's useful. Try out MobaXterm. It's a much better terminal emulator then putty and it wraps up an Xserver and a graphical file browser like winscp.

      You might consider running local server that the kids connect to with ssh, or forwarded X sessions, or NX.
      One more thing to teach about and in my experience, most linux systems are accessed remotely.
    • 2 words: Line endings.

      It's absolutely essential when using WSL that you don't mix line endings. E.g. in Notepad only open files created in WSL first. Or better still use a text editor that allows you to specify the line endings.

      Other than this issue there should really not be any reason WSL doesn't run like a standard VM (at least as far as features which it's capable of are concerned e.g. you don't need a GUI).

  • Comment removed (Score:3, Insightful)

    by account_deleted ( 4530225 ) on Tuesday February 19, 2019 @06:18PM (#58148188)
    Comment removed based on user account deletion
    • by Anonymous Coward

      Umm.... /mnt/ seems to get to all my Windows drives from WSL just fine?

    • They all provide windows access into the linux sub-systems, not the other way around... This is not an accident

      You're right, this is not an accident. This is the result of MS's malevolent actions of ensuring the OTHER direction works first. How fucking dare they!

  • Why did Microsoft make "Ctrl-c" the keyboard shortcut for copy? Because ctrl-c on unix hard exits programs.

    Why did Microsoft make systems paths with C:\this\slash instead of /this/slash? Deliberate incompatibility.

    Why did Microsoft make their line endings different? Deliberate incompatibility.

    News story: Microsofts deliberately broken shit, still expensive and broken. Marketing in progress.
    • by Anonymous Coward

      Why did Microsoft make systems paths with C:\this\slash instead of /this/slash? Deliberate incompatibility.

      And VMS used [diskroot.folder.folder]. Different systems from an era where compatibility wasn't even an idea of a thing.

      Why did Microsoft make their line endings different? Deliberate incompatibility.

      Unix used line feed. Early Macs used carriage return. MS-DOS and VMS used carriage return and line feed - which made the most sense to me, since you could copy text files straight to a printer with no driver. All choices made long before compatibility was even a thought, let alone a goal.

      News story: Microsofts deliberately broken shit, still expensive and broken. Marketing in progress.

      They have, but not here. Look harder for a place to direct your MS hate.

    • by williamyf ( 227051 ) on Tuesday February 19, 2019 @07:55PM (#58148906)

      For Ctrl+c for copy, you should blame Xerox P.A.R.C., not Microsoft. Actually, microsoft follows convention. In the GUI ctrl+c is for copy, while Ctrl+c in comand line is interrupt, just like in *nix. So, no "deliberate incompatibility"

      About c:\folder\subfolder, you should ask the CP/M guys. You see, they used the / for parameter passing, so when MSoft decided to support folders in MS-DOS 2.0 onwards, the character was already in use. Actually, if memory serves well, there was an obscure command in early MS-DOS to change the path separator to / . Since no one used it, it was retired without much fanfare. So no "deliberate incompatibility here". As a matter of fact, at that time MSoft was selling a unix (called Xenix) and, if anything, they wanted MS-DOS and Xenix to converge, that's why they included the aforementioned obscure command.

      About the line endings, as some other comentator indicated, using CR+LF together meant that you could copy a plain text file to the printer directly without further conversion. And also, dos (and windows latter), mac and *nix all had differnt ways of skinning that particular cat. And do not even ask about the complications of line separation in VMS, you will not believe it!!!. So, no "deliberte incompatibility" here.

      If you want examples of deliberate incompatibility, better check your history books for things like running Windows 3.x on DR-DOS, or running lotus 123 on early versions of Windows, that sort of thing, but, the three examples you choose, don't quite cut it.

      • by gawbl ( 941021 )
        Sorry to be pedantic... IIRC, DOS file I/O primitives would accept either '\' or '/' as a path separator. COMMAND.COM was the issue; it would always interpret '/' as the beginning of a command-line option. If you were writing a command-line utility, it could employ "C:\path\to\my\file" or "C:/path/to/my/file". Actually, I think you could pass "C:/path\to/my\file" and that would still work. Yes, there was an internal variable inside DOS that recorded the option character; I think it was "SWITCHAR", and you
        • by gawbl ( 941021 )
          Oh, yeah. I think CP/M copied the "/option" convention from DEC's RSTS.
        • Switchchar was the eviroment variable for DR-DOS. In MS-DOS the procedure was different, but the idea was the same. Do not feel bad though. I can't remember how it was done in DOS either, It has been a looong time.

    • by dryeo ( 100693 )

      Why did Microsoft make "Ctrl-c" the keyboard shortcut for copy? Because ctrl-c on unix hard exits programs.

      For Mac compatibility. The correct Windows shortcut for copy is ctrl-insert, paste is shift-insert and cut is shift-del. Try them, they still work fine, even in most Linux programs.

      The slash vs backslash comes from copying CPM where slash was used for parameters and there were no subdirectories. In this day, all programs should support both slash and backslash as directory separators

      MS line ending are actually more correct, a CR (carriage return) to bring the cursor to the beginning of the line and a LF (li

      • Originally, the CR came before LF for the following reason. Teletypes, at 10 char/sec, could complete an LF in 1/10 sec, but a CR could take up to 1/5 sec. It was 100% mechanical, with no buffering. With the CR issued first, both would complete in 1/5 sec, ready to print the first character on the new line.
        • by dryeo ( 100693 )

          Good point. All (or most?) of the CTRL characters were about controlling the printer and probably go back to before computers.

    • Comment removed based on user account deletion
  • This is actually really cool since you can interact with the Plan 9 system and do all kinds of crazy stuff. The big question will be how much can we get into that part.
    Those of you that are wondering what kind of stuff, you could force the FS to only see files as lowercase, you could have it be case insensitive, you could have if be case sensitive on match and insensitive otherwise, mount remote plan 9 filesystems (good ol' grid computing). It could be a MUCH bigger deal than it seems.

  • MSYS2 [msys2.org] is the better WSL.
    No problems with filesystems, does not break Windows update, perfect integration, pacman package manager.
    No ELF, but never missed it, pacman brings all the good tools.

    • by weberjn ( 771517 )

      and I forgot: does not need Aministrator rights to install.

    • the problem is that all the compatibility stuff in msys2 just doesn't quite work right. it's not that it's buggy, it's due to what it's trying to do: provide a compile-time windows/posix compatibility layer. which, of course, is impossible. it has to make tradeoffs.

      wsl is the better cygwin. it's kernel-mode. it's distro-agnostic. and the compatibility is excellent.

What is research but a blind date with knowledge? -- Will Harvey

Working...