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




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


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


Software Engineer's Toolkit: Deep Dive into Windows Security Hardening

Here's a breakdown of how it can be useful for you, how to get started, and some examplesThis project offers several benefits for software engineers


Beyond Budgeting: Exploring Firefly III's Tech Stack for Developers

Firefly III is an open-source tool that uses double-entry bookkeeping to help you track your finances. While its primary purpose is finance management


Termix: A Self-Hosted Web SSH Platform for Engineers

Termix, created by LukeGus, is a self-hosted, web-based server management platform. Think of it as a central hub for managing your servers


Streamline Your Kitchen with Tandoor Recipes: A Software Engineer's Perspective

While Tandoor Recipes is a tool for food and meal management, its underlying structure and features can be a great asset for a software engineer


Architecting Autonomous Chatbots: A Deep Dive into AstrBot, Docker, and Python Plugins

Think of it as the "Swiss Army Knife" for building AI agents that actually live where people talk—whether that's Discord


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


Dashy: Your Dev Dashboard Explained

Hey there! As a software engineer, I'm always looking for ways to streamline my workflow and keep an eye on my various services


How trycua/cua Solves Safety and Testing for Desktop Automation Agents

Let's break down what c/ua is, how it can be useful for you, and how to get started.The simplest way to understand c/ua is that it's "Docker for Computer-Use Agents