LongMarch7 / android-vnc-server

Automatically exported from code.google.com/p/android-vnc-server
0 stars 0 forks source link

android-vnc-server doesn't work on x86 android ports #15

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run the binary on android-x86 ports 

It will be nice if the x86 binary is also available on the Downloads page. 

Original issue reported on code.google.com by puneet.y...@gmail.com on 6 Jun 2010 at 6:58

GoogleCodeExporter commented 8 years ago
puneet-imac:tools pchawla$ ./adb shell  /data/androidvncserver
/system/bin/sh: /data/androidvncserver: not executable: magic 7F45

Original comment by puneet.y...@gmail.com on 6 Jun 2010 at 7:00

GoogleCodeExporter commented 8 years ago
yes I can't get the binary to run under x86 either. The type of the binary is 
ARM so it makes sense that x86 won't run it. I also am attempting to build for 
x86. 

Has anyone already done the build for x86? I've never used Ant and the src 
doesn't come with all the needed XML files (e.g. build.properties I think). The 
build tools are all installed according to several android developer help pages 
I've read, but the build config files are not. It's not clear exactly how to 
create them. Ant has pretty good documentation but seems to start at newbie 
stage 5 rather than stage 1 which is where I'm at, never having used Ant before.

Any suggestions on setting up Ant and/or Eclipse to build this for x86 would be 
greatly appreciated.

Original comment by andr1.do...@gmail.com on 21 Oct 2010 at 9:13

GoogleCodeExporter commented 8 years ago
yes I can't get the binary to run under x86 either. The type of the binary is 
ARM so it makes sense that x86 won't run it. I also am attempting to build for 
x86. 

Has anyone already done the build for x86? I've never used Ant and the src 
doesn't come with all the needed XML files (e.g. build.properties I think). The 
build tools are all installed according to several android developer help pages 
I've read, but the build config files are not. It's not clear exactly how to 
create them. Ant has pretty good documentation but seems to start at newbie 
stage 5 rather than stage 1 which is where I'm at, never having used Ant before.

Any suggestions on setting up Ant and/or Eclipse to build this for x86 would be 
greatly appreciated.

Original comment by andr1.do...@gmail.com on 21 Oct 2010 at 9:13

GoogleCodeExporter commented 8 years ago
How to build this for x86?
Thank you!

Original comment by xdmyl...@163.com on 4 Mar 2011 at 6:13

