You are browsing documentation for a version other than the latest stable release. Switch to the latest stable release, 2.3.

Prepare a virtual device

Skip this section if you have already completed Prepare a Raspberry Pi device

This tutorial we help you prepare your workstation to be able to run a virtual device (QEMU) with Mender integrated which will connect to hosted Mender and simulate a physical device.


To follow this tutorial, install Docker Engine on your workstation.

Step 1 - Login to hosted Mender

Login to hosted Mender. On the main page for the first time new users will get a tutorial in the Mender web GUI.

Go to the Dashboard tab and click on Connect a device.

connecting a device

Step 2 - Connect a device

Select Prepare a virtual device for now.

connecting a device

Step 3 - Start the virtual device

Next we start the virtual device on your workstation.

accepting the device

In the dialog box from above, click Copy to clipboard to copy the code. Now go to the command line on your workstation, and paste the code e.g. by right-clicking in the terminal and selecting Paste, followed by Enter.

This downloads the virtual device images and starts it.

Step 4 - Accept the device

Once the client has started, the Mender client will attempt to connect to the server and it will appear in your Pending devices tab in the server. Go ahead and Accept the pending device in the server. After accepting the device, it will appear on the Device groups tab on the left of Pending.

connecting a device

Step 5 - Get the IP address of the virtual device

You will need the the IP address of the virtual device in later stages of the documentation.

You should execute below commands in a terminal window on your workstation while the virtual device is running.

List running containers:

docker ps

Example output:

$ docker ps
CONTAINER ID        IMAGE                                      COMMAND             CREATED             STATUS              PORTS               NAMES
d335f50101cb        mendersoftware/mender-client-qemu:latest   "./"   6 minutes ago       Up 6 minutes        8822/tcp            relaxed_leakey

Save the CONTAINER ID in a shell variable:


Replace above value with actual value that you get.

Find the IP address of the virtual device (we will save it a shell variable):

IP_ADDRESS=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "${CONTAINER_ID}")

Example output:

$ echo "${IP_ADDRESS}"

Next step

Proceed to Deploy an application update.