You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
I want to be able to run, and build Linux and Windows (LCOW) containers simultaneously. #79
Tell us about your request
I want to be able to run and build Linux and Windows (LCOW) containers simultaneously.
Which service(s) is this request for?
docker build, and docker-compose
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
At this moment, I am using the (LCOW) experimental feature to run Linux and Windows containers simultaneously. The option to work streamless with Linux and Windows container is hard, because of the switch context option.
Are you currently working around the issue?
Switch context when building Linux images.
Switch setting back to windows containers, and pull Linux image in (LCOW) mode.
Additional context
The new 20H1 WSL docker integration is a great new feature, and I love it, but integration requires Linux mode. I do lose my windows context.
Issue #78 describes building both Linux and windows images in parallel on windows.
LCOW is great but lingering in limbo. There are many solutions where Windows and Linux containers work together.
Reacted by Kamil Kiewisz, Geoff, Gabriel Machado, Charles Korn, Vincent Lui, Rob Earlam, Joost, Viet Hoang, Roy, Vitalii Tylyk and 213 more
Reacted by Per Bering, Roy, Corey Smith, SenaU, Kumar Abhishek, Adam Duracz, Antonio Landolfi, Dave Wainwright, João Estevinho, Bohdan-Sydor and 44 more
Hi. I am working on moving our build and testing environment to Docker Containers.
We ship Linux and Windows components and thus need support for both.
During testing, we require a Windows client container talking to a database in Linux container.
So the lack of dual support is killing my efforts.
thank you
Reacted by chmely, shomrai, Dillan Mann, Anne Erdtsieck-Wijnen, ModernRonin, Mats Taraldsvik, PengolodhGoedath, Eugene G., 0BuRner, Nick Maltsev and 12 more
We're bound to windows containers due to the use of 'windows authentication' in some of our services and because of some SLA's. We do use some linux containers like consul and traefik. Not being able to mix Windows and Linux containers prevents our team from starting to use WSL2.
Reacted by Gabriel Machado, Alistair Young, MN, Mats Taraldsvik, 4imble, 0BuRner, Nick Maltsev, Abin, Larry Silverman, aL3891 and 1 more
I am working on upgrading our CI process to allow testing locally. Both GitHub Actions and GitLab CI don't allow running pipelines locally (of course, they weren't designed to do that). Generally I was advised to move away from the feature set of any CI runner and put as much logic into (shell) scripts as possible. Heeding that advice, I'm working on a CMake module (because all of our build automation is CMake anyway) which is able to run CI tasks locally.
Pipeline definition for GitLab and GitHub remain YAML files which do not much more than define the test matrix, distribute the work to runners and invoke a single script on every pipeline stage. The CMake module is an auxiliary project commited into version control.
CMake configuration step allows customizing the "local runner", selecting some subset of the test matrix one wishes to test for.
The build step builds the images (from Dockerfiles from within the repo), ideally in parallel.
CTest runs the same shell scripts which ordinary CI does (actually, they are CMake scripts too, invoked as cmake -P Build.cmake for eg.) in the correct order with dependency tracking inside Docker containers. Tests again ought to run in parallel. (Tests would get labels based on which test matrix elements they inherit, one could select some subset of the test matrix through ordinary CTest CLI args.)
It would be rapid response CI runs without involving remote entities, possibly even run totally offline.
I may be able to orchestrate the entire thing having CMake communicate with two daemons, one locally inside Windows and one running inside WSL2, but setup becomes way more complicated, not to mention having to bind the lifetime of the Linux daemon to a long running Windows process (service?), instead of it being the same daemon which is running on the Windows host anyway.
My org has .net framework applications I'm looking to containerize, and I would love to be able to mix Linux and windows containers on dev machines for a local development environment more reflective of our deployed environments
Reacted by Stefan Wallner, rompic, Rishi Kapoor, Kevin Gwynn, 0BuRner, Greg Woods, Zach, Larry Silverman, Igor Jigan, Mike Yeti and 6 more
I also would find it extremely useful to be able to run both Windows and Linux containers on a single host. We have many scenarios where it is required we run both types of containers in a single installation.
Reacted by Stefan Wallner, rompic, Bart Plasmeijer, 0BuRner, Greg Woods, Axel D., Igor Jigan, klr, Mike Yeti, aL3891 and 3 more
For my org using this feature would help us quite a lot as well. We have some legacy components which require to mix Linux containers with Windows containers. Manually switching on the Docker Desktop between Linux containers and Windows containers all the time is quite cumbersome for our developers.
Reacted by Bart Plasmeijer, 0BuRner, Axel D., Mike Yeti and aL3891
For my org using this feature would help us quite a lot as well. We have some legacy components which require to mix Linux containers with Windows containers. Manually switching on the Docker Desktop between Linux containers and Windows containers all the time is quite cumbersome for our developers.
Reacted by J.F. Larente, Hayden Barnes, Roy, Daniel Stratton, Fredrik Høisæther Rasch, Nick Maltsev, Abin, rompic, Cansu Shurts, Jens Andersson and 10 more
Thanks for the update @mloskot and @thaJeztah . I did try out that article, but it did not work for me. As @thaJeztah said, the feature was deprecated.
Unfortunately, if you need to work on an ASP.NET Framework application, you cannot benefit from those SOLR images. Is there a technical reason why the deprecated feature cannot be re-implemented with WSL2?
The deprecated feature used a native Windows daemon to run Linux images. For that, it created a Hyper-V VM for each container it started (effectively Linux containers were implemented as Virtual Machines).
The code that implemented that was contributed by Microsoft, and was intended to be a POC; the implementation was only partially completed, and the technical design for it had many issues (some of which were known when the implementation started), but was meant to be a temporary implementation with the intent to move the abstraction to lower level runtimes (containerd, and the OCI runtime).
There was a lot of complication involved, because Windows-native code in the Docker Engine had to (conditionally, depending on the container's image being either Linux or Windows), try to follow Linux semantics using Windows library-code from the Golang runtime (e.g. filepaths to follow Linux semantics/validation instead of Windows).
Various parts of that complexity also affected other (non-experimental, non-Windows, non-LCOW) codepaths, and the underlying Windows APIs used for the initial PoC were deprecated (and unmaintained) by Microsoft.
The net-result of all of that was that the LCOW code affected maintainability and stability of the overall code-base, which made us decide to remove it.
We don't have plans to (try to) implement this using WSL2 (this would be a significant amount of work, and likely involve "implementing containers as WSL2 VMs"), but possibly this (or a comparable) feature could find it's way back through the LCOW implementation in containerd once completed. This may still be a significant amount of work, and as of today has not been budgeted, so I can't give any estimates on that. Work for this would largely need to be done in the upstream "Moby" repository (https://github.com/moby/moby), which is fully open-source, so community participation / contributions are still an option for that.
I don't have the API specs in front of me, but if the Docker API had something that could identify the platform of a particular request, e.g., like the --platform flag for old LCOW, then a proxy (such as Docker Desktop, cough) could be used to split such requests between the native Windows dockerd and the WSL2-hosted dockerd. Right now Docker Desktop switches mode to support this same split one at a time, but both daemons are running.
I also confess I'm not really famliar with Docker Compose, can it be told that different parts of the system run on different dockerd instances, automating some of the ideas earlier in this thread? I'm not sure if it'd be feasible for, e.g., a backend private network shared between a Windows container and a Linux (WSL2-hosted) container, but I'm not sure it wouldn't be doable. (It also might be more complexity than just waiting for "New" LCOW to get into people's hands; my understanding is that it's workable on the containerd side now, but for Docker users it also depends on containerd-on-Windows and also further front-end work to enable it; I also haven't tried it myself, so might be overassuming its current state)
Why not just start both the windows container mode and wsl2 container mode at the same time?
Then automatically configure the two in a swarm with some appropriate labels and 99% of the problems goes away.
Then if i docker run from wsl, it will talk to the linux engine, and if I docker run from powershell it will talk to windows engine, and docker-compose can use the labels (or platform:, or just image) to start on the proper engine.
You can do roughly that now, using Docker contexts per #79 (comment) (and see #79 (comment) and the following few comments for caveats and notes). I'm not sure if Docker compose can work across contexts though, or just talks to the current context selected with docker context use.
Yes, that was kinda my point. It just needs to be the default or a checkbox to enable. That will send a clear signal to other tools to properly support it also
We are also interested to see if LCOW can be upgraded to support WSL2 as a backend.
The majority of our container applications right now is Windows based, but some of GPU workloads are based on Linux Container.
We can also confirm that #79 worked to some extent but we don't know how to keep both Windows and Linux Docker daemon running simultaneously without using & $env:ProgramFiles\Docker\docker\DockerCli.exe -SwitchWindowsEngine and & $env:ProgramFiles\Docker\docker\DockerCli.exe -SwitchLinuxEngine
PS: LCOW support is deprecated but not entirely remove AFAIK, and you can still turn that on with "experiment": true. Obviously however, there doesn't seems to have GPU support unlike WSL2 docker. It seems like it is removed after 23.0.0 which is half a year ago.
The old LCOW setup is removed from Docker in 23.0, and was already broken in various ways for years before that.
The new LCOW approach (Sometimes "LCOW v2", but I'm not sure if that's ever been used in a formal sense) is actually the same underlying tech as WSL2 (micro-VMs), but getting it into Docker depends on getting Windows Docker to be based on containerd, which has been a multi-year project already: moby/moby#41455 which I've apparently already referenced here in 2021, and others linked from there. (Also, I've lost track of what outstanding LCOW-specific work is still TBD in containerd itself. I believe it's been working in branches, but I'm not sure if they have all been merged into containerd yet.)
Once that's done, we will be pretty close (in a tech-stack sense, not in the "rainy afternoon's hacking" sense) to getting what this ticket wants: because containerd doesn't have "Windows" and "LCOW" modes, each container (or sandbox, really) can use a different runtime. Inter-container behaviour between LCOW and Windows containers will probably still have limitations, but being able to build Linux and Windows images in a single Docker daemon without changing modes would only require work in Docker itself, e.g. the UX could be reinstating the old (LCOW) --platform parameter for build and execution commands, but the implementation would be quite different underneath.
This might also open the door for Compose using a mix of platforms (which I don't think worked with LCOW v1), but I don't know enough about Compose to say anything further on that topic.
Reacted by Mateusz Łoskot, Nagy-Egri Máté Ferenc, wizpresso-steve-cy-fan, Jesper Balle and be567
Activity
stephen-turner commentedon May 5, 2020
See #78 for more details.
0x53A commentedon May 5, 2020
For me the important part is just building. Yeah, running both in parallel would be nice, but not strictly required.
Our dockerfiles don't do anything fancy, just copy a folder, set an environment variable and set the entry point.
So I'd also be happy with some other tool. Maybe with WSL2 we can invoke buildkit through WSL or something, idk.
thomasoatman commentedon May 26, 2020
Hi. I am working on moving our build and testing environment to Docker Containers.
We ship Linux and Windows components and thus need support for both.
During testing, we require a Windows client container talking to a database in Linux container.
So the lack of dual support is killing my efforts.
thank you
erdtsieck commentedon Jul 12, 2020
We're bound to windows containers due to the use of 'windows authentication' in some of our services and because of some SLA's. We do use some linux containers like consul and traefik. Not being able to mix Windows and Linux containers prevents our team from starting to use WSL2.
MathiasMagnus commentedon Nov 25, 2020
I am working on upgrading our CI process to allow testing locally. Both GitHub Actions and GitLab CI don't allow running pipelines locally (of course, they weren't designed to do that). Generally I was advised to move away from the feature set of any CI runner and put as much logic into (shell) scripts as possible. Heeding that advice, I'm working on a CMake module (because all of our build automation is CMake anyway) which is able to run CI tasks locally.
Pipeline definition for GitLab and GitHub remain YAML files which do not much more than define the test matrix, distribute the work to runners and invoke a single script on every pipeline stage. The CMake module is an auxiliary project commited into version control.
cmake -P Build.cmakefor eg.) in the correct order with dependency tracking inside Docker containers. Tests again ought to run in parallel. (Tests would get labels based on which test matrix elements they inherit, one could select some subset of the test matrix through ordinary CTest CLI args.)It would be rapid response CI runs without involving remote entities, possibly even run totally offline.
I may be able to orchestrate the entire thing having CMake communicate with two daemons, one locally inside Windows and one running inside WSL2, but setup becomes way more complicated, not to mention having to bind the lifetime of the Linux daemon to a long running Windows process (service?), instead of it being the same daemon which is running on the Windows host anyway.
profblackjack commentedon Dec 29, 2020
My org has .net framework applications I'm looking to containerize, and I would love to be able to mix Linux and windows containers on dev machines for a local development environment more reflective of our deployed environments
MarkLFT commentedon Dec 30, 2020
I also would find it extremely useful to be able to run both Windows and Linux containers on a single host. We have many scenarios where it is required we run both types of containers in a single installation.
derWallace commentedon Jan 11, 2021
For my org using this feature would help us quite a lot as well. We have some legacy components which require to mix Linux containers with Windows containers. Manually switching on the Docker Desktop between Linux containers and Windows containers all the time is quite cumbersome for our developers.
rompic commentedon Jan 11, 2021
+1
Afaik it is possible via the DockerCLI
bplasmeijer commentedon Mar 11, 2021
@nebuk89 any update?
49 remaining items
thaJeztah commentedon May 2, 2023
Oh! Sorry I now see I
@-mentioned the wrong person (sorry for that) 🙈andrewtek commentedon May 2, 2023
Thanks for the update @mloskot and @thaJeztah . I did try out that article, but it did not work for me. As @thaJeztah said, the feature was deprecated.
For my situation, I found that I could not run SOLR using LCOW, but it runs great using WSL2. I love that SOLR has done so much to help the community with pre-made images and documentation to get up and running,
https://solr.apache.org/guide/solr/latest/deployment-guide/solr-in-docker.html
Unfortunately, if you need to work on an ASP.NET Framework application, you cannot benefit from those SOLR images. Is there a technical reason why the deprecated feature cannot be re-implemented with WSL2?
thaJeztah commentedon May 2, 2023
The deprecated feature used a native Windows daemon to run Linux images. For that, it created a Hyper-V VM for each container it started (effectively Linux containers were implemented as Virtual Machines).
The code that implemented that was contributed by Microsoft, and was intended to be a POC; the implementation was only partially completed, and the technical design for it had many issues (some of which were known when the implementation started), but was meant to be a temporary implementation with the intent to move the abstraction to lower level runtimes (containerd, and the OCI runtime).
Some of that work has been done in containerd (see https://github.com/containerd/containerd/pulls?q=is%3Apr+lcow+ for pull requests), but may not yet be completed.
There was a lot of complication involved, because Windows-native code in the Docker Engine had to (conditionally, depending on the container's image being either Linux or Windows), try to follow Linux semantics using Windows library-code from the Golang runtime (e.g. filepaths to follow Linux semantics/validation instead of Windows).
Various parts of that complexity also affected other (non-experimental, non-Windows, non-LCOW) codepaths, and the underlying Windows APIs used for the initial PoC were deprecated (and unmaintained) by Microsoft.
The net-result of all of that was that the LCOW code affected maintainability and stability of the overall code-base, which made us decide to remove it.
We don't have plans to (try to) implement this using WSL2 (this would be a significant amount of work, and likely involve "implementing containers as WSL2 VMs"), but possibly this (or a comparable) feature could find it's way back through the LCOW implementation in containerd once completed. This may still be a significant amount of work, and as of today has not been budgeted, so I can't give any estimates on that. Work for this would largely need to be done in the upstream "Moby" repository (https://github.com/moby/moby), which is fully open-source, so community participation / contributions are still an option for that.
TBBle commentedon May 3, 2023
I don't have the API specs in front of me, but if the Docker API had something that could identify the platform of a particular request, e.g., like the
--platformflag for old LCOW, then a proxy (such as Docker Desktop, cough) could be used to split such requests between the native Windows dockerd and the WSL2-hosted dockerd. Right now Docker Desktop switches mode to support this same split one at a time, but both daemons are running.I also confess I'm not really famliar with Docker Compose, can it be told that different parts of the system run on different dockerd instances, automating some of the ideas earlier in this thread? I'm not sure if it'd be feasible for, e.g., a backend private network shared between a Windows container and a Linux (WSL2-hosted) container, but I'm not sure it wouldn't be doable. (It also might be more complexity than just waiting for "New" LCOW to get into people's hands; my understanding is that it's workable on the containerd side now, but for Docker users it also depends on containerd-on-Windows and also further front-end work to enable it; I also haven't tried it myself, so might be overassuming its current state)
davhdavh commentedon May 10, 2023
Why not just start both the windows container mode and wsl2 container mode at the same time?
Then automatically configure the two in a swarm with some appropriate labels and 99% of the problems goes away.
Then if i docker run from wsl, it will talk to the linux engine, and if I docker run from powershell it will talk to windows engine, and docker-compose can use the labels (or platform:, or just image) to start on the proper engine.
TBBle commentedon May 10, 2023
You can do roughly that now, using Docker contexts per #79 (comment) (and see #79 (comment) and the following few comments for caveats and notes). I'm not sure if Docker compose can work across contexts though, or just talks to the current context selected with
docker context use.davhdavh commentedon May 12, 2023
Yes, that was kinda my point. It just needs to be the default or a checkbox to enable. That will send a clear signal to other tools to properly support it also
wizpresso-steve-cy-fan commentedon Sep 7, 2023
We are also interested to see if LCOW can be upgraded to support WSL2 as a backend.
The majority of our container applications right now is Windows based, but some of GPU workloads are based on Linux Container.
We can also confirm that #79 worked to some extent but we don't know how to keep both Windows and Linux Docker daemon running simultaneously without using
& $env:ProgramFiles\Docker\docker\DockerCli.exe -SwitchWindowsEngineand& $env:ProgramFiles\Docker\docker\DockerCli.exe -SwitchLinuxEnginePS: LCOW support is deprecated but not entirely remove AFAIK, and you can still turn that on with
"experiment": true. Obviously however, there doesn't seems to have GPU support unlike WSL2 docker. It seems like it is removed after 23.0.0 which is half a year ago.TBBle commentedon Sep 7, 2023
The old LCOW setup is removed from Docker in 23.0, and was already broken in various ways for years before that.
The new LCOW approach (Sometimes "LCOW v2", but I'm not sure if that's ever been used in a formal sense) is actually the same underlying tech as WSL2 (micro-VMs), but getting it into Docker depends on getting Windows Docker to be based on containerd, which has been a multi-year project already: moby/moby#41455 which I've apparently already referenced here in 2021, and others linked from there. (Also, I've lost track of what outstanding LCOW-specific work is still TBD in containerd itself. I believe it's been working in branches, but I'm not sure if they have all been merged into containerd yet.)
Once that's done, we will be pretty close (in a tech-stack sense, not in the "rainy afternoon's hacking" sense) to getting what this ticket wants: because containerd doesn't have "Windows" and "LCOW" modes, each container (or sandbox, really) can use a different runtime. Inter-container behaviour between LCOW and Windows containers will probably still have limitations, but being able to build Linux and Windows images in a single Docker daemon without changing modes would only require work in Docker itself, e.g. the UX could be reinstating the old (LCOW)
--platformparameter for build and execution commands, but the implementation would be quite different underneath.This might also open the door for Compose using a mix of platforms (which I don't think worked with LCOW v1), but I don't know enough about Compose to say anything further on that topic.
linghengqian commentedon Jul 22, 2025
That being said, I don't see any issues tracking WSL2 at https://github.com/containerd/containerd/issues . Does this mean that the current issue is actually still blocked by moby/moby#41455 on the moby side?
slonopotamus commentedon Jul 22, 2025
Are there any docs (even basic) on how to use LCOW in containerd? Like, which runtime shim to use, where to get kernel, where to put it, etc.