Open evanlesmez opened 4 years ago
I'm stuck with the same issue right now. Help is greatly appreciated. Here's some more info:
Host: Manjaro Linux
Guest: MacOS Catalina
Network config in basic.sh
:
qemu-system-x86_64 \
[...]
-netdev user,id=net0 \
-device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-nic user,hostfwd=tcp::10022-:22 \
[...]
ssh hannes@localhost -p10022 -vvv
:
OpenSSH_8.1p1, OpenSSL 1.1.1d 10 Sep 2019
debug1: Reading configuration data /home/hannes/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolving "localhost" port 10022
debug2: ssh_connect_direct
debug1: Connecting to localhost [::1] port 10022.
debug1: connect to address ::1 port 10022: Connection refused
debug1: Connecting to localhost [127.0.0.1] port 10022.
debug1: Connection established.
debug1: identity file /home/hannes/.ssh/id_rsa type 0
[...]
debug1: identity file /home/hannes/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.1
Sharing / Remote Login is enabled for all users in the guest.
There are a number of search results for ssh connections being stuck on the "Local version string" line, such as firewall settings and even lowering the MTU for the guest's Ethernet connection. So far, none of them did the trick.
You need to use tap networking (guides are in the repo) as usermode networking acts like a NAT, partially isolating it from the rest of the network.
Ok thanks. I did try that, but I'll try again more systematically soon.
Still didn't get it working unfortunately. I set up tap networking as described in the networking guide using nmcli
. Note that I first had to create the tap device (ip tuntap add name tap0 mode tap
) in addition to the steps in the docs.
However, I think networking is still not configured correctly. MacOS fails to get an IP address via DHCP. Instead it self-assigns an address and cannot connect to the internet. The ssh connection is stuck the same way as before.
I tried the commands @hrantzsch and got
user@social:~$ ssh -p 10022 lz@192.168.1.11 -vvv
OpenSSH_7.4p1 Debian-10+deb9u7, OpenSSL 1.0.2u 20 Dec 2019
debug1: Reading configuration data /home/user/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "192.168.1.11" port 10022
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 192.168.1.11 [192.168.1.11] port 10022.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4p1 Debian-10+deb9u7
Any news on this?
From https://github.com/foxlet/macOS-Simple-KVM/issues/185:
In the basic.sh
I have replaced the line
-netdev user,id=net0 \
with
-netdev user,hostfwd=tcp::10022-:22,id=net0 \
That seem to do the trick, the following command gets me to guest's ssh
ssh username@localhost -p10022
My setup: Host: Ubuntu 20.04 Guest: MacOS Catalina
First off thanks for building this. I can't believe how well it works with minimal hackiness. I am working on sshfs file linking (for development) with my host (manjaro/ arch linuxy) to the mac os. I read through some other issues and it looks like file-sharing is not implemented yet with the qemu or virt-manager way. I can sshfs from the mac vm to my host but when I try to ssh from host to mac vm the connection times out. I ensured ssh was running on the mac vm with remote login enabled in the system preferences. However everytime I am still getting timeouts. Saw this might be related to port-forwarding. Any ideas?