Support Questions

Find answers, ask questions, and share your expertise

Can't connect to Sandbox via WinSCP

avatar
New Contributor

Hi,

New user here looking for some help trying to connect WinSCP to the sandbox.

My sandbox (2.4) on VirtualBox (running on Win10) seems to have installed fine (I can enter commands in the VM and bring up the Ambari page).

So far I haven't been able to transfer a file between my local machine and the sandbox though. I'm trying to do it via WinSCP (I've added 127.0.0.1 sandbox.hortonworks.com to my local machine's C:\Windows\... drivers\etc\hosts file).

In WinSCP I choose 'SCP' as file protocol, enter 'sandbox.hortonworks.com' as the host name, port number '22', user name 'root' and then the password - the error I get is "Network error: Connection to 'sandbox.hortonworks.com' refused".

From the local machine command prompt I can successfully ping sandbox.hortonworks.com but ftp'ing from there also gives a connection refused error.

From other threads on here I thought I may have a firewall issue but I don't think it's that... I checked that port 22 appears to be listening on the VM too (via sudo netstat -anp | grep sshd).

Any suggestions as to why I get the connection refused error?

1 ACCEPTED SOLUTION

avatar
Super Guru

@Neil Morin

Can you check the Virtualbox network rules to see if port forwarding is properly setup? If you ssh/scp to 127.0.0.1 on port 22, that defaults to your local computer. If port forwarding is not setup to forward that port to the VM, then you will get a connection refused.

Network -> Advanced dropdown -> Port Forwarding

11054-screen-shot-2017-01-03-at-10405-pm.png

View solution in original post

5 REPLIES 5

avatar
Super Guru

@Neil Morin

Can you check the Virtualbox network rules to see if port forwarding is properly setup? If you ssh/scp to 127.0.0.1 on port 22, that defaults to your local computer. If port forwarding is not setup to forward that port to the VM, then you will get a connection refused.

Network -> Advanced dropdown -> Port Forwarding

11054-screen-shot-2017-01-03-at-10405-pm.png

avatar
New Contributor

@Michael Young

Hi Michael, thanks for your quick response; the port forwarding for ssh is set as host 2222 / guest 22.

Long time since I've done any work with port numbers but I'm guessing that's not correct?

avatar
Super Guru

@Neil Morin

No, that is correct. So you need to connect with WinSCP using port 2222. Virtualbox will forward that port to 22 on the VM.

avatar
New Contributor

@Michael Young

Ah, perfect! Works now, many thanks!

avatar
Super Guru

@Neil Morin

Excellent, good to hear. Please accept my answer to help others.