ssh connection problem caused by MAC-adress

Asked by Henrik Schlosser

Hi,
I have quite strange problem with Ubuntu 20.4 on VirtualBox.
At first I had network issues, meaning my VM couldn't connect wirelessly with the internet. Even with Network Bridge, the right adapter chosen (en0: WLAN), "allow all VMs" and Cable Connection approved, no internet connection could be made.
After I edited the MAC-adress of my VM, so it resembled the MAC-adress of the host, I was able to get an internet connection on my VM.
Everything worked flawlessly until I tried to connect the host with the VM via ssh.
Now, I always get the error message: "ssh connect to host (IP-adress) port22: no route to host".
When I ping the host device I get the error message: "Destination host unreachable".
On the internet I found a comment which says that using the same MAC-adresses on different devices can lead up to such a "no route to host" error.
Is there any other solution to get an internet connection or a functioning connection via ssh while using the same MAC-adresses?

Sorry for any incorrect formulations, but I am new to Ubuntu.
Best regards,
Henrik

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Does the VM get an IP from the router OK?

Revision history for this message
Henrik Schlosser (henrik2000) said :
#2

Yes, the VM gets an IP from the router.
I can ping whatever I want except the host device.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

What OS is the host running?
I suggest you post on the Virtualbox forum as well, it's closer to your issue

Revision history for this message
Henrik Schlosser (henrik2000) said :
#4

On macOS Monterey Version 12.0.1.
Thank you, I will try that too.

Revision history for this message
Henrik Schlosser (henrik2000) said :
#5

On macOS Monterey Version 12.0.1.
Thank you, I will try that too.

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

"Is there any other solution to get an internet connection or a functioning connection via ssh while using the same MAC-addresses?"

It seems to me that you are doing the wrong thing. MAC addresses should be unique, if they aren't, then you may run into all kinds of problems.

In my opinion the solution to your problem must be correcting the MAC address of the VM (i.e. giving it a different one) and changing the network setup of your VM installation that networking also operates for the VM. Then ssh-ing from the host into the VM should work.

I suggest that you read the documentation about Virtualbox networking and select the settings appropriate for your requirements.
e.g. https://www.virtualbox.org/manual/ch06.html

Can you help with this problem?

Provide an answer of your own, or ask Henrik Schlosser for more information if necessary.

To post a message you must log in.