Link to home
Start Free TrialLog in
Avatar of Michael Lam
Michael Lam

asked on

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.
ASKER CERTIFIED SOLUTION
Avatar of Seth Simmons
Seth Simmons
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Michael Lam
Michael Lam

ASKER

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.
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.
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.
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.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.