Friday, December 25, 2015

Alternatives for installing chromium os

I've shared this blog with a few friends. Strangely enough they all had the same question: Did it not yet exist?
The real answer is always both yes and no. Yes, you already have alternatives and no, they don't work as I like to use it. So let's take a look at some of those alternatives.

A chromium os distribution

A long time ago, when chromium os was just started, a lot of people tried to get something similar. CrOS is most likely the most successful in its feature set. With some tweaks to the configurations of chrome, bundled in a default gnome shell, pidgin and even wine.

So if you like to have some feeling of how chrome-os will work, CrOS is only touching it barely. So for testing, I did not prefer it. Normally I refrain myself from giving advice about software and just provide a (hopefully objective) comparison of the alternatives. However, the latest version is based on chromium 24, which is from the year 2012 or maybe 2013, while we are almost in 2016. So here is some advice: Don't use it, it looks like it's no longer maintained.

More modern, you can find an up-to-date distribution called Chromixium, this actually looks very promising and if I have some time, I'll definitely give it a try and possibly it can become the subject of a future post.

Virtualization

So we've already seen the 'faking' of chromium os, so the obvious next step is to dump it in a virtual machine. Personally, I like the idea and I virtualize way too much. Getting something working in a virtual machine is not the easiest thing to do if you don't have the correct drivers. (I know, I tried it with Gentoo) As we all know, chrome os is made for a few devices, so getting it working with the drivers of VirtualBox or similar doesn't look like the easiest job to do. However, the result is worth it. Hexxeh got it working and on whatever system you like to run it (even windows), if you can install VirtualBox you can run this correctly. A quick how-to can be found here.

Similar to CrOS, this project has been abandoned in 2013, making it not that useful. However since this shows the real deal, you can try it if you've never seen a chromebook before. Though don't use your personal accounts, because there are known vulnerabilities in chromium, fixed in newer versions.

Run the official executables

You might have guessed it, though my idea of using the official builds is not really new and has been tried before. On github you can find the project dz0ny/lightdm-login-chromeos which does exactly that. I've even had my own fork of it, though similar to all previous ones, it has been abandoned in 2013. (It must have been a bad year) I'll definitely get some futures ideas from it, though as it no longer works, it's more a research project opposed to something you can use.

Summary

As this blog already indicates I did not find something I liked, mainly because most projects are abandoned. So the best is that what you do yourself.

Merry Christmas
JVApen

Sunday, December 13, 2015

Updating the current chromiumos installation

Today I wanted to update the installation which I created with the previous blogpost. (See Getting started with Chromium-OS) It didn't took long before I realized that I will be doing this a lot of times in the future, so I started scripting. (Let's be honest, if you don't want to remember how to do something, teach your computer)
Note: If you haven't created an installation yourself, I'm convinced you can reuse this update-script for installation to.

This time, no long text on how I did it, since the script itself should explain this. Don't just copy and paste, nothing is as dangerous as executing something you found on the internet. Make sure you understand it to become convinced of this script being secure.

update_chromiumos.sh

JVApen

Friday, December 11, 2015

Getting started with Chromium-OS

I like chrome a lot and as a Google Top Contributor on the chrome help forums, I liked to get something which looked like a chromebook, acts like it and actually works.

I've started searching the internet and came upon a few attempts which looked promising, though most of them are abandoned or require some obscure installations. So as every nerd I decided that I can do better. (Call me a fool with too much time)

So before getting started, a small warning I've only tested this once on an ubuntu 14.04 64-bit, while using the official developer builds on linux (also known as google-chrome-unstable), no chromium is available and executing the code below can make those profile corrupt. Please don't expect a step-to-step walkthrough for creating this, it that was possible, I would just provide a bash-script.

Getting started with chromium gave me a good place to start: The not-as-easy steps of using chromium redirected me to the official snapshots for chromium on Linux. If you click on the name column, you can get this one sorted to get the latest snapshot (Version 363342 on writing, or release 49 of chromium). Note that this page takes a while to load.  

Every subdirectory of the snapshot page contains a chrome-linux.zip file, which the executables, scripts and resources. I have extracted this to /opt/google/chromiumos similar to who the chrome executables are stored on my system.

