Run Docker for Windows and corresponding containers within VMWare Windows 10 session using the facilities provided by Visual Studio/Visual Studio Code

This post was originally published on this site

I want to run Docker For Windows within a VMWare Windows 10 Pro session. Right now, attempting to even start Docker for Windows in a virtual session results in an error message.

“Invalid Operation Exception:

Failed to deploy distro docker-desktop to …AppDataLocalDockerwsldistro: exit code: -1

stdout: Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS”


I checked, the Virtual Machine Platform feature is turned on both in the host and the VM and virtualization is enabled in the BIOS.


Below is the TLDR description of what I’m trying to accomplish and why.


I have searched for that scenario and come up either empty, with very outdated (as in years too old) methodologies or with respondents who wish to change the OP’s world view by telling them “You’re doing it wrong, change your methodology to this…” whatever “this” might happen to be. Or worse, asking “why do you want to do it that way? Do it this way instead…”. In all cases the respondents failed to fully understand the OP’s original question, which amounts to: “Can I run Docker for Windows within a Windows 10 Pro VMWare virtual session and, if so, how?”.


I understand the difference between Docker and VMWare, that’s not the issue. I’ve been a VMWare user since their version 3 so I get how it works and what it provides. Am I a VMWare guru? Nope, that’s part of the charm of VMWare – usually it “just works” and I don’t have to care about the machinery beneath. In the course of my learning, I see that, properly configured, Docker is exactly the same – it “just works” – awesome!


I am a developer, I use Visual Studio (VS) as my dev environment. Microsoft has gone to great lengths to make VS work with Docker. Marvelous! Love it! BUT, the presumption by Microsoft is that VS is running on the host machine or, and I haven’t tried this yet, running under their hypervisor. Never used hypervisor. When it first came out there were *way* too many problems with it and again, VMWare just worked. Never saw a reason to move off the VMWare platform and doing so now would be a major change for me, one I would very much like to avoid.


(update): I *have* tried running Docker for Windows within Microsoft’s Hyper-V environment. With a little fiddling (as in a few PowerShell commands) it WORKS JUST FINE! The concept is billed as “nested virtualization” but turning on a few Windows features and executing a PowerShell command or two and Docker for Windows starts just fine within the Hyper-V virtual session and I can execute both Windows and Linux containers.


My situation is this. Because I travel a great deal I rotate between my own personal machine at home, a company desktop machine and a laptop when traveling, usually issued by DevOps whenever I have to go offsite so the laptop isn’t “mine” it’s whatever happens to be available at the time. Changing that scenario is way above my pay-grade, company policy is something I cannot affect.


My solution up to this point has been to use VMWare to create a session, keep the session on a portable SSD drive and simply ensure that I have either VMWare Player or Workstation available to me, company DevOps has yielded that much as I’m not affecting their “host” machine configuration. It then becomes a simple matter to tune my development environment to suit me with all the additional bells and whistles and custom configurations and other goodies I might desire. Since its my environment with strictly controlled access to the corporate network as designated and configured by company DevOps, they don’t care what’s on my session so I avoid all sorts of political red tape if I wish to try a new version of Windows (yep, even Windows updates come through them, we had to fight a major battle to get them to allow us Windows 10, 2004 and wsl 2!), try a new tool, install a new version of VS (updates to which come out now about every two weeks!), etc.

In short, by using VMWare sessions, my dev environment is exactly what I want it to be, totally under my control as I am the admin on the session and thus able to control group policy, etc. and…it’s PORTABLE! *Easily* portable! I plug in the drive and viola! back to work and it matters not one whit which machine I might be working on!


Here is the kicker: We finally get to move to .NET Core and all the goodies associated with it and our C-level management has finally acknowledged the existence of Docker so now we get to play. Trouble is, when I went to install Docker for Windows into my Windows 10 Pro, 2004 with all updates, WSL2 enabled with both Debian and Alpine session running on the latest version of VMWare for Windows with full VMWare Tools installed, I receive the following error message:

“System.InvalidOperationException: Failed to deploy distro docker-desktop to …AppDataLocalDockerwsldistro: exit code: -1 stdout: Please enable Virtual Machine Platform WIndows feature and ensure virtualization is enabled in the BIOS.”


I checked and both “Virtual Machine Platform” and “Containers” are enabled in “Windows Features” for both the session and the host machine and virtualization is turned on for the host machine and that’s about as far as I can go – there is no “virtualization” setting in the VMWare BIOS for the session. I even took the risk and turned on hyper-v for the session (haven’t tried that for the host yet, am waiting for a response here before I take that plunge despite the articles on MS and VMWare working together to make that “just work”.


So, finally, the question is this: Is there a method of making Docker for Windows Desktop work within a VMWare session running Windows 10, 2004 with wsl 2 such that I might take advantage of all the goodies provided by Visual Studio and Visual Studio Code for Docker and, if so, will someone please provide the link to the instructions for configuring my environment, virtual or otherwise?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.