Live data from Hacker News

WSL2 corrupting Git repositories and shell history

github.com

281–290 of 423 posts

Re: WSL2 corrupting Git repositories and shell history

#281

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.

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

Re: WSL2 corrupting Git repositories and shell history

#282
I experienced this problem and a ext4 corruption, too. Because my company force me to use Windows for internal policy, my previous solution was a VMware VM , accessed "remotely" by my IDE. Then I wanted try the new sauce. My colleagues working to legacy code on SVN also experienced problems (anyone else ?). So I switched back to VMWare VM. The other considerations were that a VM can be easily backupped copying a directory and, if I need to change computer or an additional environment, the migration of the whole environment is extremely easy. Moreover i use snapshots, so if something goes wrong at OS level I can go back with a click.

Re: WSL2 corrupting Git repositories and shell history

#283

Earlier quoted context omitted.

This is probably HyperV. I’ve seen exactly this ext4 corruption in production on windows server 2012R2 with CentOS 7. Even to the point that the machine remounts root read only. Unfortunately our windows operations guys are severely lacking in diagnostic savvy and just reboot the machine over and over again or blast it and provision a new one and don’t analyse the problem. From what I’ve seen it’s a combination of th…

After upgrading to WSL2, I started having issues with a Virtualbox VM. Turns out it didn't play nicely with HyperV. I went back to WSL1.

Newer VirtualBox releases can run virtual machines on top of Hyper-V as a virtualization engine. It is slower than VirtualBox' own engine, but overall it is still a better experience than Hyper-V Manager.

Re: WSL2 corrupting Git repositories and shell history

#284

Earlier quoted context omitted.

Opposite anecdata - I got a gaming PC and i migrated all my development to it and WSL(2) has been a godsend. VS Code has a "WSL Remote" mode that works really well (where a vscode server runs in Linux and the windows GUI access it "remotely"). I even use the Windows Github app for the occasional GUI-assisted commit, and apart from being slow its fine. I've had only two problems with this set up: - Occasionally VS Cod…

Also opposite anecdote, I switched from Pop!_OS to Windows after getting into music production recently as a hobby (MIDI controller driver software doesn't always play well, even with WINE-devel) after over a decade on Linux. I expected to hate it, but I'm asking myself why I didn't do this sooner. It's the same sort of scenario as before -- I have Windows running the games I occasionally play, and music stuff, and I…

I’ve always solved this issue by keeping windows on one drive and linux on another. It does have an upfront cost, but keeping my dev work / linux environment setup has always worked well for me. Lately I’ve thought of trying WSL, but I don’t see any real benefit over my current setup

Re: WSL2 corrupting Git repositories and shell history

#285

Earlier quoted context omitted.

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

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.

Re: WSL2 corrupting Git repositories and shell history

#286
post #2

More: - WSL2 sometime corrupt .zsh_history and git https://github.com/microsoft/WSL/issues/5026 - WSL2 corrupts ext4 filesystem https://github.com/microsoft/WSL/issues/5895

This is probably HyperV. I’ve seen exactly this ext4 corruption in production on windows server 2012R2 with CentOS 7. Even to the point that the machine remounts root read only. Unfortunately our windows operations guys are severely lacking in diagnostic savvy and just reboot the machine over and over again or blast it and provision a new one and don’t analyse the problem. From what I’ve seen it’s a combination of th…

I can confirm that hyper-v snapshots break ext4 just about everytime

Re: WSL2 corrupting Git repositories and shell history

#287

Earlier quoted context omitted.

Opposite anecdata - I got a gaming PC and i migrated all my development to it and WSL(2) has been a godsend. VS Code has a "WSL Remote" mode that works really well (where a vscode server runs in Linux and the windows GUI access it "remotely"). I even use the Windows Github app for the occasional GUI-assisted commit, and apart from being slow its fine. I've had only two problems with this set up: - Occasionally VS Cod…

Also opposite anecdote, I switched from Pop!_OS to Windows after getting into music production recently as a hobby (MIDI controller driver software doesn't always play well, even with WINE-devel) after over a decade on Linux. I expected to hate it, but I'm asking myself why I didn't do this sooner. It's the same sort of scenario as before -- I have Windows running the games I occasionally play, and music stuff, and I…

I've recently come across the same issue with DAWs. Settled on having multiple machines and switching the drives if I need to reuse a workstation for something else. Most of the time you can dedicate cheap systems to specific utilizations, it will save you time and effort. e.g. There is no reason for your DAW machine to also be your gaming machine as the hardware requirements are pretty different.

Re: WSL2 corrupting Git repositories and shell history

#288

Earlier quoted context omitted.

Opposite anecdata - I got a gaming PC and i migrated all my development to it and WSL(2) has been a godsend. VS Code has a "WSL Remote" mode that works really well (where a vscode server runs in Linux and the windows GUI access it "remotely"). I even use the Windows Github app for the occasional GUI-assisted commit, and apart from being slow its fine. I've had only two problems with this set up: - Occasionally VS Cod…

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.

Re: WSL2 corrupting Git repositories and shell history

#289
post #284

Earlier quoted context omitted.

Also opposite anecdote, I switched from Pop!_OS to Windows after getting into music production recently as a hobby (MIDI controller driver software doesn't always play well, even with WINE-devel) after over a decade on Linux. I expected to hate it, but I'm asking myself why I didn't do this sooner. It's the same sort of scenario as before -- I have Windows running the games I occasionally play, and music stuff, and I…

I’ve always solved this issue by keeping windows on one drive and linux on another. It does have an upfront cost, but keeping my dev work / linux environment setup has always worked well for me. Lately I’ve thought of trying WSL, but I don’t see any real benefit over my current setup

IMHO dedicated environments encourage mindsets specific to those environments thus make you more productive. Would not switch to not having them.

Re: WSL2 corrupting Git repositories and shell history

#290

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.

ESXi is VMware's 'bare-metal' hypervisor. I'm not sure what VirtualBox uses, but I doubt it's ESXi, unless Oracle wants lawsuits (oh, wait...nevermind; they love them.)
Post reply on HN