RDP Custom Port Inaccessible
Operating system
Ubuntu 24.04.2 LTS
Description
I first tried the default docker-compose from this repository with the default port 3389, and it worked as expected. However, when I tried using a custom port (e.g., 3340), it seems rdp reject incoming connection.
Starting Nmap 7.97 ( https://nmap.org ) at 2025-06-07 12:14 +0700 Nmap scan report for 149.5.247.53 Host is up (0.26s latency).
PORT STATE SERVICE 3340/tcp filtered anet-m
Nmap done: 1 IP address (1 host up) scanned in 7.80 seconds
Docker compose
services:
windows:
image: dockurr/windows
container_name: windows
environment:
VERSION: "10e"
RAM_SIZE: "12G"
CPU_CORES: "6"
DISK_SIZE: "200G"
USERNAME: "admin"
PASSWORD: "1234567890"
volumes:
- /var/win:/storage
devices:
- /dev/kvm
cap_add:
- NET_ADMIN
ports:
- 8006:8006
- 3340:3340/tcp
- 3340:3340/udp
stop_grace_period: 2m
Docker Logs
❯ Starting Windows for Docker v4.35...
❯ For support visit https://github.com/dockur/windows
❯ CPU: Intel Xeon E5 2697 v2 | RAM: 15/16 GB | DISK: 480 GB (ext4) | KERNEL: 6.8.0-60...
❯ Requesting Windows 10 from the Microsoft servers...
Parsing download page: https://www.microsoft.com/en-us/evalcenter/download-windows-10-enterprise
Getting download link..
Found download link: https://go.microsoft.com/fwlink/p/?LinkID=2208844&clcid=0x409&culture=en-us&country=US
❯ Downloading Windows 10...
0K ........ ........ ........ ........ 0% 104M 51s
5373952K ........ ........ ........ ........ 99% 112M 0s
5406720K ........ ..... 100% 112M=51s
❯ Extracting Windows 10 image...
❯ Adding drivers to image...
❯ Adding win10x64-enterprise-eval.xml for automatic installation...
❯ Building Windows 10 image...
❯ Creating a 200 GB growable disk image in raw format...
❯ Host: e622e70f6cd9 IP: 172.18.0.2 Gateway: 172.18.0.1 Interface: eth0 MAC: 02:BE:B4:4B:72:F4 MTU: 1500
❯ Nameservers: 127.0.0.11
❯ Nested KVM virtualization detected..
Arguments:
-nodefaults
-cpu host,kvm=on,l3-cache=on,+hypervisor,migratable=no,-vmx,hv_passthrough
-smp 6,sockets=1,dies=1,cores=6,threads=1
-m 12G
-machine type=q35,smm=off,graphics=off,vmport=off,dump-guest-core=off,hpet=off,accel=kvm
-enable-kvm
-global kvm-pit.lost_tick_policy=discard
-display vnc=:0,websocket=5700
-vga virtio
-monitor telnet:localhost:7100,server,nowait,nodelay
-daemonize
-D /run/shm/qemu.log
-pidfile /run/shm/qemu.pid
-name windows,process=windows,debug-threads=on
-serial pty
-device qemu-xhci,id=xhci,p2=7,p3=7
-device usb-tablet
-netdev tap,id=hostnet0,ifname=qemu,script=no,downscript=no
-device virtio-net-pci,id=net0,netdev=hostnet0,romfile=,mac=02:BE:B4:4B:72:F4
-drive file=/storage/win10x64-enterprise-eval.iso,id=cdrom9,format=raw,cache=unsafe,readonly=on,media=cdrom,if=none
-device ich9-ahci,id=ahci9,addr=0x5
-device ide-cd,drive=cdrom9,bus=ahci9.0,bootindex=9
-drive file=/storage/data.img,id=data3,format=raw,cache=none,aio=native,discard=on,detect-zeroes=on,if=none
-device virtio-scsi-pci,id=data3b,bus=pcie.0,addr=0xa,iothread=io2
-device scsi-hd,drive=data3,bus=data3b.0,channel=0,scsi-id=0,lun=0,rotation_rate=1,bootindex=3
-object iothread,id=io2
-rtc base=localtime
-global ICH9-LPC.disable_s3=1
-global ICH9-LPC.disable_s4=1
-drive file=/storage/windows.rom,if=pflash,unit=0,format=raw,readonly=on
-drive file=/storage/windows.vars,if=pflash,unit=1,format=raw
-object rng-random,id=objrng0,filename=/dev/urandom
-device virtio-rng-pci,rng=objrng0,id=rng0,bus=pcie.0
❯ Booting Windows using QEMU v10.0.0...
BdsDxe: skipped Boot0002 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0xA,0x0)/Scsi(0x0,0x0)
BdsDxe: loading Boot0001 "UEFI QEMU DVD-ROM QM00013 " from PciRoot(0x0)/Pci(0x5,0x0)/Sata(0x0,0xFFFF,0x0)
BdsDxe: starting Boot0001 "UEFI QEMU DVD-ROM QM00013 " from PciRoot(0x0)/Pci(0x5,0x0)/Sata(0x0,0xFFFF,0x0)
❯ Windows started succesfully, visit http://127.0.0.1:8006/ to view the screen...
BdsDxe: loading Boot0004 "Windows Boot Manager" from HD(1,GPT,DD14AFD1-8CB3-455E-A067-EF959D913800,0x800,0x40000)/\EFI\Microsoft\Boot\bootmgfw.efi
BdsDxe: starting Boot0004 "Windows Boot Manager" from HD(1,GPT,DD14AFD1-8CB3-455E-A067-EF959D913800,0x800,0x40000)/\EFI\Microsoft\Boot\bootmgfw.efi
BdsDxe: loading Boot0004 "Windows Boot Manager" from HD(1,GPT,DD14AFD1-8CB3-455E-A067-EF959D913800,0x800,0x40000)/\EFI\Microsoft\Boot\bootmgfw.efi
BdsDxe: starting Boot0004 "Windows Boot Manager" from HD(1,GPT,DD14AFD1-8CB3-455E-A067-EF959D913800,0x800,0x40000)/\EFI\Microsoft\Boot\bootmgfw.efi
Screenshots (optional)
U should change port in windows
And u docker command wrong should be 3340:3389
And u docker command wrong should be 3340:3389
So basically, I can only create 1 Windows instance on 1 VPS/IP?
No... You should forward different external ports to the same internal port (3389), just like @kmille36 was saying. Then you can have as many instances as you want.