1

I have created a virtual machine in virtual box with host only network. I am able to ping to the virtual machine but when i try to ssh into the same machine it reject my request with following error

ssh: connect to host 192.168.1.56 port 22: No route to host

I am able to ssh within the virtual machine.

ifconfig result on host machine :

vboxnet0 Link encap:Ethernet HWaddr 0a:00:27:00:00:00
         inet addr:192.168.56.1 Bcast:192.168.56.255 Mask:255.255.255.0
         inet6 addr: fe80::800:27ff:fe00:0/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:146 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:0 (0.0 B)
         TX bytes:17432 (17.4 KB)

and ifconfig within virtual machine just shows the loopback information .

1
  • 1
    Don't remove newlines and spaces when you copy-paste the output of a command, it makes it unreadable. – Gilles 'SO- stop being evil' Apr 28 '15 at 21:46
2

Normally the vboxnet0 device has address 192.168.56.1. This also shows in your config. Your ssh statement point to another address where '56' and '1' are exchanged. Your ping command probably just pings the hosts vboxnet0 device and since you only have a loopback device in your guest machine I suppose that you did not configure networking within the guest.

You might try to use ifconfig eth0 192.168.56.101/32 up (assuming that eth0 is your guests network interface name) within the guest operating system and try to ping ping 192.168.56.1 from the guest or ping 192.168.56.101 from the host. If that works, try to ssh using ssh 192.168.56.101 from the host.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.