Linux :: Crouton

Crouton

Installation

sudo install -Dt /usr/local/bin -m 755 ~/Downloads/crouton
# find all releases (distros)
crouton -r list
crouton -r bullseye

# target (desktop environment)
crouton -t core,keyboard,audio,cli-extra,gtk-extra,extension,x11,xorg
# start
crouton enter-chroot -n name
# all names located in
ls /usr/local/chroots

# delete
delete-chroot name

# edit
sudo edit-chroot -n name

# update
sudo edit-chroot -n name -u
# in chroot
sudo apt install i3
echo "exec i3" > ~/.xinitrc

# in crouton shell
sudo enter-chroot -n i3 xinit

## use i3-gaps rather than i3
## build from source
#https://github.com/Airblader/i3/wiki/Building-from-source
git clone https://github.com/Airblader/i3 i3-gaps
cd i3-gaps
mkdir -p build && cd build
meson --prefix /usr/local #install to /usr/local/bin
ninja
sudo ninja install


## remove bar section in i3 config to remove i3bar
# not sure if the following is necessary; should be done automatically
ln -s /etc/crouton/pulseaudio-default.pa ~/.config/pulse/default.pa
# create /etc/rc.local and make it exec
vi /etc/rc.local
#!/usr/bin/bash
mount -o remount,exec /media/removable/sdcard
chown -R /media/removable/sdcard
exit 0

chown +x /etc/rc.local

Debian

vi /etc/apt/sources.list
# add
deb http://deb.debian.org/debian/ bullseye-backports main non-free contrib

# update
apt update
apt -t bullseye-backports install package-name

apt upgrade
apt full-upgrade
apt show pkg [-a]
apt search pkg
apt info pkg
apt install pkg
apt remove pkg
apt purge pkg
apt autoremove
# swap search key and ctrl (xev to find keycode)
# add to i3 config or .xinitrc
xmodmap -e "keycode 133 = Control_L"
xmodmap -e "keycode 37 = Overlay1_Enable"
xmodmap -e "add control = Control_L"
xmodmap -e "remove control = Overlay1_Enable"
vi /etc/X11/xorg.conf.d/30-touchpad.conf
Section "InputClass"
    Identifier "touchpad"
    Driver "libinput"
    MatchIsTouchpad "on"
    Option "NaturalScrolling" "true"
EndSection
# locate /etc/alteratives
sudo update-alterative --config x-terminal-emulator
sudo update-alterative --install /usr/bin/x-terminal-emulator x-terminal-emulator /usr/local/bin/st 50

Crostini

(ctrl-alt-t)
# ^ Opens the crosh shell
# › crosh>

# vmc commands (within crosh)
vmc destroy termina     # delete a VM and all containers within it
vmc start termina       # create a VM and a default container
# create a new container `arch` within `termina`
# lxc launch may be easier
vmc container termina arch https://us.lxd.images.canonical.com/ archlinux/current

# start vsh (within crosh)
vsh termina
# ^ Enters the Linux VM ("termina").
# › (termina) chronos@localhost ~ $

# lxc commands (within vsh)
lxc remote list
lxc list
NAME URL PROTOCOL AUTH TYPE PUBLIC STATIC
images https://images.linuxcontainers.org simplestreams none YES NO
NAME STATE IPV4 IPV6 TYPE SNAPSHOTS
arch RUNNING PERSISTENT 0
penguin STOPPED PERSISTENT 0
## if not running, use 'lxc start arch'

# download an image (seems to be the same as vmc container)
lxc launch images:arch/current arch

# list information of a container
lxc info arch

# non-login root session
lxc exec arch -- bash
# > [root@arch ~]#

## setup user/password/sudo

exit    # exit container

## open console for a login session
lxc console arch

## stop a container
lxc stop --force arch

## rename
lxc stop --force penguin
lxc rename penguin debian
lxc rename arch penguin
lxc delete debian
lxc start penguin

Set up user and network

groupmod -n new-user old-user
usermod -d /home/new-user -l new-uswer -m -c new-user old-user
password new-user

## sudo/doas

## network
## Terminal app stuck at "Starting Linux Container Manager"
pacman -Syu dhclient
ip -4 a show dev eth0
# skip below if ^ output is non-empty
dhcpcd eth0
ping 8.8.8.8
systemctl disable systemd-networkd
systemctl disable systemd-resolved
unlink /etc/resolv.conf
touch /etc/resolv.conf
systemctl enable --now dhclient@eth0

GUI

cros-container-guest-tools-git  # AUR, allow X apps
wayland
xorg-xwayland
# start/enable services and restart
systemctl enable --now --user sommelier{,-x}@{0,1}.service

# check GPU acceleration
glxinfo -B

Sound

cp -rT /etc/skel/.config/pulse ~/.config/pulse

Crosh

# open
Ctrl+Alt+T
chrome-untrusted://crosh

exit
help [command]
help_advanced [command]

ping
top
memory_test
uptime
network_diag
free
meminfo
bt_console  # bluetooth
syslog

Shortcuts

Key Function
Alt + [ or ] Pin current window to left or right
Alt + = or - maximize or minimize window
Alt + 1 - 8 open shelf apps 1-8; 9 is the last app
Ctrl + Plus or Minus zoom in and out; 0 to reset
Ctrl + Shift + Plus or Minus increase/decrease resolution; 0 to reset
Shift + Alt + n notification tray
Shift + Alt + m open Files app
Search + [ or ] Switch to left/right desk