27 ms·
Android container in Chrome OS
- a1exanderjung 9y agoInteresting to see Chrome OS adopt process compartmentalization techniques such as this, specifically adopting `cgroups'. Afaik, cgroups isn't enabled by default and requires customizing the kernel before you can enable it. At the very least, container tools such as Docker require symlinks too to invoke chroot-like filesystem isolation and this is also not available. It'll interesting to see where they'll go with this, specifically since Google also work on Kubernetes and that new OS, Fuchsia.
- geofft 9y agocgroups are a dependency of systemd, so they're extremely standard. (I'm not sure what you mean by "customizing"; there are no binary builds of the Linux kernel available from the kernel developers, so everyone builds their own kernel.) Not sure what you mean by symlinks either - the right primitives for secure filesystem isolation (pivot_root, etc.) are also very common. pivot_root is the normal way to switch from an initramfs to the real root filesystem, so it's also extremely prevalent.
- patrickaljord 9y agoSpeaking of which, it is now possible to run full linux and android apps on chromebooks which support containers (and vms?) in a tab with the new official Google Crostini project. Makes the Pixelbook more attractive. https://twitter.com/rothgar/status/981579699833880576 https://twitter.com/rothgar/status/981579699833880576 More info on Crostini https://www.reddit.com/r/chromeos/comments/7ytpb1/project_crostini_linux_vms_on_chrome_os/ https://www.reddit.com/r/chromeos/comments/7ytpb1/project_cr... …
- kyrra 9y agoThere is a Crostini subreddit where people are trying different things with it: https://www.reddit.com/r/Crostini/ https://www.reddit.com/r/Crostini/
- terhechte 9y agoWould this work on a ChromeOS that I install on, say, an aging PC Laptop?
- jacksmith21006 9y agoYes. The code is also being done in chromium OS.
- lima 9y agocgroups are pretty standard nowadays and all major distros have them enabled. Any modern containerization tool depends on them for resource isolation. Or are you talking about the ChromeOS kernel in particular?
- ajross 9y agoNo, cgroups is enabled on every major linux distro (though I'm too lazy to check if every configurable is set such that it will run this particular Android container). It's well-established base linux technology at this point, certainly nothing weird.
- DCKing 9y agoI think OP might be referring to the fact that Android kernels disable most functionality required to run most standard Linux container tech. AFAIK it's not possible to run Docker even on rooted devices if they are running a (close to) vanilla kernel, whereas you can run Docker just fine on Linux single board computers that run similar processors.
- jacksmith21006 9y agoYou can use Docker fine on a CB that you put in developer now. Just install Crouton and use rkt. But now with ChromeOS 67 no longer need to use developer to do.
- ajross 9y agoThe host OS in this case is ChromeOS, though. But OK. I took the point to be "cgroups is weird, nonstandard and by implication dangerous" when the truth is more "cgroups is standard equipment, sorta boring, and the obvious way to implement a container like this".
- cyphar 9y agoYou can run LXC on Android, and have been able to for several years. So on Android enough of the kernel features are there (though to be honest you only really need a pid+mnt namespaces and most people wouldn't tell the difference).
- cbhl 9y agoI don't work on Chrome OS, but my understanding is that one of the things that makes this possible is that Chrome OS requires device manufacturers to upstream kernel drivers for a device to be supported. This means that -- unlike Android -- it's always possible to rebuild a new kernel from source using the Chrome OS source tree.
- cyphar 9y ago> Afaik, cgroups isn't enabled by default and requires customizing the kernel before you can enable it. cgroups are supported on every distribution's kernel I've ever touched in the past 5 years. Not to mention that they were originally developed (in part) by Google, though they had a different purpose back then. They're also a requirement for systemd to work properly, so any distribution that needs to run systemd will have them enabled in their kernels. > At the very least, container tools such as Docker require symlinks too to invoke chroot-like filesystem isolation and this is also not available. Docker (or rather runc) uses pivot_root and mount namespaces to implement filesystem isolation -- not symlinks (though I'm not sure what you mean here to be frank). These features have been in Linux for more than 10 years.
- quantumwoke 9y agoI can't wait for the day that phone operating systems development environments are a docker pull away. It's encouraging to see Google approaching my ideal workflow using containerisation. Apple systems are great until you run into the garden walls and are forced to use closed-source single platform software like Xcode. Chrome OS and Android are a lot more open in many respects. Hopefully efforts like this continue with Fuchsia and other Google products.
- jacksmith21006 9y agoYou have it with ChromeOS 67. Docker without having to put in developer.
- xrd 9y agoCan you share a specific example of this? I got lost in the parent article but was that in there?
- jacksmith21006 9y agoYes. Boot, launch chrome tab, type Ctrl alt t, then type vmc start dev. You have a GNU/Linux kernel which you can do whatever you want. For more info visit Reddit and the Crostini subreddit. You can use Steam or really whatever.
- jacksmith21006 9y agoWhat is happening is Google has enabled the KVM. You are using a second Linux kernel and can do whatever safely and away from the ChromeOS Linux kernel. Even GUI works as forwarded to ChromeOS. So start xclock and opens.
- bubblethink 9y ago>Even GUI works as forwarded to ChromeOS. So start xclock and opens. What is graphics performance like for the guest ? Does this use gpu virtualization (somewhat supported for intel gpus in recent kernels) ?
- lima 9y agoI wonder how hard it would be to get this working on, say, Fedora... At the very least, one would need to replace what sounds like a surfaceflinger <-> wayland proxy.
- ibrahima 9y agoYeah, it would be pretty interesting to be able to use this as an Android development environment. It should be significantly faster than current approaches with emulation.
- jacksmith21006 9y agoSupports AS. The thinking is this is why Google did it. You can now run GNU/Linux applications
- jacksmith21006 9y agoVery easy with ChromeOS 67. Just boot, launch a chrome window and type Ctrl alt t. Then type vmc start dev. Then you can use whatever distribution you want as you have full GNU/Linux. Only works on Pixelbooks but Google will extend and will share more at Google IO. You can even package up gnu/Linux applications. One click and they run in a container but on a second Linux kernel. So Android shares the ChromeOS kernel where gnu/Linux will run in a container on top of a VM using the KVM. It is interesting that Google did not feel just using containers for GNU/Linux was secure enough.
- kuschku 9y agoAnd that helps me get an Android container running on an actual desktop OS how? That was the question, after all.
- jacksmith21006 9y agoYes it does. Well if you consider gnu/Linux a desktop OS.
- jacksmith21006 9y agoBetter is ChromeOS 67 enables running your own containers without having to put CB in developer. It uses the KVM to run a second Linux kernel. So you will be able to use GNU/Linux applications including Steam. More to be shared at Google IO this year.
- tootie 9y agoAre you sharing a rumor/insider knowledge? Can I do this right now?
- zifnab06 9y agoThe current dev branch (67) supports this. From crosh: vmc start dev start_container.sh --container_name stretch --user <yourusername> --shell That should drop you into a shell in a debian stretch distro. You can install packages and launch them. I haven't figured out if there's a way to pin them to the shelf yet and launch that way.
- jacksmith21006 9y agoYes. No inside information. Done it myself.
- jacksmith21006 9y agoYou can use gnu/Linux on Android with a CB. But you have to use a fake Chroot. Just go to play store and install GNUroot. Then install the Android XSDL app for the GUI.
- rrix2 9y agocan you use this to properly replicate the functionality of dropbox, though?[1] [1]: https://news.ycombinator.com/item?id=8863 https://news.ycombinator.com/item?id=8863
- jacksmith21006 9y agoShould not be a problem unless I am missing something? Can what you are talking about run on GNU/Linux?
- reggieband 9y agoI just had a vision of all major OS projects providing developer containers for their projects. Like, you could just pull the latest Firefox dev container and run a single command to have a running debuggable app. I know one of the major pains we have when on-boarding new people is the whole dance to get to that first working build / first meaningful change. I can imagine this being significantly more simple if a working dev environment was shipped as a container.
- moosingin3space 9y agoGnome is moving in this direction by using Flatpak + Gnome Builder. They're also running CI inside the Flatpak environment.
- jacksmith21006 9y agoExactly what Google has done with ChromeOS 67. You can run GNU/Linux applications as containers. But extra safe as a container on a separate kernel through a VM using KVM. Versus they did Android as a container on the same Linux kernel as ChromeOS. But locked to only an Android container.
- reggieband 9y agoYou mention "run GNU/Linux applications as containers" but is that a full dev environment? As in, I can open a cpp file or whatever, make a change, run a single command and I can see my changes?
- jacksmith21006 9y agoYes a full dev environment as of ChromeOS 67. How you want to use is your choice. But it looks like Google will package GNU/Linux applications as containers that you can just run. You can use what they have enabled in other ways as I am already doing on a PB with ChromeOS 67.
- 77ko 9y ago> You can run GNU/Linux applications as containers. Do you need to run gnu/linux apps inside containers or can they just run inside the VM running on top of chromeos?
- xrd 9y agoDoes anyone have a link to what Chromebooks will support ChromeOS 67? Is there a matrix somewhere?
- jacksmith21006 9y agoJust about all will support ChromeOS 67 including ARM. But that does not mean they all will get the new gnu/Linux without developer support. Right now only the pixel book supports in ChromeOS 67. Google will share more at Google IO as this is still beta stuff. The hope is it will be more than just the PB.
- hawski 9y agoI'm assumng that it will be very close to the Android support list [0]. I'm a bit sad that NaCl Dev Environment [1] went nowhere, because I think, that my Acer Chromebook 13 will never be otherwise supported. That's also a reason for me to not buy ARM. I'm mildly counting on the hypothetical AMD Chromebook. However my miniscule trust in corporations is getting even smaller lately, so I don't know what I will do when my Chromebook will see it's inevitable EOL. As much as I like technology behind ChromeOS I would prefer to finish my own Linux distribution project. [0] https://www.chromium.org/chromium-os/chrome-os-systems-supporting-android-apps https://www.chromium.org/chromium-os/chrome-os-systems-suppo... [1] https://chrome.google.com/webstore/detail/nacl-development-environm/aljpgkjeipgnmdpikaajmnepbcfkglfa https://chrome.google.com/webstore/detail/nacl-development-e... [2] https://chromeunboxed.com/news/amd-chromebook-in-development-meet-grunt/ https://chromeunboxed.com/news/amd-chromebook-in-development...
- hammerandtongs 9y agoI'd really like this to evolve into a standard thing in our linux distros. By which I mean apt-get'able, which it looks very close to. I have no interest in the play store but I would like my lineageos/fdroid userspace available directly to my desktop.
- andor 9y agoWhat about Binder? Do Chrome OS kernels come with Binder built in, or are they emulating it on top of another IPC mechanism? Edit: yes, Chrome OS kernels come with the binder driver enabled.
- jacksmith21006 9y agoBy looking at the comments this article is creating confusion. So I thought I might provide an overview of the two things happening with ChromeOS. 1) Android apps have been enabled on many Chromebooks using a locked container that shares a Linux kernel with ChromeOS. You do NOT have access to the container mechanism that is being used. It ONLY supports a container locked by Google. It is NOT using Docker also. This is available on both ARM and X86 Chromebooks and most recent models are now supported. It took a while. All Android apps run in a single container. 2) Starting with ChromeOS 67 and only on Pixel books so far there is full GNU/Linux capabilities on a Chromebook without having to put the Chromebook in developer mode. Developer mode is how you turn off much of the security of a Chromebook and keeping in this state is a bit of a hassle as when you boot you MUST remember not to hit the wrong keys and wipe your CB. What Google has done is enable the KVM on the Chromebook ChromeOS Linux kernel. So you can run a second Linux kernel where you have full control of the second Linux kernel. Then on top of this VM Google is pushing the use of containers. So these containers are completely separate from the Android containers. Then all the containers on the VM share a common Linux kernel that is separate from the Android and ChromeOS kernel. What this does is keeps the highly secure aspect of ChromeOS while giving you full GNU/Linux on the machine. Google has also enabled forward GUI of the GNU/Linux VM to the ChromeOS desktop. So say you start XClock on the VM the window will open up on the ChromeOS desktop. What is also confusing to people is GNU/Linux has been available on Chromebooks for a long time. There has been a number of ways to use. 1) Put CB into developer, install Crouton and you have GNU/Linux. But to use Docker you MUST use rkt to start the containers. 2) Install the Android GNURoot app. This gives you GNU/Linux but in a fake chroot that breaks many things. You can also use the Android XSDL app for the GUI. Since Google implemented ALL Android apps in a common container the IP is the same for both GNURoot and the XSDL app. In ChromeOS 67 Google has fixed the IPs used by the Android container and now using the NAT reserved IPs instead of private IPs. This solves a weird bug you would run into where you had a IP conflict if you used the same private IPs elsewhere. Google is also using the NAT reserved IPs with the new GNU/Linux support through a VM. It looks like Google will be packaging GNU/Linux applications like Android Studio in containers that you can then run on a Chromebook with just a click. But will they be in the play store is unclear. But these containers will run on the VM. Google will have ChromeOS 67 hitting stable at the same time as Google IO where they are rumored to explain things better. All of this new GNU/Linux support with a VM is in beta.
- indescions_2018 9y agoThanks for publishing. Very informative. Am just setting up NeverWare as a devenv for Android. With localhost ADB connections. Could prove a powerful platform for Android automation. Also noticed there is a web "demo" of Fuschia experimental OS. That can be run in a single Chrome tab (click "guest"): https://mgoulao.github.io/fuchsia-web-demo/ https://mgoulao.github.io/fuchsia-web-demo/
- mankash666 9y agoTheoretically, this container should be able to run in any host os supporting containers. I'd like to be able to run native (via container) android apps on my desktop OS
- torpedo 9y agoThe recently announced Droplet containers extend on this idea with a supposedly commercial-ready multiplatform solution https://dropletcomputing.com/ https://dropletcomputing.com/
- jasonvorhe 9y agoThis is incredible. Using this, going from Linux to Zirkon is just a Kernel-switch away. Potentially they could replace small parts of the Linux-parts of Chrome OS slowly and iteratively with Fuchsia.
- zer0zzz 9y agoWhen the hell are we going to get electron and node.js apps on chromeos. Those are far more important than these crappy blown up phone apps
- bitskits 9y agoI disagree on the "more electron" front. Running old Chrome with known vulns packaged up into an app is not the direction I'm looking for ChromeOS to go. I'll take an app in a tab, please.
- bhaavan 9y agoNot sure if this is a sarcastic comment. But afaict, Android apps in Chrome OS need not be artificially blown up to full screen. They can run in a windowed mode, in an optimal size. However, I don't see any technical challenges in supporting Electron apps as well, other than constraints in RAM, performance and security of the Electron platform.
- wolfspider 9y agoI have an ARM64 React Native toolchain sitting on blocks for ChromeOS. Caret is the IDE for this but Android SDK is truly lacking for ARM the build tools are base level. There is a guide floating around out there to make your own too. Looking forward to more stuff like this because essentially you get realtime Native app development with this but hooking into the debugger via crosh terminal is hard. Smoothing out the rough edges on this and then wow! You will have a powerhouse. NativeScript? Even better in theory.
- asfdsfggtfd 9y agoDoes this open the path to running android apps on gnu/linux desktop?
- alsadi 9y agoAndroid need a kernel feature called binder which afaik is not part of vanilla kernels / distro kernels.