mirror of
https://github.com/dockur/windows.git
synced 2026-01-22 02:43:06 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56cb787c55 | ||
|
|
da9ef0e061 | ||
|
|
b02f65a41e | ||
|
|
7921b1eb54 | ||
|
|
463ec9fb49 | ||
|
|
3a871e4ac5 | ||
|
|
ab6ba410b3 | ||
|
|
8f6f73dab7 | ||
|
|
6aee02b4e1 |
@@ -6,6 +6,8 @@
|
|||||||
.gitmodules
|
.gitmodules
|
||||||
Dockerfile
|
Dockerfile
|
||||||
Dockerfile.archive
|
Dockerfile.archive
|
||||||
|
compose.yml
|
||||||
|
compose.yaml
|
||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
|
docker-compose.yaml
|
||||||
*.md
|
*.md
|
||||||
|
|||||||
2
.github/workflows/check.yml
vendored
2
.github/workflows/check.yml
vendored
@@ -21,5 +21,5 @@ jobs:
|
|||||||
uses: hadolint/hadolint-action@v3.1.0
|
uses: hadolint/hadolint-action@v3.1.0
|
||||||
with:
|
with:
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
ignore: DL3008
|
ignore: DL3008,DL4006,SC3037
|
||||||
failure-threshold: warning
|
failure-threshold: warning
|
||||||
|
|||||||
19
Dockerfile
19
Dockerfile
@@ -1,28 +1,31 @@
|
|||||||
FROM scratch
|
FROM scratch
|
||||||
COPY --from=qemux/qemu-docker:4.17 / /
|
COPY --from=qemux/qemu-docker:4.20 / /
|
||||||
|
|
||||||
ARG DEBCONF_NOWARNINGS "yes"
|
ARG DEBCONF_NOWARNINGS "yes"
|
||||||
ARG DEBIAN_FRONTEND "noninteractive"
|
ARG DEBIAN_FRONTEND "noninteractive"
|
||||||
ARG DEBCONF_NONINTERACTIVE_SEEN "true"
|
ARG DEBCONF_NONINTERACTIVE_SEEN "true"
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update && \
|
||||||
&& apt-get --no-install-recommends -y install \
|
apt-get --no-install-recommends -y install \
|
||||||
curl \
|
curl \
|
||||||
7zip \
|
7zip \
|
||||||
wsdd \
|
wsdd \
|
||||||
samba \
|
samba \
|
||||||
wimtools \
|
|
||||||
dos2unix \
|
dos2unix \
|
||||||
cabextract \
|
cabextract \
|
||||||
genisoimage \
|
genisoimage \
|
||||||
libxml2-utils \
|
libxml2-utils && \
|
||||||
&& apt-get clean \
|
echo "deb http://deb.debian.org/debian/ sid main" >> /etc/apt/sources.list.d/sid.list && \
|
||||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
echo -e "Package: *\nPin: release n=trixie\nPin-Priority: 900\nPackage: *\nPin: release n=sid\nPin-Priority: 400" | tee /etc/apt/preferences.d/preferences > /dev/null && \
|
||||||
|
apt-get update && \
|
||||||
|
apt-get -t sid --no-install-recommends -y install wimtools && \
|
||||||
|
apt-get clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
COPY ./src /run/
|
COPY ./src /run/
|
||||||
COPY ./assets /run/assets
|
COPY ./assets /run/assets
|
||||||
|
|
||||||
ADD https://raw.githubusercontent.com/christgau/wsdd/master/src/wsdd.py /usr/sbin/wsdd
|
ADD https://raw.githubusercontent.com/christgau/wsdd/v0.8/src/wsdd.py /usr/sbin/wsdd
|
||||||
ADD https://github.com/qemus/virtiso/releases/download/v0.1.248/virtio-win-0.1.248.iso /run/drivers.iso
|
ADD https://github.com/qemus/virtiso/releases/download/v0.1.248/virtio-win-0.1.248.iso /run/drivers.iso
|
||||||
|
|
||||||
RUN chmod +x /run/*.sh && chmod +x /usr/sbin/wsdd
|
RUN chmod +x /run/*.sh && chmod +x /usr/sbin/wsdd
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ services:
|
|||||||
windows:
|
windows:
|
||||||
image: dockurr/windows
|
image: dockurr/windows
|
||||||
container_name: windows
|
container_name: windows
|
||||||
|
environment:
|
||||||
|
VERSION: "win11"
|
||||||
devices:
|
devices:
|
||||||
- /dev/kvm
|
- /dev/kvm
|
||||||
cap_add:
|
cap_add:
|
||||||
12
readme.md
12
readme.md
@@ -19,9 +19,13 @@ Windows in a Docker container.
|
|||||||
- KVM acceleration
|
- KVM acceleration
|
||||||
- Web-based viewer
|
- Web-based viewer
|
||||||
|
|
||||||
|
## Video
|
||||||
|
|
||||||
|
[](https://www.youtube.com/watch?v=xhGYobuG508)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Via `docker-compose.yml`
|
Via Docker Compose:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: "3"
|
version: "3"
|
||||||
@@ -29,6 +33,8 @@ services:
|
|||||||
windows:
|
windows:
|
||||||
image: dockurr/windows
|
image: dockurr/windows
|
||||||
container_name: windows
|
container_name: windows
|
||||||
|
environment:
|
||||||
|
VERSION: "win11"
|
||||||
devices:
|
devices:
|
||||||
- /dev/kvm
|
- /dev/kvm
|
||||||
cap_add:
|
cap_add:
|
||||||
@@ -41,7 +47,7 @@ services:
|
|||||||
restart: on-failure
|
restart: on-failure
|
||||||
```
|
```
|
||||||
|
|
||||||
Via `docker run`
|
Via Docker CLI:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run -it --rm --name windows -p 8006:8006 --device=/dev/kvm --cap-add NET_ADMIN --stop-timeout 120 dockurr/windows
|
docker run -it --rm --name windows -p 8006:8006 --device=/dev/kvm --cap-add NET_ADMIN --stop-timeout 120 dockurr/windows
|
||||||
@@ -100,7 +106,7 @@ docker run -it --rm --name windows -p 8006:8006 --device=/dev/kvm --cap-add NET_
|
|||||||
|
|
||||||
So for a better experience you can connect using any Microsoft Remote Desktop client to the IP of the container, using the username `docker` and by leaving the password empty.
|
So for a better experience you can connect using any Microsoft Remote Desktop client to the IP of the container, using the username `docker` and by leaving the password empty.
|
||||||
|
|
||||||
There is a good RDP client for [Android](https://play.google.com/store/apps/details?id=com.microsoft.rdc.androidx) available from the Play Store. One for [iOS](https://apps.apple.com/nl/app/microsoft-remote-desktop/id714464092?l=en-GB) is in the Apple Store. For Linux you can use [rdesktop](http://www.rdesktop.org/) and for Windows you don't need to install anything as it is already ships as part of the operating system.
|
There is a good RDP client for [Android](https://play.google.com/store/apps/details?id=com.microsoft.rdc.androidx) available from the Play Store and one for [iOS](https://apps.apple.com/nl/app/microsoft-remote-desktop/id714464092?l=en-GB) in the Apple Store. For Linux you can use [FreeRDP](https://www.freerdp.com/) and on Windows just type `mstsc` in the search box.
|
||||||
|
|
||||||
* ### How do I increase the amount of CPU or RAM?
|
* ### How do I increase the amount of CPU or RAM?
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -Eeuo pipefail
|
set -Eeuo pipefail
|
||||||
|
|
||||||
|
: "${BOOT_MODE:="windows"}"
|
||||||
|
|
||||||
APP="Windows"
|
APP="Windows"
|
||||||
BOOT_MODE="windows"
|
|
||||||
SUPPORT="https://github.com/dockur/windows"
|
SUPPORT="https://github.com/dockur/windows"
|
||||||
|
|
||||||
cd /run
|
cd /run
|
||||||
|
|||||||
@@ -316,6 +316,7 @@ startInstall() {
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm -rf "$TMP"
|
||||||
mkdir -p "$TMP"
|
mkdir -p "$TMP"
|
||||||
|
|
||||||
if [ ! -f "$STORAGE/$CUSTOM" ]; then
|
if [ ! -f "$STORAGE/$CUSTOM" ]; then
|
||||||
@@ -325,7 +326,6 @@ startInstall() {
|
|||||||
ISO="$STORAGE/$CUSTOM"
|
ISO="$STORAGE/$CUSTOM"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f "$TMP/$BASE"
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -445,6 +445,9 @@ downloadImage() {
|
|||||||
|
|
||||||
info "Failed to download $desc using Mido, will try a different method now..."
|
info "Failed to download $desc using Mido, will try a different method now..."
|
||||||
|
|
||||||
|
rm -rf "$TMP"
|
||||||
|
mkdir -p "$TMP"
|
||||||
|
|
||||||
ISO="$TMP/$VERSION.esd"
|
ISO="$TMP/$VERSION.esd"
|
||||||
iso="$ISO"
|
iso="$ISO"
|
||||||
file="$ISO"
|
file="$ISO"
|
||||||
@@ -573,6 +576,7 @@ extractImage() {
|
|||||||
|
|
||||||
if [[ "${iso,,}" == *".esd" ]]; then
|
if [[ "${iso,,}" == *".esd" ]]; then
|
||||||
if ! extractESD "$iso" "$dir"; then
|
if ! extractESD "$iso" "$dir"; then
|
||||||
|
rm -f "$iso"
|
||||||
error "Failed to extract ESD file!"
|
error "Failed to extract ESD file!"
|
||||||
exit 67
|
exit 67
|
||||||
fi
|
fi
|
||||||
@@ -604,6 +608,7 @@ extractImage() {
|
|||||||
rm -rf "$dir"
|
rm -rf "$dir"
|
||||||
|
|
||||||
if ! 7z x "$iso" -o"$dir" > /dev/null; then
|
if ! 7z x "$iso" -o"$dir" > /dev/null; then
|
||||||
|
rm -f "$iso"
|
||||||
error "Failed to extract ISO file!"
|
error "Failed to extract ISO file!"
|
||||||
exit 66
|
exit 66
|
||||||
fi
|
fi
|
||||||
@@ -768,7 +773,7 @@ prepareXP() {
|
|||||||
|
|
||||||
find "$target" -maxdepth 1 -type f -iname winnt.sif -exec rm {} \;
|
find "$target" -maxdepth 1 -type f -iname winnt.sif -exec rm {} \;
|
||||||
|
|
||||||
{ echo "[Data]"
|
{ echo "[Data]"
|
||||||
echo "AutoPartition=1"
|
echo "AutoPartition=1"
|
||||||
echo "MsDosInitiated=\"0\""
|
echo "MsDosInitiated=\"0\""
|
||||||
echo "UnattendedInstall=\"Yes\""
|
echo "UnattendedInstall=\"Yes\""
|
||||||
@@ -811,10 +816,12 @@ prepareXP() {
|
|||||||
echo "[Networking]"
|
echo "[Networking]"
|
||||||
echo "InstallDefaultComponents=Yes"
|
echo "InstallDefaultComponents=Yes"
|
||||||
echo ""
|
echo ""
|
||||||
|
echo "[Branding]"
|
||||||
|
echo "BrandIEUsingUnattended=Yes"
|
||||||
|
echo ""
|
||||||
echo "[URL]"
|
echo "[URL]"
|
||||||
echo "Home_Page = http://www.google.com"
|
echo "Home_Page = http://www.google.com"
|
||||||
echo "Search_Page = http://www.google.com/ie_rsearch.html"
|
echo "Search_Page = http://www.google.com"
|
||||||
echo "AutoConfig = 0"
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "[RegionalSettings]"
|
echo "[RegionalSettings]"
|
||||||
echo "Language=00000409"
|
echo "Language=00000409"
|
||||||
@@ -823,6 +830,57 @@ prepareXP() {
|
|||||||
echo "AllowConnections=1"
|
echo "AllowConnections=1"
|
||||||
} | unix2dos > "$target/WINNT.SIF"
|
} | unix2dos > "$target/WINNT.SIF"
|
||||||
|
|
||||||
|
{ echo "Windows Registry Editor Version 5.00"
|
||||||
|
echo ""
|
||||||
|
echo "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security]"
|
||||||
|
echo "\"FirstRunDisabled\"=dword:00000001"
|
||||||
|
echo "\"AntiVirusOverride\"=dword:00000001"
|
||||||
|
echo "\"FirewallOverride\"=dword:00000001"
|
||||||
|
echo "\"FirewallDisableNotify\"=dword:00000001"
|
||||||
|
echo "\"UpdatesDisableNotify\"=dword:00000001"
|
||||||
|
echo "\"AntiVirusDisableNotify\"=dword:00000001"
|
||||||
|
echo ""
|
||||||
|
echo "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wscsvc]"
|
||||||
|
echo "\"Start\"=dword:00000004"
|
||||||
|
echo ""
|
||||||
|
echo "[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\WindowsFirewall\StandardProfile]"
|
||||||
|
echo "\"EnableFirewall\"=dword:00000000"
|
||||||
|
echo ""
|
||||||
|
echo "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess]"
|
||||||
|
echo "\"Start\"=dword:00000004"
|
||||||
|
echo
|
||||||
|
echo "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List]"
|
||||||
|
echo "\"3389:TCP\"=\"3389:TCP:*:Enabled:@xpsp2res.dll,-22009\""
|
||||||
|
echo ""
|
||||||
|
echo "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]"
|
||||||
|
echo "\"LimitBlankPasswordUse\"=dword:00000000"
|
||||||
|
echo ""
|
||||||
|
echo "[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Tour]"
|
||||||
|
echo "\"RunCount\"=dword:00000000"
|
||||||
|
echo ""
|
||||||
|
echo "[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]"
|
||||||
|
echo "\"HideFileExt\"=dword:00000000"
|
||||||
|
echo ""
|
||||||
|
echo "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]"
|
||||||
|
echo "\"DefaultUserName\"=\"Docker\""
|
||||||
|
echo "\"DefaultDomainName\"=\"Dockur\""
|
||||||
|
echo "\"AltDefaultUserName\"=\"Docker\""
|
||||||
|
echo "\"AltDefaultDomainName\"=\"Dockur\""
|
||||||
|
echo "\"AutoAdminLogon\"=\"1\""
|
||||||
|
} | unix2dos > "$dir/\$OEM\$/install.reg"
|
||||||
|
|
||||||
|
{ echo "Set WshShell = WScript.CreateObject(\"WScript.Shell\")"
|
||||||
|
echo "Set WshNetwork = WScript.CreateObject(\"WScript.Network\")"
|
||||||
|
echo "Set oMachine = GetObject(\"WinNT://\" & WshNetwork.ComputerName)"
|
||||||
|
echo "Set oInfoUser = GetObject(\"WinNT://\" & WshNetwork.ComputerName & \"/Administrator,user\")"
|
||||||
|
echo "Set oUser = oMachine.MoveHere(oInfoUser.ADsPath,\"Docker\")"
|
||||||
|
} | unix2dos > "$dir/\$OEM\$/admin.vbs"
|
||||||
|
|
||||||
|
{ echo "[COMMANDS]"
|
||||||
|
echo "\"REGEDIT /s install.reg\""
|
||||||
|
echo "\"Wscript admin.vbs\""
|
||||||
|
} | unix2dos > "$dir/\$OEM\$/cmdlines.txt"
|
||||||
|
|
||||||
rm -rf "$drivers"
|
rm -rf "$drivers"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@@ -854,7 +912,7 @@ prepareImage() {
|
|||||||
local iso="$1"
|
local iso="$1"
|
||||||
local dir="$2"
|
local dir="$2"
|
||||||
|
|
||||||
if [[ "${BOOT_MODE,,}" == "windows" ]]; then
|
if [[ "${BOOT_MODE,,}" != "windows_legacy" ]]; then
|
||||||
if [[ "${DETECTED,,}" != "winxp"* ]] && [[ "${DETECTED,,}" != "win2008"* ]]; then
|
if [[ "${DETECTED,,}" != "winxp"* ]] && [[ "${DETECTED,,}" != "win2008"* ]]; then
|
||||||
if [[ "${DETECTED,,}" != "winvista"* ]] && [[ "${DETECTED,,}" != "win7"* ]]; then
|
if [[ "${DETECTED,,}" != "winvista"* ]] && [[ "${DETECTED,,}" != "win7"* ]]; then
|
||||||
|
|
||||||
|
|||||||
24
src/samba.sh
24
src/samba.sh
@@ -23,7 +23,7 @@ SAMBA="/etc/samba/smb.conf"
|
|||||||
echo " security = user"
|
echo " security = user"
|
||||||
echo " guest account = nobody"
|
echo " guest account = nobody"
|
||||||
echo " map to guest = Bad User"
|
echo " map to guest = Bad User"
|
||||||
echo " server min protocol = SMB2"
|
echo " server min protocol = NT1"
|
||||||
echo ""
|
echo ""
|
||||||
echo " # disable printing services"
|
echo " # disable printing services"
|
||||||
echo " load printers = no"
|
echo " load printers = no"
|
||||||
@@ -41,7 +41,7 @@ SAMBA="/etc/samba/smb.conf"
|
|||||||
echo " force group = root"
|
echo " force group = root"
|
||||||
} > "$SAMBA"
|
} > "$SAMBA"
|
||||||
|
|
||||||
{ echo "--------------------------------------------------------"
|
{ echo "--------------------------------------------------------"
|
||||||
echo " $APP for Docker v$(</run/version)..."
|
echo " $APP for Docker v$(</run/version)..."
|
||||||
echo " For support visit $SUPPORT"
|
echo " For support visit $SUPPORT"
|
||||||
echo "--------------------------------------------------------"
|
echo "--------------------------------------------------------"
|
||||||
@@ -61,7 +61,23 @@ SAMBA="/etc/samba/smb.conf"
|
|||||||
echo ""
|
echo ""
|
||||||
} | unix2dos > "$SHARE/readme.txt"
|
} | unix2dos > "$SHARE/readme.txt"
|
||||||
|
|
||||||
smbd -D
|
! smbd && smbd --debug-stdout
|
||||||
wsdd -i dockerbridge -p -n "host.lan" &
|
|
||||||
|
isXP="N"
|
||||||
|
|
||||||
|
if [ -f "$STORAGE/windows.old" ]; then
|
||||||
|
MT=$(<"$STORAGE/windows.old")
|
||||||
|
if [[ "${MT,,}" == "pc-q35-2"* ]]; then
|
||||||
|
isXP="Y"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$isXP" == [Yy1]* ]]; then
|
||||||
|
# Enable NetBIOS on Windows XP
|
||||||
|
! nmbd && nmbd --debug-stdout
|
||||||
|
else
|
||||||
|
# Enable Web Service Discovery
|
||||||
|
wsdd -i dockerbridge -p -n "host.lan" &
|
||||||
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
Reference in New Issue
Block a user