Windows Subsystem for Linux gets new 'mirrored' network mode
bleepingcomputer.com
bleepingcomputer.com
Added support for new opt-in experimental features
autoMemoryReclaim – Makes the WSL VM shrink in memory as you use it by reclaiming cached memory
Sparse VHD – Automatically shrinks the WSL virtual hard disk (VHD) as you use it
Mirrored mode networking – A new networking mode for WSL that adds new features and improves network compatibility
dnsTunneling – Changes how WSL resolves DNS requests to improve network compatibility
firewall – Applies Windows firewall rules to WSL, and allows for advanced firewall controls for the WSL VM
autoProxy – Makes WSL automatically use the proxy information from Windows to improve network compatibility
[0] https://devblogs.microsoft.com/commandline/windows-subsystem...autoMemoryReclaim – Makes the WSL VM shrink in memory as you use it by reclaiming cached memory
Sparse VHD – Automatically shrinks the WSL virtual hard disk (VHD) as you use it
Mirrored mode networking – A new networking mode for WSL that adds new features and improves network compatibility
dnsTunneling – Changes how WSL resolves DNS requests to improve network compatibility
firewall – Applies Windows firewall rules to WSL, and allows for advanced firewall controls for the WSL VM
autoProxy – Makes WSL automatically use the proxy information from Windows to improve network compatibility
WSL GUI apps now have Windows snapping with the keyboardIt came from Docker Desktop for Windows, where they needed a solution for VPNs like GlobalProtect and AnyConnect that are often configured to drop packets for networks that aren't the main one associated with the VPN.
How it works: https://www.docker.com/blog/how-docker-desktop-networking-wo...
Edit: Reading a bit more, it seems like they are both trying to solve the same problem but in a different way. The mirrored mode seems use the same exact IP in the wsl/linux instance that's used in Windows. Somewhat like docker host networking.
When I first started seeing articles this week on hacker news, I thought they were just old.
Anyways, I love WSL! Thanks for the update.
From my understanding, mirrored network mode is essentially duplicating the Windows host network interfaces into the WSL2 VM, so that they have the same IPv4 (and IPv6) addresses. This also allows you to seamless access network services between the Host and VM over localhost, and also expose network services (say SSH) over your LAN without futzing around with firewall and port forwarding (as you would have to do previously).
Scroll down to "New Networking Mode". Still somewhat sparse on info, but does have some detail.
TLDR always confused me. I'd rather read 10 paragraphs in a minute, than sit through 10 minutes of "hi, I'm Joe X, and this is my blah blah..."
Hopefully the mirrored network mode will help, looking forward!
Sidenote regarding the website (mobile) of the article, how many annoying and slow loading ads can you fit into a single page holy smokes...
Regardless, I think this is great, particularly for colleagues, so I can have a good story around using something Linux on their Windows laptops (specifically bash, docker, using devops tooling, etc.)
GIT is slower on cygwin, especially stat() with do hacks to check for +x mode. But once cache is warm, it works fine. Albeit, I didnt used GIT under Win10 from quite some time, im doing most of my stuff on older windows using my very old Cygwin fork thats is more snappier :)
So, cannot say much about Win10 + msys2 + new GIT performance here. My laptop is slow anyway with all the bloat IT put there :)
I worked at a company where I was being denied a Mac despite them being common in the organisation and other engineers had them. I left due to a numerous reasons, and the next-most-senior teammate was very vocal about getting a Mac.
He was given a Mac very next week after I left.
Sadly so, I'd like to use more of that on my Win10 work device, but not willing to move to 11 for just that.
Finally. Previously you had to run a bunch of sketchy diskpart scripts, unless you paid for windows professional, which doesn’t come on Microsoft devices.
I think development on windows has come a long, long way over the years, but I still feel like these days you're all but stuck going all-in on WSL -- meaning no more GUIs -- or keeping the GUIs but losing WSL. For example: if I want to use sourcetree for git on the host, but autoreload processes within docker when I change code, I'm basically out of luck: sourcetree can't deal with files on the linux filesystem (or at least, not on my setup, though that could be more than just an issue with sourcetree), so I have to store the files on the host. But things like inotify can't cross the filesystem boundary, so now autoreloading works. Which is why the advice is always just to keep all of your code within the WSL filesystem, but now the GUIs don't work. (I mean, I think in theory you can get GUIs from inside WSL, but I have absolutely no interest setting that up -- now it's like a Matryoshka doll of virtualization. Plus, some of the programs I want to use don't ship a linux version, so it's a moot point).
My workaround is annoying but effective, as long as you have a good enough system for it: I run a watcher process on the host and an rsync server within a dedicated docker container, and it syncs my code for me into a named docker volume. I guess this has the added benefit of allowing me to have my own filter files for whether or not things get copied over (I have multiple git repos, and I'd like each of them to obey their gitignores when copying), but... it's definitely pretty rough around the edges.
But still: any improvements are good!
But it's kinda moot, because not all of the applications even have a linux version. Sourcetree is a great example: it's only available on windows and mac.
To complicate things further, because I move frequently between my laptop and my desktop, I have all of my source code in dropbox (including git, and yes, it's a shitshow, though I would like to change the way I have this set up because dropbox has a nasty habit of temporarily breaking git). And to complicate things _even further_, my old laptop is dying, and I'm replacing it with a macbook (and throwing ubuntu on the old one), so I'll have windows 10, mac, and linux all at the same time.
For the most part I make it work, but there are definitely days when I just want to throw them all out the window.
But I don't think it's reasonable to expect that all of my tooling work with WSL2. A decent chunk of my tooling isn't even developer-centric -- why would the tools I use for asset creation support WSL2? Should Adobe? Should Inkscape? What about the docker sync that I use for static assets, or for source code when I need to move between laptop and desktop and don't want to make a temporary commit or patch with git? Windows app development is already messy enough, are we going to require that everyone making a windows app jump through yet another hurdle, on the off-chance that the small percentage of windows users who happen to be devs can get it to work with docker containers? That doesn't seem reasonable to me.
There are plenty of people like me that choose to develop on windows (and aren't forced by a company to do so), precisely because they want to be able to use windows as they normally would, but also, yknow, develop code. All I'm saying is, having a native way to mirror a filesystem while providing the expected semantics on both sides of the share seems like an important feature for these kinds of workflows.
Put more directly: I don't think any of my previous employers would have had a problem with me developing on a windows machine, as long as I was running the code in a virtualized environment that matched production. But it wouldn't have been acceptable at any of them to run the code directly on the host.
This is already possible, I distinctly remember SSHing to my WSL by network.
I believe WSL2 set up networking almost as a virtual client on a network local to your machine. Windows used NAT to direct traffic from Windows to WSL. The new changes allow more direct access to the network hardware instead of "virtualizing" (probably the wrong word) it
I know we just use headlines here, but that is my single greatest gripe about using WSL day to day
If you specifically want to run a Linux variant (now if you are a true Unix user, you will likely compile from source or use binaries built for Darwin/macOS), you will resort to a VM which is similar to WSL. There are many ways to do this, including just installing Docker which will bring up a Linux VM for you.
Docker / Podman for Windows is much better than macOS equivalents currently.
It is odd because it seems that macOS should be able to provide a better Linux development experience but right now, Microsoft seems to care about this immensely more than Apple.