Couldn't connect VM using SSH #2535
Replies: 9 comments 8 replies
-
try setting up port forwarding to a different port than ssh (i. e. port 4321), and set up sshd in RHEL to listen on that port, then try this |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
The settings around SSH are as follows. [Mac m1] The content of id_rsa.pub on Mac m1 is posted to ~/.ssh/authorized_keys on VM. *Changed the port used from 4321 to 5432. |
Beta Was this translation helpful? Give feedback.
-
The solution for Mac users is to change the network mode to shared or bridged mode. The emulated network seems to break SSH. |
Beta Was this translation helpful? Give feedback.
-
I'm using UTM on a Macbook m1. Installed two ubuntu servers(20.4), with x86 and arm respectively, both with emulated network, and mapped 22(guest) to 2222(host). The x86's port map of ssh works out of box, but the arm version doesn't work. I finally found out that my interface(enp0s7) is not properly configured automatically on start. There is no IP address assigned to this interface. So I updated my network config like this
reboot, then it works
My network config may not be the best practice, you better follow your according distribution documentation |
Beta Was this translation helpful? Give feedback.
-
To confirm, is ssh still broken on emulated VLAN? I'm able to ssh into my virtual box using this common command: ssh -p 22022 ubuntu@localhost But then I set the Network settings to 'Emulated VLAN', and set the IP address of the Guest Network to 192.168.56.1 and DHCP start to 192.168.56.101. Then, when I try to connect with this command: ssh -p 22 ubuntu@192.168.56.101 The command hangs and the operation eventually times out. Is this still because ssh is broken on emulated VLAN? |
Beta Was this translation helpful? Give feedback.
-
I have the same issue, was struggling with it for days, appreciate if anyone was able to fix. |
Beta Was this translation helpful? Give feedback.
-
I have the same problem. My solution is changing the UTM network config to the shared network mode. Next, follow the method of @fffx and reboot vm.Then, check your IP in your virtual environment. Finally, use ssh to connect to this IP.
For me, I just use the following command in my host terminal: Actually, I don't know why this work and would like to know the reason.If somebody know it,Please tell me.Thanks. |
Beta Was this translation helpful? Give feedback.
-
For those following these instructions and if it is still not working, check if you are connected to a vpn which is having a similar subnet to the guest. |
Beta Was this translation helpful? Give feedback.
-
I have installed UTM on my Mac M1 and created a virtual machine using the RHEL7.6 ISO image.
The installation of the virtual machine was successful, but when I try to connect to the created virtual machine from my local machine using port forwarding, I get the following error and it fails.
$ ssh root@localhost
kex_exchange_identification: read: Connection has been reset by peer
I would like to know how to solve this.
[Environment]
OS: macOS Big Sur
Architecture M1
UTM Version: 2.0.28 (28)
Beta Was this translation helpful? Give feedback.
All reactions