So, let's run /opt/google/chromiumos/chrome and close this blog. ... You might have guessed it, I wouldn't have started writing this blog. Simply running this executable results into one line of text and a crash. Some investigation, was able to discover that I was missing some files. For some unknown reason, you need a file which is called icudtl.dat, which can be borrowed from your normal chrome installation. Also some libraries have a mismatch in version, so I renamed them and hoped for the best. (Most likely this will cause crashes later on, though let's take that risk). A small summary:
  • cd /opt/google/chromiumos && ln -s /lib/x86_64-linux-gnu/libudev.so.1 && ln -s libudev.so.1 libudev.so.0
  • cd /opt/google/chromiumos && cp /opt/google/chrome-unstable/icudtl.dat ./

If we start up again with one extra command line option (and one less feature) we get a nice result. (/opt/google/chromiumos/chrome --disable-setuid-sandbox) We have working chromium-os, which a decent user account. We can go through the settings, open chromium and the files app. A nice result for about an hour of investigations and try-outs. When you startup, you still get a warning about an unsupported option. The new way of providing this is by setting the environment variable CHROME_DEVEL_SANDBOX to an empty string.

Chromium OS after the first successful try
Let's look into more detail into the result. We have two warnings, one about the command line flag we added. Security can suffer? We are hacking, do you really think we are going do online banking with it? The second one is about Google API keys, which might be important. The Learn more already explains a lot, so you can just follow the instructions of 'Acquiring keys' to get some API keys and use them in some future steps.

Let's provide the the keys to the executable and try starting again. You can write the following in a bash-file or just type it in every time. My preferred way is creating an alias which gets included in my ~/.bashrc. Choose your preferred method and stick with it. As I create core files on crashes of my executables, I like them to be always at the same place, for which I choose ~/.config/chromiumos.

The script:
  • mkdir --parents ~/.config/chromiumos
  • cd ~/.config/chromiumos
  • export CHROME_DEVEL_SANDBOX=
  • export GOOGLE_API_KEY=my-very-own-key
  • export GOOGLE_DEFAULT_CLIENT_ID=my-very-own-client-id
  • export GOOGLE_DEFAULT_CLIENT_SECRET=my-very-own-client-secret
  • /opt/google/chromiumos/chrome

Starting via this script removes the warning, so I guess it worked. So we can look into the other stuff. Unlike at the beginning, the console is now full of spam, created by the executable. If you ever did the same with your chrome installation, you know it sometimes contains something useful. In my case, I discovered that libexif.so was missing. So fixing it is similar to the libudev:
  • cd /opt/google/chromiumos && ln -s /usr/lib/x86_64-linux-gnu/libexif.so.12 && ln -s libexif.so.12 libexif.so

We still are using a stub-user, so how cool would it be if we actually were able to import our profile? Would we just be able to copy it from chrome? The answer is yes:
  • cd ~/.config/chromium && rm -r Default/ test-user Local\ State && cp -R ../google-chrome-unstable/Default ./ && ln -s Default/ test-user

Chromium OS after importing my profile
As you can see on the image, the view is already different from the first time, though we get an annoying warning about an incorrectly opened profile. So let's rethink, search for some extra command line flags and try again:
  • cd ~/.config/chromium && rm -r *
  • /opt/google/chromiumos/chrome --login-manager

Chromium OS with an install screen
If you now log in the sync can start. You might want to restart to get you image loaded, though from now on, if you start chromium os you can log in like on a normal chromebook.
Chromium OS with login screen
For now, I consider myself a happy person. A half day of hacking resulted in something which I couldn't image when I started. Though I still have a lot to investigate:
  • I'm still getting some warning about a shared library of my graphics driver, though most likely I have to fix my system.
  • The installation still gives the warning 'Failed to load /opt/google/chromiumos/keyboard_resources.pak', while I have no idea what this file is meant for.
  • After the actual login, I only have a portion of my synced data, which might just be caused by the limitations of the free API-keys or a bug in this snapshot.
  • The Google-Now-integration is still missing, so some detailed investigation of the actual installation can still reveal some other missing components that should be made working.

Nice hacking
JVApen