As Entangle Sodium only works in Linux, I thought wouldn’t it be weird cool if we could run it in macOS? Well one problem is the dependency on the Linux-only libudev
. That’s an easy one, run it in a virtual Linux. Docker images provide a virtual Linux which run in a Virtual Machine. Another problem is that the default docker-machine will not forward USB devices to the container. There is an elegant workaround, albeit deprecated / migrated / unpopular / officially highly discouraged, and that is to boot up the lightweight boot2docker linux machine in VirtualBox. We must do this because it allows us to express the USB bus as a directory: /dev/bus/usb
, as macOS does not provide the USB bus in files. The docker image is pulled to the boot2docker machine, where it may permanantly reside, and run with a privileged mode that allows access to that linux’s /dev
tree. The boot2docker ISO for VirtualBox can be found here:
Entangle docker instructions for macOS
Runs entangle in boot2docker VM and copies captures to timestamped dir in ~
on host.
open -a Xquartz
socat TCP-LISTEN:6000,bind=$(ifconfig -a|tail +9|grep 'inet '|cut -d ' ' -f 2|head -1),reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"
echo $(ifconfig -a|tail +9|grep 'inet '|cut -d ' ' -f 2|head -1) > /private/var/tmp/hostip
echo $HOME>/private/var/tmp/homedir
- Settings > Ports: add USB2 or USB3 driver and add the filter for your connected camera.
- Settings > Shared Folders: add Folder Path
/private/var/tmp
with Mount Point/tmp2
and Folder Path/Users
with Mount Point/Users
making both permanent automounts. - Start the boot2docker VM
docker pull kd6kxr/entangle
docker run -it -e DISPLAY=$(cat /tmp2/hostip):0 -v /tmp/.X11-unix:/tmp/.X11-unix -v $(cat /tmp2/homedir):/hi -v /dev/bus/usb:/dev/bus/usb --privileged kd6kxr/entangle
- Upon success the container will quit and have copied your files to a new dir in
~
. On failure, you will exit tobash
where you may recover files, thenexit
when finished.
- An easier thing to type than the
docker run
command above:curl https://tinyurl.com/entangleme -L > cmnd && chmod +x cmnd
- Then run the image with
./cmnd
Here’s the Dockerfile
which auto-builds from the official entangle repo.
This is the docker autobuild repo I’ve made: https://cloud.docker.com/repository/docker/kd6kxr/entangle
And of course, the source code lives here:
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
As a reward for reading this far, here is a capture of entangle capturing entangle capturing entangle capturing entangle...