Created on 01-03-2017 06:00 PM - edited 09-16-2022 03:52 AM
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?
Created on 01-03-2017 06:03 PM - edited 08-19-2019 04:29 AM
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
Created on 01-03-2017 06:03 PM - edited 08-19-2019 04:29 AM
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
Created 01-03-2017 06:25 PM
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?
Created 01-03-2017 06:26 PM
No, that is correct. So you need to connect with WinSCP using port 2222. Virtualbox will forward that port to 22 on the VM.
Created 01-03-2017 06:31 PM
Ah, perfect! Works now, many thanks!
Created 01-03-2017 06:38 PM
Excellent, good to hear. Please accept my answer to help others.