Coder Social home page Coder Social logo

windows-in-docker's Introduction

Almost done, Work in Progress

Browser > Docker > KVM > Windows

Thank you Redhat, very legal & very cool.

WHY?

QEMU + KVM has a relatively involved setup, not very user friendly.

This image is vastly more user friendly, it comes with:

  1. Browser UI

  2. Networking out of the box

  3. Literally copy paste install

  4. Built-in Windows drivers

  5. Crazy easy customizations, ie. --cpus=9 --memory=6024 --size=120

Preview

preview1 img

preview2 img

Instructions

Prerequisites

You hardware must be able to run KVM. (Most computer can run at least 1 layer of virtualization now days.)

Install

Run the command below, and head to Firefox at port 8080 to finish installation

docker -it --rm \
  --privileged \
  -v /lib/modules:/lib/modules:ro \
  -p 8080:65080 \
  -v /vm_image_dir:/config \
  -v /iso_dir:/install \
  msjpq/kvm-windows new <windows.iso> --bios

Add --bios, if your windows version is old, or else it will load UEFI

<windows.iso> will eject after first poweroff, you will find the generated libvirt manifest under /config.

Run the command below to finish installation, and for future usage.

docker -it --rm \
  --privileged \
  -v /lib/modules:/lib/modules:ro \
  -p 8080:65080 \
  -v /vm_image_dir:/config \
  msjpq/kvm-windows

Drivers

You will need to manually install some of drivers, (VirtIO is annoying like that).

Essential
  1. The harddrive drivers will need to be installed before first reboot.

  2. The ethernet drivers will need to be installed after first login under Device Manager.

Whatever

Things like qxl can also be installed under Device Manager. Not really important though.

All drivers are included with the default install, under D:/ or E:/ drive.

Customization

Additional flags to pass onto new <image name> <flag> <flag> ...

Flag Default Option
--bios False Boot bios instead of uefi
-os win10 Windows distro
--cpus #cores Number of virtual cpus
--memory 4000 (MB)
--vram 256 (MB)
--size 100 (GB)
--dry-run False Dry run
--extra None Extra args for virt-install

Networking

All ports from VM are forwarded to container except:

53, 67-68, 65001-65535

NOT recommended to run with --net=host.

Environmental Variables

Browser UI

  • -e PATH_PREFIX=/
  • -e VNC_RESIZE=scale|off
  • -e RECON_DELAY=250 reconnection delay (ms)

Virtualization

Libvirt look for VM_NAME.xml to boot.

new will create VM_NAME.xml and VM_NAME.img.

  • -e VM_NAME=wind

Ports

  • -p 8080:65080 noVNC web UI

  • -p 5900:65059 VNC

Volumes

Libvirt manifests are stored in/config, along with VM images.

  • -v ./vm_data/:/config

You need to supply your own windows.iso, for obvious reasons.

  • -v ./install_media/:/install

Disclaimer

Works on my machine โ„ข.

windows-in-docker's People

Contributors

ms-jpq avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.