Closed andreacortis closed 8 years ago
Hey, do you have qemu and qemu-user-static installed on your host? I haven't worked out why it is required yet, but that is the same error that I get without.
My host is:
Darwin C02PW287G8WP 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64
I have installed qemu
and now I can run the run-emu
script, but I cannot find qemu-static-user
:
C02PW287G8WP:docker-rpi-emu andreacortis$ brew search qemu
qemu ✔
so now I get errors when I am actually inside the emulated environment:
C02PW287G8WP:docker-rpi-emu andreacortis$ make run-emu
[....]
Launching interactive emulated session
Attempting to mount images/2016-05-27-raspbian-jessie-lite.img to /media/rpi
Attached base loopback at: /dev/loop2
Located partitions: p1 (/boot) at 8192 and p2 (/) at 137216
Closed loopback /dev/loop2
Mounted to /media/rpi and /media/rpi/boot
Bootstrapping Qemu
root@50758288b86d:/# ls
bash: /bin/ls: cannot execute binary file: Exec format error
root@50758288b86d:/#
Assuming that this is my problem, any suggestions on how to install qemu-user-static
on osx?
Hmm, are you running Docker for Mac or using Kitematic (or some other approach)?
On 30 August 2016 at 10:46, Andrea Cortis notifications@github.com wrote:
My host is:
Darwin C02PW287G8WP 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64
I have installed qemu and now I can run the run-emu script, but I cannot find qemu-static-user:
C02PW287G8WP:docker-rpi-emu andreacortis$ brew search qemu qemu ✔
so now I get errors when I am actually inside the emulated environment:
C02PW287G8WP:docker-rpi-emu andreacortis$ make run-emu [....] Launching interactive emulated session Attempting to mount images/2016-05-27-raspbian-jessie-lite.img to /media/rpi Attached base loopback at: /dev/loop2 Located partitions: p1 (/boot) at 8192 and p2 (/) at 137216 Closed loopback /dev/loop2 Mounted to /media/rpi and /media/rpi/boot Bootstrapping Qemu root@50758288b86d:/# ls bash: /bin/ls: cannot execute binary file: Exec format error root@50758288b86d:/#
Assuming that this is my problem, any suggestions on how to install qemu-user-static on osx?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ryankurte/docker-rpi-emu/issues/6#issuecomment-243280787, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0hzDcbHawH8QsZ58wAwktXK_oaVED9ks5qk2FWgaJpZM4Jvmvu .
I am running docker for Mac
C02PW287G8WP:~ andreacortis$ docker -v
Docker version 1.12.0, build 8eab29e
Running the daemon
C02PW287G8WP:~ andreacortis$ docker-machine restart default
Restarting "default"...
(default) Check network to re-create if needed...
(default) Waiting for an IP...
Waiting for SSH to be available...
Detecting the provisioner...
Restarted machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
C02PW287G8WP:~ andreacortis$ docker-machine env
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="/Users/andreacortis/.docker/machine/machines/default"
export DOCKER_MACHINE_NAME="default"
# Run this command to configure your shell:
# eval $(docker-machine env)
C02PW287G8WP:~ andreacortis$ eval $(docker-machine env)
C02PW287G8WP:~ andreacortis$
So the problem might be that docker runs in another host on OSX. I don't think qemu is required on the OSX machine, but it is required on whatever is running the docker environment.
With the Docker for Mac application I don't think you should have to (or be able to) use docker-machine to control the docker host, and the instance they spin up works with qemu on the couple of OSX machines I have tested.
It might be worth checking what is going on there (docker icon in top bar, definitely running, nothing running in docker-machine docker-machine ls
). Other options are to try installing qemu-user-static in the docker-machine (not sure what the os is, but docker-machine ssh
should get you in, or to mod the scripts to run from OSX.
I have reinstalled Docker with Docker for Mac. And now the issue I originally reported is resolved.
There is however still something that I do not understand (please tell me if you want me to open another issue). I cannot get an IP address in the emulated session (see below). Is that normal?
C02PW287G8WP:docker-rpi-emu andreacortis$ make run
[...]
root@41f78f4b8763:/usr/rpi# hostname -I
172.17.0.2
C02PW287G8WP:docker-rpi-emu andreacortis$ make run-emu
[...]
root@52ae8506b401:/# hostname -I
hostname: Address family not supported by protocol
Good good ^_^
That is normal. Qemu isn't actually running the whole OS, only interpreting the binaries you call in the container. If you want to connect to it (ie. you are running a web server in the emulated environment) use the address of the docker host as above, and outbound things should /just work/ via the container.
I am having an issue with launching the emulated CLI. Could you please advise?
Thanks
Andrea