-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Launching a chroot from the chromeos launcher? #369
Comments
That would be neat, but it's not that simple: crosh/nassh use the You could try the approach in #170, and start crouton on startup. But that requires disabling root verification, and possibly(?) losing auto-updates in Chrome OS (some say it still works, didn't try myself). The simplest solution might be to see if her CLI-phobicity can be cured (or at least managed), after all the command only needs to be run once per reboot ,-)) You could make a Google Doc, with commands to be copy-pasted along with clear instructions, and pin/bookmark it in Chrome. |
I've heard of people putting the commands as their wallpaper... |
I know you guys have a lot of tickets requesting the same feature here but wanted to throw an alternative approach to implementing this. Are you guys familiar with ARC (Android Runtime for Chrome) or its "open-source" copycat ARChon Runtime for Chrome (https://archon-runtime.github.io/)? It's basically an Android chroot environment that embeds a port of the Android Runtime (ART/dalvik) and enables running Android apps inside Chrome (OS or regular Chrome in other platforms such as Windows, OSX, Linux). The internals of it all are probably way too different from crouton to find any commonalities but the point I wanted to bring up is how ARC/hon is deployed as an extension (just like crouton) and enables other extensions (ie: apps) to depend on it and specify which "apk" to launch when running the original extension as a result of launching this depending extension. This basically allows for individual app shortcuts (with icons/names) as well as launching the depending extension (ARC in this case but could be crouton) with specific parameters (passed in through the regular Chrome Extension manifest.json in a special section). Following a similar principle if crouton was modified to enable other Chrome extensions to be built on top of it (ARChon source is available in Bitbucket: https://bitbucket.org/vladikoff/archon) as well as have a simple way to generate depending Apps/shortcuts like ARChon's https://github.com/vladikoff/chromeos-apk which basically creates a blank Chrome Extension that points to ARChon and enables specifying custom icon, title and APK (in crouton case it'd be the command we'd like to start: We could even have separate extensions published to the Chrome Web Store that worked in conjunction with the main crouton one for the standard crosh scripts it currently exposes. Or is the whole limitation that you have to start the extension via |
If it's not as simple as that perhaps ARC/hon can be used as an inspiration for a future major revision rearchitecture of crouton to be able to create the chroot just like it does its Android one without requiring root access to do what it does today (ie: mounting/unmonting partitions, etc?) |
Running 'crouton' or something like it in a container has been discussed somewhat here: LXC containers? #364. |
I haven't dug into the code of ARChon but if LXC is not supported by the kernel I don't think that's what they are doing there? |
ARC++ has been recently implemented on Chrome OS, see 'Chrome OS Systems Supporting Android Apps'. It does unfortunately require a kernel version that supports containers however. See 'The Play Store comes to Chrome OS, but not the way we were expecting', especially the part entitled: 'Goodbye ARC; Hello containers'. |
That's a fascinating read @DennisLfromGA thanks for sharing it. I was under the impression they were still moving forward with ARC. So from a containers perspective (LXC, Docker or Rocket based), as per discussion on #364, with the latest kernels is it possible to run a container inside Chrome OS natively without the need for a chroot like with crouton? Also, if that's possible I wonder if there is any work going on or a version/branch of crouton that leverages that for things like |
I believe it is very possible and probably would work on all of the Chrome OS devices listed that will eventually get Android apps since their kernel versions will support it. I'm afraid I don't know of anyone doing any work on this front though. Maybe we'll be pleasantly surprised one day with Ubuntu or something like it in a container for Chrome OS. I'm keeping my fingers crossed. -DennisL |
On another front, looks like Google is already using Chromium OS in their GCP environment to run containers instead of its former Debian based OS. Would be nice to see this make its way to official Chrome OS. Have you guys tried the latest dev channel? I'm on the beta one and got kernel 3.14 which enables all the Android containerization. Wondering if even on the latest dev Chrome OS you still can't run docker natively. |
@drinkcat This is incorrect -- or at least, misleading if you're fine with using locally installed extensions. I copied the source code for the "Secure Shell" extension, modified the code, and loaded it using the Chrome extensions page "Load Unpacked Extension" button. (my custom repo of it is here, however I haven't pushed my changes to it yet: https://github.com/Venryx/chrome-secure-shell) The modified version is now installed, which runs my custom code -- automatically running some shell code when the "Crosh Window" (or just the Secure Shell app/tab) is opened. Instead of auto-running, it would be trivial to also add a button to choose which chroot to launch, and then have some code run to do so on click. Which is exactly what the OP requested, is it not? The only drawback is that you probably can't distribute the modified extension on the Chrome webstore. But manually installing an extension once is better than manually typing a command each boot, for someone CLI-phobic. By the way: The source code in that repo I forked it from works, but does appear to be outdated. So it has some issues with scrolling, as well as not working correctly when you press "ctrl + shift + n" to open a new Crosh Window. So if someone knows where I can get the latest source code, please let me know. EDIT: Nevermind, found that you can get the latest source code by just navigating to "~/Extensions/pnhechapfaindjhompbnflcldabbghjo/" in a Crosh shell. (and then copying it to the Downloads folder or what-not) |
That’s awesome progress @Venryx lmk when you push your changes to repo, I’ll give it a try. |
Sounds very interesting, let us know when you have it working and have pushed your changes. -DennisL |
I have gotten a basic "crouton launcher" toolbar added, and pushed the changes to the repo: https://github.com/Venryx/chrome-secure-shell You can see a video of it here: https://www.useloom.com/share/21a4ecc860604600a6d92165831714a1 Note that the chroot's desktop environment was successfully launched -- the screen recorder just continued to record the ChromeOS screen instead. |
Just had a chance to test this @Venryx and indeed it works. I just changed to to provide a button to I wonder if we fork Crosh Window in a similar fashion, we could provide a similar architecture as the ARC(hon) projects where every "app/shortcut" is basically an extension that hooks into the main one, launching it and running specific commands in that window (ie: |
That's a pretty interesting route indeed @beliefless-dogmasless I'm wondering if crouton were to install this simple web server and allow for configuration of a wildcard route so that once you access http://localhost:port/app-name, in the background it would execute Would this be a viable feature and configuration option within the crouton extension? |
If one wants to get a bit hacky https://github.com/ppibburr/xiwi-shell/ Automatically start chroot upon Ctrl+Alt+T. If desired you can set chrome to open the developer terminal upon start up. (abstract away the steps, as this will launch a xiwi launcher service in the chroot that can be accessed by chrome) This includes a dash like launcher for the linux apps, and you can add linux apps to the shelf. |
That looks very interesting but I'm too scared to try it. ;-) -DennisLfromGA |
Would it be possible to add an "app" extension to the ChromeOS launcher that starts the chroot, instead of having to manually open a terminal and typing "sudo startkde"? (It's not a big deal for me, but I'm setting up my SO's laptop, and she's CLI-phobic)
Since crosh and "crosh window" are implemented as a chrome extensions, shouldn't it be possible to make an extension that automagically starts crosh, runs "shell", and "sudo startkde -b"?
If you wanted to make it super-fancy, it could check if chroot is already running, and just switch to it, as if the cntrl-alt-shift-=> hotkey had been used.
The text was updated successfully, but these errors were encountered: