2

I have boot-up the armhf standard machine with ssh on port 22 from here Using this command:

qemu-system-arm -M vexpress-a9 -kernel vmlinuz-3.2.0-4-vexpress -initrd initrd.img-3.2.0-4-vexpress \
-drive if=sd,file=debian_wheezy_armhf_standard.qcow2 -append "root=/dev/mmcblk0p2" -net user,hostfwd=tcp::5555-:22

As explained in this tutorial I've set an ssh-server private/public key pair invoking ssh-keygen -t rsa on it.

Then when I to connect it from my guest machine Ubuntu 17.10 x64

ssh -p 5555 localhost

I get this error:

ssh_exchange_identification: read: Connection reset by peer

When I try explicitly to ssh connect to the virtual machine invoking

qemu-system-arm -M vexpress-a9 -net user,hostfwd=tcp::5555-:22 &

I get this message

qemu-system-arm: -net user,hostfwd=tcp::5555-:22: Could not set up host forwarding rule 'tcp::5555-:22'

What is the problem ?

How can I ssh connect to the arm emulator ?

Thank you

4
  • Can you confirm that the sshd server is actually running on the virtual machine?
    – user86219
    Commented Dec 15, 2017 at 12:44
  • I think so. I have a working process called /user/sbin/sshd (with no children)
    – Roey
    Commented Dec 19, 2017 at 9:38
  • can you post the output of ssh -vvv -p 5555 localhost it will give more debugging information which might help track down the issue.
    – user86219
    Commented Dec 20, 2017 at 10:19
  • OpenSSH_6.0p1 Debian-4, OpenSSL 1.0.1e 11 Feb 2013 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to localhost [::1] port 5555. debug1: connect to address ::1 port 5555: Connection refused debug1: Connecting to localhost [127.0.0.1] port 5555. debug1: connect to address 127.0.0.1 port 5555: Connection refused ssh: connect to host localhost port 5555: Connection refused Sorry I can't ident the script output CTRL+K is hijacked by Firefox to focus the address line.
    – Roey
    Commented Dec 21, 2017 at 15:26

1 Answer 1

1

you need to connect the qemu to the current terminal add this to you running line

-append "root=/dev/sda rw console=ttyS0,115200 acpi=off nokaslrearlyprintk=serial,ttyS0,115200" 

and then where you inside the qemu configure the ip of your nic:

ifconfig eth0 10.0.2.15 netmask 255.255.255.0 up && route add default gw 10.0.2.2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .