bradleyd / devops_for_the_desperate

The companion code for the book DevOps for the Desperate
111 stars 62 forks source link

[Apple M1 Pro] SSH connection refused upon Debian login via QEMU #31

Closed diffeo-christopher closed 1 week ago

diffeo-christopher commented 9 months ago

OS: OS X 13.5.2 (22G91) Following the README, I executed:

Command: qemu-system-aarch64 -cpu cortex-a72 -smp cpus=4,sockets=1,cores=4,threads=1 -machine virt,highmem=off -accel hvf -accel tcg,tb-size=2048 -m 2G -initrd initrd.img-5.10.0-11-arm64 -kernel vmlinuz-5.10.0-11-arm64 -append "root=/dev/vda2 console=ttyAMA0" -drive if=virtio,file=debian-dftd-aarch64.qcow2,format=qcow2,id=hd -net user,hostfwd=tcp::10022-:22,hostfwd=tcp::20375-:2375,hostfwd=tcp::5001-:5000 -net nic -device intel-hda -device hda-duplex -nographic (I changed memory from 4G to 2G)

Attempt to login with SSH:

dftd@debian:~$ ssh dftd@127.0.0.1 -p 10022
ssh: connect to host 127.0.0.1 port 10022: Connection refused
dftd@debian:~$

Is this expected?

bradleyd commented 9 months ago

Hey @diffeo-christopher. When you run the qemu-system-aarch64 command, you are dropped right into the running VM. You can tell by your shell prompt dftd@debian. There would be no need to SSH into the host from that shell. You can open another tab in your terminal and try there.

Thanks for supporting me and the book!

Let me know how it goes.

bradleyd commented 1 week ago

Please reopen if you need help.