Trying to setup debian vm and ssh into it

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
Tigerhawk247
Posts: 3
Joined: 8. Feb 2014, 19:22

Trying to setup debian vm and ssh into it

Post by Tigerhawk247 »

Hi All,

I was interested in learning more about linux commands and started following the "learn linux the hard way" (can't post urls yet).

It was written with a pc in mind, but I've gotten virtualbox setup, along with putty installed on my mac (running 10.9.1). I can't get past the steps to SSH into the virtual machine when I connect with localhost.

I've tried just using the NAT with port forwarding. I've also tried using 2 adapters. The first is the NAT, and I've made sure port forwarding is turned on for tcp from host port 22 to guest port 22. The 2nd I've tried using as Host-only Adapter, with the default vboxnet0 that gets created under the general virtualbox preferences.

When I launch the vm, and use "ls /sys/class/net" I see eth0 eth1 lo, all listed. If i try and edit /etc/network/interfaces I have the following:

Code: Select all

# The loopback network interface
auto lo
iface lo inet loopback

#The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
I've tried adding the following line to see if it helps:

Code: Select all

allow-hotplug eth1
iface eth1 inet dhcp
If i use /sbin/ifconfig I only get an ip for eth0 and lo. eth1 doesn't have an inet address.

When I try to use putty and connect to localhost it says wrong username/password because I don't think the forward is working.

Any help would be appreciated!

~T
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Trying to setup debian vm and ssh into it

Post by noteirak »

Your questions are aimed to Linux-based systems in general, which is not in scope of this forum.

Still, I can see two issues with your virtualbox config :
- In the port forwarding, you use port 22 on the host, but this port is most likely already in use! Try something else, like 46734
- Make sure the DHCP server of the Host-Only config is activated, else you won't get an IP address.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Tigerhawk247
Posts: 3
Joined: 8. Feb 2014, 19:22

Re: Trying to setup debian vm and ssh into it

Post by Tigerhawk247 »

That did it!

Thanks so much!
Post Reply