3

Objective: I would like to install several virtual (emulated) Raspberry machines on the laptop, connect them to each other and to the laptop. Afterwards I would like to send tcp packets from virtual machines to mysql on host localhost (and back to machines).

Achieved: On Ubuntu 14.04 I virtualized Raspberry through mounting Raspbian on Qemu (i.e. running virtual machine) source: http://www.soslug.org/wiki/raspberry_pi_emulation.

I run the machine through entering qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -append "root=/dev/sda2 panic=1" -hda Occidentalis_v02.img & (note: Occidentalis is an alternative version of Raspbian)

so from different folders I am running different instances of QEMU.

MySQL is running.

Problem: Each instance has the same IP address 10.0.2.15, and can't ping the host IP or reverse. enter image description here

Assumption: I assume that I need to create a new connection in the host computer (such as eth0, lo, br0, or etc.). I saw something regarding port forwarding, but I am not sure that its exactly what I need, because I would like to have constant connection between machines and host's "localhost".

If anyone could help me out:

  1. how to connect such a connection on host.
  2. how to configure raspbian machine (configuration of IP etc)
  3. how to connect machines to each other?
  4. anything else to establish this network scenario.
2
  1. Add -netdev user,id=mynet0,net=192.168.76.0/24,dhcpstart=192.168.76.9 to your qemu command line. Ping will not work, however TCP connections from your system to the VM will.

  2. Raspbian machine should be configured to use DHCP.

  3. Your machine will need to be assigned a 192.168.76.0/24 address. ifconfig eth0:0 192.168.76.2

  4. You should now be able to ssh from your host system into the Emulated Raspbian system at 192.168.76.9

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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