How to configure Linux, Steam In-Home Streaming and PS4 Controller on Chromebook

It has been a long while since the last time I update my blog. I guarantee that I don’t just waste my time on watching videos and playing video games lol.

Why another post on this topic?

There is a bunch of guides on the web about setting up Linux on Chromebook, Installing Steam and using PS4 Controller on Linux, but no single article covers these topics together. And it turns out a little tricky to get all the thing done right. Also, some of these journals are outdated so far. And this one should provide you enough information to configure all these stuff without a headache. I’ve done all these on Asus CBE-431, it should also work on other models.

Install Linux with Crouton

It is also possible to make a dual-boot Linux-ChromeOS on your device, but Crouton really provides a safe and efficient enough system to get things done. You can switch between two OS swiftly and the loss of performance is negligible.

To do this, you should first get into Developer Mode. This will wipe out all the local data on your device. Be sure to backup all the files you need before any further actions. And then follow these steps:

  • Turn off your laptop, using the combination of Esc, Refresh and Power buttons to reboot your Chromebook into Recovery Mode.
  • After seeing the Recovery Mode screen with the yellow exclamation, press Ctrl+D. And then press Enter to confirm entering Developer Mode. Wait a little while (about 10 minutes) until it return to the screen with the yellow exclamation. Leave it alone until it reboots into Chrome OS.
  • Some old models have a physical switch that you’ll have to flip in order to turn on Developer Mode. Check your instruction if you are not sure.

After login to the system, download the crouton script from here or click this to download the latest version.

Open a shell (Ctrl+Alt+T, type shell and hit enter), and run the following command:

1
sudo sh ~/Downloads/crouton -r trusty -t xfce

# or add other targets if you like
# sudo sh ~/Downloads/crouton -r trusty -t xfce,keyboard,audio,cli-extra

You can also change xfce to other desktops you want, for example unity which has a better look but requires more performance. And you can also add other targets such as keyboard,audio,cli-extra after xfce if you need.

Ubuntu 14.04 Trusty is used, because the default 12.04 Precise could cause some trouble while installing steam.

In the end of the installation, you will be asked the user and password for your linux system, choose anything you want. Remember the password, it will be used a lot later on.

Install Steam on Ubuntu

First login to ubuntu by entering enter-chroot in the shell and startxfce4 to start the xfce desktop (use other command for other desktops). Notice you can switch between Ubuntu and ChromeOS with Crtl+Alt+Shift+Left/Right(at the top of the keyboard) in any time.

And then, download the latest version of Steam for Linux from the Steam website. Start the terminal in linux, and install Ubuntu Software Center with the following command:

1
# You need to enter your password using sudo
sudo apt-get install softeware-center

After that, find and click the Steam .deb package and install steam following the instructions. You should be able to login and launch Steam after this.

In-Home Streaming

Brismuth has a very good post on this topic. I just followed his steps. The ports used by Steam In-Home Streaming is by default blocked by ChromeOS. To unblock them, using the iptables command is the simplest way. First, install this command with sudo apt-get install iptables in the shell.

And then create a new alias command to unblock all the ports needed:

1
echo "alias steamStream='
sudo iptables -A INPUT -p udp --dport 27036 -j ACCEPT; 
sudo iptables -A INPUT -p udp --dport 37804 -j ACCEPT; 
sudo iptables -A INPUT -p tcp --dport 37804 -j ACCEPT; 
sudo iptables -A INPUT -p tcp --dport 27036 -j ACCEPT; 
sudo iptables -I INPUT -p udp --dport 27031 -j ACCEPT; 
sudo iptables -I INPUT -p udp --dport 27036 -j ACCEPT; 
sudo iptables -I INPUT -p tcp --dport 27036 -j ACCEPT; 
sudo iptables -I INPUT -p tcp --dport 27037 -j ACCEPT;'" >> ~/.bash_aliases

Restart the terminal, you will be able to unblock the network with steamStream command. And make sure your host device and your chromebook are on the same network. You should be able to stream from your PC to your chromebook right now.

Setup Sony Dualshock 4 Wireless Controller

I really like the PS4 controllers, you can now use them on almost every devices - your PS4, PC, Mac and Linux. To use them in Linux on Chromebook, I think the best way is to use the ds4drv package.

To install this package, we must first install all the dependencies:

1
sudo apt-get install python2.7-dev
sudo apt-get install python-setuptools
sudo apt-get install bluez-utils

And then install ds4drv by sudo pip install ds4drv.

After this, you can pair your controllers. First, turn on the bluetooth on your chromebook in chromeOS, and then switch back to Linux, entering sudo ds4drv in the terminal. Pair the controller by press the share button and PS button together, the light in front of the controller should start blinking, and turn bright blue after successfully paired.

You can also check how to pair multiple controllers and set the light on the controller on ds4drv website.

I’m having trouble with using the the PS4 controller in Big Picture Mode this way. I will update if I managed fix it.

Enjoy!

Every time you want to use this setup, you should

  • open up Ubuntu in the shell and start desktop
  • Unblock the ports with steamStream in the Linux terminal
  • Launch Steam on both chromebook and host machine
  • Make sure your bluetooth on the chromebook is enabled and pair the controller after sudo ds4drv commmand
  • Start streaming!