Ubuntu 26.04
Baixar a imagem
Baixe imagem resolute-wsl-amd64.wsl
https://cdimage.ubuntu.com/ubuntu-wsl/daily-live/current/
Instalando
Copie o arquivo para pasta. Segue estrutura sugerida:
├── C:\wsl
│ ├── images # coloque sua imagem aqui
│ ├── images\resolute-wsl-amd64.wsl # imagem baixada
│ ├── workspace # aqui ficarão seus linux
Abra o CMD ou Powershell e execute:
Configurando
Abra o seu novo linux. Use o comando wsl ou através de seu programa favorito (eu uso o MobaXTerm)
root@laptop:~# adduser <nome-usuario>
root@laptop:~# vim /etc/wsl.conf
[user]
default=<nome-usuario>
A partir daqui é com seu usuário.
usermod -aG sudo <nome-usuario>
sudo apt update
sudo apt install -y zsh
chsh -s $(which zsh) <nome-usuario>
No powershell ou cmd:
Agora volte para o seu novo linux.
This is the Z Shell configuration function for new users,
zsh-newuser-install.
You are seeing this message because you have no zsh startup files
(the files .zshenv, .zprofile, .zshrc, .zlogin in the directory
~). This function can help you with a few settings that should
make your use of the shell easier.
You can:
(q) Quit and do nothing. The function will be run again next time.
(0) Exit, creating the file ~/.zshrc containing just a comment.
That will prevent this function being run again.
(1) Continue to the main menu.
(2) Populate your ~/.zshrc with the configuration recommended
by the system administrator and exit (you will need to edit
the file by hand, if so desired).
# eu fui de opção 2
sudo apt install -y curl git
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
vim .zshrc
# EDITADO INICIO
plugins=(git docker kubectl)
ZSH_THEME="agnoster"
HISTSIZE=200000
SAVEHIST=200000
HISTFILE=~/.zsh_history
setopt EXTENDED_HISTORY
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt SHARE_HISTORY
setopt APPEND_HISTORY
setopt INC_APPEND_HISTORY
Corrigindo a tecla end e home no zsh
# Execute
cat -v
pressione END e HOME
veja o que aparece e adicione no ~/.zshrc de acordo com sua saída do cat.
Exemplo:
bindkey '^[[H' beginning-of-line
bindkey '^[[F' end-of-line
bindkey '^[[1~' beginning-of-line
bindkey '^[[4~' end-of-line
Evitar que o vim entre em modo de visualização ao selecionar texto
Instalando Docker
sudo apt update
sudo apt install -y ca-certificates curl gnupg lsb-release
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo $VERSION_CODENAME) stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io \
docker-buildx-plugin docker-compose-plugin
sudo usermod -aG docker $USER
Extra
Tema agnosterplus-custom.omp
crie o arquivo .poshthemes/agnosterplus-custom.omp.json com o seguinte conteúdo:
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"type": "rprompt",
"segments": [
{
"foreground": "#007ACC",
"options": {
"time_format": "15:04:05"
},
"style": "plain",
"template": " {{ .CurrentDate | date .Format }} ",
"type": "time"
}
]
},
{
"alignment": "left",
"segments": [
{
"background": "#ffffff",
"foreground": "#100e23",
"powerline_symbol": "\ue0b0",
"style": "powerline",
"template": " {{ .UserName }}@{{ .HostName }} ",
"type": "session"
},
{
"background": "#91ddff",
"foreground": "#100e23",
"powerline_symbol": "\ue0b0",
"options": {
"folder_icon": "\uf115",
"folder_separator_icon": " \ue0b1 ",
"home_icon": "\ueb06",
"style": "agnoster"
},
"style": "powerline",
"template": " {{ .Path }} ",
"type": "path"
},
{
"background": "#95ffa4",
"foreground": "#193549",
"background_templates": [
"{{ if or (.Working.Changed) (.Staging.Changed) }}#FFEB3B{{ end }}",
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}#FFCC80{{ end }}",
"{{ if gt .Ahead 0 }}#B388FF{{ end }}",
"{{ if gt .Behind 0 }}#F78C6C{{ end }}"
],
"powerline_symbol": "\ue0b0",
"style": "powerline",
"template": " {{ .UpstreamIcon }}{{ .HEAD }}{{ if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \ueb4b {{ .StashCount }}{{ end }} ",
"type": "git",
"options": {
"fetch_status": true,
"fetch_stash_count": true,
"fetch_upstream_icon": true
}
}
],
"type": "prompt"
}
],
"final_space": true,
"version": 4
}
vim ~/.zshrc
# adicione no final do arquivo
eval "$(oh-my-posh init zsh --config ~/.poshthemes/agnosterplus-custom.omp.json)"
source ~/.zshrc
Pode ficar com a fonte quebrada se ela não estiver instalada. Para resolver:
Baixar a fonte Font Nerd
(https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Meslo.zip)[https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Meslo.zip]
descompactar e instalar no windows