[SOLVED] Trouble connecting JLink USB in Linux dev container

  • My OS is Linux Mint 21.2, using Docker Desktop. I'm working with VS Code remote containers. My container has JLink installed with dependencies with notes from this thread UDEVADM JLink Container Solution.

    Using root user and a basic container to get things up before dialing down, I can't seem to access my USB JLink.


    This does work under my OS installed JLink outside of the container.

    I'm not sure what to try next. Is there a log somewhere?

    Has anyone had this issue?

    Maybe a permissions recommendation? The container is marked as privledged in VSCode ("privileged": true in devcon json).


    Support info:

    1. In my linux desktop I have a /dev/bus/usb/021 which is currently my JLink (no persistent name, but that's OK for now). In my Container I have no matching folder. I assume there may be differences in my Linux Mint (Ubuntu based) Desktop and Ubuntu 22.4 Container... But I think this is a big clue. I don't seem to have USB in the container... Looking for a solution because Segger's own container guide doesn't mention this at all.


    2. I noticed other JLink Utils will not start. I suspect this is because most of the pop up a GUI? These do work in my OS version.

    Code
    root@ae1709e223cc:/# JLinkGDBServerExe 
    JLinkGDBServerExe: error while loading shared libraries: libXrandr.so.2: cannot open shared object file: No such file or directory
    root@ae1709e223cc:/#

    3. Somehow and from somewhere, a .reg file was created on my linux container's root folder. No idea what this is!


    Edited once, last by RTTseemsOK (October 30, 2023 at 8:31 PM).

  • Solved.

    The very short answer is that Docker Desktop for Linux is not ready, don't use it. At a very minimum it does not seem to pipe USB or /dev through even when specifically requested.

    Uninstalled it. Installed the engine and utils instead. Had to edit .docker/config.json to remove "credsStore", but now it works perfectly in VS Code. USB pipes through with no special work in the Dockerfile or devcontainer config.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!