Monday, 4 July 2016

Linux on Pixel C : Running ubuntu xenial in a LXC container



Hi guys,

Today i wanted to share with you some of my work to run linux on the pixel C. :D

First of all i'm not responsible for anything, so try this but i can't guarantee that it works for you and that you won't break your tablet (even though normally it should work ;) ).
Secondly this thread is for people who know how to use correctly adb, fastboot and linux console, instructions are not very detailed here, so if you're stuck try a bit to search, you will learn a lot !

So first what is LXC ?


LXC (Linux Containers) is an operating-system-level virtualization method for running multiple isolated Linux systems (containers) on a control host using a single Linux kernel. (wikipedia)

We are gonna use this technology to run ubuntu on Pixel C (we will even be able to access to the GPU drivers in the future, i'm currently working on it)

I developped all of this on DP4, so please update to the lastest android ! (I will give kernel for 6.X devices in the future).

So first, we need a special kernel where cgroups are activated.

Please download an flash my modified XCeed kernel on DP4 :
https://drive.google.com/open?id=0Bz...mQzeUZTYmlGWFE


Code:


fastboot flash boot boot.img

Try to see if you can run su in the tablet, otherwise you will have to install supersu.

Now, install busybox so that we have some tools to help us a bit : https://play.google.com/store/apps/d....busybox&hl=fr :)

Download now lxc compiled with PIE support for Pixel C and the ubuntu rootfs (here is a 32bit version, 64bit is also working fine on my tablet :) ) :
https://drive.google.com/open?id=0Bz...nJBbS1LbGo0MUE

send it to the pixel C :

Code:


adb push lxc.tar.gz /sdcard/

Now extract the archive in /data

Code:


adb shell
su
tar xvzf /sdcard/lxc2.tar.gz -C /data/


Now run ubuntu and enjoy ! :highfive:

Code:


# open a terminal as root on the tablet
# execute :
/data/lxc/startSystem


If everything goes well, you will see ubuntu booting ;)
Welcome to Ubuntu 16.04 LTS!

Set hostname to <u3>.
[ OK ] Reached target Remote File Systems (Pre).
[ OK ] Listening on /dev/initctl Compatibility Named Pipe.
[ OK ] Listening on Journal Socket.
[ OK ] Listening on udev Control Socket.
[ OK ] Reached target Swap.
[ OK ] Listening on Journal Audit Socket.
[ OK ] Reached target Remote File Systems.
[ OK ] Listening on Journal Socket (/dev/log).
[ OK ] Reached target Encrypted Volumes.
[ OK ] Started Forward Password Requests to Wall Directory Watch.
[ OK ] Listening on Syslog Socket.
[ OK ] Listening on udev Kernel Socket.
...

user : ubuntu
password :ubuntu

Internet will work out of box if your tablet has a net access, you can install, remove things using apt :)

What is going on for this project :

I'm currently trying to use the GPU drivers using libhybris so that in the future we can run wayland on pixel C and have a fully working linux environnement ! (KDE, gnome)
see here for KDE, we need to port this : http://blog.bshah.in/2016/05/02/plas...w-base-system/
I need help for this (because it's difficult). For this, we will have to patch bionic so that we can use libhybris. All the devs can contribute here :))

If you're happy of this work and you want to have more detailed instructions please pay me a beer ! Because developing for Pixel C is time consuming ;)
paypal.me/MathieuTournier

Thanks to : @cheep5k8 for his kernel soucre code http://forum.xda-developers.com/pixe...ernel-t3289357



No comments:

Post a Comment