Tag: Acer C720p

Installing Ubuntu on an Acer C720P chromebook

There is a lot of information available regarding installation of single-boot Ubuntu on an Acer C720P but here I’m posting what works for me in Jan 2017.

I am not going to explain how to prepare the Chromebook for  installation of Ubuntu, I’m just posting notes on certain configurations that work for me:

Basic hardware functionality

  1. Elantech touchpad: the newest kernels recognize the touchpad perfectly (>= 4.8). Previously, only the GalliumOS kernel made the touchpad usable for me.
    1. Download the amd64 kernel from here and install: http://kernel.ubuntu.com/~kernel-ppa/mainline/
    2. For example, for 4.9, you need to download   linux-headers-4.9.0-040900_4.9.0-040900.201612111631_all.deb
    3. Install using dpkg -i linux-*.deb
  2. Touchscreen: works with any kernel.
  3. Microphone: does not work
  4. Speakers: work with any kernel

Enabling keyboard functions and keys

  1. Install programs to control brightness and map keys:
    1. apt-get install xbindkeys xdotool xbacklight
    2. create ~/.xbindkeysrc with these contents to map keys (customize to your needs)
      "xdotool keyup F1; xdotool key alt+Left"
      "xdotool keyup F2; xdotool key alt+Right"
      "xdotool keyup F3; xdotool key ctrl+r"
      "xdotool keyup F4; xdotool key F11"
      "xdotool keyup F5; gnome-screenshot -f $HOME/Pictures/Screenshot_$(date +%F_%T).png"
      "xdotool keyup F6; xbacklight -dec 3"
      "xdotool keyup F7; xbacklight -inc 3"
      "xdotool keyup F8; pactl set-sink-mute alsa_output.pci-0000_00_1b.0.analog-stereo toggle"
      #"xdotool keyup F9; pactl set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo -10%"
      "xdotool keyup F9; amixer -D pulse sset Master 5%-"
      #"xdotool keyup F10; pactl set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo +10%"
      "xdotool keyup F10; amixer -D pulse sset Master 5%+"
      "xdotool keyup control+shift+Down Arrow; xdotool key Page_Down; xdotool keydown shift"
      control+shift+Down Arrow
      "xdotool keyup control+shift+Up Arrow; xdotool key Page_Up"
      control+shift+Up Arrow
      "xdotool keyup control+shift+Left Arrow; xdotool key Home"
      control+shift+Left Arrow
      "xdotool keyup control+shift+Right Arrow; xdotool key End"
      control+shift+Right Arrow
      "xdotool keyup XF86PowerOff; xdotool key Delete"
    3. Notice that I disable the power button and map it to Del. To shutdown the computer, I use the shutdown button in Gnome panel.

