Search code examples
yoctoros

When running yocto runqemu the ip seems not to be found


I have built a yocto image (just for reference see the end of this question) when I try to run it with runqemu I get the following error:

runqemu - ERROR - runqemu-ifup: /opt/yocto/workspace/openembedded-core/scripts/runqemu-ifup
runqemu - ERROR - runqemu-ifdown: /opt/yocto/workspace/openembedded-core/scripts/runqemu-ifdown
runqemu - ERROR - ip: None
runqemu - ERROR - In order for this script to dynamically infer paths
 kernels or filesystem images, you either need bitbake in your PATH
 or to source oe-init-build-env before running this script.

I have sourced ot-init-build-env before running the script.

It seems the ip is not found. Do I need to modify /etc/hosts before running it?


The project I am using is meta-ros but I am building my images inside a docker image as in this repository

In this tutorial Step 5 it says

-- You start this system in the qemu virtual machine with

runqemu <MACHINE> core-image-ros-roscore

The <MACHINE> is the identifier that is set in the local.conf, e.g., qemux86. On the Linux virtual machine system, you can log in as root with the empty password. Now, you ensure that the own host's name in resolved by adding

127.0.0.1    <HOSTNAME>.localdomain        <HOSTNAME>

to the /etc/hosts file,

What is HOSTNAME here?


Solution

  • this is actually complaining about the "ip" command not being found, not your IP address, you need to install it.

    Depending on your distribution the package name may change, but for Ubuntu/Debian the package you need is iproute2

    sudo apt update && sudo apt install iproute2
    

    Should do the trick.

    Also, in case you didnt install the required packages, you may be missing a few others, you can get the list of required packages from here: https://docs.yoctoproject.org/brief-yoctoprojectqs/index.html#build-host-packages