Can not connect to Genymotion ADB - android

I have 2 machines in the virtual box :
Santoku(linux) and device from Genymotion emulator
I want to connect to Genymotion ADB from another machine which is Santoku(linux) in the virtual box.
I made a network in Santoku Machine Bridged but when I make Network in Genymotion in the virtual box as Bridged, it is not working and give me this error:
the android emulator works only if I change the network to host only.
and when I try to connect to adb from Santoku machine it gives me:
unable to connect to 192.56.103:5555 (IP of the android machine)

I think you are mixing up the various networks. Let me explain with images.
The Genymotion virtual device has 2 network adapters: a host-only and a NAT or Bridged adapater.
Adapter 1:
Adapter 2:
The first adapter is used exclusively by Genymotion player to communicate with VirtualBox - the Android OS virtualization is handled by VirtualBox and Genymotion emulates the display via OpenGL translation through this interface. It should not be used by anything else but Genymotion.
The second adapter is the device network adapter: this is how the virtual device communicate with your local network to reach the internet. It is NAT by default which means that the device network is handled by VirtualBox DHCP. If you set the device network mode to Bridge, then the device network will be handled by your local network DHCP (as on the second screen).
Communication with the virtual device should be done via the same network as adapter 2. So, the solution is to set your Santoku VM network adapter in Bridge mode and use the same network interface than Genymotion VD adapter 2 (wlo1 in my case):

Related

Genymotion overrides dhcp of virtualbox network adapter

I am running an android image with genymotion 2.8.0 and virtualbox 5.0.28 on osx. My network has a router with dhcp 192.168.1.1 and I want to access my host system (the mac) from android by using 10.0.2.3 or the IP of the MAC. The problem is that the virtual network adapter is always getting an ip in the wrong net vboxnet1 => inet 192.168.57.1
Therefore I tried to changed the interface by setting the dhcp settings. Now every time when I do start the image with genymotion the dhcp settings are getting overridden as show in the screenshot.
So how can I persist the dhcp settings?
The Cause of the Problem
Genymotion is rewriting your network settings in VirtualBox because it has it's own way to handle network connection. That is due to the fact that Genymotion needs to make the android emulator think it has a cellular network or WiFi connection.
Defining Network Through Genymotion Settings
Because you said that Genymotion keeps resetting your VirtualBox's network configurations, I think it might have something to do with Genymotion's own network configuration.
In order to define your network setting in Genymotion, you need to do the following:
Open Genymotion => Settings => Network tab. You will get the following screen and in there you need to enable HTTP Proxy:
It is called a proxy, but it is supposed to work as kind of a "bridge" between your machine's DHCP and the emulator.
You might need to define the connection inside android system too, depending on the case.
If so, inside the emulator itself, go to: Settings => Wi-Fi => Long Click on WiredSSID => Modify network => Advanced options and modify the setting there too accordingly.
If that's not helping, you might need to change the specific setting of your emulator's virtual box:
Network Configuration via Virtualbox Settings
Genymotion uses two different kinds of network configurations in VirtualBox in order to operate.
An internal and technical network (defined in Network =>
Adapter 1 of VirtualBox settings) that helps Genymotion to display
the virtual device screen or forward events (clicks or widgets) to
the virtual device. This network configuration needs to remain untouched. Changing this may prevent Genymotion to run properly.
A network simulating access to your local network and to the Internet (defined in Network => Adapter 2 of VirtualBox settings). This network configuration is the one responsible for the emulator's internet connection.
So, you can configure Network => Adapter 2 of VirtualBox settings as desired, according to the following cases:
Use NAT, if you are using Genymotion on your local machine.
Use Bridged Adapter, if you need your virtual device to use an IP address of your local network (a DHCP server in your local network is required).
You will need to choose the Bridged Adapter option, in your case.
Make sure to change that setting in your specific VirtualBox device.

Genymotion emulator no internet connection

