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.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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)

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, and internal address.  Also I see  I can't use either of these addresses.  I was, however, able to connect from the host to the VM using with port 3022, which I had opened up previously with settings change in VirtualBox.
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.
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

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.
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.
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.
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?
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.
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.