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:
41,442
Location:
Prague, Czechia

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

If I understand it correctly, you can login directly using:
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