How to tunnel to docker through VM using the winscp?

Advertisement

xyzo0
Joined:
Posts:
2

How to tunnel to docker through VM using the winscp?

I am running ubuntu 16.4 as a VM on my windows. I have installed a docker container on my VM with this command:
docker run -p 222:22 --name test -d urgi/docker_vre_aio 
ssh -p 222 centos@localhost
Now I would like to get access to my docker folders by WinSCP, I tried tunneling through VM
but it doesn't work, can anyone guide me on how to do it?

session.jpg

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
38,695
Location:
Prague, Czechia

Re: How to tunnel to docker through VM using the winscp?

If I understand it correctly, you can login directly using the ssh -p 222 centos@localhost. There's no tunneling involved.

So do the same in WinSCP. Connect directly to host localhost and port 222.

Reply with quote

xyzo0
Joined:
Posts:
2

it didn't work like that, my guess, because my VM is not running on my windows so it I can't connect through winscp using 'localhost' until I know my virtual machine's port.

so what I did was that I created a directory, one in docker container and one on my host machine and bound them together

docker run --name=test -d -v /media/volume/nyz:/home/centos/nyz  urgi/docker_vre_aio

now I can connect to my virtual machine through winscp and go in the nyz dir and have the same files as I have in the nyz dir in the container.

Reply with quote

Advertisement

You can post new topics in this forum