先安装wsl
升级到wsl2
安装LxRunOffline
上面有教程很详细就不说了
CentOS7镜像下载地址:
https://raw.githubusercontent.com/CentOS/sig-cloud-instance-images/CentOS-7-x86_64/docker/centos-7-x86_64-docker.tar.xzhttps://raw.githubusercontent.com/CentOS/sig-cloud-instance-images/CentOS-7-x86_64/docker/centos-7-x86_64-docker.tar.xz像这样:
执行:
LxRunOffline.exe install -n centos -d D:\LinuxSubSystem\CentOS7 -f D:\LinuxSubSystem\WSL\centos-7-x86_64-docker.tar.xz
即可将镜像安装到D:\LinuxSubSystem\CentOS7下
wsl --list --verbose
查看wsl版本:
此时是wsl1,必须升级到wsl2
wsl.exe --set-version centos 2
转换之后就是这样:
执行wsl进入centos容器:
开始安装xfce4
一键配置镜像源,不配置可能下载会很慢。
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo yum clean all yum makecache yum update -y yum install -y sudo yum install -y wget sudo yum install -y epel-release yum -y groupinstall Fonts # 安装字体 防止中文乱码 sudo yum groupinstall -y "Xfce" # 安装图形环境 echo ok
yum -y install firefox
运行浏览器:
sudo -i firefox
点击下载linux版
Thank you for downloading the Toolbox App! (jetbrains.com)https://www.jetbrains.com/toolbox-app/download/download-thanks.html?platform=linux或者直接运行命令进行下载指定版本toolbox:
wget https://download.jetbrains.com.cn/toolbox/jetbrains-toolbox-1.21.9712.tar.gz
tar -xvf jetbrains-toolbox-1.21.9712.tar.gz # 解压 ./jetbrains-toolbox-1.21.9712/jetbrains-toolbox # 运行toolbox
大概等几秒之后:
下载后打开即可
ps: 剪切板如果存有图片运行的GUI软件会崩溃(似乎是个bug)
要点:
运行GUI必须是WSL2才行,WSL1不行