Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QBluetooth in Windows Docker Container



  • Hi,

    I want to run a Qt 5.11.3 (Windows) application that is using QBluetooth module in a Windows Docker container. The image is based on mcr.microsoft.com/windows/servercore:1809, but I also tried mcr.microsoft.com/windows:1809 and saw no difference. The docker host is running on Windows 10 v1809. The Qt is installed from here: https://download.qt.io/archive/qt/5.11/5.11.3/qt-opensource-windows-x86-5.11.3.exe.mirrorlist using silent installer. The installed Docker Desktop version is 2.1.0.5 (engine 19.03.5).

    The docker run command is: docker run --memory 2g -v C:\Users\user\BluetoothTest:C:\build\x --entrypoint C:\build\x\build-BluetoothTest\release\BluetoothTest.exe qt-5.11.3-win. I can provide Dockerfile if needed.

    The problem is that once I run the application under Docker, it gets stuck infinitely. If I remove the bluetooth module from project file, re-compile the application and run it again, it runs just fine. I am including all the necessary DLLs with the application, also the QBluetooth.dll.

    So I went ahead and tested the Qt application on multiple non-docker devices and I found out that on Windows 8, the Qt application does not launch and displays a dialog box with the following message: "This Windows version (6.3.9600) does not support the required Bluetooth API. Consider updating to a more recent Windows (10.0.10586 or above)". However, the Docker container is running on Windows Server 2016 base, which should fall into the same category as Windows 10. Naturally, I can't skip such dialog inside a running container, as there is no GUI available.

    So, my questions are:

    • What is happening there? Is my "dialog" assumption correct, or am I missing something?
    • Is it possible to run Qt application that uses a bluetooth module in a Windows Docker container?
    • Is it possible to bypass the Windows version check in qtconnectivity/src/bluetooth/qbluetoothutils_win.cpp?

    Any idea that could help me with the investigation is greatly appreciated.



  • I am going to answer myself. I did a bit more research and I came upon this page: https://docs.microsoft.com/en-us/windows-hardware/drivers/bluetooth/general-bluetooth-support-in-windows, which contains this little statement: "Windows Server 2016 does not support Bluetooth." Honestly, I did not even consider this to be a thing, I just thought all modern Windows versions come with Bluetooth by default.

    Indeed, when I looked into it, it seems that the entire Bluetooth stack is missing. Because the provided base Docker images are all essentially stripped Windows Server 2016, they all have this problem. I thought I might be able to install the Bluetooth stack to the Docker image, however, it does not seem to be an easy task.

    So yes, the problem is not with Qt or my implementation, it is with the Windows docker image.


Log in to reply