How to ssh into a VM inside a windows hosting machine

I have a VirtualBox VM (ubuntu 14.04) hosted inside a windows machine.  I want to ssh into the VM from an outside computer.  I have the hosting window's firewall open up for port 22, but still got permission denied.  I also have port forwarding set up for my VM for port 22.  Can someone tell me what I am doing wrong?  Thanks.
LVL 1
mmingfeilamAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Seth SimmonsSr. Systems AdministratorCommented:
you need to connect to the host name/ip address of the ubuntu guest, not the windows host
also make sure ssh is running on the guest (service ssh start)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mmingfeilamAuthor Commented:
Typing ifconfig returns an address of 10.0.2.15, and internal address.  Also I see 127.0.0.1.  I can't use either of these addresses.  I was, however, able to connect from the host to the VM using 127.0.1.1 with port 3022, which I had opened up previously with settings change in VirtualBox.
0
mmingfeilamAuthor Commented:
Also the the VM, I have NAT, internal network, and host-only adapter set up. For NAT, I have port forwarding set for TCP, host port 3022 and guest port 22.
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

rindiCommented:
What Hypervisor are you using? You must setup your VM to use bridged networking in order for it to get visible to the rest of the LAN. NAT and host only mode will make it invisible to the rest of the LAN.
0
mmingfeilamAuthor Commented:
I am using virtualbox, a type 2 hypervisor. I also have a bridge network setup along with a NAT and internal network.  But when I ssh or putty into the ip I got from the bridge network, it just hangs there. Do I need to create dhcp server?  The company's network already has dhcp.  Also the host machine, a windows server, can access other internal machines but no Internet access.
0
rindiCommented:
No, when using a bridged NIC, your main DHCP server gives the VM an IP. First check that the IP you are trying to use is the correct one of your VM on the bridged adapter. Also, on some OS's you may have to check the /etc/ssh/sshd configuration files that the correct NIC is being used, and you of course also have to install SSH within the VM, not all Distro's have it installed by default, and the service has to be started.

If after that you can't connect, make sure you have deleted any saved keys which may be referencing old connections on the PC you are trying to connect with.
0
mmingfeilamAuthor Commented:
I think it's the correct ip because that's the only one I see with ifconfig.  The VM is Ubuntu 14.04, how do you know if NIC is correct?
0
rindiCommented:
in the sshd_config file you would set the ListenAddress to the IP of the NIC you want to use. But if there is only one address then that shouldn't be necessary.
1
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SSH / Telnet Software

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.