4

I have a Chromebook that I've set up in Developer Mode, with a crouton-installed version of Linux running alongside. Within the Linux crouton, I'm running a simple web server.

My question is whether it's possible to access that server using any Android apps that are also running on that Chromebook?

Android apps have been installable natively on ChromeOS for some time, but everything that I've read says that they run in some kind of sandbox. ChromeOS itself is pretty tight with its firewall rules as well.

Just to get a start, I'm trying to use the Android version of the Chrome browser to load up a page that's running on a web server in the Linux crouton. I've tried localhost,127.0.0.1, and the Chromebook's current IP address.

I followed the instructions at https://developer.android.com/topic/arc/index.html to enable Developer Mode on the Android side and also, I think, loosen up those firewall rules on the ChromeOS side.

Is there some secret sauce that I'm missing? Is this even possible at all?

ChillyPenguin
  • 1,150
  • 12
  • 18

3 Answers3

0

I had the exact same question and found this: https://developer.android.com/topic/arc/index.html#network

It seems that in essence there is no IP traffic allowed from local Chrome to the Android web servers..

Update (thanks jlb for the ping) However, you can run ifconfig in crouton. And then you can access your content via that IP address. I wonder if Firefox takes that shortcut for you..

tomdemuyt
  • 4,572
  • 2
  • 31
  • 60
  • On my installation, Firefox is an Android app (as opposed to a Chrome Extension or ChromeOS app), which I assume runs under the same emulator or container as termux, where I run node. So my lightly-informed guess is that Firefox's network configuration is relative to the emulator. – jlb May 10 '18 at 22:20
0

Leveraging @tomdemuyt's post, his citation source says that android apps will be assigned a private IP address, so you can access local IP traffic, just not with localhost or 127.0.0.1.

For example, from termux execute ifconfig and look for the local IP address. Then run your service, e.g. node from termux, or kWs, any Android app.... and point Chrome to http://<your-local-ip-address>:<your-service-port>

127.0.0.1 and localhost will work from other Android apps, just not Chrome.

jlb
  • 679
  • 1
  • 10
  • 21
0

The solutions by jlb and tomdemuyt are for accessing a android app from chromeos (i.e. an ftp server)

However, I needed the opposite way (accessing an node server running in the linux virtual environment from android chrome browser) and that was basically the question ChillyPenguin asked for.

I finally solved it:

  • Start your webserver and ensure that you can access it with localhost (in my case http://localhost:8080
  • Within the chromeos terminal run
hostname -I
100.115.92.203 (and an ip:v6:adress:...)

(or ip addr show which is more verbose)

Jürgen Steinblock
  • 30,746
  • 24
  • 119
  • 189
  • Are you able to discover the 100.115.92.203(in this case) IP from the Android App or you need to hardcode it in advance? – Ionut Holbia Oct 27 '21 at 09:50