侧边栏壁纸
  • 累计撰写 12 篇文章
  • 累计创建 19 个标签
  • 累计收到 1 条评论
隐藏侧边栏

Win11下全新安装wslg以及配置.md

zjan
2021-09-14 / 0 评论 / 0 点赞 / 243 阅读 / 2,213 字
温馨提示:
本文最后更新于 2021-09-14,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

Win11下全新安装wslg以及配置

wslg是基于wsl2上的图形化界面,可以和win11很好的契合,目前发现最大的bug是图形传输质量不行,RDP的分辨率太低了,对付用。

  1. 为wsl2提供gpu加速驱动
    1. AMD GPU driver for WSL
    2. Intel GPU driver for WSL
    3. NVIDIA GPU driver for WSL
  2. 全新安装wslg
    1. win +x 打开windows终端
    2. 列出可用的Linux发行版
      wsl --list --online
    3. 安装发行版,这里以Ubuntu为例
      wsl --install -d Ubuntu
    4. 稍等片刻,提示输入username和password即安装成功
    5. 默认位置安装在C:\Users\zjan\AppData\Local\Packages有个Ubuntu开头的文件夹中
  3. Ubuntu常用配置
    1. 更新换源
$ sudo cp /etc/apt/sources.list /etc/apt/sources/list.bak
$ sudo vim /etc/apt/sources.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

$ sudo apt updapte -y
$ sudo apt upgrade -y
  1. 安装zsh并配置ohmyzsh
// 安装zsh
$ sudo apt install zsh

// 配置ohmyzsh
$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

// 配置ohmyzsh插件
//// zsh-autosuggestions
$ git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

//// zsh-syntax-highlighting
$ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

// 启用插件
$ vim .zshrc
plugins=(git z zsh-autosuggestions zsh-syntax-highlighting)
  1. 配置代理
$ vim .zshrc
host_ip=$(cat /etc/resolv.conf |grep "nameserver" |cut -f 2 -d " ")
alias proxy="export ALL_PROXY="http://$host_ip:7890""
alias unproxy="unset ALL_PROXY"
  1. 安装wslg
    1. 安装一个gui应用就会安装图形界面工具了
    2. $ sudo apt install gedit
0

评论区