Skip to main content

Posts

WSL: Filesystem fast and furious?

Introduction By now, everyone that is working long enough with WSL (a.k.a WSLinux ?) complaint at least once about a specific pain point: Filesystem performance. Microsoft acknowledged it several times already, and while they're aware of the problem they also know this is complicated to address as WSL is not virtualized. I do strongly recommend to watch (again) the Channel9 video on the Filesystem implementation (here's the blog post too ). Please note that some limitations described in the video and/or the blog post are since then been addressed. But the "logic" remains. So while a real solution will be implemented in the future by Microsoft, here is a quick "hack" that could help on certain projects. Our workspace is $HOME as usual, I will target the most used directory: the Desktop folder ... hmm ... I mean the $HOME directory. I blogged about it, on different ways you can have $HOME mounted/linked to a directory in Windows space (latest one...
Recent posts

WSL + Explorer: the secret Terminal

Warning   Please note that while you should read this blog post as a "joke", which hopefully will make you smile, all the commands are technically correct and should work for you too. With that being said, let the show begin.  Introduction   During the //BUILD 2018 conference, the session with  Sarah  and  Tara  showed how far WSL has come and, lucky for us, we can now see the  replay  or if you prefer reading, Tara has your back with a  great recap .  at the very end of their presentation, there is small but (very) impactful demo: the Windows Explorer context menu now has "Open Linux shell here": Look at the past, you will see the future Unfortunately I don't remember who showed this first (I do apologize), but there's a neet trick with Windows Explorer: if you type "cmd.exe" in the address bar, it will open a command prompt in the current directory. So, with a little thinking and knowing that the shell is different fro...

WSL + Interop + Azure: $HOME is everywhere

Introduction Microsoft //BUILD is just 3 days away and while I'm just (super) sad that I will not attend, I wanted to bring a "special" gift. After some discussion on Twitter with @Tara_msft , she asked me if I tried Azure Cloud Shell. She past a link to the (incredibly) excellent @docmsft site. And the Pandora box was definitively open... The crazy idea after looking at the Cloud Shell, and reading  about Spot Instant Cloud, this (crazy) idea came to life: What if, I could tweak the "$HOME" hack  and make it available "everywhere"!  Or, due to the limitation of the Azure free account (in terms of storage capacity) and the "Network drives" permissions/behavior, at least I could put the important dot files in the Cloud Drive while keeping the development files on the "Interop zone" (read: /mnt/c/...) as described in Brian's blog post. To be prepared, you must Before we can apply what follows, some preparatio...

WSL: Interop state of mind

Introduction while playing with Docker and the Named Pipe trick , I wanted to give a more "*nix" feeling of Craig Wilhite volume mounting example: $ docker run -v C:/Users/crwilhit.REDMOND/tmp/ microsoft/nanoserver cmd.exe There's nothing wrong with this command, but the "scope" is WSL shell, and while using the docker nix command, the path of the volume is the windows one. There should be a better way, no? WSLENV to save the day Luckily, the WSL team did already implement a very nice feature,  WSLENV , and a linux command, wslpath  that will help translating the Windows path. Now it would be up to you to either create, in Windows, an environment variable and use it. Here is the same example, using LCOW (because why not), for mounting volumes in a "linux way": $ docker run --platform=linux -it -v $DOCKERVOL/mydir:/sharedvol ubuntu bash or use the wslpath command: $ docker run --platform=linux -it -v `wslpath -w /mnt/c/DockerVolumes/mydir...

Docker + WSL: Get 2 daemon for the price of 1

Introduction almost two years ago, Docker announced the capability of switching between the Linux and Windows containers "mode" (far from the right click that we have today). At that time, I wrote a blog post on how to run both daemons at the same time ( http://darthnunix.blogspot.ch/2016/10/docker-for-windows-2-daemons-enter-in.html ) Fast forward to 2018, and while we were blogging on how to get the TLS connection from WSL docker client with  Rory McCune  ( https://raesene.github.io/blog/2018/03/29/WSL-And-Docker/ ), another blog post, by Stefan Stranger drew my attention (read: blew my mind) as I was trying to reproduce the same: how could I "bind" the docker socket in WSL with the Docker for Windows Linux mode socket ( https://blogs.technet.microsoft.com/stefan_stranger/2018/04/02/access-my-docker-for-windows-kubernetes-cluster-from-debian-wsl/ ) From 1 to 2 daemon: DemonHunter mode achieved Now that we have all the required setup resources, let's b...

Windows Feedback: a WSL love letter

Introduction As many of you, you might have seen a request for Feedback from the Windows team and how it help us innovating, creating or simply help running our daily Business. For me, while Windows 10 is certainly one of the best version so far, what really stood out since now almost 2 years is WSL. So here is the text I sent as a feedback (minus the typos) and I will warn you: this IS a Love Letter. So if you're not interested in "Care Bear" writting, good bye and have a nice day. The feedback Windows 10 is for me the WSL love and the impact it’s causing on the “legacy IT genes” itself. Since now ever, in a computerized view, Windows was the evil Dragon to be slain by the *nix knights in shiny armor. And then Windows 10 came, with two main crazy ideas. The first one is to have an unchanged, not recompiled linux environment running side by side with Windows and not virtually (as in Virtualization) separated. And with the possibility to call bi...

Scripting with GO: what about Windows?

!!! Warning !!! Once again, let me repeat, I'm by no means a developer nor a sysadmin (at least no more since 5 years). This means that, while the solution below worked for me and I could reproduce it, it's not 100% safe neither! Also, my solution still feels incomplete (read further), so if someone know the tweak to make it even more compete, please share it and reach out in Twitter, I'll be waiting. Introduction By now, everyone following  @jessfraz read her take about the very neat " little hack " from @cloudflare :  Using Go as a scripting language in Linux As a good WSL Corsair, I tried it and it just worked! But then, based on my latest playground of having a seamless coding experience between WSL and Windows (thanks @bketelsen for the love and notification spam), I really thought it would be unfair to "my Windows side" to not be able enjoying the fun of GO scripting (yes, split personality is bad). So as the good Corsair I am, it wa...