[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"article-run-linux-containers-on-wsl-with-wslc-en":3,"article-related-run-linux-containers-on-wsl-with-wslc-en":30,"series-tools-422265fa-3472-489b-a791-af1622f7461b":75},{"id":4,"slug":5,"title":6,"content":7,"summary":8,"source":9,"source_url":10,"author":11,"image_url":12,"cover_image":12,"category":13,"language":14,"translated_content":11,"related_article_id":15,"keywords":16,"key_takeaways":23,"views":27,"created_at":28,"published_at":29,"topic_cluster_id":11},"422265fa-3472-489b-a791-af1622f7461b","run-linux-containers-on-wsl-with-wslc-en","Run Linux containers on WSL with wslc","\u003Cp data-speakable=\"summary\">Use wslc.exe on WSL to build and run Linux containers from Windows.\u003C\u002Fp>\u003Cp>This guide is for Windows developers who want a local container workflow inside Windows Subsystem for Linux (WSL), with no separate container engine to install. After you follow the steps, you will have WSL updated, wslc verified, a sample container running, and a path to build your own app image.\u003C\u002Fp>\u003Cp>You will also know how to publish ports, inspect logs, and clean up stopped containers so the setup stays fast and easy to maintain. The workflow works well with Visual Studio Code and a Linux distro such as Ubuntu.\u003C\u002Fp>\u003Ch2>Before you start\u003C\u002Fh2>\u003Cul>\u003Cli>Windows 11 or Windows 10 with WSL installed\u003C\u002Fli>\u003Cli>WSL version 2.9.3 or higher\u003C\u002Fli>\u003Cli>PowerShell access on Windows\u003C\u002Fli>\u003Cli>Optional: Visual Studio Code with the WSL extension\u003C\u002Fli>\u003Cli>Optional: Windows Terminal\u003C\u002Fli>\u003Cli>Git installed in your WSL distro\u003C\u002Fli>\u003Cli>A Linux distro such as Ubuntu installed in WSL\u003C\u002Fli>\u003C\u002Ful>\u003Ch2>Step 1: Update WSL to a pre-release build\u003C\u002Fh2>\u003Cp>Your first outcome is a WSL install that includes the built-in wslc.exe CLI. \u003Ca href=\"\u002Ftag\u002Fmicrosoft\">Microsoft\u003C\u002Fa>’s tutorial requires WSL 2.9.3 or higher, and that version is currently available only in pre-release builds.\u003C\u002Fp>\n\u003Cfigure class=\"my-6\">\u003Cimg src=\"https:\u002F\u002Fxxdpdyhzhpamafnrdkyq.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fcovers\u002Finline-1785933173005-9jnb.png\" alt=\"Run Linux containers on WSL with wslc\" class=\"rounded-xl w-full\" loading=\"lazy\" \u002F>\u003C\u002Ffigure>\n\u003Cpre>\u003Ccode>wsl --update --pre-release\nwsl --version\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>You should see a WSL version at 2.9.3 or higher in the version output. If the update succeeds, you have the base runtime needed for container commands.\u003C\u002Fp>\u003Ch2>Step 2: Confirm wslc is available\u003C\u002Fh2>\u003Cp>Next, verify that the container CLI shipped with WSL is ready to use. This confirms the tool is installed and responding before you try to run any images.\u003C\u002Fp>\n\u003Cfigure class=\"my-6\">\u003Cimg src=\"https:\u002F\u002Fxxdpdyhzhpamafnrdkyq.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fcovers\u002Finline-1785933169587-wake.png\" alt=\"Run Linux containers on WSL with wslc\" class=\"rounded-xl w-full\" loading=\"lazy\" \u002F>\u003C\u002Ffigure>\n\u003Cpre>\u003Ccode>wslc version\nwslc --help\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>You should see a version string for wslc and a help page listing commands such as run, build, image, container, and stats. That means the CLI is reachable from PowerShell.\u003C\u002Fp>\u003Ch2>Step 3: Run the hello-world container\u003C\u002Fh2>\u003Cp>Now prove the container path works end to end by pulling and running a tiny built-in image. This is the fastest check that WSL, the image pull, and the runtime are all connected correctly.\u003C\u002Fp>\u003Cpre>\u003Ccode>wslc run --rm hello-world\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>You should see a Hello message that confirms the installation appears to be working correctly. If that message shows up, you have a working container runtime on WSL.\u003C\u002Fp>\u003Ch2>Step 4: Start a web container and publish a port\u003C\u002Fh2>\u003Cp>After the smoke test, run a real container in the background and map it to a Windows port. This gives you a practical loop for testing a service from your browser or local tools.\u003C\u002Fp>\u003Cpre>\u003Ccode>wslc run -d --rm -p 8080:80 --name web nginx\ncurl localhost:8080\nwslc container list\nwslc exec web cat \u002Fetc\u002Fos-release\nwslc container stop web\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>You should see a response from localhost:8080, the container listed as running, and Linux details from inside the container. When you stop it, the container is removed automatically because --rm was used.\u003C\u002Fp>\u003Ch2>Step 5: Build your own image in WSL\u003C\u002Fh2>\u003Cp>Now move from a stock image to your own app image. The key outcome here is a Containerfile in your project root and a tagged image you can run later.\u003C\u002Fp>\u003Cpre>\u003Ccode>FROM python:3\nWORKDIR \u002Fapp\nCOPY requirements.txt .\nRUN pip install --no-cache-dir -r requirements.txt\nCOPY . .\nEXPOSE 8000\nCMD [\"python\", \"manage.py\", \"runserver\", \"0.0.0.0:8000\"]\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>From the folder that contains the Containerfile, build the image with a tag you can reuse. Microsoft recommends keeping project files on the WSL file system for better performance when Linux tools access them.\u003C\u002Fp>\u003Cpre>\u003Ccode>wslc build -t helloworld-django .\nwslc image list\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>You should see the new image in the image list. If you build from the WSL file system, file access should feel much faster than working from the Windows file system.\u003C\u002Fp>\u003Ch2>Step 6: Run, inspect, and clean up the app container\u003C\u002Fh2>\u003Cp>Finish by running your image, checking logs, and then cleaning up resources. This gives you a repeatable workflow for development and troubleshooting.\u003C\u002Fp>\u003Cpre>\u003Ccode>wslc run -d --rm -p 8000:8000 --name django helloworld-django\nwslc container list\nwslc container logs django\nwslc exec django uname\nwslc container stop django\nwslc container prune\nwslc image prune\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>You should see the app available at http:\u002F\u002Flocalhost:8000\u002F, logs from the container, and uname reporting Linux. After cleanup, stopped containers and unused images should be removed.\u003C\u002Fp>\u003Ctable>\u003Cthead>\u003Ctr>\u003Cth>Metric\u003C\u002Fth>\u003Cth>Before\u002FBaseline\u003C\u002Fth>\u003Cth>After\u002FResult\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\u003Ctbody>\u003Ctr>\u003Ctd>WSL version\u003C\u002Ftd>\u003Ctd>Below 2.9.3\u003C\u002Ftd>\u003Ctd>2.9.3 or higher with pre-release update\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>Container CLI\u003C\u002Ftd>\u003Ctd>No wslc.exe access\u003C\u002Ftd>\u003Ctd>wslc version returns a valid CLI version\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>Smoke test\u003C\u002Ftd>\u003Ctd>No container verification\u003C\u002Ftd>\u003Ctd>hello-world prints the Hello confirmation\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>Port publishing\u003C\u002Ftd>\u003Ctd>No local service exposure\u003C\u002Ftd>\u003Ctd>localhost:8080 or localhost:8000 reaches the container\u003C\u002Ftd>\u003C\u002Ftr>\u003C\u002Ftbody>\u003C\u002Ftable>\u003Ch2>Common mistakes\u003C\u002Fh2>\u003Cul>\u003Cli>Using WSL below 2.9.3. Fix: run \u003Ccode>wsl --update --pre-release\u003C\u002Fcode> and confirm with \u003Ccode>wsl --version\u003C\u002Fcode>.\u003C\u002Fli>\u003Cli>Storing project files on the Windows file system. Fix: keep the code in the WSL file system so Linux tools can read and write it faster.\u003C\u002Fli>\u003Cli>Forgetting to publish the container port. Fix: add \u003Ccode>-p host:container\u003C\u002Fcode>, such as \u003Ccode>-p 8000:8000\u003C\u002Fcode>, before testing in a browser.\u003C\u002Fli>\u003C\u002Ful>\u003Ch2>What's next\u003C\u002Fh2>\u003Cp>From here, explore the WSL container overview, the container \u003Ca href=\"\u002Ftag\u002Fapi\">API\u003C\u002Fa> samples, and the \u003Ca href=\"\u002Ftag\u002Fvs-code\">VS Code\u003C\u002Fa> WSL workflow so you can debug, automate, and extend this setup for your own services.\u003C\u002Fp>","Set up WSL 2.9.3+ and use wslc.exe to build, run, and inspect Linux containers on Windows.","learn.microsoft.com","https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fwindows\u002Fwsl\u002Ftutorials\u002Fwsl-containers",null,"https:\u002F\u002Fxxdpdyhzhpamafnrdkyq.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fcovers\u002Finline-1785933173005-9jnb.png","tools","en","fea0311b-9182-48fa-af78-cb5d916970f2",[17,18,19,20,21,22],"WSL","wslc.exe","Linux containers","Dockerfile","VS Code","WSL 2",[24,25,26],"WSL 2.9.3 or higher is required to use the built-in wslc.exe CLI.","You can verify the setup quickly with hello-world before building your own image.","Keeping code on the WSL file system improves the container development experience.",0,"2026-08-05T12:32:28.209285+00:00","2026-08-05T12:32:28.203+00:00",{"tags":31,"relatedLang":34,"relatedPosts":38},[32],{"name":21,"slug":33},"vs-code",{"id":15,"slug":35,"title":36,"language":37},"run-linux-containers-on-wsl-with-wslc-zh","在 WSL 用 wslc 跑 Linux 容器","zh",[39,45,51,57,63,69],{"id":40,"slug":41,"title":42,"cover_image":43,"image_url":43,"created_at":44,"category":13},"90a9e12a-c375-4082-b7f7-9c2f56f4b803","claim-alibaba-cloud-free-trial-ecs-credits-en","Claim Alibaba Cloud Free Trial Credits on ECS","https:\u002F\u002Fxxdpdyhzhpamafnrdkyq.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fcovers\u002Finline-1785846783510-ed2x.png","2026-08-04T12:32:35.510907+00:00",{"id":46,"slug":47,"title":48,"cover_image":49,"image_url":49,"created_at":50,"category":13},"9d41f638-ce04-4c38-8791-b1bf0136ac61","deepseek-v4-flash-turns-agent-work-cheap-en","DeepSeek V4 Flash turns Agent work cheap","https:\u002F\u002Fxxdpdyhzhpamafnrdkyq.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fcovers\u002Finline-1785785622118-cv0b.png","2026-08-03T19:33:16.512658+00:00",{"id":52,"slug":53,"title":54,"cover_image":55,"image_url":55,"created_at":56,"category":13},"f7b3e715-3846-4073-a11a-724cee335a56","gpt-56-sol-cuts-gpu-costs-20-en","GPT-5.6 Sol cuts GPU costs 20%","https:\u002F\u002Fxxdpdyhzhpamafnrdkyq.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fcovers\u002Finline-1785780227547-t9b5.png","2026-08-03T18:03:17.835161+00:00",{"id":58,"slug":59,"title":60,"cover_image":61,"image_url":61,"created_at":62,"category":13},"cff81190-9b94-4959-9be0-2294dc95ad88","astra-math-post-model-launch-en","Astra Turns a Math Post Into a Model Launch","https:\u002F\u002Fxxdpdyhzhpamafnrdkyq.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fcovers\u002Finline-1785758610707-9dmh.png","2026-08-03T12:03:03.24803+00:00",{"id":64,"slug":65,"title":66,"cover_image":67,"image_url":67,"created_at":68,"category":13},"6eda1d14-2c22-476d-b365-40305337a837","openai-api-changelog-spend-caps-transcribe-fast-mode-en","OpenAI’s API changelog adds spend caps, transcribe, and Fast mode","https:\u002F\u002Fxxdpdyhzhpamafnrdkyq.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fcovers\u002Finline-1785744185924-vlxx.png","2026-08-03T08:02:40.923014+00:00",{"id":70,"slug":71,"title":72,"cover_image":73,"image_url":73,"created_at":74,"category":13},"9a74d5a3-3666-477c-a8d2-78b9e92f8ca3","windsurf-intellij-plugin-shortcut-not-strategy-en","Windsurf’s IntelliJ plugin is a shortcut, not a strategy","https:\u002F\u002Fxxdpdyhzhpamafnrdkyq.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fcovers\u002Finline-1785610962743-vqa2.png","2026-08-01T19:02:18.902162+00:00",[76,81,86,91,96,101,106,111,116,121],{"id":77,"slug":78,"title":79,"created_at":80},"8008f1a9-7a00-4bad-88c9-3eedc9c6b4b1","surepath-ai-mcp-policy-controls-en","SurePath AI's New MCP Policy Controls Enhance AI Security","2026-03-26T01:26:52.222015+00:00",{"id":82,"slug":83,"title":84,"created_at":85},"27e39a8f-b65d-4f7b-a875-859e2b210156","mcp-standard-ai-tools-2026-en","MCP Standard in 2026: Integrating AI Tools","2026-03-26T01:27:43.127519+00:00",{"id":87,"slug":88,"title":89,"created_at":90},"165f9a19-c92d-46ba-b3f0-7125f662921d","rag-2026-transforming-enterprise-ai-en","How RAG in 2026 is Transforming Enterprise AI","2026-03-26T01:28:11.485236+00:00",{"id":92,"slug":93,"title":94,"created_at":95},"6a2a8e6e-b956-49d8-be12-cc47bdc132b2","mastering-ai-prompts-2026-guide-en","Mastering AI Prompts: A 2026 Guide for Developers","2026-03-26T01:29:07.835148+00:00",{"id":97,"slug":98,"title":99,"created_at":100},"3ab2c67e-4664-4c67-a013-687a2f605814","garry-tan-open-sources-claude-code-toolkit-en","Garry Tan Open-Sources a Claude Code Toolkit","2026-03-26T08:26:20.245934+00:00",{"id":102,"slug":103,"title":104,"created_at":105},"66a7cbf8-7e76-41d4-9bbf-eaca9761bf69","github-ai-projects-to-watch-in-2026-en","20 GitHub AI Projects to Watch in 2026","2026-03-26T08:28:09.752027+00:00",{"id":107,"slug":108,"title":109,"created_at":110},"9f332fda-eace-448a-a292-2283951eee71","practical-github-guide-learning-ml-2026-en","A Practical GitHub Guide to Learning ML in 2026","2026-03-27T01:16:50.125678+00:00",{"id":112,"slug":113,"title":114,"created_at":115},"1b1f637d-0f4d-42bd-974b-07b53829144d","aiml-2026-student-ai-ml-lab-repo-review-en","AIML-2026 Is a Bare-Bones Student Lab Repo","2026-03-27T01:21:51.661231+00:00",{"id":117,"slug":118,"title":119,"created_at":120},"6d1bf3f6-e191-4d30-b55b-8a0722fa6afe","ai-trending-github-repos-and-research-feeds-en","AI Trending Tracks Repos and Research Feeds","2026-03-27T01:31:35.709532+00:00",{"id":122,"slug":123,"title":124,"created_at":125},"010539a1-4c3a-4bd3-937a-26616422ee0d","awesome-ai-for-science-research-tools-map-en","Awesome AI for Science Is Becoming a Real Research Map","2026-03-27T01:46:50.89513+00:00"]