SSH to Debian Guest from Windows host via Putty

Discussions related to using VirtualBox on Windows hosts.
munder
Posts: 11
Joined: 16. May 2013, 19:18

SSH to Debian Guest from Windows host via Putty

Post by munder »

I have read the forum rules and read some the posts, my problem is very specific so that is why I am having to post.

Summary of problem

I cant SSH into the Debian guest on my Windows 7 host.

Background

I have installed Virtual Box on my Windows 7 OS with Debian as the guest. I have followed this tutorial up until the SSH part.

I have two adaptors, the first is NAT which works fine as the Debian guest can connect to the internet okay. The second is a Host only adaptor. I have filled in the interfaces file on Debian with exactly the same details as displayed in the tutorial.



I have also set up the hosts file on Windows 7 exactly how they say on the tutorial.


I have installed set up SSH on Debian and its listening

Potential problems

- The network page in the Virtual Box preferences flags a error "host IPv4 network mask of Virtualbox Host Only Network Ethernet Adaptor is wrong"
- I can talk to the Windows host from the Debian box but cannot talk to the Debian box from the Windows host.
- It times out when SSH to the Debian box via Putty using either the IP address of name used in the Windows host file.
- When doing a ipconfig on Windows host it displays

Wireless LAN adapter Wireless Network Connection:


Tunnel adapter isatap.cable.virginmedia.***:


Tunnel adapter Teredo Tunneling Pseudo-Interface:


This is much different then a article I read

I want to SSH into my Debian virtual machine via Putty. Can anyone please help? Lots of the information that I wanted to post to backup my point is seen as URLs and since im a first member I need to make a first post. If its possible I can provide more details such as ipconfig details, hosts file, netstat details and interfaces details.
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: SSH to Debian Guest from Windows host via Putty

Post by noteirak »

Run the following on the host :

Code: Select all

ipconfig /all
route print
arp -a
netstat -an | find "LISTENING"
netsh advfirewall show allprofiles
Run the following in the guest :

Code: Select all

sudo ifconfig -a
sudo route
sudo arp
sudo netstat -lnp
sudo iptables -L -n -v
Post as attached zip the output of those two.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
munder
Posts: 11
Joined: 16. May 2013, 19:18

Re: SSH to Debian Guest from Windows host via Putty

Post by munder »

I have attached the Host and Guest information according to the commands you told me to run. Hope that is all okay.
Attachments
Host-Guest-Config-Details.zip
Config details from the Windows 7 host and Debian guest
(3.83 KiB) Downloaded 389 times
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: SSH to Debian Guest from Windows host via Putty

Post by noteirak »

Your host does not show a host-only interface using the 192.168.56.x range, could you show the output of the following command ran from the install directory of Virtualbox :

Code: Select all

vboxmanage list hostonlyifs
and the following command by replacing VmName by your actual VM name :

Code: Select all

vboxmanage showvminfo VmName --details
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
munder
Posts: 11
Joined: 16. May 2013, 19:18

Re: SSH to Debian Guest from Windows host via Putty

Post by munder »

I have attached the results again from what you told me to run.
Attachments
Results.txt
The results from the list host only ifs and showvminfo --details
(4.28 KiB) Downloaded 320 times
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: SSH to Debian Guest from Windows host via Putty

Post by noteirak »

Two issues :

1. Your Host-Only interface doesn't seem to be enabled or working. Make sure it is enabled.
2. You need to tick the checkbox for "Cable Connected" on the host-only interface of your VM.

Right now, nothing is up or connected, so you would obviously have a really hard time to have anything working.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
munder
Posts: 11
Joined: 16. May 2013, 19:18

Re: SSH to Debian Guest from Windows host via Putty

Post by munder »

I have done those steps you said to take. I am trying to SSH via Putty using a hostname of Debian and 192.168.56.101 on port 22. It times out still, do I need to resend some details now that I have made those changes? The only changes I had to make was step 2, The host only network adaptor was already enabled.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: SSH to Debian Guest from Windows host via Putty

