Connecting to a Remote Docker - (Docker CLI in Hostmachine WIndows10); Daemon in VirtualBox Ubuntu VM

I have installed VirtualBox and installed Ubuntu server version in VirtualBox VM. My host machine is Windows 10.

I have also installed Docker in my host Windows box. My intention is to use the docker CLI in Windows to connect to docker daemon (server) inside the VM.

I have made the changes in the Ubuntu VM and it is listening at port 2375.

tcp        0      0*                LISTEN 2305/dockerd

Also I have set the environment variable DOCKER_HOST in my host(Windows) to the VM machine IP and port.

 set DOCKER_HOST=tcp://

My Windows machine IP is and the ping is working fine.

Pinging with 32 bytes of data:
Reply from bytes=32 time<1ms TTL=64
Reply from bytes=32 time<1ms TTL=64

But when I try to connect from my Windows machine, it gives the following error:

error during connect: Get dial tcp connectex: No connection could be made because the target machine actively refused it.

Please find docker info output:

controller@ubuntuserver:~$ docker info
Containers: 4
 Running: 0
 Paused: 0
 Stopped: 4
Images: 2
Server Version: 18.09.6
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: bb71b10fd8f58240ca47fbb579b9d1028eea7c84
runc version: 2b18fe1d885ee5083ef9f0838fee39b62d653e30
init version: fec3683
Security Options:
  Profile: default
Kernel Version: 4.15.0-50-generic
Operating System: Ubuntu 18.04.2 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 7.79GiB
Name: ubuntuserver
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Experimental: false
Insecure Registries:
Live Restore Enabled: false
Product License: Community Engine

WARNING: API is accessible on without encryption.
         Access to the remote API is equivalent to root access on the host. Refer
         to the 'Docker daemon attack surface' section in the documentation for
         more information:
WARNING: No swap limit support
 cat /lib/systemd/system/docker.service
Description=Docker Application Container Engine
BindsTo=containerd.service firewalld.service containerd.service

# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H fd:// -H tcp:// --containerd=/run/containerd/containerd.sock
ExecReload=/bin/kill -s HUP $MAINPID

# Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229.
# Both the old, and new location are accepted by systemd 229 and up, so using the old location
# to make them work for either version of systemd.

# Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230.
# Both the old, and new name are accepted by systemd 230 and up, so using the old name to make
# this option work for either version of systemd.

# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.

# Comment TasksMax if your systemd version does not supports it.
# Only systemd 226 and above support this option.

# set delegate yes so that systemd does not reset the cgroups of docker containers

# kill only the docker process, not all processes in the cgroup


Can you please help me to resolve this?

What is the reason that you don’t use Docker Desktop? It runs its own VM in Hyper-V and they have probably solved 99 % of the problems that could arise around Windows.

I already tried that - but had issues in mounting volumes using Docker desktop in WIndows. Moreover, I require Linux VM for running other applications in my desktop to test. So I thought I would run docker inside the available Linux VM. Then faced this network issue (it says the connection was able to get through, but the server refused it).

Please see the following link for the details I tried:

Then the easiest is to solve this issues. Volume mounts work fine with Desktop when it is configured properly and Desktop is in any case the best choice if it runs on your OS.
What you try is to develop from scratch something similar to Docker Toolbox that was used on older Windows versions. It will not work. As a reference, take a look at their Github repo.

What about WSL?

Look at this