GoogleCodeExporter commented 8 years ago
I built it for android-x86 with Debian squeeze.
I was exhausted... :-[

#####################################################
# 1. Install necessary packages
#####################################################

$ sudo apt-get install make gcc git-svn

#####################################################
# 2. Get android-x86 NDK (froyo is android-2.2)
#####################################################

$ cd ~
$ mkdir gittmp
$ cd gittmp

$ git clone git://git.android-x86.org/platform/prebuilt.git -b froyo-x86
$ git clone git://git.android-x86.org/platform/ndk.git -b froyo-x86

$ cd ndk

[directory tree]
gittmp
   + prebuilt
   + ndk  <- current directory!!

#####################################################
# 3. Get android sources (froyo is android-2.2)
#####################################################

$ git clone git://android.git.kernel.org/platform/external/jpeg.git 
external/jpeg -b froyo
$ git clone git://android.git.kernel.org/platform/external/zlib.git 
external/zlib -b froyo

[directory tree]
gittmp
   + prebuilt
   + ndk  <- current directory!!
      + external
          + jpeg
          + zlib

#####################################################
# 4. Build libjpeg.a (froyo's API-level is 8)
#####################################################

$ mkdir -p apps/jpeg

$ vi apps/jpeg/Application.mk

APP_PROJECT_PATH := $(call my-dir)
APP_MODULES      := libjpeg
APP_BUILD_SCRIPT := $(APP_PROJECT_PATH)/Android.mk
APP_CFLAGS:=-fno-stack-protector

$ cp -p external/jpeg/Android.mk apps/jpeg/
$ vi apps/jpeg/Android.mk

...

$ diff external/jpeg/Android.mk apps/jpeg/Android.mk
1c1
< LOCAL_PATH:= $(call my-dir)
---
> LOCAL_PATH:= external/jpeg
37c37
< include $(BUILD_SHARED_LIBRARY)
---
> include $(BUILD_STATIC_LIBRARY)

$ make APP=jpeg SYSROOT:=build/platforms/android-8/arch-x86

[directory tree]
gittmp
   + prebuilt
   + ndk  <- current directory!!
      + external
         + jpeg
         + zlib
      + apps
         + jpeg
            + Application.mk
            + Android.mk

#####################################################
# 5. Build libz.so (froyo's API-level is 8)
#####################################################

$ mkdir -p apps/zlib

$ vi apps/zlib/Application.mk

APP_PROJECT_PATH := $(call my-dir)
APP_MODULES      := libz
APP_BUILD_SCRIPT := $(APP_PROJECT_PATH)/Android.mk
APP_CFLAGS:=-fno-stack-protector

$ cp -p external/zlib/Android.mk apps/zlib/
$ vi apps/zlib/Android.mk

...

$ diff external/zlib/Android.mk apps/zlib/Android.mk
1c1
< LOCAL_PATH:= $(call my-dir)
---
> LOCAL_PATH:= external/zlib
26,86d25
<
< include $(CLEAR_VARS)
<
< LOCAL_ARM_MODE := arm
< LOCAL_MODULE := libz
< LOCAL_CFLAGS += -O3 -DUSE_MMAP
< LOCAL_SRC_FILES := $(zlib_files)
< include $(BUILD_STATIC_LIBRARY)
<
< include $(CLEAR_VARS)
<
< LOCAL_ARM_MODE := arm
< LOCAL_MODULE := libz
< LOCAL_CFLAGS += -O3 -DUSE_MMAP
< LOCAL_SRC_FILES := $(zlib_files)
< include $(BUILD_HOST_STATIC_LIBRARY)
<
<
<
< unzip_files := \
<       adler32.c \
<       crc32.c \
<       zutil.c \
<       inflate.c \
<       inftrees.c \
<       inffast.c
<
< include $(CLEAR_VARS)
< LOCAL_SRC_FILES := $(unzip_files)
< LOCAL_MODULE:= libunz
< LOCAL_ARM_MODE := arm
< include $(BUILD_HOST_STATIC_LIBRARY)
<
< include $(CLEAR_VARS)
< LOCAL_SRC_FILES := $(unzip_files)
< LOCAL_MODULE:= libunz
< LOCAL_ARM_MODE := arm
< include $(BUILD_STATIC_LIBRARY)
<
< include $(CLEAR_VARS)
<
< LOCAL_SRC_FILES:=        \
<       minigzip.c
<
< LOCAL_MODULE:= gzip
<
< LOCAL_SHARED_LIBRARIES := libz
<
< include $(BUILD_EXECUTABLE)
<
< include $(CLEAR_VARS)
<
< LOCAL_SRC_FILES:=        \
<       minigzip.c
<
< LOCAL_MODULE:= minigzip
<
< LOCAL_STATIC_LIBRARIES := libz
<
< include $(BUILD_HOST_EXECUTABLE)
<

$ make APP=zlib SYSROOT:=build/platforms/android-8/arch-x86

[directory tree]
gittmp
   + prebuilt
   + ndk  <- current directory!!
      + external
         + jpeg
         + zlib
      + apps
         + jpeg
            + Application.mk
            + Android.mk
         + zlib
            + Application.mk
            + Android.mk

#####################################################
# 6. Build androidvncserver (froyo's API-level is 8)
#####################################################

$ git svn clone http://android-vnc-server.googlecode.com/svn/trunk 
apps/AndroidVncServer

$ vi apps/AndroidVncServer/Application.mk

APP_PROJECT_PATH := $(call my-dir)
APP_MODULES      := androidvncserver
APP_BUILD_SCRIPT := $(APP_PROJECT_PATH)/Android.mk
APP_CFLAGS:=-fno-stack-protector

$ cp -p apps/AndroidVncServer/fbvncserver.c 
apps/AndroidVncServer/fbvncserver.c.org
$ vi apps/AndroidVncServer/fbvncserver.c

...

$ diff apps/AndroidVncServer/fbvncserver.c 
apps/AndroidVncServer/fbvncserver.c.org
154c154
<         //exit(EXIT_FAILURE);
---
>         exit(EXIT_FAILURE);
160c160
<         //exit(EXIT_FAILURE);
---
>         exit(EXIT_FAILURE);

$ mkdir -p out/apps/AndroidVncServer/x86/
$ find out/apps/jpeg/ -type f -name libjpeg.a -exec cp {} 
out/apps/AndroidVncServer/x86/ \;
$ find out/apps/zlib/ -type f -name libz.so -exec cp {} 
out/apps/AndroidVncServer/x86/ \;

$ make APP=AndroidVncServer SYSROOT:=build/platforms/android-8/arch-x86
$ find out/apps/AndroidVncServer/ -type f -name androidvncserver -exec cp {} 
./androidvncserver_x86 \;

[directory tree]
gittmp
   + prebuilt
   + ndk  <- current directory!!
      + external
         + jpeg
         + zlib
      + apps
         + jpeg
            + Application.mk
            + Android.mk
         + zlib
            + Application.mk
            + Android.mk
         + AndroidVncServer
            + Application.mk
            + fbvncserver.c
            + ...
      + androidvncserver_x86  <- binary!!

#####################################################
# 7. Run androidvncserver_x86
#####################################################

$ export ADBHOST=<IP_ADDRESS of android-x86>
$ adb kill-server
$ adb start-server
$ adb push androidvncserver_x86 /system/bin/
$ adb shell
root@android:/ # chmod 755 /system/bin/androidvncserver_x86
root@android:/ # androidvncserver_x86 -k /dev/input/event1 -t /dev/input/event2

[result]
Accessing <IP_ADDRESS of android-x86>:5901 with vnc-viewer,
now only view and keyboard work well, but mouse doesn't works.
Probably, fbvncserver.c should be patched.

Original comment by sakurai....@gmail.com on 18 May 2011 at 4:09

Attachments:

GoogleCodeExporter commented 8 years ago
I got the touchscreen to work!!!

Basically I used the above instructions but with oNaiPs' droidVNC version of 
the fbvncserver.c + suinput. Of course it doesn't help that androidx86 doesn't 
initialize the uinput module by default!

Build Instructions:
1. Do all of the steps above up right until the final make
2. Go to github and grab the droid vnc version of fbvncserver.c, suinput.h, and 
suinput.c. Save them to your apps/AndroidVncServer
3. In the Android.mk in apps/AndroidVncServer add suinput.c after the 
fbvncserver.c
4. Now use the make command from the above post to try to compile, it might 
work but for me I was getting errors about __android_log_print not being there. 
In theory you are supposed to add the -llog as one of the linked libraries but 
the ndk couldn't find it for me. If this happens, go to step 4.a.
4.a. In fbvncserver.c add the following macro after the include for log.h: 
#define __android_log_print(type, name, ...) printf(__VA_ARGS__)
4.b. Cross your fingers and recompile!
5. Continue the instructions from the above post to copy the file to your 
Androidx86's /system/bin
6. Verify you have a /dev/uinput on your Android. If you do not, you need to 
search for the uinput.ko: find / | grep uinput
6.a. Install the uinput module, for instance: insmod 
/system/lib/modules/2.6.35.7-android-x86+/kernel/drivers/input/misc/uinput.ko
7. Run your vnc executable as above BUT WITHOUT the -k and -t parameters (droid 
vnc uses the /dev/uinput automatically so there is no need for this).

I attached my build...

Original comment by maha...@gmail.com on 7 Jul 2011 at 4:16

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Thanks for the port, I finally got it going on a VM and I love it. My only 
issue currently is that I can't seem to access the back button from either 
right click or escape. Is there a work around for that?

Original comment by lars.sol...@gmail.com on 11 Feb 2012 at 4:45

GoogleCodeExporter commented 8 years ago
This doesn't work on Android x86 ICS. Been searching all over, no luck with 
anything.

Original comment by s...@garbesi.com on 4 Apr 2012 at 7:47

GoogleCodeExporter commented 8 years ago
how is it done on a VM lars??It still doesn't work for me on VM.. can you show 
me your work on VM.. thanks..

Original comment by RizkiAb...@gmail.com on 12 Apr 2012 at 7:19

GoogleCodeExporter commented 8 years ago
Same here: can't make it run on Android x86 ICS:

#androidvncserver_x86&
sh androidvncserver_x86: not found

Any ideas? The permissions are 755 and I'm running it as root...

Thank you all for a great bloog!

Original comment by evgeny.b...@mobilepointofsales.com on 24 Dec 2012 at 10:23

GoogleCodeExporter commented 8 years ago
Guys! My appologies for my previous commet :) I for got to run it correctly:

./droidvnc_x86

Now it works!!!! Thank you!!

Original comment by evgeny.b...@mobilepointofsales.com on 24 Dec 2012 at 10:27

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Many thanks to sakurai....@gmail.com! It works!

P.S. Some links have been changed so be careful.

Original comment by hebo....@gmail.com on 25 Sep 2013 at 7:19

GoogleCodeExporter commented 8 years ago
Wonderful workaround for x86. I am glad I ended up here. 

I am trying to implement following scenario :- 
I have made my ubuntu system as server and I am running genymotion in it. 
I want some other computer(client) to access this genymotion device through VNC 
implementation. The client will just open browser and can access the genymotion 
device. 
Client-side implementation:-I can use noVNC(with combination of HTML5 and 
canvas) in browser.

I have 2 questions : 
1 - Is this VNC client-server implementation possible ? 
2 - Will the above workaround of making VNC server work with higher versions of 
genymotion devices (mainly Android 4.3+)?? 

Any suggestions and idea are appreciated. Thanks . 

Original comment by shivang....@gmail.com on 5 Jul 2014 at 1:01