[Solved] cannot ssh into virtual machine

Discussions related to using VirtualBox on Linux hosts.
Post Reply
rdozijn
Posts: 4
Joined: 2. Jul 2009, 16:03
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: win7, ubuntu, debian

[Solved] cannot ssh into virtual machine

Post by rdozijn »

I cannot ssh to my virtualbox client machine with debian stretch OS. It is configured in the same way as many other virtual box clients which do not have this problem.
I hope you can help me figure out what exactly is the problem.

On the virtualbox
* I have openssh-server installed and running. I can ssh to the host and to localhost without problem
* sudo nmap -p 20-2550 localhost gives me

Code: Select all

Starting Nmap 7.40 ( ...  ) at 2018-01-03 10:38 CET
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000021s latency).
Other addresses for localhost (not scanned): ::1
Not shown: 2530 closed ports
PORT   STATE SERVICE
22/tcp open  ssh
which seems OK

On the host
* I can ping to the virtualbox machine
* a ssh connection takes long time before it gives the message 'ssh: connect to host IP port 22: no route to host'

As I mentioned, there are other virtual machines that do not have this problem. The only thing that is different, and what I do not understand completely is the adapter.
In the virtualbox menu, in the configuration of the bridged adapter, I have three adapter names to choose from: eth0, eth1 and docker0.
When I look at my adapters on the client, only the docker0 adpater is mentioned. The adapter that has the IP of the machine has an unusual name (and this is different on my other clients): its name is enp0s3. I have tried both eth0 and eth1, but they have the same problem.

I hope I have given enough information to explain my problem. If not, let me know so that I can provide missing info.

thanks for helping me, Ruud
Last edited by socratis on 4. Jan 2018, 16:28, edited 1 time in total.
Reason: Marked as [Solved].
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: cannot ssh into virtual machine

Post by socratis »

Docker is a program that relies on VirtualBox but modifies its configuration files in unknown ways to us. It is not supported on these VirtualBox user forums, they have their own Docker support channels. If you are having this problem with a standalone version of VirtualBox, then we can continue this discussion.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
rdozijn
Posts: 4
Joined: 2. Jul 2009, 16:03
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: win7, ubuntu, debian

Re: cannot ssh into virtual machine

Post by rdozijn »

Are you sure this is docker related? I have had docker installed, but I don't use it now; the docker service is not running. What can docker have changed that can explain this behaviour?

I can try deinstalling docker in a clone to see if that helps.

Thanks, Ruud
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: cannot ssh into virtual machine

Post by socratis »

rdozijn wrote:I have three adapter names to choose from: eth0, eth1 and docker0.
rdozijn wrote:When I look at my adapters on the client, only the docker0 adpater is mentioned.
rdozijn wrote:The adapter that has the IP of the machine has an unusual name
rdozijn wrote:Are you sure this is docker related?
From your description, I cannot rule it out. It seems suspicious...
rdozijn wrote:What can docker have changed that can explain this behaviour?
As I said, you'd have to ask them. I really don't have a clue, I don't use docker. If you re-install your host OS without any Docker installation and you have that problem with VirtualBox standalone, yes, we could continue this. But I honestly don't have a clue what their installation does or doesn't do to a host. As I already said, you'd have to ask them how exactly they modify the host OS.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
rdozijn
Posts: 4
Joined: 2. Jul 2009, 16:03
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: win7, ubuntu, debian

Re: cannot ssh into virtual machine

Post by rdozijn »

Both the host and the client have a docker installation. I removed it from the host, but I don't think docker on the host has anything to do with this, since all my other virtualboxes work fine with ssh.

thanks, Ruud
rdozijn
Posts: 4
Joined: 2. Jul 2009, 16:03
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: win7, ubuntu, debian

Re: cannot ssh into virtual machine

Post by rdozijn »

Got it. The guest was running a firewall, ufw, and apparently this was blocking all traffic. Disabling the firewall with /usr/sbin/ufw disable fixed my problem.
So this problem was neither virtualbox nor docker related.

Time to read more on firewall configuration.... ;)

thanks for your time, Ruud
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: cannot ssh into virtual machine

Post by socratis »

Great, thanks for the feedback. Marking as [Solved].
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply