Setting up Pixelbook for development: ZSH, Git, SSH, Node, VSCode

Sarbbottam Bandyopadhyay
4 min readNov 25, 2018

--

Screenshot of Pixelbook with Terminal and Visual Studio Code opened side by side.

Why Pixelbook?

All the ChromeDevSummit 2018 attendees were provided with a 75% discount code for the latest Pixelbook (base configuration). On learning, that I could enable Linux sandboxes, I got intrigued to try it as a dev box.

I am thankful to the Google Chrome team for this opportunity.

First impression

Sleek, stunning, lightweight, smooth onboarding.

The UI/UX seemed like an amalgamation of Windows and Mac experience.

Setting it up as a dev box

I needed the following setup to use the Pixelbook as a full-fledged dev environment.

  • zsh as my preferred Shell
  • git as the source control
  • ssh for accessing GitHub
  • Node for the runtime; I develop primarily using node
  • Visual Studio Code as the editor, it has been my preferred editor for the last 3 years, since its release.

But first I needed to enable Linux.

Set up Linux (Beta) on your Pixelbook

Please note as of Chrome OS Version 70.0.3538.76, Linux support is still in Beta.

Following steps are from the official support documentation to enable Linux.

  1. Select your account photo.
  2. Select Settings
  3. Under "Linux (Beta)," select Turn On.
  4. Follow the steps on the screen. Setup can take 10 minutes or more.
  5. A terminal window opens. You can run Linux commands, install more tools using the APT package manager, and customize your shell.

Once the Linux (Beta) is enabled, the Terminal app will appear in the launcher.

Screenshot of Pixelbook’s launcher displaying Terminal app.

Setting up ZSH

The default shell in the Linux sandbox is bash. I used the following commands to install zsh and change the default shell to zsh.

sudo apt-get install zsh
sudo chsh -s /usr/bin/zsh $USER

I also installed oh-my-zsh for managing zsh configuration.

Setting up git and ssh

I used the following commands to install git and ssh.

sudo apt-get install git ssh

I copied the .ssh folder from my MacBook, so that I can use the existing keys.

Please note, that there could be a security concern in sharing the same ssh keys across multiple systems, however, I mitigate it by ensuring that a password is required to access any of my systems and my ssh keys are password protected. Please refer to this conversation for further details.

I also use ssh-find-agent for locating existing ssh compatible agent processes; and, optionally, setting SSH_AUTH_SOCK accordingly.

If you are new to ssh, you may refer the Connecting to GitHub with SSH for further details.

Installing Node

I prefer using n to manage multiple versions node. There are many ways to install n, I used the following steps:

# create the desired directories needed by n
sudo mkdir /usr/local/{include,share,n}/
# change the owner for the following directories
sudo chown -R $USER /usr/local/{bin,lib,include,share,n}/
# download n
curl -o /usr/local/bin/n https://raw.githubusercontent.com/tj/n/master/bin/n &>/dev/null
# change the permission for n
chmod 755 /usr/local/bin/n
# install the latest node
n latest

Installing Visual Studio Code

I download the .deb 64 bit from the Visual Studio Code Download page.

Draged the downloaded .deb file from Downloads to Linux files.

Screenshot of Pixelbook’s Files app.

Then installed Visual Studio Code using the following commands.

sudo dpkg -i <file>.deb
sudo apt-get install -f # Install dependencies

sudo apt-get install -f is mandatory, otherwise even though VSCode icon appears in the launcher, activating it won't work.

I referred the documentation at https://code.visualstudio.com/docs/setup/linux for installing VSCode on Linux

Update: The below-mentioned issues have been fixed at Chrome OS 71.

PS: There is an existing issue with the VSCode icon but that does not affect the dev workflow. Please refer the following resources for further details:

Finally, the Pixelbook is ready to be my full-fledged dev box.

Screenshot of Pixelbook with Terminal and Visual Studio Code opened side by side.

Final thoughts

So far it has been a pleasure to use the Pixelbook.

I think sooner with the upcoming Chrome OS development, Pixelbook could give a tough competition to the status quo.

--

--