Skip to main content
2 of 3
Updated answer to the updated question
Stefan M
  • 1.6k
  • 1
  • 12
  • 20

Please try first whether the host is reachable at all. This can easily be done using nmap. For your case this should suffice:

nmap localhost -p 22

If it says that the port is open, you should look into the sshd on the guest. If it is filtered, maybe a firewall-issue on your guest (incoming) or your host (outgoing/incoming from local).

On the update:

Simply put, you have two choices:

  1. Use bridged networking for example as described in here, that way you can install the sshd.

  2. Use guestfwd. As you already established a connection (port forwarding) via qemu in one direction, you can easily do the same the other way around:

  • Install a proxy on your host (squid, tinyproxy, whatever)
  • Point the guest to your proxy: (below untested part of your command):

guestfwd=tcp::3128-:3128

  • Last, but not least: Use http_proxy for the apt commands or set the variable system-wide.

When you finally have the sshd running, you should be able to connect to the guest system via ssh.

Stefan M
  • 1.6k
  • 1
  • 12
  • 20