Using a lightweight Desktop (Openbox):

  1. Even Gnome 2 uses too much memory for my likings. Openbox uses < 350 MB idle and Gnome ~ 600 MB idle. 250 MB in a 2 GB system is a lot for me. With Openbox I get a light Gnome-like desktop.
  1. Install Openbox:
    sudo apt-get install openbox
  2. Install gnome-session-fallback:
    1. sudo apt-get install gnome-session-fallback
    2. I use some Gnome applications.
    3. Also, Chromebooks don’t have a “Super” key, which is required in Openbox to add buttons to gnome-panel. In Gnome, you can add buttons by clicking the right mouse button and Alt only. So I login to Gnome, configure gnome-panel, logout and login to Openbox.
    4. Alternatively, plug in a keyboard and click Super+Alt and the right mouse key on the Gnome panel in Openbox to add items). But this means you always depend on an external keyboard to configure Gnome panel in Openbox.
  3. Install volti to control the sound volume. Gnome’s won’t work:
    sudo apt-get install volti
  4. Configure gnome-panel. The native Gnome indicator applet won’t work in Openbox, which means no network manager, no clock, etc.To configure Gnome panel in Openbox without plugging an external keyboard: login to Gnome (metacity) and configure the gnome-panel with the mouse, adding:
    1. A custom application launcher that will be the shutdown button. Select a shutdown icon to be displayed.
      1. Create this script and configure the shutdown button in Gnome panel to call this script:
        gmessage "Are you sure you want to shut down your computer?" -center -title "Take action" -font "Sans bold 10" -default "Cancel" -buttons "_Cancel":1,"_Log out":2,"_Reboot":3,"_Shut down":4,"_Suspend":5 >/dev/null
        case $? in
        echo "Exit";;
        killall openbox;;
        shutdown -r now;;
        shutdown -h now;;
      2. Remove the bottom panel bar for more screen real estate.
      3. Add a window selector to the top panel bar.
      4. Add desired application shortcuts.
      5. Add a clock.
    2. Logout from Gnome and login to Openbox.
    3. In a terminal, create .config/openbox/autostart.sh
    4. Install gxmessage to show the shutdown dialog when you press the shutdown button:
      apt-get install gxmessage
    5. Configure sudoers to allow any user to shutdown:
      1. sudo visudo
      2. Insert this at the end of the file:
        %users ALL=NOPASSWD: /usr/bin/shutdown
    6. I’m still working on how to make pm-suspend work without sudo.
  5. Configure start up applications: Edit .config/openbox/autostart.sh to start several applications upon login:
    gnome-panel & # openbox has no panels, you need to start one
    volti & # sound control
    nm-applet & # for network management
    xbindkeys # for key mapping to the weird Chromebook keyboard
    xscreensaver &
    synclient ClickFinger3=2 # to enable right click on the touchpad (tap the touchpad with 2 fingers simultaneously)
    synclient TapButton3=2 # to enable pasting with the touchpad (tap the touchpad with 3 fingers simultaneously)
    earlyoom # aggressively kill programs when there's no RAM available, see below
  6. Enable a screensaver:
    1. gnome-screensaver doesn’t work.
    2. Install xscreensaver instead and remove gnome-screensaver:
      sudo apt-get remove gnome-screensaver
      sudo apt-get install xscreensaver
    3. run xscreensaver-demo to configure the screensaver.
  7. Backup .config/ so anytime you have to reinstall you don’t need to reconfigure Gnome panel and start up applications.

Other configurations

  1. SSD settings: configure /etc/fstab with configurations that are more gentle on your SSD: Add discard,noatime,errors=remount-ro to /dev/sda1:
    /dev/sda1   /               ext4    discard,noatime,errors=remount-ro 0       1
  2. Swap: I used to disable swap completely and let programs crash if they used too much memory. However, there seems to be a bug in 16.04 and sometimes kswapd0 runs at 100% CPU for several minutes when there’s not swap. So now I:
    1. create a very small swap (10 MB)
    2. decrease swappiness (sudo sysctl vm.swappiness=10)
    3. use earlyoom (https://github.com/rfjakob/earlyoom) to aggressively kill programs. I add it to .config/openbox/autostart

Acer C720P Elantech touchpad finally working with Ubuntu!

Thanks to GalliumOS, I’ve been able to use the Elantech touchpad on my Acer C720P Chromebook since I installed full single boot Ubuntu on it in late 2015.

Now the mainline kernel 4.8.10 also supports my touchpad! This means I can have the newest kernel updates without losing touchpad support. The wait is over!

Installing Ubuntu 16.04 on an Acer C720p chromebook

I booted a Ubuntu LiveUSB on my Acer C720p and I got this error:

Missing parameter in configuration file. Keyword: path
gfxboot.c32: not a COM32R image
boot :

Pressing tab shows boot options: live live-install

But typing live and pressing Enter results in another error:

Not enough memory to load specified image

The solution is to type live mem=1900m or whatever amount of memory you have.

Not enough memory to load specified image
boot: live mem=1900m

Then Ubuntu LiveUSB will boot as normal.

Creating a ChromeOS recovery drive using Ubuntu

The way to reinstall ChromeOS using Linux is to download a script from Google and run it.

Running sudo linux_recovery.sh failed with an error about the config file:

ERROR: The config file isn't valid.

linux_recovery.sh downloads /tmp/tmp.crosrec/config.txt which contains the URL of the image to download.

The entry for my Chromebook in /tmp/tmp.crosrec/config.txt is:

name=Acer C720 Chromebook
desc=Acer C720 Chromebook
hwidmatch=^PEPPY .*

I downloaded the image and used dd to create the USB drive:

wget https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_8172.62.0_peppy_recovery_stable-channel_mp-v2.bin.zip
unzip chromeos_8172.62.0_peppy_recovery_stable-channel_mp-v2.bin.zip
sudo dd bs=4194304 of=/dev/sdb if=chromeos_8172.62.0_peppy_recovery_stable-channel_mp-v2.bin conv=sync