Live data from Hacker News

WSL2 corrupting Git repositories and shell history

github.com

291–300 of 423 posts

Re: WSL2 corrupting Git repositories and shell history

#291

> Feel like booting Linux on a separate disk because of these issues. It always seemed strange to me that people would rather use WSL than the real thing when Windows doesn't bring much advantage. What am I missing ?

Just compatiblity. I was Linux for a long while for work and gaming. Constant compatibility and hardware issues.

Even something like Zoom worked like shit on Linux half the time. Or was missing features.

Audio/Video hardware had issues too. Something as simple as a webcam became this giant problem. Configuring mice and keyboards was a nightmare.

This is a lot to do with companies not supporting Linux and having to use community created reverse-engineered stuff, so it's not all Linux's fault, but at the same time, it just became a pain in the ass to maintain and fix constantly.

Also games, as much as Steam/Photon/Wine have improved, there are just some things that don't work.

So, I switched back to Windows, and even if I prefer linux, I just can't have it as my daily driver. so WSL2 is great for me.

Re: WSL2 corrupting Git repositories and shell history

#293

Earlier quoted context omitted.

Can you expound on this? Windows doesn't let you use VirtualBox and WSL2 at the same time?

WSL2 uses hyper-v. You can only run either hyper-v or ESXi (VB's hypervisor) at the same time.

That's not longer true.

Yes, WSL2 is type-1 hypervisor (which means Linux under WSL2 and windows are both VMs of sort, managed by higher level invisible "main" OS) and initially this made running VMs inside windows impossible (since technically that would be VM inside VM). But this has been fixed for months now - originally not only it was not possible to run virtualbox (or vmware, ESXi is vmware type-1 btw, dont mistake it with free vbox) but also it was not possible to run docker either.

Edit: btw. this is why it took so long for WSL2 to be released to public; they gave time to most of the VM solutions to adapt to the fact windows would be running under type-1 hypervisor.

Re: WSL2 corrupting Git repositories and shell history

#294

Earlier quoted context omitted.

Same here. I want to like Windows but MS just makes it impossible. The MBP M1 has blown me away, I don't think I'll try to go back any time soon.

Yeah M1 Mini here. Total game changer.

Sorry if this doesn't apply to you but how do you deal with Docker development? I've heard some horror stories regarding Docker for mac and I don't think I'll be able to live without my Docker containers.

Re: WSL2 corrupting Git repositories and shell history

#295

Earlier quoted context omitted.

Yeah M1 Mini here. Total game changer.

Sorry if this doesn't apply to you but how do you deal with Docker development? I've heard some horror stories regarding Docker for mac and I don't think I'll be able to live without my Docker containers.

I do that on an AWS instance. I have learned over the years to keep my desktop and my tools well apart as there have been some fatalities which have knocked me out for a day at a time before.

I mostly write Go though which is fine on M1 macs.

Re: WSL2 corrupting Git repositories and shell history

#296
post #30

I think calling it WSL2 was a mistake. The predecessor, WSL, "just worked" and it was more a less a linux experience for most practical purposes-- and certainly better than hoary old cygwin. This caused a lot of people to believe they could just transition to WSL2, lead on by the promise of an even more performant linux experience. The documentation didn't say anything about complications from attempting this, so a l…

File system corruption is unforgivable mistake, but FS work is really hard to get right. Even stuff like VMware corrupts shared folders ... wherever they try to bypass a driver translation layer. Just Google for “vmware shared folder corruption”

I could swear I ran into that corruption (or a similar one?) almost a decade ago. They still haven't fixed it?! It was quite reproducible too, it just happened when I transferred a large file...

Re: WSL2 corrupting Git repositories and shell history

#297
post #273

Earlier quoted context omitted.

Is this file system corruption? The article isn’t 100% clear it ‘only’ loses some data writes, but it also doesn’t explicitly say files not being written are affected, directory structures are corrupted, etc. So, to me, it looks like WSL2 not completely flushing writes to the underlying file system. Bad, but not as bad as file system corruption (which could lead to losing all data on the disk)

There's no enough information to know if all the reported problems are the result of the same defect. But in: https://github.com/microsoft/WSL/issues/5895 The first instance of a problem is: [ 1.956835] JBD2: Invalid checksum recovering block 97441 in log And that's corruption that leads to log replay failing, i.e. rejecting it because honoring the replay in the face of checksum errors could make things much worse. S…

Thanks. That definitely is file system corruption. And that is very scary, as (assuming you have backups, which you should) losing files you’re working on is not the biggest problem you can have. That will lose you a few days at most.

Silent corruption of parts of the disk that you rarely access but still want to keep is scarier (you might have rotating backups for months or years and still eventually lose data)

Re: WSL2 corrupting Git repositories and shell history

#298
post #243

Earlier quoted context omitted.

Yeah; Windows had something like that, too. It was WSL1 (or just "WSL"). I also tend to think that was the better approach.

It didn't extend to use cases like containers, that would have basically required MS to rewrite large parts of the Linux kernel's core code for namespaces, mount points etc.

Sure. Running a Linux VM (WSL2) just to use containers seems to kind of defeat the point, though. You might as well just run your containers in VMs.

Re: WSL2 corrupting Git repositories and shell history

#299

WSL2 was promised as a good working extension for a Linux dev environment on windows by my peers. Sadly, a whole host of issues specific to my dev environment meant that it was useless as I’d spend more time fixing it than getting any valuable use out of it. More importantly, this became the very reason I switched to arch full time, and haven’t looked back since. I still hope that it becomes what it was promised to b…

Agreed, I can't use virtualbox and WSL2 at the same time, epic fail.

That is no longer true since VirtualBox 6 (or VMware Workstation 15.5), both of which can work alongside WSL2.

Re: WSL2 corrupting Git repositories and shell history

#300

Earlier quoted context omitted.

Oh you need to fucking disable Window's Defender though, or add exclusions for your Linux distro/WSL2 folder, because when installing "node_modules" it will attempt to do realtime scans for threat-protection which absolutely cripples the speed. https://www.cicoria.com/improving-windows-subsystem-for-linu... https://www.reddit.com/r/bashonubuntuonwindows/comments/eok7... "I noticed a significant performance difference…

Tip: Add a separate SSD and format it as ext4. Mount it to wsl2 and do all your work there. https://docs.microsoft.com/en-us/windows/wsl/wsl2-mount-disk Currently, the mount is not automatic so you can make a startup.ps script and run it on start through group policy.

Ah this is a great tip, I will have to try this one -- thank you!
Post reply on HN