如何启用VPN支持在Android模拟器

如何启用VPN支持在Android模拟器

本文介绍了如何启用VPN支持在Android模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢使用PPTP VPN的Andr​​oid模拟器。我的VPN供应商是Witopia。设置工作在一个真正的手机(HTC Desire的)。

I like to use a PPTP VPN in the Android emulator. My VPN provider is Witopia. The settings work on a real phone (HTC Desire).

它不工作,连接只是超时一段时间后。

It does not work, the connection just times out after a while.

亚行logcat 打印:

D/VpnManager( 1527): succeeded to connect to VPN service
D/com.android.settings.vpn.AuthenticationActor( 1527): ~~~~~~ connect() succeeded!
I/SProxy_mtpd( 2211): Stop VPN daemon: mtpd
D/VpnSettings( 1527): received connectivity: Witopia: connected? CONNECTING   err=0
D/SProxy_mtpd( 2211): mtpd is stopped after 0 msec
D/SProxy_mtpd( 2211): stopping mtpd, success? true
I/SProxy_racoon( 2211): Stop VPN daemon: racoon
D/SProxy_racoon( 2211): racoon is stopped after 0 msec
D/SProxy_racoon( 2211): stopping racoon, success? true
D/VpnService( 2211):   Local IP: 10.0.2.15, if: eth0
D/VpnService( 2211):        VPN UP: down
I/SProxy_mtpd( 2211): Start VPN daemon: mtpd
D/SProxy_mtpd( 2211): mtpd is running after 0 msec
D/SProxy_mtpd( 2211): service not yet listen()ing; try again
D/mtpd    ( 2224): Waiting for control socket
D/mtpd    ( 2224): Received 19 arguments
I/mtpd    ( 2224): Using protocol pptp
I/mtpd    ( 2224): Connecting to 203.131.247.213 port 1723
I/SProxy_mtpd( 2211): got data from control socket: 19
I/mtpd    ( 2224): Connection established (socket = 10)
D/mtpd    ( 2224): Sending SCCRQ
D/mtpd    ( 2224): Received SCCRP -> Sending OCRQ (local = 32087)
I/mtpd    ( 2224): Tunnel established
D/mtpd    ( 2224): Received OCRQ (remote = 52286)
I/mtpd    ( 2224): Session established
I/mtpd    ( 2224): Creating PPPoX socket
F/mtpd    ( 2224): Socket() Address family not supported by protocol

其次是用户消息:无法连接到网络。你想再试一次吗?

与此同时,在亚行logcat

E/VpnService( 2211): onError()
E/VpnService( 2211): java.io.IOException: Connecting timed out
E/VpnService( 2211):    at com.android.server.vpn.VpnService.waitUntilConnectedOrTimedout(VpnService.java:206)
E/VpnService( 2211):    at com.android.server.vpn.VpnService.onConnect(VpnService.java:136)
E/VpnService( 2211):    at com.android.server.vpn.VpnServiceBinder$2.run(VpnServiceBinder.java:114)
E/VpnService( 2211):    at java.lang.Thread.run(Thread.java:1096)
I/VpnService( 2211): disconnecting VPN...
D/VpnSettings( 1527): received connectivity: Witopia: connected? DISCONNECTING   err=0
I/SProxy_mtpd( 2211): Stop VPN daemon: mtpd
D/SProxy_mtpd( 2211): mtpd is stopped after 0 msec
D/SProxy_mtpd( 2211): stopping mtpd, success? true
I/SProxy_racoon( 2211): Stop VPN daemon: racoon
D/SProxy_racoon( 2211): racoon is stopped after 0 msec
D/SProxy_racoon( 2211): stopping racoon, success? true
D/VpnService( 2211): onFinalCleanUp()
I/VpnService( 2211): restore original suffices --> null
D/VpnSettings( 1527): received connectivity: Witopia: connected? IDLE   err=101

我想这是任何一个权限问题或Android模拟器不支持它。

I guess this is either a permission problem or the Android emulator does not support it.

我的平台是MacOSX上,模拟器运行的是Android 2.2。

My platform is MacOSX, Emulator is running Android 2.2.

这个问题涉及到:

  • Does VPN in the Android emulator 2.2 work?
  • Setting up a VPN in the emulator
  • will android emulator access a network using a vpn on the host machine

推荐答案

是的,它是像籽粒问题:

yes it is like kernal issue:

  1. 在没有tun.ko模块(请参阅的http://论坛.xda-developers.com / showthread.php T = 630703&放大器;页= 2
  2. 在不支持LKM(可加载的内核模块)(HTTP://$c$c.google.com/p/get-a-robot-vpnc/issues/detail ID = 100)

所以,我认为你需要定制的内核 HTTP://$c$c.google.com/p/batterymine/wiki / BuildingInModuleSupport

So I think you need custom kernelhttp://code.google.com/p/batterymine/wiki/BuildingInModuleSupport

此外,您将需要复制到仿真器等模块:slhc.ko,PPP * .ko

Also you will need copy to emulator other modules: slhc.ko, ppp*.ko

这篇关于如何启用VPN支持在Android模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-02 00:30