Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Anbox – Android in a Box (gravedo.de)
317 points by popey on April 11, 2017 | hide | past | favorite | 62 comments


This could be really useful for Android. For example, continuous integration services like Circle CI are completely useless for UI automation tests because they don't expose virtualization infrastructure necessary to run the fast x86 emulator. The ARM one is unusably slow (even with dozens of lines of code by me to try to keep the screen on and unlocked while tests that run in 10 seconds on a dev machine with x86 plod through taking over half an hour on ARM).

Circle has mentioned in discussions that the virtualization limit will never be fixed because it is due to them running on Google's cloud services that don't support it.

They do seem to support LXC, however: https://circleci.com/docs/enterprise/config/


It's not exactly ideal for CI. We had to run uiautomator tests on Jenkins to get sensible real-world device coverage. On top of that these were a pain to maintain as each device required things to be done a little differently. Not to mention the hell we had doing CI on older devices with 4.4.4.


I'm curious to know what they have running in Google Cloud, I assumed they were 100% AWS - Is it just their Android builds?


Can someone explain how badly `snap install --classic anbox-installer` might mess up my development machine? Can I expect uninstall to properly clean up?


IIUC installing the snap should be easily reversible, but it only installs an installer :). The installer then does some much more intrusive stuff, It has to install kernel modules for ashmem and binder.

Can't really blame the devs, it's easy to see how this would be a hard thing to package via normal techniques.


I thought snaps were meant to be a container-like thing. Try it on a VM if you're worried?


Anbox in docker should be a good choise here.


It's already using containers (LXC) for running the actual Android system. The rest of the package contains kernel modules and udev rules, which aren't suitable for containerization.


Sort of related: I think Android should consider switching to using cgroups for each application, rather than a separate user account. This will bring it more in line with the mainline kernel and maybe we can see some enhancements there.


Gee, I had kinda hoped/expected that was the case already. Aren't iOS apps sandboxed like that? Sadly, I think many exploits involve chaining until you get to a defect in the kernel -- from which a cgroup namespace wouldn't help much.


It's not a bad idea, but why would that bring them closer to the upstream kernel? UIDs aren't exactly special; are they doing some extra user separation?


Yah, id try to explain but I'll get downvoted for not bring completely correct. It's 'different', there are a bunch of great blog posts on it. Iirc the biggest problem is Google's patches are pretty useless to the rest of the Linux community because the security model is so strange


This is pretty cool, but the advent of Android Things might've rendered it obsolete. My understanding is you can run a custom Android Things image on a Raspberry Pi 3, and get access to the full Android OS, along with developer niceties like adb for pushing APKs.


I'm not sure it's really comparable to Android Things... you can run this in an LXC container on your desktop. With Android Things, unless I've missed something, you need to start by getting a Development Board from the supported hardware list.


Furthermore, Android Things is designed to run just one application on the whole machine, whereas Anbox is for running Android apps in a container within a multitasking environment.


This is cool. I guess something similar might be coming from google as part of unification between android and chrome OS. However this is still very useful as it can exist outside chrome OS ecosystem.


My bet goes to Android + Chrome OS + Fuchsia OS

[0]https://en.wikipedia.org/wiki/Google_Fuchsia


This is really cool from a technical perspective, but what's the use case? I can't think of a single Android app that I use that doesn't have an equivalent desktop/web app that's optimized for a mouse and keyboard. I can't imagine the UX nightmare of using touch-optimized apps on a regular PC.


> I can't think of a single Android app that I use that doesn't have an equivalent desktop/web app that's optimized for a mouse and keyboard.

I can. E.g. my phone settings manager, my TV provider's remote app, my main screen of multiple widgets, my local TV station's weather app w/ notifications, etc. Also, in many cases for web apps w/ mobile app equivalents, the latter are easier to use and snappier. Finally, though less useful, this can give an app developer a sandbox in which to embed his app upon distribution and be able to target Android and Linux assuming the app is simple.


> I can't imagine the UX nightmare of using touch-optimized apps on a regular PC.

You'd be surprised. Android has full mouse and keyboard support - you can click on buttons, tab between text boxes, use scroll gestures... it's not perfect (and some apps are awful) but I've been very surprised by how much I can do.


Yeap. You can even alt-tab between apps (even if the UI is worse than on Windows).


If you can debug in this, it's got to feel a lot faster than the emulator. Though I admit I haven't used the emulator in so long that I don't know if they ever fixed how slow it was.



That's a great point; I hadn't even thought about development. If that is indeed the case, this could be a godsend for Android devs!


>Though I admit I haven't used the emulator in so long that I don't know

https://developer.android.com/studio/run/emulator.html

On my MacBook it's actually faster than the iOS simulator.


I'm not sure you need a use case for this to be a sensible addition to the tools we have in the box.

IMHO if this machine is linux, and that machine is linux, and both machines are fully open, then why can't you run this app on that machine? Because reasons, that's why... no more!


For example, app development - virtual machines running Android are dreadfully slow and cumbersome to use.

