LukeShortCloud / rootpages

Root Pages is a collection of easy-to-reference tutorials and guides primarily for Linux and other UNIX-like systems.
Other
56 stars 6 forks source link

[linux_distributions][chromium_os] Create other Crostini containers #495

Open LukeShortCloud opened 2 years ago

LukeShortCloud commented 2 years ago

Arch Linux

First, start the termina virtual machine.

crosh> vmc start --enable-gpu --enable-vulkan termina

In a separate terminal, create a new container. It will seemingly fail because the Crostini integrations have not been installed yet.

crosh> vmc container termina arch https://us.images.linuxcontainers.org archlinux/current
Error: operation `container_start` failed: timeout while waiting for signal
[ERROR:src/main.rs:181] ERROR: command failed

Log into the container.

crosh> vsh termina
(termina) chronos@localhost ~ $ lxc ls
+---------+---------+-----------------------+------+------------+-----------+
|  NAME   |  STATE  |         IPV4          | IPV6 |    TYPE    | SNAPSHOTS |
+---------+---------+-----------------------+------+------------+-----------+
| arch    | RUNNING | 100.115.92.195 (eth0) |      | PERSISTENT | 0         |
+---------+---------+-----------------------+------+------------+-----------+
| penguin | STOPPED |                       |      | PERSISTENT | 0         |
+---------+---------+-----------------------+------+------------+-----------+
(termina) chronos@localhost ~ $ lxc exec arch -- bash

A default account with the username of the Google account without the @gmail.com will be automatically created. Verify that username.

[root@arch ~]# grep 1000:1000 /etc/passwd | cut -d':' -f 1

Set a password for the user:

[root@arch ~]# passwd <USER>

Enable 32-bit packages.

[root@arch ~]# vim /etc/pacman.conf
[multilib]
Include = /etc/pacman.d/mirrorlist

Update the package repository cache and then install the sudo package.

[root@arch ~]# pacman -S -y
[root@arch ~]# pacman -S sudo

Give the user password-less sudo (root) access.

[root@arch ~]# echo "<USER> ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/<USER>
[root@arch ~]# chmod 0440 /etc/sudoers.d/<USER>

Install yay so AUR packages can be installed.

[root@arch ~]# pacman -S --needed git base-devel
[root@arch ~]# su - <USER>
[<USER>@arch ~]$ git clone https://aur.archlinux.org/yay.git
[<USER>@arch ~]$ cd yay
[<USER>@arch yay]$ makepkg -si

Install Wayland and Xorg for GUI applications:

[<USER>@arch yay]$ sudo pacman -S wayland xorg-xwayland

Exit the container and re-enter it via a console. This will allow systemd commands to work properly.

[<USER>@arch yay]$ exit
[root@arch ~]$ exit
(termina) chronos@localhost ~ $ lxc console arch

Install and enable the Crostini guest tools:

[<USER>@arch ~]$ yay -S cros-container-guest-tools-git
[<USER>@arch ~]$ systemctl --user enable --now sommelier@0.service sommelier-x@0.service sommelier@1.service sommelier-x@1.service

Enable SFTP for file sharing:

[<USER>@arch ~]$ sudo systemctl enable --now cros-sftp

https://github.com/Jguer/yay https://wiki.archlinux.org/title/Chrome_OS_devices/Crostini

LukeShortCloud commented 2 years ago

Arch Linux Vulkan Passthrough Support

Install mesa-git. This will automatically build Mesa with the required vulkan-drivers=virtio-experimental flag.

[<USER>@arch ~]$ yay -S mesa-git

Install lib32-mesa-git. This does NOT have the required flag enabled. We need to manually modify the PKGBUILD file.

[<USER>@arch ~]$ git clone https://aur.archlinux.org/lib32-mesa-git.git
[<USER>@arch ~]$ cd lib32-mesa-git/
[<USER>@arch lib32-mesa-git]$ vim PKGBUILD
        -D vulkan-drivers=amd,intel,virtio-experimental \
[<USER>@arch lib32-mesa-git]$ makepkg -s -i

Test Vulkan pass-through support.

[<USER>@arch ~]$ sudo pacman -S vulkan-tools
[<USER>@arch ~]$ export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/virtio_icd.i686.json:/usr/share/vulkan/icd.d/virtio_icd.x86_64.json
[<USER>@arch ~]$ vulkaninfo
[<USER>@arch ~]$ vkcube

Make the Vulkan driver permanent.

[<USER>@arch ~]$ sudo vim /etc/environment
VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/virtio_icd.i686.json:/usr/share/vulkan/icd.d/virtio_icd.x86_64.json

https://bbs.archlinux.org/viewtopic.php?id=265471

LukeShortCloud commented 2 years ago

For demo purposes on hardware limited to Vulkan 1.0, use the Vulkan build of Quake. Use MangoHUD to show benchmarks and to prove it is using Vulkan.

https://steamlists.com/quake-run-vulkan-vk-on-steam/

Otherwise, with Vulkan 1.2 support, demo a game like Halo 3 or Skyrim with Proton using the DXVK HUD.

LukeShortCloud commented 2 years ago

Fedora: https://www.reddit.com/r/Crostini/wiki/howto/run-fedora-linux

LukeShortCloud commented 2 years ago

More documentation for Arch Linux: https://faq.fydeos.com/en/recipes/install-arch-linux/