Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynatrace agent on WSL2

Frequent Guest

I am running the latest version of Ubuntu on WSL2 on Windows. I have a local copy of my client's wordpress website and mysql database, with near identical nginx webserver and php.

I need to install OneAgent in order to unlock mySQL insights, nginx insights, wordpress page insights and so forth

There is much potential as Dynatrace outlines in

When I install it on WSL Ubuntu, I get this error,

root@localhostname# cat /etc/os-release
VERSION="20.04.5 LTS (Focal Fossa)"
PRETTY_NAME="Ubuntu 20.04.5 LTS"
root@localhostname# /bin/sh --set-infra-only=false --set-app-log-content-access=true
01:57:47 Checking root privileges...
01:57:47 Process user: root, ID: 0
01:57:47 OK
01:57:47 Logging to /var/log/dynatrace/oneagent/installer/installation_4818.log
01:57:47 Installation started, version, build date: 18.11.2022, PID 4818.
01:57:47 Detected platform: LINUX arch: X86_64
01:57:47 Error: Dynatrace OneAgent cannot be installed inside a container (or in an isolated mount namespace), setup won't continue.
01:57:47 Error: For a supported way of deployment using a container please refer to:

Following the link above, one of the steps is to run apparmor, but when I do, I get this error

root@localhostname# apparmor_parser -r /etc/apparmor.d/oneagent Cache read/write disabled: interface file missing. (Kernel needs AppArmor 2.4 compatibility patch.) Warning: unable to find a suitable fs in /proc/mounts, is it mounted? Use --subdomainfs to override.

I need guidance here, this may be the first post on installing on wsl2 ubuntu. How can I get past this error or is there another way I get agent installed to grab full insights (mysql, wordpress, php, nginx)?


DynaMight Legend
DynaMight Legend

As it says - it's not supported to install it this way in a container - WSL2 is considered a container here.

What you can do - you can use the PaaS agent version. In this case, you must wrap execution of your application.
So basically you need to:

  1. download the PaaS agent version instead:
    wget -O "https://<dt_environment>/api/v1/deployment/installer/agent/unix/paas/latest?arch=x86&flavor=default" --header="Authorization: Api-Token <dt_paas_token>"​
  2. unzip the agent to a directory such as /opt/dynatrace/oneagent or any of your choice.
  3. run each process to be monitored using the or depending on the platform

PaaS agents will have some limitations of course but should work in your case.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner