[HELP REQUEST] VNC docker with wine - blueiris


Recommended Posts

I am working on building a docker to run blueiris security camera software. This is windows software that has the ability to run on linux using wine. I have successfully run a dockerized x11 server including vnc. I am able to install wine in another docker and show applications such as notepad and explorer on the vnc server.

 

I am also able to get blueiris to install inside the docker but only if I use boot2docker. Using the exact same docker on unraid, running wine gives me the error:

bash: /usr/bin/wine: cannot execute binary file: Exec format error

 

Interestingly if I install wine directly on unraid, I get the same error. However, I am able to run the 64-bit version of wine (wine64). I tried to just use this as the solution for unraid users, but the blueiris.exe file won't run with 64 bit wine. I get the error:

wine: Bad EXE format for Z:\tmp\blueiris.exe

 

My guess is there are some modules not included in unraid that is causing bad interpretation of the 32-bit wine executable. If anybody has any thoughts as to the problem or any paths forward, please let me know.

Link to comment

64bit unRAID has no support for 32bit executables.

 

That's what I figured. I was hoping that running inside a docker would help with this problem. I guess since dockers run on the host's kernel the 32-bit docker executables also won't run.

Link to comment

64bit unRAID has no support for 32bit executables.

 

Are you running the command as docker exec -it <NAMEOFDOCKER> <COMMAND> ? then it wouldn't matter if its 32/64bit because the command is running in the docker

 

I'm running docker exec -it <NAMEOFDOCKER> /bin/bash

 

Then from inside the docker I'm running the 32-bit executable. I wonder if I need to install some kind of multi-arch library inside the docker.

Link to comment

64bit unRAID has no support for 32bit executables.

 

Are you running the command as docker exec -it <NAMEOFDOCKER> <COMMAND> ? then it wouldn't matter if its 32/64bit because the command is running in the docker

 

I'm running docker exec -it <NAMEOFDOCKER> /bin/bash

 

Then from inside the docker I'm running the 32-bit executable. I wonder if I need to install some kind of multi-arch library inside the docker.

 

shouldn't matter... can you link me to your dockerfile?

Link to comment

docker on unRaid does not support 32 bit libraries

 

docker in general does not have support for 32 bit libraries, but some people were able to get them to work on certain base platforms by installing additional compatibility libraries.

 

I have not been able to get any 32 bit app to work in docker on unRaid

Link to comment

docker on unRaid does not support 32 bit libraries

 

docker in general does not have support for 32 bit libraries, but some people were able to get them to work on certain base platforms by installing additional compatibility libraries.

 

I have not been able to get any 32 bit app to work in docker on unRaid

 

I learned something today!  weeeeeeeeee

Link to comment

wine may be a different case though..

 

i tried to compile it in what they refer to as a wow setup here.

 

http://wiki.winehq.org/Wine64

 

 

it built on my VM, but testing was pointless there, because my VM has multiarch support.

 

however, 6 attempts of dockerhub building it all came back with "unexpected failure" .. i never got to the bottom of that...

 

knowing dockerhub and how ridiculously flaky it is, i couldn't say if it was an issue with them or not... one thing that was bizarre that every other time a docker build fails there, i get a notification via email, no such notification with those 6 failures though.

Link to comment

I'm very glad to see the pros are all stepping in to help!

 

The problem seems to be a bit different then I originally thought. I was able to get 64-bit windows programs to run using wine64. The blueiris installer is able to install 32 and 64 bit versions of the software. However, for compatibility, the installer itself is a 32-bit program and I can't run it using wine64.

Link to comment

# set base os
FROM phusion/baseimage:0.9.16

# Set environment variables for my_init, terminal and apache
ENV DEBIAN_FRONTEND=noninteractive HOME="/root"

CMD ["/sbin/my_init"]

# Configure user nobody to match unRAID's settings
RUN usermod -u 99 nobody && \
usermod -g 100 nobody && \

# add repository for wine build-deps
add-apt-repository ppa:ubuntu-wine/ppa && \

# update apt
apt-get update -qq && \

# install wine64 build-deps
apt-get build-dep wine1.6 && \

install wine32 build-deps, wget and other useful tools 
apt-get install \
gcc-multilib \
g++-multilib \
wget \
unrar \
openjdk-7-jre-headless \
unzip -qy && \

# fetch wine source
cd /tmp && \
wget http://prdownloads.sourceforge.net/wine/wine-1.7.47.tar.bz2 && \
bzip2 -d wine-* && \
tar xvf wine-* && \
cd wine-* && \

# configure and make wine32 and wine64
mkdir wine32 wine64 && \
cd wine64 && \
../configure \
--enable-win64 && \
make && \
cd .. && \
cd wine32 && \
../configure \
--without-x \
--without-freetype \
--with-wine64=../wine64 && \
make && \

# install wine32 and wine64
make install && \	
cd ../wine64 && \
make install

 

 

that should compile wine64 and wine32 without adding i386 to dpkg config.

i haven't been able to satisfy dependencies for x and freetype 386 though, i don't know whether that's a deal breaker for getting this to work.

 

i also can't find the env settings to put wine and wine64 into path, i had them before but lost them, and google isn't playing the game, lol.

Link to comment

I tried this using the ubuntu:14.04 baseimage instead of phusion since that is what I was working on previously. I'll likely switch to phusion once (/if) I release the docker.

 

I compiled the wine32 executable using your same flags to ignore x and freetype and am still getting the same problem (bash: /usr/local/bin/wine: cannot execute binary file: Exec format error)

 

Were you able to get the 32-bit wine to run in phusion? I'm asking before I take another hour to rebuild.

Link to comment

I tried this using the ubuntu:14.04 baseimage instead of phusion since that is what I was working on previously. I'll likely switch to phusion once (/if) I release the docker.

 

I compiled the wine32 executable using your same flags to ignore x and freetype and am still getting the same problem (bash: /usr/local/bin/wine: cannot execute binary file: Exec format error)

 

Were you able to get the 32-bit wine to run in phusion? I'm asking before I take another hour to rebuild.

 

you have to use the 64bit executable.

 

 

it's called wine64 and compiling this way allegedly allows the 64bit wine to run 32 bit apps.

 

whether that works within unraid is the big question.

 

Link to comment

here's what i have so far, need to work out the runtime dependencies next.

 

# set base os
FROM phusion/baseimage:0.9.16

# Set environment variables for my_init, terminal and apache
ENV DEBIAN_FRONTEND=noninteractive HOME="/root" LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8

CMD ["/sbin/my_init"]

# Set the locale
RUN locale-gen en_US.UTF-8 && \

# set common wine configure options as a variable
common_configure="--without-hal \
--without-sane \
--without-xinerama \
--without-opencl \
--without-oss" && \

# set build deps as a variable
build_deps="gettext \
prelink \
gcc-multilib \
g++-multilib \
flex \
bison \
libx11-xcb-dev \
libfreetype6-dev \
libxcursor-dev \
libxi-dev \
libxxf86vm-dev \
libxrandr-dev \
libxcomposite-dev \
libglu1-mesa-dev \
libosmesa6-dev \
libxml2-dev \
libxslt1-dev \
libgnutls-dev \
libjpeg-dev \
libfontconfig1-dev \
libtiff5-dev \
libpcap-dev \
libdbus-1-dev \
libmpg123-dev \
libv4l-dev \
libldap2-dev \
libopenal-dev \
libcups2-dev \
libgphoto2-2-dev \
libgsm1-dev \
liblcms2-dev \
libcapi20-dev \
libgstreamer-plugins-base0.10-dev \
libncurses5-dev" && \

# set useful tools deps as a variable tools
useful_tools="wget \
unrar \
unzip \
supervisor \
openjdk-7-jre-headless" && \

# install build-deps , wget and other useful tools
apt-get update -qy && \
apt-get install \
$useful_tools \
$build_deps -qy && \

# fetch wine source
cd /tmp && \
wget http://prdownloads.sourceforge.net/wine/wine-1.7.47.tar.bz2 && \
bzip2 -d wine-* && \
tar xvf wine-* && \
cd wine-* && \

# configure and make wine32 and wine64
mkdir wine32 wine64 && \
cd wine64 && \
../configure \
$common_configure \
--enable-win64 && \
make && \
cd .. && \
cd wine32 && \
../configure \
$common_configure \
--without-x \
--without-freetype \
--with-wine64=../wine64 && \
make && \

# install wine32 and wine64
make install && \	
cd ../wine64 && \
make install && \

# clean up
cd / && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Link to comment

That may be true. My compiled wine64 wouldnt run the 32-bit executable I was trying. I didn't try other executables yet. I get no error message and no response. If your build is done, can you try to run this program:

http://blueirissoftware.com/blueiris.exe

 

Also don't forget to include wine-gecko and wine-mono

 

i'm working on a base image only with no vnc/rdp components yet, so it's not really in a testable condition.

 

 

Link to comment

Fair enough.

 

I have a docker with the x11 server and vnc built in. It takes some configuring on the client side, but it's pretty simple.

 

X11server:

docker run -d --name display -e VNC_PASSWORD=newPW -p 5901:5900 suchja/x11server:latest

 

Dockerfile for x11client:

# Setup the xclient
# first create user and group for all the X Window stuff
# required to do this first so we have consistent uid/gid between server and client container
RUN addgroup --system xusers \
  && adduser \
		--home /home/xclient \
		--disabled-password \
		--shell /bin/bash \
		--gecos "user for running an xclient application" \
		--ingroup xusers \
		--quiet \
		xclient

# Install packages required for connecting against X Server
RUN apt-get update && apt-get install -y --no-install-recommends \
			xauth \
	&& rm -rf /var/lib/apt/lists/*

 

Then just run your wine docker:

docker run -d --name winebottle --link display:xserver --volumes-from display winebottle

 

From inside the winebottle, change the user to xclient and run your wine64 program.

Link to comment

apt-cache search wine-gecko
wine-gecko2.21 - Microsoft Windows compatibility layer (embedded web browser)
libwine-gecko-2.21 - Windows API implementation - web browser module
libwine-gecko-dbg-2.21 - Windows API implementation - web browser debug build

 

 

which ?

 

I missed this post earlier. On my machine, the package repository repository looks a little bit different. I'm guessing this is because I added the ppa and then updated before searching the cache.

 

libwine-gecko-2.21 - Windows API implementation - web browser module
libwine-gecko-dbg-2.21 - Windows API implementation - web browser debug build
wine-gecko2.21 - Microsoft Windows compatibility layer (embedded web browser)
wine-gecko2.24 - Microsoft Windows compatibility layer (embedded web browser)
wine-gecko2.34 - Microsoft Windows compatibility layer (embedded web browser)
wine-gecko2.36 - Microsoft Windows compatibility layer (embedded web browser)

 

wine-gecko2.36 is the one I've been using with wine1.7.*

Link to comment

latest iteration of base image docker file.

 

# set base os
FROM debian:wheezy

# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive HOME="/root" TERM=xterm

# add local files
ADD glibconfig.h.diff /tmp/

# install some prebuild packages
RUN apt-get update && \
apt-get install \
wget \
git -qy && \

# clone wine git repository
cd /tmp && \
git clone git://source.winehq.org/git/wine.git /tmp/wine-git && \

# add ubuntu wine ppa repository
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F9CB8DB0 && \
echo "deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main" >> /etc/apt/sources.list && \
echo "deb-src http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main" >> /etc/apt/sources.list && \

# update apt and install misc packages
apt-get update -qq && \
apt-get install \
libsane-dev \
wine-gecko2.36 \
wine-mono4.5.6 \
libtiff4-dev -qy && \

# install main body of wine build-deps
apt-get build-dep wine1.7 -y && \
apt-get install \
libgstreamer-plugins-base0.10-dev \
libhal-dev \
liblcms2-dev \
libosmesa6-dev \
ocl-icd-opencl-dev -qy && \

# install 32 bit dependencies
dpkg --add-architecture i386 && \
apt-get update -qq && \
apt-get install \
gcc-multilib \
libasound2-dev:i386 \
libgsm1-dev:i386 \
libjpeg8-dev:i386 \
liblcms2-dev:i386 \
libldap2-dev:i386 \
libmpg123-dev:i386 \
libopenal-dev:i386 \
libv4l-dev:i386 \
libx11-dev:i386 \
libxinerama-dev:i386 \
libxml2-dev:i386 \
zlib1g-dev:i386 -qy && \

# install more 32 bit dependencies
apt-get install \
libcapi20-dev:i386 \
libcups2:i386 \
libdbus-1-3:i386 \
libfontconfig:i386 \
libfreetype6:i386 \
libglu1-mesa:i386 \
libgnutls26:i386 \
libgphoto2-2:i386 \
libncurses5:i386 \
libosmesa6:i386 \
libsane:i386 \
libxcomposite1:i386 \
libxcursor1:i386 \
libxi6:i386 \
libxrandr2:i386 \
libxslt1.1:i386 \
ocl-icd-libopencl1:i386 -qy && \

# symlink some packages
cd /usr/lib/i386-linux-gnu && \
ln -s libcups.so.2 libcups.so && \
ln -s libexif.so.12 libexif.so && \
ln -s libfontconfig.so.1 libfontconfig.so && \
ln -s libfreetype.so.6 libfreetype.so && \
ln -s libGL.so.1 libGL.so && \
ln -s libGLU.so.1 libGLU.so && \
ln -s libgnutls.so.26 libgnutls.so && \
ln -s libgphoto2.so.2 libgphoto2.so && \
ln -s libgphoto2_port.so.0 libgphoto2_port.so && \
ln -s libOSMesa.so.6 libOSMesa.so && \
ln -s libsane.so.1 libsane.so && \
ln -s libtiff.so.4 libtiff.so && \
ln -s libXcomposite.so.1 libXcomposite.so && \
ln -s libXcursor.so.1 libXcursor.so && \
ln -s libXi.so.6 libXi.so && \
ln -s libXrandr.so.2 libXrandr.so && \
ln -s libXrender.so.1 libXrender.so && \
ln -s libxslt.so.1 libxslt.so && \
ln -s libXxf86vm.so.1 libXxf86vm.so && \
ln -s /lib/i386-linux-gnu/libdbus-1.so.3 libdbus-1.so && \
ln -s /lib/i386-linux-gnu/libpng12.so.0 libpng12.so && \
ln -s /lib/i386-linux-gnu/libtinfo.so.5 libtinfo.so && \
ln -s libpng12.so libpng.so && \
echo 'INPUT(libncurses.so.5 -ltinfo)' >libncurses.so && \

# install remaining dependencies
apt-get install \
libgstreamer-plugins-base0.10-0:i386  -qy && \

# more smylinking
cd /usr/lib/i386-linux-gnu && \
ln -s libgstapp-0.10.so.0 libgstapp-0.10.so && \
ln -s libgstbase-0.10.so.0 libgstbase-0.10.so && \
ln -s libgstreamer-0.10.so.0 libgstreamer-0.10.so && \
ln -s libgobject-2.0.so.0 libgobject-2.0.so && \
ln -s libgmodule-2.0.so.0 libgmodule-2.0.so && \
ln -s libgthread-2.0.so.0 libgthread-2.0.so && \
ln -s /lib/i386-linux-gnu/libglib-2.0.so.0 libglib-2.0.so && \

# apply gstreamer patch
cd /usr/lib/x86_64-linux-gnu/glib-2.0/include && \
patch </tmp/glibconfig.h.diff && \

# compile and install wine builds
cd /tmp && \
mkdir wine64 && \
cd wine64 && \
../wine-git/configure \
--without-hal \
--enable-win64 && \
make > make.log 2>&1 && \
cd .. && \
mkdir wine32 && \
cd wine32 && \
../wine-git/configure \
--without-hal \
--without-sane \
--without-pcap \
--with-wine64=../wine64 && \
make > make.log 2>&1 && \
make install && \
cd ../wine64 && \
make install && \

# clean up
cd / && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

 

and the patch for gstreamer

 

--- glibconfig.h.orig	2014-02-06 11:09:52.043779521 +0100
+++ glibconfig.h	2014-02-06 11:44:14.838498832 +0100
@@ -49,6 +49,7 @@
#define G_GUINT32_FORMAT "u"
#define G_HAVE_GINT64 1          /* deprecated, always true */

+#ifdef __LP64__
typedef signed long gint64;
typedef unsigned long guint64;

@@ -71,6 +72,30 @@
#define G_MAXSIZE	G_MAXULONG
#define G_MINSSIZE	G_MINLONG
#define G_MAXSSIZE	G_MAXLONG
+#else
+G_GNUC_EXTENSION typedef signed long long gint64;
+G_GNUC_EXTENSION typedef unsigned long long guint64;
+
+#define G_GINT64_CONSTANT(val)	(G_GNUC_EXTENSION (val##LL))
+#define G_GUINT64_CONSTANT(val)	(G_GNUC_EXTENSION (val##ULL))
+#define G_GINT64_MODIFIER "ll"
+#define G_GINT64_FORMAT "lli"
+#define G_GUINT64_FORMAT "llu"
+
+#define GLIB_SIZEOF_VOID_P 4
+#define GLIB_SIZEOF_LONG   4
+#define GLIB_SIZEOF_SIZE_T 4
+
+typedef signed int gssize;
+typedef unsigned int gsize;
+#define G_GSIZE_MODIFIER ""
+#define G_GSSIZE_FORMAT "i"
+#define G_GSIZE_FORMAT "u"
+
+#define G_MAXSIZE	G_MAXUINT
+#define G_MINSSIZE	G_MININT
+#define G_MAXSSIZE	G_MAXINT
+#endif

typedef gint64 goffset;
#define G_MINOFFSET	G_MININT64
@@ -81,6 +106,7 @@
#define G_GOFFSET_CONSTANT(val) G_GINT64_CONSTANT(val)


+#ifdef __LP64__
#define GPOINTER_TO_INT(p)	((gint)  (glong) (p))
#define GPOINTER_TO_UINT(p)	((guint) (gulong) (p))

@@ -93,6 +119,20 @@
#define G_GINTPTR_MODIFIER      "l"
#define G_GINTPTR_FORMAT        "li"
#define G_GUINTPTR_FORMAT       "lu"
+#else
+#define GPOINTER_TO_INT(p)	((gint)  (gint) (p))
+#define GPOINTER_TO_UINT(p)	((guint) (guint) (p))
+
+#define GINT_TO_POINTER(i)	((gpointer) (gint) (i))
+#define GUINT_TO_POINTER(u)	((gpointer) (guint) (u))
+
+typedef signed int gintptr;
+typedef unsigned int guintptr;
+
+#define G_GINTPTR_MODIFIER      ""
+#define G_GINTPTR_FORMAT        "i"
+#define G_GUINTPTR_FORMAT       "u"
+#endif

#ifdef NeXT /* @#%@! NeXTStep */
# define g_ATEXIT(proc)	(!atexit (proc))
@@ -172,18 +212,32 @@
#define GUINT64_TO_LE(val)	((guint64) (val))
#define GINT64_TO_BE(val)	((gint64) GUINT64_SWAP_LE_BE (val))
#define GUINT64_TO_BE(val)	(GUINT64_SWAP_LE_BE (val))
+#ifdef __LP64__
#define GLONG_TO_LE(val)	((glong) GINT64_TO_LE (val))
#define GULONG_TO_LE(val)	((gulong) GUINT64_TO_LE (val))
#define GLONG_TO_BE(val)	((glong) GINT64_TO_BE (val))
#define GULONG_TO_BE(val)	((gulong) GUINT64_TO_BE (val))
+#else
+#define GLONG_TO_LE(val)	((glong) GINT32_TO_LE (val))
+#define GULONG_TO_LE(val)	((gulong) GUINT32_TO_LE (val))
+#define GLONG_TO_BE(val)	((glong) GINT32_TO_BE (val))
+#define GULONG_TO_BE(val)	((gulong) GUINT32_TO_BE (val))
+#endif
#define GINT_TO_LE(val)		((gint) GINT32_TO_LE (val))
#define GUINT_TO_LE(val)	((guint) GUINT32_TO_LE (val))
#define GINT_TO_BE(val)		((gint) GINT32_TO_BE (val))
#define GUINT_TO_BE(val)	((guint) GUINT32_TO_BE (val))
+#ifdef __LP64__
#define GSIZE_TO_LE(val)	((gsize) GUINT64_TO_LE (val))
#define GSSIZE_TO_LE(val)	((gssize) GINT64_TO_LE (val))
#define GSIZE_TO_BE(val)	((gsize) GUINT64_TO_BE (val))
#define GSSIZE_TO_BE(val)	((gssize) GINT64_TO_BE (val))
+#else
+#define GLONG_TO_LE(val)	((glong) GINT32_TO_LE (val))
+#define GULONG_TO_LE(val)	((gulong) GUINT32_TO_LE (val))
+#define GLONG_TO_BE(val)	((glong) GINT32_TO_BE (val))
+#define GULONG_TO_BE(val)	((gulong) GUINT32_TO_BE (val))
+#endif
#define G_BYTE_ORDER G_LITTLE_ENDIAN

#define GLIB_SYSDEF_POLLIN =1

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.