Post by Perryg »

In the VirtualBox main manager go to file -> preferences -> network and compare the settings below.
host-only-1.png
host-only-1.png (25.24 KiB) Viewed 11758 times
host-only-2.png
host-only-2.png (28.41 KiB) Viewed 11758 times
munder
Posts: 11
Joined: 16. May 2013, 19:18

Re: SSH to Debian Guest from Windows host via Putty

Post by munder »

Tried that, still no luck, It still flags saying the host IPv4 network mask is wrong host only adaptor is wrong.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: SSH to Debian Guest from Windows host via Putty

Post by Perryg »

Those are the default settings and what you should use. If the guest is unhappy with that you need to show why and not just say the guest is not happy.

Post the results of ifconfig -a from the guests terminal & /etc/udev/rules.d/70-persistent-net.rules .
munder
Posts: 11
Joined: 16. May 2013, 19:18

Re: SSH to Debian Guest from Windows host via Putty

Post by munder »

I have attached the results of the ifconfig you asked for. As for the /etc/udev/rules.d/70-persistent-net.rules there is only a 70-persistent-cd.rules in that directory. You will have to excuse me as I do not know virtrualisation and networking that well so its hard for me to know why some things are not working.
Attachments
details from ifconfig.zip
Details from the ifconfig as requested
(644 Bytes) Downloaded 127 times
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: SSH to Debian Guest from Windows host via Putty

Post by Perryg »

Code: Select all

eth0      Link encap:Ethernet  HWaddr 08:00:27:84:ae:f3  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe84:aef3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:15 errors:0 dropped:0 overruns:0 frame:0
          TX packets:83 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2390 (2.3 KiB)  TX bytes:10842 (10.5 KiB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:29:5e:ef  
          inet addr:192.168.56.101  Bcast:192.168.56.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe29:5eef/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:9322 (9.1 KiB)
OK so you have NAT and you have a valid host-only address from the Host-only DHCP server. Can you ping the 192.168.56.101 from the host?
You said " It still flags saying the host IPv4 network mask is wrong host only adaptor is wrong.", exactly what flags this?
munder
Posts: 11
Joined: 16. May 2013, 19:18

Re: SSH to Debian Guest from Windows host via Putty

Post by munder »

I pinged 192.168.56.101

Code: Select all

C:\Users\Matt>ping 192.168.56.101

Pinging 192.168.56.101 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 192.168.56.101:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
You said " It still flags saying the host IPv4 network mask is wrong host only adaptor is wrong.", exactly what flags this?
I have attached a picture which should explain it,there is a message box that comes up with the warning message, also it kept the DHCP details in but reset the Adaptor settings. I do not know what flags the message.
Attachments
Host-only-network-settings.zip
Adaptor settings
(45.32 KiB) Downloaded 140 times
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: SSH to Debian Guest from Windows host via Putty

Post by Perryg »

munder wrote:I pinged 192.168.56.101

Code: Select all

C:\Users\Matt>ping 192.168.56.101

Pinging 192.168.56.101 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 192.168.56.101:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
You said " It still flags saying the host IPv4 network mask is wrong host only adaptor is wrong.", exactly what flags this?
I have attached a picture which should explain it,there is a message box that comes up with the warning message, also it kept the DHCP details in but reset the Adaptor settings. I do not know what flags the message.
Well the picture shows that you have not set the address or netmask line in the example I sent.
Make sure they match and in the rare case that VirtualBox does not save the entries. Delete the adapter and create it again with the proper information
IP = 192.168.56.1
Mask = 255.255.255.0
munder
Posts: 11
Joined: 16. May 2013, 19:18

Re: SSH to Debian Guest from Windows host via Putty

Post by munder »

I put in the details twice making sure they match. I have created the host only network adaptor from scratch to make sure I am following the correct steps. It still says that the network mask is incorrect and wont save the Adaptor details. One thing I noted is that when filling in the Adaptor settings, the field IPv6 network mask length is disabled so it won't let me put a 0 in it.
Post Reply