Developing on Windows: Docker, Linux VM, WSL or Cygwin?

twitter logo github logo ・1 min read

(I'm currently a Mac user, switching to a Dell laptop)

Macs are expensive and Linux has some hardware compatibility problems. That leaves me with Windows.

Most developers I know hate to develop on Windows, unless they're developing .NET applications, which is not my case. Also, I'm very happy with my Unix shell and I don't want to use PowerShell or the terrible Windows CMD.

Don't get me wrong, Windows 10 is great. Microsoft is getting its groove back. And to develop on Windows as a main OS (without dual boot), there are some choices:

1) Docker for Windows
2) Linux VM (VMWare, Virtual Box, Hyper-V)
3) Windows Subsystem for Linux (that is pretty neat)
4) Cygwin

These options give my Unix shell back, and makes development much easier.

Have anyone used any of these options?

twitter logo DISCUSS (14)
markdown guide
 

I tried to do web dev on Windows 10 in 2018. I spent more then 40h on stackoverflow, github issues and google. Bottom line, because is not a popular platform for devs many libraries had issues and I ended up using C9 IDE for some nodeJS projects.

Docker had a missing feature on Windows, I forgot which one. WSL is useless because of the file system limitations, I could not put the project files with the IDE running in windows space.

Any container/VM will add a layer of complexity on debuging mostly and made everything a lot more complex.

I would deal with those hardware compatibilty issues rather than tring to use windows for dev.

 

I could not put the project files with the IDE running in windows space.

in wsl you can acces you windows drives as /mnt/c

but for the most part I agree. I also spent some good 10 hours trying to set it all up in windows, but debugging was still a problem (web spa). Dropped it and switched back to linux

Here is an advice for WSL users: add it's directory to ignore path of windows defender, otherwise npm install becomes deadly slow

 

I meant it did not supported file watcher and also it was highly recommended to not modify the files under the linux mounts in WSL with windows processes (IDE), which beats the purpose of WSL for a dev.

If it didn't work for you I have no interest in trying to convert you but I've had nothing but success developing using WSL for the past few years. It's true that you shouldn't access anything under WSL "/" from windows but I'm able to work exclusively out of the Windows space (/mnt/c) for everything. I can read and write those files from Windows VScode, etc. and from my Linux utilities running in WSL. And you can create symlinks in WSL-land to conveniently access My Documents, Downloads, etc. in Windows. Obviously your success will depend on the kind of work you're doing but for my needs I'm 100% satisfied with WSL

Sounds good,maybe I will try it again in a few years.

For now I no longer need windows so I can stay on a linux for full time. In that time I was on Unity3D too which is awful on Linux.

 

Hi Vinicius, to be honest, I would recommend you only the first choice "Docker for Windows". But if you have the chance of using a Linux OS please go for it.

Docker for Windows has been growing very fast and the integration is pretty good.

 

I'm using Docker for everything. Having gone through the same transition (Mac to Dell XPS), on Windows, I settled for a combination of Docker and WSL. I've blogged about it here: medium.com/software-development-st...

While the setup described in the post linked above is certainly workable, nothing beats a native Linux installation. Docker's file IO is slower (fortunately not as slow as on a Mac) and depending on the projects you work on, you might need to add docker-sync into the mix.

 

Great! Just a quick question: why WSL + Docker instead of Docker for Windows?

 

It is Docker for Windows. I use WSL for git, vim and all the Linux tools. If you don't need or use any Linux tools, you don't need WSL I guess.

 

I use a Fedora Linux desktop VM for development. Formatted as VMDK, I can run under just about any virtualization or containerization platform with at most a format change of the disk image, by using virtualbox's dish format utilities to change from VMDK to raw or others. Virtual box, VMware player, VMware server, etc. are available for Linux, Mac and Windows. That means I also backup my Dev desktop by simply copying the file and compressing it. Inside the VM I can run libvirt with docker, lxc, vagrant, and what have you with hardware support for nested virtualization. Also, it makes upgrades of my Dev machine a snap. Whichever platform I'm on, I start up the VM on login and see it to full screen on all screens. It's seamless, maintainable, easy, and works everywhere.

Also, it gives me the ability to snapshot clean builds after I add my timing and after Dev stack upgrades that could go sideways. Never again do I have to completely uninstall and reinstall Ruby after a "yum upgrade" borks my build. Try it, you'll thank me. ;)

 

Depends on the nature of the development you're doing. If there's any likelihood that what you're planning to do will require running in a native space, then a VM is going to be your best bet (whether hosted locally or "in the cloud"). The first three options you list fall under the "VM" heading, to a greater or lesser degree.

I've used Cygwin/X for over a decade. However, that use has mostly been as a management interface. It's good for things like SSH'ing to remote systems, running tools like the AWS CLI, basic editing of programs (that will be run elsewhere) or displaying remote X-clients' output to. For actual coding that is influenced by the environment it runs in, it's not adequately insulated/abstracted from the host it's running on as it's really just a shell (you'll especially see this in code that relies on multi-threading or low-level I/O manipulation).

 

I'm currently using WSL for developing purposes, a really cool feature in the latest update of Windows is the ability to share Env variables across your bash and cmd CLI. If it helps I'm working on a project which uses a PHP framework and Angular with some JQuery.

 

Don't, just don't, I've been using Windows for quite a while now (work mandated) and I spend more time figuring out how to deal with it's quirks.

 

Just wanted to say, if you're going to be using a Dell Laptop, Linux will most likely work perfectly fine. Dell even sells laptops with Ubuntu pre-installed.

Classic DEV Post from Jan 10

Some Incredibly Clever Layout Pens from CodePen (with bonus twists)

I picked out a couple of posts that demonstrate CSS layout possibilities in interesting ways.

Vini Brasil profile image
Software Engineer working with Web and Mobile. Christian, programmer, bathroom singer, Ruby, product development, and tech in general.