Live data from Hacker News

Initial Impressions of WSL 2

daverupert.com

211–220 of 233 posts

Re: Initial Impressions of WSL 2

#211

Just a reminder that enabling Hyper-V (needed for WSL2) will make your computer boot your current Windows install inside a VM too. This might makes a slight performance impact. And you might also encounter issues with Type 2 virtualization software such as VirtualBox or VMWare Workstation. (I will still stick to WSL 1 because of that).

VMWare has beta Workstation that integrates with Hyper-V.

Re: Initial Impressions of WSL 2

#212

Earlier quoted context omitted.

I've also switched from Mac to a Ryzen desktop. So far the experience has been extremely good and performance is amazing. Been working with clojure and react native on WSL2 several months now. I didn't want it to be this way though. Apple has been continuously pushing out laptops that are not what I want. My Mac is also notifying me nonstop about 2FA authentication and iCloud storage, and I can't seem to turn those o…

Why do you guys even use WSL? React does not work on Windows proper? If a few command line tools is all you need - there is MSYS and Git Bash. Genuinely curious: I use it mostly for testing, as some of the software we make supports Linux.

If you deploy / admin linux on production side it just seems to be a lot easier to also basically develop in a linux like environment.

With WSL2 you can go from - I wonder if this would work, do a quick no git checkin no vm no docker quick script, then looks good, let's drop this into git, get a dockerfile going, test on docker then test deploy or start going to production.

And it's all pretty fictionless and you can use your Windows machine still for whatever other desktop stuff you have (which many find easier than getting a linux desktop going especially if you need to interop with a word / excel / microsoft business).

I think Microsoft is finally paying a bit of attention to what developers are looking for. The vagrant / docker on windows solutions were in part providing for this need (windows desktop / linux development). This is also what made MacOS so great (unix/bsd under the hood with a nice gui). Why not bake it in? Linux is open source - you don't even have to license it from someone.

Re: Initial Impressions of WSL 2

#213
post #3

No free lunch, of course. Faster file access with WSL2 (vs WSL1), if you stay in the Linux world. But if you point it at Windows files (/mnt/c, etc), it's pretty slow. WSL2 just moved the slowness from one side to the other. Accessing the Linux FS from Windows (\\wsl$\) is also slow. That said, I am a fan, and get a lot of use out of WSL1. Since I don't use the Windows interop much, WSL2 should be a performance win f…

I'm sure I'm missing something but I don't get this problem with filesystem access performance. It seems the obvious way to do this was to have SMB mounts on either side and optimize the hell out of the already existing SMB implementations on both OSes to get the performance close enough to disk. Maybe have a dedicated virtual network interface exposed only to the VMs and not to the LAN to avoid security issues. It p…

> It seems the obvious way to do this was to have SMB mounts on either side and optimize the hell out of the already existing SMB implementations on both OSes to get the performance close enough to disk.

That's basically what they're doing, only that it's not SMB but 9p protocol servers.

Here is a video where they discuss the WSL2 architecture. The link is time-stamped to go to an overview picture of the architecture.

https://www.youtube.com/watch?v=lwhMThePdIo&t=2435

Re: Initial Impressions of WSL 2

#214

I must say WSL2 has genuinely been huge for me, to the point where I've finally been able to ditch macOS for a desktop with a Ryzen CPU. Honestly it's mindblowing how far Windows has come - if I were Apple I'd genuinely be scared of losing a large proportion of power-users as Windows becomes an increasingly viable platform for development.

I'm not sure about that. I've been running Linux as my daily driver for a good 20 years now (minus a few years on macOS when I foolishly bought some Mac hardware too poorly-supported by Linux to be usable). I finally gave up on Mac hardware last year and bought a Dell XPS 13. I went through the Win10 setup so I could easily shrink the Windows partition and install Debian in the remaining space.

It frankly disturbed the hell out of me. Windows asked for consent (default to yes, of course) for a lot of invasive things, to the point that I wondered what it was going to do without asking. And even after I said no to them, I saw what I can only describe as ads all over Windows itself. Windows pushing me to use Edge, Windows pimping Cortana even when I said I didn't want to use it, etc. In the hour or so that I used it, I never wanted to use it ever again (and, indeed, I haven't).

Apple and macOS certainly have issues of their own, but I never felt like Apple was trying to advertise to me or violate my privacy. Microsoft made it very clear that they ravenously wanted to do both to me immediately. I'll stick with Debian, thanks.

Re: Initial Impressions of WSL 2

#215

Earlier quoted context omitted.

I really like WSL. And Windows 10, well, it's not awful. I don't hate it anymore than I hate Mac OS's GUI. I find things especially nice with the new Windows Terminal. But the piece missing is still first class support for X (or Wayland) Linux applications. Without GUI Emacs, for example, or some way of integrating the Windows Emacs well, I find the WSL experience not as productive as booting into my actual Linux par…

