Skip to content

Instantly share code, notes, and snippets.

@uogbuji
Forked from cassiozen/pixelbook-dev-setup.md
Last active January 4, 2026 00:29
Show Gist options
  • Select an option

  • Save uogbuji/714d06ad3a9e081b69337107a0beff18 to your computer and use it in GitHub Desktop.

Select an option

Save uogbuji/714d06ad3a9e081b69337107a0beff18 to your computer and use it in GitHub Desktop.
Notes on setting up Pixelbook for development

Pixelbook Setup

Change your channel

Some of the features mentioned in this document only work on the beta or Dev channel. To change your channel:

  1. chrome://help in a browser window
  2. Click Detailed Build Information
  3. Change Channel
  4. Select Beta (Or Dev, if you're feeling adventurous)
  5. Wait for Chromebook to download an update then show icon in bottom left
  6. Restart when update is ready

Fast User Switching

  1. Open the status area (the bottom-right menu)
  2. Click your account photo.
  3. Click Sign in another user.
  4. You'll see a reminder to use the feature only with people you trust. Click OK.
  5. Pick a person, then enter their password. You can add up to 7 users.

You can then quick-switch between users with CTRL+ALT+, & CTRL+ALT+.

Enable Power Button as 2FA

Pixelbook's power button has a built-in 2fa/2sv key (think YubiKey), but it's disabled by default. If you use Two-Factor authentication on GitHub, Gmail etc, you can turn it on by entering this command on the Crosh shell (Ctrl+Alt+T):

u2f_flags g2f

Linux Setup

Enable Linux Apps

  1. Open drawer in bottom right and click gear icon
  2. Scroll down to find Linux Apps or Linux (Beta) and select TURN ON
  3. After the install runs, you should have an application in ChromeOS called Terminal

Initial setup of container

sudo apt-get update && sudo apt-get dist-upgrade

Generate new SSH Key

ssh-keygen -t rsa -b 4096 -C pixelbook
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
cat .ssh/id_rsa.pub
# Paste in GitHub/GitLab

Set Password

sudo passwd root

Install Fonts

  • Copy .ttf file to ~/.local/share/fonts
fc-cache -vf ~/.local/share/fonts
fc-list | grep [your font name] # To verify

Enable File Sharing between Chrome OS and Linux

  1. Go to chrome://flags and turn on 'crostini-files'.
  2. Right-click on folders in FilesApp and select 'Share with Linux'
  3. Folders will show up in /ChromeOS/Downloads/ inside linux.

Applications

Tilix (Terminal alternative)

echo 'deb http://ftp.debian.org/debian stretch-backports main' | sudo tee /etc/apt/sources.list.d/stretch-backports.list
sudo apt update
sudo apt -y install tilix
sudo ln -s /etc/profile.d/vte-2.91.sh /etc/profile.d/vte.sh

Add to path

if [ $TILIX_ID ] || [ $VTE_VERSION ]; then
    source /etc/profile.d/vte.sh
fi

VSCode

curl -L https://go.microsoft.com/fwlink/?LinkID=760868 > code.deb
sudo apt-get install libxss1 libasound2 ./code.deb

By Default, VSCode opens with weird cursor sizes and scroll issues. This can be fixed by editing the code.desktop file and your user settings in VSCode:

/usr/share/applications/code.desktop

Change Exec entries to specify Sommelier's DPI and disable hardware acceleration (Not yet available on the linux container):

[Desktop Entry]
Name=Visual Studio Code
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=sommelier --dpi=235 -X /usr/share/code/code "--disable-gpu --unity-launch %F"
Icon=code
Type=Application
StartupNotify=true
StartupWMClass=Code
Categories=Utility;TextEditor;Development;IDE;
MimeType=text/plain;inode/directory;
Actions=new-empty-window;
Keywords=vscode;

X-Desktop-File-Install-Version=0.23

[Desktop Action new-empty-window]
Name=New Empty Window
Exec=sommelier --dpi=235 -X /usr/share/code/code "--disable-gpu --new-window %F"
Icon=code

VSCode User settings

"window.titleBarStyle": "custom",
"window.zoomLevel": 3.5,
"editor.mouseWheelScrollSensitivity": 0.5
@uogbuji
Copy link
Copy Markdown
Author

uogbuji commented Jul 6, 2019

@esternin
Copy link
Copy Markdown

The Pen section is a little too slim, do you (or anybody) know more about the sommelier support for stylus/touchscreen?

As far as I can tell, stylus and touchscreen are not treated by sommelier as separate devices, so in stylus-oriented programs, like xournal/xournalpp, one cannot assign separate devices to zoom/pan (I would want touchscreen to do those) and draw (the stylus device). There is also the eraser device (wacom style), and that would be just a cherry on top, especially if and when the [stupid] Assistant-only button on the Pixelbook pen could be captured and assigned to switch-pen-to-eraser action, or if a pen with an actual active eraser tip could be found for Pixelbook.

Here's what I see in termina (ChromeOS 79, manually updated to buster=Debian 10.2, which will be the default for ChromeOS 80 in a couple of weeks) :

$ ps -ef | grep sommelier
user_name+   121    97  0 12:37 ?        00:00:00 /opt/google/cros-containers/bin/../lib/ld-linux-x86-64.so.2 --library-path /opt/google/cros-containers/bin/../lib --inhibit-rpath  /opt/google/cros-containers/bin/sommelier.elf -X --x-display=0 --sd-notify=READY=1 --no-exit-with-child --x-auth=/home/user_name/.Xauthority /bin/sh -c systemctl --user set-environment DISPLAY=${DISPLAY};                     systemctl --user set-environment XCURSOR_SIZE=${XCURSOR_SIZE};                     systemctl --user import-environment SOMMELIER_VERSION;                     touch /home/user_name/.Xauthority;                     xauth -f /home/user_name/.Xauthority add :0 . $(xxd -l 16 -p /dev/urandom);                     . /etc/sommelierrc
user_name+   122    97  0 12:37 ?        00:00:00 /opt/google/cros-containers/bin/../lib/ld-linux-x86-64.so.2 --library-path /opt/google/cros-containers/bin/../lib --inhibit-rpath  /opt/google/cros-containers/bin/sommelier.elf --master --sd-notify=READY=1 --socket=wayland-1 /bin/sh -c systemctl --user set-environment WAYLAND_DISPLAY_LOW_DENSITY=${WAYLAND_DISPLAY};                     systemctl --user import-environment SOMMELIER_VERSION
user_name+   123    97  0 12:37 ?        00:00:00 /opt/google/cros-containers/bin/../lib/ld-linux-x86-64.so.2 --library-path /opt/google/cros-containers/bin/../lib --inhibit-rpath  /opt/google/cros-containers/bin/sommelier.elf --master --sd-notify=READY=1 --socket=wayland-0 /bin/sh -c systemctl --user set-environment WAYLAND_DISPLAY=${WAYLAND_DISPLAY};                     systemctl --user import-environment SOMMELIER_VERSION
user_name+   125    97  0 12:37 ?        00:00:00 /opt/google/cros-containers/bin/../lib/ld-linux-x86-64.so.2 --library-path /opt/google/cros-containers/bin/../lib --inhibit-rpath  /opt/google/cros-containers/bin/sommelier.elf -X --x-display=1 --sd-notify=READY=1 --no-exit-with-child --x-auth=/home/user_name/.Xauthority /bin/sh -c systemctl --user set-environment DISPLAY_LOW_DENSITY=${DISPLAY};                     systemctl --user set-environment XCURSOR_SIZE_LOW_DENSITY=${XCURSOR_SIZE};                     systemctl --user import-environment SOMMELIER_VERSION;                     touch /home/user_name/.Xauthority;                     xauth -f /home/user_name/.Xauthority add :1 . $(xxd -l 16 -p /dev/urandom);                     . /etc/sommelierrc

$ xinput
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ xwayland-pointer:7                      	id=6	[slave  pointer  (2)]
⎜   ↳ xwayland-relative-pointer:7             	id=7	[slave  pointer  (2)]
⎜   ↳ xwayland-touch:7                        	id=9	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ xwayland-keyboard:7                     	id=8	[slave  keyboard (3)]

Is there perhaps some sommelier configuration option that could be added to resolve this?

@uogbuji
Copy link
Copy Markdown
Author

uogbuji commented Jan 21, 2020

Hi @esternin. You're right that I didn't spend much time on pen input. I'm not a heavy pen user, though I do have a Lenovo Stylus, mostly for filling and signing forms, so just Chrome and the native PDF app—No Linux apps. If you figure this out I'd be happy to add a section, with credit to you, or you could also fork the doc and issue a PR later. I wasn't able to find many hints on a quick googling, which I'm sure you already tried, anyway. I'd suggest asking on Reddit r/Pixelbook.

@esternin
Copy link
Copy Markdown

Thanks. I'll just add it here, in comments, if I figure it out. From reviewing Reddit r/Pixelbook I see that the pen/stylus is a very low priority at google, and the majority of users either use a pen, or Linux, never pen/stylus under Linux. And the problem is not limited to google hardware (I test using a Pixelbook, and a Samsung Chromebook Plus, with identical results), it's crostini interface that is the problem.

It is frustrating that the best Linux+pen software (xournal/xournal++) that I have been using for 15 years to take notes, mark up PDF, and deliver talks and lectures, a true replacement for a chalkboard/whiteboard, is limited by the deficiencies of the Chrome<->crostini interface. I have Wacom Cintiq's in my office and many of our classrooms, and xournal is installed on every lectern computer on campus. I know professional musicians using Chromebook+xournal under crostini to play (and mark up) all of their sheet music.

Unfortunately, xournal is frozen in time. At the same time, xournal++ developers do not recognize the potential of their own software - on a Chromebook. So google is not being asked to improve the interface to crostini. There is a feature request for remapping the Assistant button to a user-defined function within apps, but lack of interest keeps pushing its priority down, so I am not sure it will ever happen.

I was just hoping that someone reading this might know an undocumented switch to sommelier to make its input device recognition work properly for the stylus.

@ursuad
Copy link
Copy Markdown

ursuad commented Mar 5, 2020

Have you tried changing the user (which by default it's your email address) in Crostini for the penguin container? I've seen someone saying here that if the penguin container doesn't exist, you can create it and set a specific user name at creation time, like this:

crosh> vmc start termina
(termina) chronos@localhost ~ $ run_container.sh --container_name penguin --shell --user cl4rkc4nt

I'm just curious if this will have some other implications down the road and it might help other people as well.

EDIT: I found a good way of changing the username here.

@esternin
Copy link
Copy Markdown

Typically, modern applications installed through sudo apt-get install... arrive with their own .desktop file, and their .svg icon file. However, crostini currently (ChromeOS 80) does not understand the .svg files, only .png. One workaround is to install the imagemagick tools and render the .svg file provided into all resolutions of .png files required by xwayland. I use the following makepng.sh script to do this:

#!/bin/sh
cd /usr/share/icons/hicolor
for s in ?x? ??x?? ???x???
do
  sudo convert -scale $s scalable/apps/$1.svg $s/apps/$1.png
done	
sudo touch /usr/share/icons/hicolor
gtk-update-icon-cache

Assuming /usr/share/applications/MYAPP.desktop has a line that says Icon=MYAPP, which refers to /usr/share/icons/hicolor/scalable/apps/MYAPP.svg, you call the script as makepng.sh MYAPP.

@avm99963
Copy link
Copy Markdown

This is a great setup guide, thanks for sharing!

Personally, I didn't know there was an experimental U2F software key, so discovering this was great!

However, it seems like the command to activate the security key is different now, now you should run the following: u2f_flags u2f,user_keys. The command u2f_flags u2f enables the previous software key which is no longer recommended to be used because it has a vulnerability.

More info: https://sites.google.com/a/chromium.org/dev/chromium-os/u2f-ecdsa-vulnerability

@uogbuji
Copy link
Copy Markdown
Author

uogbuji commented Mar 22, 2020

Thanks @avm99963 for the note and the reference. I can't verify your suggested change because I'm no longer in a situation where I'm using a YubiKey with my Chromebook, but I did read the link and so went ahead and updated the doc.

@librehat
Copy link
Copy Markdown

The scaling tips work for X perhaps. Any ideas how one can apply DPI and scaling for native wayland GUI apps?

@Firespyer
Copy link
Copy Markdown

Have you managed to get git installed?

@uogbuji
Copy link
Copy Markdown
Author

uogbuji commented Mar 8, 2021

Yes, I was able to install git no problem via apt.

@Firespyer
Copy link
Copy Markdown

@uogbuji what version are you running? I am running into a dependency error trying to install with apt.

@uogbuji
Copy link
Copy Markdown
Author

uogbuji commented Mar 8, 2021

@Firespyer I don't remember. That was almost a year ago. I ended up switching back to Mac when the new MBPs finally seemed worthwhile. I do still keep an eye on the quite active PixelBook reddit, and that might be your best bet for a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment