An open API service indexing awesome lists of open source software.

https://github.com/cynegeirus/winbox-docker

This project allows you to run a lightweight, isolated Windows virtual machine using QEMU inside a Docker container, with VNC remote desktop access. It is useful for testing, sandboxing, or serving GUI-based environments remotely.
https://github.com/cynegeirus/winbox-docker

docker-machine docker-sandbox docker-windows kvm qemu qemu-kvm sandbox

Last synced: 4 months ago
JSON representation

This project allows you to run a lightweight, isolated Windows virtual machine using QEMU inside a Docker container, with VNC remote desktop access. It is useful for testing, sandboxing, or serving GUI-based environments remotely.

Awesome Lists containing this project

README

          

# ๐Ÿ–ฅ๏ธ QEMU Windows VM in Docker with VNC Access

This project allows you to run a lightweight, isolated Windows virtual machine using **QEMU inside a Docker container**, with **VNC remote desktop access**. It is useful for testing, sandboxing, or serving GUI-based environments remotely.

---

## ๐Ÿ“ฆ Features

- Full Windows VM with VirtIO drivers
- QEMU-based virtualization
- VNC access over configurable ports
- Parametric CPU, RAM, and Disk configurations
- Base QCOW2 image support for efficient disk usage
- Volume-based persistent disk
- Easy-to-use `docker-compose` deployment

---

## โš™๏ธ Requirements

- Docker
- Docker Compose
- Host system that supports KVM/QEMU (Linux recommended)

---

## ๐Ÿš€ Getting Started

### 1. Clone the Repository

```bash
git clone https://github.com/cynegeirus/winbox-docker.git
cd winbox-docker
````

### 2. Prepare ISO Images

Place your Windows installation ISO and VirtIO ISO files into the `iso/` directory:

```
iso/
โ”œโ”€โ”€ os.iso # Windows ISO
โ””โ”€โ”€ virtio.iso # VirtIO drivers ISO
```

> You can rename them if needed, just update the Dockerfile or `main.sh` accordingly.

---

## ๐Ÿ”ง Configuration

You can modify the following environment variables inside `docker-compose.yml` or `.env`:

```yaml
environment:
- CPU=2 # Number of CPU cores
- RAM=4G # RAM in megabytes
- DISK_SIZE=20G # Virtual disk size
- VNC_PORT=5903 # VNC port to expose
```

---

## ๐Ÿงช First-Time Setup

To build and start the virtual machine:

```bash
docker-compose up -d --build
```

> The first run will create the disk image and start the Windows installation.

---

## ๐Ÿ–ฅ๏ธ Access the VM

Use any VNC client to connect:

```
Host:
Port: (default 5901)
```

![plot](./images/Example.jpeg)

---

## ๐Ÿ’พ Persistent Storage

The virtual machine disk is stored in a named Docker volume or host path (`/machines/` inside the container). You can mount it from the host or export it for backup.

---

## ๐Ÿง  Advanced Features

* **Base Image Layering**: Use `qemu-img` with `-b base.qcow2` to create differential VM disks.
* **Multiple VMs**: Scale up using `docker-compose --scale machine=n` with different ports.

---

## ๐Ÿ“ Project Structure

```
.
โ”œโ”€โ”€ Dockerfile # QEMU + VNC setup
โ”œโ”€โ”€ docker-compose.yml
โ”œโ”€โ”€ main.sh # VM startup script
โ”œโ”€โ”€ iso/ # Directory for ISOs
โ””โ”€โ”€ vm/ # (optional) disk storage
```

---

## โš ๏ธ Warnings

* Do **not** mount the same QCOW2 disk in multiple VMs for read-write.
* Base QCOW2 files must remain **unchanged** once overlay disks are created.
* Ensure host system supports KVM and nested virtualization.

---

## ๐Ÿ“œ License

This project is licensed under the [MIT License](LICENSE). See the license file for details.

---

## ๐Ÿ™Œ Issues, Feature Requests or Support

Please use the Issue > New Issue button to submit issues, feature requests or support issues directly to me. You can also send an e-mail to akin.bicer@outlook.com.tr.