The Computer Oracle

How to enable network with a raspberry pi emulated on qemu?

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Take control of your privacy with Proton's trusted, Swiss-based, secure services.
Choose what you need and safeguard your digital life:
Mail: https://go.getproton.me/SH1CU
VPN: https://go.getproton.me/SH1DI
Password Manager: https://go.getproton.me/SH1DJ
Drive: https://go.getproton.me/SH1CT


Music by Eric Matyas
https://www.soundimage.org
Track title: Dream Voyager Looping

--

Chapters
00:00 How To Enable Network With A Raspberry Pi Emulated On Qemu?
01:50 Accepted Answer Score 5
02:36 Thank you

--

Full question
https://superuser.com/questions/690060/h...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#linux #ubuntu #debian #raspberrypi #qemu

#avk47



ACCEPTED ANSWER

Score 5


It would be nice to see the output of ifconfig on your virtual machine too.

According to http://en.wikibooks.org/wiki/QEMU/Networking with the options you've specified you should get NAT with a virtual DHCP server, not direct bridging onto your local IP network, so your hard-coded IP addresses probably wouldn't work. Try:

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp

reboot or use ifdown/ifup to reconfigure eth0 and see if it finds the virtual DHCP server. ifconfig and route -n should tell you if it worked - you'll have a local IP and a gateway route.

Assuming it did work you should be able to ssh from your host to your VM using:

ssh -p 5022 localhost

because that port is setup by the -redir clause in your command-line.