> One thing I really like is that the Windows version of CLion will use SSH to connect into your WSL installation and use the Linux toolchain. So you can develop both Linux and Windows applications using the CLion GUI IDE on Windows, it's quite seamless. Tramp[1] does this for Emacs. You can run Windows GUI Emacs and use SSH or another protocol to edit files and run commands within the WSL installation. It's pretty s…

that's awesome! thanks

Re: Initial Impressions of WSL 2

#216

Earlier quoted context omitted.

> One thing I really like is that the Windows version of CLion will use SSH to connect into your WSL installation and use the Linux toolchain. So you can develop both Linux and Windows applications using the CLion GUI IDE on Windows, it's quite seamless. Tramp[1] does this for Emacs. You can run Windows GUI Emacs and use SSH or another protocol to edit files and run commands within the WSL installation. It's pretty s…

that's awesome! thanks

The one (big) caveat is that some Emacs commands that start subprocesses will incorrectly try to start the process in your local environment (in this case, on the Windows side), rather than the remote environment (within the WSL VM). This mainly occurs when elisp functions are implemented using call-process or make-process when they should use process-file[1] or start-file-process[2].

This isn't an issue for most code within Emacs itself, but it pops up occasionally when using packages from ELPA or MELPA.

[1] https://www.gnu.org/software/emacs/manual/html_mono/elisp.ht...

[2] https://www.gnu.org/software/emacs/manual/html_mono/elisp.ht...

Re: Initial Impressions of WSL 2

#217
post #15

Earlier quoted context omitted.

WSL gives you a full Linux distro. You can use Debian, Fedora, Ubuntu, from the top of my head. These are default options. There are others available. Additionally, you can bootstrap to other distros. I know Arch was an early target. WSL1 replaced the init process. For Ubuntu, at least, snaps were not enabled, at least out of the box. There were occasional issues early on where the syscall translation was not perfect…

There were 4 "standard" distros in the Microsoft store IIRC

Just double checked in a Windows VM. These are available when searching WSL in the Microsoft Store. Some of these are for a fee. There are also a few results for terminal emulators and an X server.

- Ubuntu (18.04 and 20.04)

- Kali

- Debian

- Fedora (remix for WSL)

- openSUSE-Leap-15

- SUSE Linux Enterprise

- Alpine

- Pengwin (Debian-based and apparently optimized for WSL, and an enterprise version)

- Centos (7 and 8.1)

-

Re: Initial Impressions of WSL 2

#218
post #153

> It’s still weird to say it, but Windows Terminal is hands-down the best terminal on Windows. Windows terminal is pretty good, but no, it's not yet the best terminal on windows. cmder is. It has panel split, quake mode, git integration... Now the read map of Windows Terminal is pretty convincing, so let's see how it plays out.

Surely the git integration is in the shell, not the terminal?

Technically yes, but practically, cmder configures each shell it embeds (windows cmd, powershell, cygwing bash) to work with git automatically. So for the end user, ~=.

Re: Initial Impressions of WSL 2

#219

> Smoother web development Last I heard networking/sharing ports didn't work, has that been fixed or is there now a solution?

Support for accessing exposed ports on docker containers using localhost:PORT is still spotty, though.

I've set up a scheduled task to get WSL IP address and update an entry in hosts file then access using http://wsl:PORT.

Re: Initial Impressions of WSL 2

#220
post #187

Earlier quoted context omitted.

Windows does something weird with the filesystem that I have never figured out. In a msys2 shell, git is incredibly incredibly slow. I actually don't even bother running git in msys2 anymore; I just use the native git in that directory. (I use msys2 to cross-compile AVR stuff.) This seems to be a known issue, but nobody knows how to fix it. (It's some UAC thing, apparently.) I imagine this is what WSL 1 used, and it…

As far as I know it's a fundamental kernel architecture decision that Microsoft can't just "fix." From the original NT microkernel design, filesystem access is all asynchronous messaging, and it can be intercepted and modified by drivers at many points. A lot of software takes advantage of that. But it's also why caching isn't as effective as it could be, since you can't rely on all those unknown layers returning the…

Also, NTFS has very different (multi-file) ACID guarantees and transaction semantics compared to most POSIX file systems. A lot of performance differences between Windows and POSIX file APIs make some sense in a NoSQL versus SQL database analogy: they make very different guarantees about what the "atomic commit" level is, what is stored and how it is stored, what is locked and how and when it is locked. They both have great uses and there are trade-offs to both approaches, you can't always rely on the performance of an application built for one running performatively on top of the other.
Post reply on HN