Windows in a Box: Simplified Testing with Docker


Windows in a Box: Simplified Testing with Docker

dockur/windows

2025-08-31

Cross-Platform Testing
If you're building an application that needs to work on multiple operating systems, you can use this Docker image to quickly and easily test how your software behaves on Windows without needing a dedicated virtual machine or physical machine. This is great for CI/CD pipelines.

Sandboxed Environments
It provides a safe, isolated environment to test untrusted applications or scripts. You can run something in the container, and if it's malicious or unstable, it won't affect your host machine.

Automating Windows-Specific Tasks
You can use this image to automate tasks that require a Windows environment, like running PowerShell scripts, testing legacy applications, or using Windows-only command-line tools. This can be integrated into build scripts or automated workflows.

First, you'll need Docker installed on your machine. If you don't have it, you can get it from the Docker website.

Once Docker is ready, you can pull the dockur/windows image from Docker Hub. Just open your terminal or command prompt and run this command

docker pull dockur/windows

After the image is downloaded, you can run a container from it. The simplest way to run it is like this

docker run -it --rm dockur/windows

-it
This gives you an interactive shell inside the container.

--rm
This automatically removes the container when you exit, which is great for cleanup.

This will run a shell inside the Windows container. You can run Windows commands, but it's a very stripped-down environment. To get a more useful experience, you'll want to access the desktop, which requires a VNC client.

To see the Windows desktop, you need to expose the VNC port. By default, VNC runs on port 5900 inside the container. You'll map this to a port on your host machine.

Here's an example

docker run -p 5900:5900 --name my-windows-vm dockur/windows

-p 5900:5900
This maps port 5900 on your host to port 5900 in the container.

--name my-windows-vm
This gives the container a friendly name.

Once the container is running, you can connect to it using a VNC client. Just open your VNC client and connect to localhost:5900.

The default VNC password is vncpassword. You can change this when you run the container if you like.

Let's say you have a PowerShell script named test.ps1 on your host machine that needs to be executed on Windows. You can use the dockur/windows image to do this.

Create your PowerShell script (test.ps1)

Write-Host "Hello from Windows!"

Run the Docker container and mount the script
You can use a volume mount to make your local file accessible inside the container.

docker run --rm -v $(pwd):/data dockur/windows powershell.exe -ExecutionPolicy Bypass -File C:\data\test.ps1

--rm
Cleans up the container after it's done.

-v $(pwd):/data
This is the key part. It mounts your current directory ($(pwd)) to a /data directory inside the container. This makes your test.ps1 script available at C:\data\test.ps1.

powershell.exe -ExecutionPolicy Bypass -File C:\data\test.ps1
This is the command that gets executed inside the container. It runs your PowerShell script.

This command will output

Hello from Windows!

dockur/windows




Running Windows Applications on Linux with winboat

As a developer, you often encounter situations where a client, a specific library, or a tool you need for a project only works on Windows


Winapps: Seamlessly Integrate Windows Apps into Your Linux Workflow

Imagine you're a Linux user, maybe you're developing on a powerful Ubuntu machine because of its excellent command-line tools and development environment


tldr-pages: Your Command-Line Cheat Sheet for Software Engineers

As software engineers, we frequently interact with the command line. Whether it's git for version control, docker for containerization


Traefik Explained: Dynamic Routing and Let's Encrypt for Software Engineers

Traefik simplifies routing and managing traffic to your microservices in dynamic environments like Docker and Kubernetes


From Code to Clinic: Building on OpenEMR's Popular Electronic Health Record Platform

OpenEMR is the most popular open-source Electronic Health Records (EHR) and Medical Practice Management solution. It is a full-featured system that is certified for use in the US (ONC certification), meaning it handles the complex regulatory and functional requirements of clinical practice


PowerShell for Engineers: Beyond Windows

From a software engineer's perspective, PowerShell is a fantastic scripting and automation tool. Here's why you'd want it in your toolbox


Technical Breakdown: How TrendRadar's NLP Features Streamline Software Engineering Tasks

Here is a friendly, detailed breakdown, focusing on the technical value and implementation steps.The sansan0/TrendRadar project is essentially a sophisticated AI-driven news aggregation and monitoring system


RevokeMsgPatcher: Binary Patching for PC Messaging Apps

RevokeMsgPatcher is a hex editor tool specifically designed to modify the executable files of PC versions of popular Chinese messaging apps like WeChat


Streamlining Windows for Developers: A Win11Debloat Guide

As a software engineer, you likely appreciate efficiency, clean environments, and having control over your development machine


A Software Engineer's Guide to Clash Verge Rev

Clash Verge Rev is a modern, cross-platform GUI client for Clash, designed for Windows, macOS, and Linux. As a software engineer