I have installed Docker desktop on my pc and would like to install kali-rolling docker container with xrdp enabled for remote desktop.
I followed this article https://techspan.org/setup-kali-linux-via-docker-for-rdp-xfce-remote-control/ after many failing attempts, I just changed to use docker host network rather than bridge, but it is still not working. Now I am getting below RDP error:
your computer could not connect to another console session on the remote computer because you already have a console session in progress
Container configurations
[
{
"Id": "91837562b4360ac29d87bf14739399c0ea238787f9f9bb3238d25fdb90185f53",
"Created": "2022-10-20T15:29:35.8471604Z",
"Path": "/bin/bash",
"Args": [],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 3059,
"ExitCode": 0,
"Error": "",
"StartedAt": "2022-10-20T15:29:36.6492677Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:0064f154f442d0c070a80a179e8e26dfeb2b79d28820eb27b9813288abff0edd",
"ResolvConfPath": "/var/lib/docker/containers/91837562b4360ac29d87bf14739399c0ea238787f9f9bb3238d25fdb90185f53/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/91837562b4360ac29d87bf14739399c0ea238787f9f9bb3238d25fdb90185f53/hostname",
"HostsPath": "/var/lib/docker/containers/91837562b4360ac29d87bf14739399c0ea238787f9f9bb3238d25fdb90185f53/hosts",
"LogPath": "/var/lib/docker/containers/91837562b4360ac29d87bf14739399c0ea238787f9f9bb3238d25fdb90185f53/91837562b4360ac29d87bf14739399c0ea238787f9f9bb3238d25fdb90185f53-json.log",
"Name": "/wonderful_colden",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": [
"a04c8f5bd439d0b56c6e16ca434926ddeaddeb502c777a9bf7bc06a1567bc734"
],
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "host",
"PortBindings": {},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"CgroupnsMode": "host",
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "private",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
19,
152
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": [],
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": [],
"DeviceCgroupRules": null,
"DeviceRequests": null,
"KernelMemory": 0,
"KernelMemoryTCP": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": null,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/asound",
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/77dc7e5aae9049d7b9aa64d809b121f23a6ae171cd69a6441f845be51eb91a89-init/diff:/var/lib/docker/overlay2/d4fdd6cf81fd87525dfb53b47d94b11241e37d8777f9602e29b8e47f7c896609/diff:/var/lib/docker/overlay2/4fd2eb612e54606436fbb581d3003eaef2299954ba24e8eae956fde40f11b32f/diff",
"MergedDir": "/var/lib/docker/overlay2/77dc7e5aae9049d7b9aa64d809b121f23a6ae171cd69a6441f845be51eb91a89/merged",
"UpperDir": "/var/lib/docker/overlay2/77dc7e5aae9049d7b9aa64d809b121f23a6ae171cd69a6441f845be51eb91a89/diff",
"WorkDir": "/var/lib/docker/overlay2/77dc7e5aae9049d7b9aa64d809b121f23a6ae171cd69a6441f845be51eb91a89/work"
},
"Name": "overlay2"
},
"Mounts": [],
"Config": {
"Hostname": "docker-desktop",
"Domainname": "",
"User": "",
"AttachStdin": true,
"AttachStdout": true,
"AttachStderr": true,
"ExposedPorts": {
"3389/tcp": {}
},
"Tty": true,
"OpenStdin": true,
"StdinOnce": true,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"/bin/bash"
],
"Image": "reverent_feistel2",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"io.buildah.version": "1.23.1",
"org.opencontainers.image.authors": "Kali Developers \[email protected]\u003e",
"org.opencontainers.image.created": "2022-10-16T04:17:03Z",
"org.opencontainers.image.description": "Official Kali Linux container image for kali-rolling",
"org.opencontainers.image.revision": "838d8f2b",
"org.opencontainers.image.source": "https://gitlab.com/kalilinux/build-scripts/kali-docker",
"org.opencontainers.image.title": "Kali Linux (kali-rolling branch)",
"org.opencontainers.image.url": "https://www.kali.org/",
"org.opencontainers.image.vendor": "Offensive Security",
"org.opencontainers.image.version": "2022.10.16"
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "48d954988bc2073924de29e8c5adb488608a4ba020ac0bd3f400a0f892e08804",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {},
"SandboxKey": "/var/run/docker/netns/default",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"host": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "a08c31ade3dcd139e4887e1ce76b48a93a08f47ecc677602d514cf15e1b2232d",
"EndpointID": "aa8de7035bf5c5d7d9bac1f4587b4c6a3c8d906550b7fff76b99fae32b094957",
"Gateway": "",
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "",
"DriverOpts": null
}
}
}
}
]
Netstat status
Docker:
└─# netstat -lntnup | grep 33
tcp 0 0 0.0.0.0:3389 0.0.0.0:* LISTEN -
tcp6 0 0 ::1:3350 :::* LISTEN 29/xrdp-sesman
Host:
PS C:\Users\username> netstat -ano |findstr ":33" TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING 1880
TCP [::]:3389 [::]:0 LISTENING 1880
UDP 0.0.0.0:3389 *:* 1880
UDP [::]:3389 *:* 1880
Host IPs:
PS C:\Users\username> ipconfig|findstr IPv4
IPv4 Address. . . . . . . . . . . : 10.2.2.149
IPv4 Address. . . . . . . . . . . : 192.168.5.18
Can anyone tell, why can I not RDP to my docker kali linux container?