Refresh the Arch Linux keyring. This process involves refreshing the key database and ensuring that all necessary keys are trusted.
pacman-key --init
pacman-key --populate archlinuxuse the useradd command to create a new user. Replace yourusername with your desired username. This command will create the users home directory, add them to the wheel group and set bash as their default shell.
useradd -m -G wheel -s /bin/bash yourusernameSet a password for the newly created user, you will be prompted to enter and confirm the password
passwd yourusernameTo allow members of the wheel group to execute any command using sudo, you'll need to edit the sudoers file. It's recommended to use the visudo command for editing to prevent syntax errors.
EDITOR=nano visudoUncomment the line %wheel ALL=(ALL) ALL by removing the leading # character. If you want to not have to enter your password when using sudo, change it to %wheel ALL=(ALL) NOPASSWD: ALL
Open the wsl.conf file in the /etc folder and add a default username.
nano /etc/wsl.confAdd the following text. Replace yourusername with your user name.
[user]
default=yourusernameFrom powershell shutdown your WSL instance
wsl -t <distro-name>Start up your wsl instance and it should auto login with your username.
wsl -d <distro-name>Run the following command to setup your instance to my preferences.
curl -sSL https://raw.githubusercontent.com/codemonkey76/arch-linux-setup/main/setup.sh | sh