Open up powershell and download the nomultilib stage3 tarball:
curl -o stage3-amd64-nomultilib-openrc.tar.xz https://bouncer.gentoo.org/fetch/root/all/releases/amd64/autobuilds/20221204T163153Z/stage3-amd64-nomultilib-systemd-20221204T163153Z.tar.xz
Create a directory for registration:
mkdir -p C:\Users\brett\AppData\Local\WSL\Gentoo
Import downloaded file:
wsl --import Gentoo C:\Users\brett\AppData\Local\WSL\Gentoo\ .\stage3-amd64-nomultilib-openrc.tar.xz --version 2
Enter the Gentoo distribution on WSL by using the command:
wsl -d Gentoo
Setup make.conf:
cd /etc/portage
rm make.conf
wget https://raw.githubusercontent.com/brettcurtis/gentoo-wsl2/main/etc/portage/make.conf
emerge resolve-march-native
Setup package.use:
rm -rf /etc/portage/package.use
touch /etc/portage/package.use
wget https://raw.githubusercontent.com/brettcurtis/gentoo-wsl2/main/etc/portage/package.use
Setup a few thangs':
emerge app-eselect/eselect-repository dev-vcs/git
eselect repository add gentoo git https://github.com/gentoo-mirror/gentoo.git
rm -rf /var/db/repos/gentoo
emerge --sync
emerge --oneshot sys-apps/portage
emerge sudo vim
eselect editor set 3
. /etc/profile
emerge -a --depclean
NOTE:
* Messages for package app-vim/gentoo-syntax-2:
*
* This plugin provides documentation via vim's help system. To
* view it, use:
* :help gentoo-syntax
*
* This plugin makes use of filetype settings. To enable these,
* add lines like:
* filetype plugin on
* filetype indent on
* to your ~/.vimrc file.
*
Setup user:
useradd -m -G wheel brett
passwd brett
echo "brett ALL=(ALL) NOPASSWD:ALL" | EDITOR='tee -a' visudo
Setup wsl.conf
cat << EOF >> /etc/wsl.conf
[user]
default=brett
EOF
Setup CPU_FLAGS_*:
emerge app-portage/cpuid2cpuflags
echo "*/* $(cpuid2cpuflags)" > /etc/portage/package.use
Setup timezone:
echo "America/New_York" > /etc/timezone
emerge --config sys-libs/timezone-data
Locale generation:
vi /etc/locale.gen
locale-gen
eselect locale set 6
env-update && source /etc/profile
Updating the @world set:
emerge --ask --verbose --update --deep --newuse @world
Go make some ☕!
Cleanup:
emerge -a --depclean
Create an export from powershell:
mkdir -p C:\WSL2
wsl --export Gentoo C:\WSL2\Gentoo.tar