I am trying to connect my genymotion emulator to internet and got this message:
emulator network configuration:
On Mac Os I solved No Internet Connection Problem on Genymotion emulator using next steps:
Go to Android Settings -> System -> Developer Options -> Turn On Developer Options
In Settings go to Network & Internet -> Mobile Network -> Turn Off Data Roaming
In Settings go to Network & Internet -> Data usage -> Turn Off Mobile Data
In Settings go to Network & Internet -> Wi-Fi -> Turn On Wi-Fi
And Internet Connection should be established. Also restarting the emulator may be required.
I didn't change anything in VirtualBox:
Best network configuration for an optimal use of Genymotion
To run properly, Genymotion uses two different network configurations:
An internal and technical network (Network > Adapter 1 of VirtualBox settings)
This network is used for example to display the virtual device screen or forward events (clicks or widgets) to the virtual device.
Changing this network configuration may prevent Genymotion to run properly.
If you get the message Unable to connect to the virtual device, please refer to When I start a virtual device, why does the window remain black?.
A network simulating access to your local network and to the Internet (Network > Adapter 2 of VirtualBox settings)
You can configure it as desired, but be aware that an error in this configuration may prevent Genymotion to access the local network and the Internet.
We recommend that you use the following configuration:
NAT, if you are using Genymotion on your local machine.
Bridged Adapter, if you need your virtual device to use an IP address of your local network (a DHCP server in your local network is required).
Currently, this network is regarded as the Wi-Fi connection of your virtual device.
Reference:
https://www.genymotion.com/#!/support?chapter=network-configuration#faq
First of, check your VirtualBox Host-Only Network #2 in: Control Panel\Network and Internet\Network Connections, has the correct properties as follows:
Navigate to Control Panel\Network and Internet\Network Connections and Right click the Connection: VirtualBox Host-Only Network #2
Select Properties
From the popup, activate the VirtualBox NDIS6 Bridged Networking Driver by checking/ticking the check-box and click OK
Lastly, navigate to Oracle VM Box\Google Nexus 7 4.4.4 ...\Settings\Network\Adapter 2 and enable the Network Adapter 2.
Hope this helps resolve your issue.
PS.
If you are connected via wireless and you have followed the above, do try un-checking the cable connected check box under Adapter 2 as shown in the image below.
Try this:
Just turn Wifi on and select WiredSSID network.
1) Open the Oracle VM VirtualBox manager
2) Settings->Network
3) Select the Adapter 2 (Adapter 1 is used primary by Genymotion and cannot change)
4) Select the NAT
5) Restart the VM and Genymotion
Otherwise:
Try on the virtual device > go into Settings > Wi-Fi > Select the IP automatically > After that just click on Done > and now... connected to the internet.
try to uninstall your android virtual device that cannot access internet in genymotion, and re-install a new virtual device. I tried and fixed.
The reason I guess is I installed genymotion and add virtual device before install the virtualbox.
Update Virtualbox and clear-cache work in my case
update virtualbox
genny motion - preference - misc - clear-cache -> restart emulator
I faced the same issue and followed all above instructions, but not worked.
Open Oracle VM Virtual box
Select the custom phone ->right click->settings->General->Basic
Change the type to your current OS (My case Mac OS X)
Choose Version of the Mac OS (64 bit)
Only this solved my problem.
My problem was that I changed the IP of my machine, and I already had the vitual device configured. To solve, I clicked on wifi on the virtual device, clicked on the WiredSSID network and chose the "forget" option.
Open the Oracle VM VirtualBox manager, Settings->Network, Select the Adapter 2 because Adapter 1 is used primary by Genymotion and that's why each time you change it and restart the vm it reset itself to old settings, using Bridged Adapter and select the working network card. if you are behind proxy, please use NAT
In my Mac, genymotion device's WiFi was off. So I solve this issue only by turning on the WiFi. and internet starts back to work
Try to ping your VM ip :
ping 192.168..
it is possible that a firewall blocks the connection. try to stop it : go to process and search for firewall and stop it.
I had similar issue:
I had a LAN cable internet connection to my laptop. (No wifi )
In Genymotion, I opened wifi and there was a wifi network available , just connected to that network. Then it worked.
(But actually I haven't turned my modem wifi, I think its some kind of virtual wifi)
In your Computer go to Control Panel > All Control Panel Items > Network Connections then change the Network Adapter Preferred DNS Server to 8.8.8.8 which is Google Server
Below steps helped me:
(i) Enabled network from sidebar
(ii) Enabled Developer Options
Late but I had a similar issue when running Genymotion(3.2.1) on Windows10
I had the Windows "Virtual Machine Platform" on as I was using WSL2
I disabled it,restarted my system and Genymotion got connected to internet.
Hope someone finds this useful.
What worked was pulling down the notification bar and clicking the Wi-Fi icon to turn it off and then back on again 😂

Fixed host address from Visual Studio Emulator for Android

In the stock Android emulator, 10.0.2.2 always maps to the host. This makes it handy for baking into web service tests on the device. Is there any equivalent host name or address for the Visual Studio Emulator for Android or a way to create one?
Hyper-V creates a "Internal Ethernet Port Windows Phone Emulator Internal Switch" with address 169.254.80.80, but the emulator can't access it.
there is no such builtin address I believe, but you can do something similar:
create internal LAN switch in hyper-v and link it to some of your network cards (wifi or ethernet) via internet connection sharing (ICS).
in this case host adapter attached to this internal switch will get fixed address (192.168.137.1) and some kind of dhcp server serving 192.168.137.0/24 subnet.
attach this switch to android image in hyper-v and emulator will get address 192.168.137.abc, will be able to connect to host on 192.168.137.1 and have access to internet at the same time

Connecting from Android device to linux virtual machine on MAC via bluetooth

Let me explain the situation:
Web application is running on ubuntu virtual machine (VirtualBox). I can
ping it from my mac. Vm's ip address is 192.168.56.100.
Android device is connected to a mac via bluetooth internet sharing.
I can ping from android to mac. mac's ip address 192.168.65.1.
I can access web application from android if its are running directly on mac (MAMP).
The problem: I need to be able to ping from android device to virtual machine.
Don't know what is the best ways to achieve that. I believe i have to set up some sort of network
bridge or IP forwarding or port forwarding or routing rule to virtual machine.
This is my virtual box network settings:
http://imageshack.us/a/img42/2475/9ufb.png
http://imageshack.us/a/img24/2319/w4nh.png
Tried to make a bridge network adapter to Bluetooth PAN on virtual box setting
Didn't work.
Any help or advice would be appreciated.
Thank you.

Google TV emulator in bridge network mode

I want to connect to my app running in the emulator from another machine on my local network. The ip assigned to emulator is 10.0.2.15 while my host machine has ip 192.168.1.* . Is there any way to run the emulator in bridge mode such that it gets an ip in the range 192.168.1.* ?
The Android Emulator has a virtual router connecting it to the network. You can use the redir command to setup network connections. See this article:
http://developer.android.com/guide/developing/devices/emulator.html#emulatornetworking

Categories

Resources