Can I run Kinect V2 inside a Docker container?

I am exploring the possibility of launching the C # Kinect visual gesture program (something like the “Continuous Building Basics” project https://github.com/angelaHillier/ContinuousGestureBasics-WPF) inside the Docker for the Windows container.

  • Is this possible theoretically (run C # Kinect in a Docker container for Windows?)

  • If the answer is 1 - yes, here are some additional details:

I am using microsoft / dotnet-framework: 4.7 image as the base, and my initial Docker file looks like this:

FROM microsoft/dotnet-framework:4.7 ADD . /home/gesture WORKDIR /home/gesture 

Create an image:

 $ docker build -t kinect . 

Include container:

 $ docker run -dit --name kinectContainer kinect 

Attach a powershell session to the monkey around:

 $ docker exec -it kinectContainer powershell 

When I try to start the gesture application from the Docker container, I get the following error (which is expected since the Kinect SDK is not installed in the container):

 Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'Microsoft.Kinect, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependenc ies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058) ---> System.BadImageFormatExcep tion: Cannot load a reference assembly for execution. erable program. Check the spelling of the name, or if a path was included, verify that the path --- End of inner exception stack trace --- at GestureDetector.GestureDetectorApp..ctor() 

At this point, the big question arises: how to install the Kinect v2 SDK [KinectSDK-v2.0_1409-Setup.exe] or Kinect v2 runtime [KinectRuntime-v2.0_1409-Setup.exe] in the container.

Installers have a license agreement and, according to some smart University of Wisconsin , there is a way to extract installers using the Wix dark.exe decompiler ( https://social.msdn.microsoft.com/Forums/en-US/a5b04520-e437-48e3- ba22-e2cdb46b4d62 / silent-install-installation-instructions? forum = kinectsdk )

ex.

 $ & 'C:\Program Files (x86)\WiX Toolset v3.11\bin\dark.exe' C:\installerwork\KinectRuntime-v2.0_1409-Setup.exe -xc:\installerwork\kinect_sdk_installersfiles 

The problem that I encountered when I got into the main msi files, there is no way to run them without using msiexec.

I found out that the runtime installer (Runtime installer (KinectRuntime-x64.msi), extracted from the Kinect v2 SDK) makes at least the following changes to the file system:

Creates a Kinect folder in C: \ Windows \ System32 and adds 3 files to System 32:

k4wcll.dll

kinect20.dll

microsoft._kinect.dll

The last three files in System32 must be 64-bit versions (the installer has the x86 and x64 versions of the 3)

Manually replicating these changes does not succeed on the host, not to mention the container.

It is currently unclear what other registry / system changes are occurring with the installer (and whether this will take us along the line of the target in the Docker container)

Any ideas on how to get here?

+8
c # windows docker wix kinect
source share
2 answers

In short, no. docker on windows does not have hardware tunnel / map capability. on Linux, it executes with the option --device=

As @VonC stated, you will need to use a Windows virtual machine, it can be Hyper-V or you can use Virtual Box, then you can provide Kinect Hardware via the Tunneling method (add / connect a device), without this, do not be a way for your container be a virtual machine or not have access to the hardware of a host machine with windows.

+1
source share

Another approach would be to try to install Kinetic in the Windows server VM and detect the exact changes made by the specified installation.

See for example, How do I know what changes have been made by the program installer? and a tool like ZSoft Uninstaller 2.5 .

Once you determine exactly which files / registry / variables are affected by the installation process, you can replicate this in the Docker file.

0
source share

All Articles