Enabling Linux Development on Chrome OS

Posted by on in Blogs

This is part of my series on developing with Chrome OS

You need to put your Chromebook in Developer Mode First.

Chrome OS is Linux with a modified Chrome browser, but the Linux it is running is really stripped down and very restricted. What if you want to run a full fledged Linux on your Chromebook? Turns out it is pretty easy. For starters you need to be in developer mode, then you install croton to setup your chroot Linux environment.

If you want to do it via the shell ([Ctrl][Alt][T] + shell) you can type this: (That is an uppercase letter O) 

cd ~/Downloads
wget https://goo.gl/fd3zc -O crouton

Now you have crouton downloaded, and you can use it to setup a Linux environment. There is more information on the Github page. We will just setup the command-line interface for now though.

sudo sh ~/Downloads/crouton -t cli-extra

It is normal to get a warning (or at least I always do), but now you can sit back and wait while it downloads and installs all the packages it needs to run your chroot. Once it finishes you will be prompted for a new username and password to use within the chroot. And then to run your chroot you type

sudo startcli 

To deploy PAServer the easiest way is to do it via Google Drive since it is already setup to sync with your Chromebook. Just copy LinuxPAServer19.0.tar.gz from your Google Drive to the Downloads folder on your Chromebook. Then from the terminal extract the files

tar xvf LinuxPAServer19.0.tar.gz

You can only run PAServer from within the chroot, and you do so just like on a normal Linux box. However the Chromebook as a firewall on by default. It has only been modified to allow port 22 through the firewall for ADB. It uses the iptables firewall. You can configure this from the chronos shell, or the chroot shell if you install it there too. To install the iptables package in chroot do the following:

sudo apt-get install iptables

Now you can disable the firewall until next boot with the following

sudo iptables -F     
sudo iptables -P INPUT ACCEPT    
sudo iptables -P FORWARD ACCEPT   
sudo iptables -P OUTPUT ACCEPT 

A better solution would be to setup the specific ports you want enabled and persisting them. Now you can connect to your Intel Chromebook for Linux development just like any other Linux box.

~/Downloads/PAServer-19.0/paserver


Comments

Check out more tips and tricks in this development video: