WSL2安装、WSL2 GUI


rem 这行貌似没用
wsl --install

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart


rem 不启用hyperV
rem dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
rem dism.exe /online /disable-feature /featurename:VirtualMachinePlatform  /norestart

wget https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
wsl_update_x64.msi  rem 安装后即为 WSL 2 ?

wsl --set-default-version 2

wget https://wsldownload.azureedge.net/Ubuntu_2004.2020.424.0_x64.appx

rem 解压 Ubuntu_2004.2020.424.0_x64.appx 到D:\Ubuntu_2004.2020.424.0_x64\

D:\Ubuntu_2004.2020.424.0_x64\ubuntu2004.exe  REM 此即开始安装 Ubuntu20.04

rem 安装完后:
D:\Ubuntu_2004.2020.424.0_x64\ubuntu2004.exe  rem 即打开 ubuntu20.04的 shell

wsl2 gui

ref

wsl2 :

sudo apt-get install x11-apps
sudo apt-get install xfce4-terminal
sudo apt-get install xfce4

安装 VcXsrv , 启动 XLaunch,

Display number : 0
Disable access control
Additioanl parameters for VcXsrv: -ac

执行 “启动x”

以下内容写入到 .bashrc中,

#启动x:
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0.0
export LIBGL_ALWAYS_INDIRECT=1
pidof xfce4-session || ( nohup startxfce4 & )

以后日常启动过程

  1. cmd下执行: wsl --shutdown
  2. 启动 XLaunch
  3. 启动x (打开wsl终端即可)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ziix

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值