How should i connect my docker desktop to docker-machine in swarm?

I have been learning about docker swarm and machine. To create a swarm whether you need docker-machines or other virtual machines which are running docker.
I have been trying to connect my docker-machines as workers to the docker on my desktop which is a manager. But every time it shows error.
It gets listed in “docker node ls” but showed as “down” in status column.
I also tried vice-versa but the same happened.
Anyone having idea about this please help!!!??