1

So I run the following command to open QEMU :

qemu-system-x86_64 -m 64M -hda ../debian_squeeze_amd64_standard.qcow2 -append "root=/dev/sda1 console=tty0 console=ttyS0,115200n8" -kernel arch/x86_64/boot/bzImage -nographic -net nic,vlan=1 -net user,vlan=1 -redir tcp:2222::22

And the code works and QEMU starts but when I type the following code to code the file newcheck, it shows error :

root@debian-amd64:~# scp -P 2222 newcheck root@localhost:~
ssh: connect to host localhost port 2222: Connection refused
lost connection

Can someone please let me know what is wrong?

2 Answers 2

2

I succeeded by changing -net nic,vlan=1 -net user,vlan=1 -redir tcp:2222::22 to -net nic,model=e1000 -net user,hostfwd=tcp::2222-:22. Hope this helps XD

Recommendation:#07 - How To Emulate Firmware With QEMU - Hardware Hacking Tutorial

1
  • Thanks. Right now, I have no idea why I had this question or what I was trying at the time :p Aug 17, 2020 at 7:18
1

In newer versions of qemu "-net" became deprecated and it's advised to use "-netdev" instead. So, try this one:

qemu-system-x86_64 -m 64M -hda ../debian_squeeze_amd64_standard.qcow2 -append "root=/dev/sda1 console=tty0 console=ttyS0,115200n8" -kernel arch/x86_64/boot/bzImage -nographic -netdev user,id=net0,hostfwd=tcp::2222-:22 -device e1000,netdev=net0
1
  • You're right, -net has become deprecated, but even with your command, it still shows the same error in copying part after logging into root. Please help. Nov 15, 2018 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.