Also, Linux doesn't have many apps and small games. For example, if this works, Linux users can run Word and Excel, as well as Angry Birds.


In current state it will probably crash on more complex stuff.

In two years if there's no widespread adoption it will still crash because it's just another potential platform for QA to test on.

Also if I'm not mistaken it will only run apps that are compiled for x86 Android.


I can tell you haven't used the new emulator in some time. It's just as fast as the iOS simulator.


Nice way to try out suspicious looking apps in safe environment, before loading them up in your phone.


I've been interested in something like this since Spotify pulled all support for their cross-platform libspotify library and left us with just their iOS and android SDKs. Nothing I could see specifically mentions audio support but surely it's a given.


WhatsApp. I have several phone numbers, despite having just one phone - and I need separate WhatsApp accounts for each, but the official (essentially, only) client insists on only being connected to one.


> the official (essentially, only) client insists on only being connected to one.

You might be able to work around that limitation by using an app like AppCloner [1] or Parallel Space [2].

[1] https://play.google.com/store/apps/details?id=com.applisto.a...

[2] https://play.google.com/store/apps/details?id=com.lbe.parall...


+1 WhatsApp is the only reason I keep an Android phablet with data only plan which I would happily get rid of since I do everything on a laptop or small netbook when possible. I know about the WA web client, but it doesn't solve the problem as it requires the phablet to be on, connected and not in sleep mode which is a huge limitation.


I wonder whether this could work on Sailfish OS? Currently there is a similar library called Alien Dalvik, but which is proprietary and can only run on phones that Jolla officially produces, not ports to other hardware.


This looks quite similar to Samsung's new Dex dock UI. Of course, you don't need an S8 for this to work. Very interesting.


I wonder whether this could be used as a simple way to get an Android env for Qt development? Last time I did Qt dev for mobile the biggest headaches were trying to get the Android SDK and NDK configured and setup in a way that actually worked with Qt :-s

(Similar-ish thought for React Native, although it was much easier than Qt somehow (so much so that originally I was planning to do the project in Qt and changed to React Native because everything was up and running much faster).)


Last time I tried Qt for android, the problem wasn't setting up development kits, but rather, it didn't support the x86 android target in order to run the fast emulator.

In any case, this is not about development environments, this is about running android in a chroot jail likr environment directly on linux.


Is this running on ARMv7-based boards yet, or only on x86 machines? The former would be much more useful for running proprietary Android apps with a native component.


You might be surprised how many Android apps work on x86 too. Either they are "fat" (have libraries for multiple ABIs in the .apk) or the Play Store has multiple versions, and delivers you the one for your platform.

Edit: however, the last FAQ mentions there's a system image for armhf so you might be in luck anyway :)


If nothing else, it's probably worth looking into integration with qemu user mode emulation, which already allows execution of ARM binaries on x86 platforms


You might be able to use libhoudini for ARM emulation on x86.


This is wonderful. Was waiting for the Chrome team to open source a their Android app container code - didn't happen. Will be testing!


I wonder if this could be ported to WSL. Android apps were Microsoft's original motivation for developing it, after all.


That would have limited utility, since many Android apps in the wild assume an ARM processor.


Can you get Google Play Services on it?


This is covered in their FAQ:

"Is it possible to install the Google Play Store?

Yes, this is generally possible. However Google doesn't allow anyone to ship its applications as long as the device is not certified and the vendor didn't sign an agreement with Google.

The Anbox project does not have any interest in shipping the Google Play store and we're not allowed to do so. We may add an easy way for our users at a later point which allows easy distribution of Android applications suited for the Anbox runtime environment."


I guess this can be easily fixed by flashing a gapps package on the guest Android image. That is if flashing stuff is actually supported.


There was a thread a few weeks ago on HN about running Android w/o google... can't seem to find it


But anbox is already running a flavor of AOSP, which is android without google (unless you meant android without google code, in which case you will have exactly nothing to run). AOSP can entirely be built from source, everything is Apache2-licenced, and it does not contain or require the gapps. Now you can add most gapps APIs (in order to make apps that rely on them work) through the microg project, or you can install the official google services using opengapps.


Probably microg could be legally used.


Otherwise it is useless!

speaking of which, is there a generic push notification system available that doesn't require Google Play Services?

doesn't seem that hard in theory. websocket service that instructs the creation of an android notification object



https://pushover.net/ is what I use.

There is also https://www.pushbullet.com/ which I have bookmarked, but not tested.


Can this be used to run Netflix, HBO Go, etc on Linux?


If there's hardware-accelerated video decoding for DRMed streams exposed to the guest OS then it should. That is if there's a x86 supporting APK for each one too.


Now if I can just do this on my phone to lockout google from everything else.. indeed put every app in a box to stop cross app data theft


Nice! Someone please port it to mac!


I am curious which laptop is being shown on the homepage ?



people will definitely come looking for google apps support, so may be since andbox says "any" app. Maybe just pull opengapps and install it.


good job! this looks really cool.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: