Gentoo on WSL2

翻译自Gentoo Forum

1Make sure hardware virtualization is enabled in BIOS.

确保在BIOS开启了虚拟化

2.Log into Windows and open an administrator PowerShell prompt.

以管理员身份打开Powershell

3.Make sure WSL is installed:

安装wsl,详细可见Microsoft文档

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform

4.Grab a Gentoo stage3 AMD64 tarball (nomultilib recommended) from your mirror. Uncompress it, but leave it in tar format.

下载stage3

解压

再压缩成(.tar.gz)格式,重命名为rootfs (#建议)

wsl --import gentoo C:\Users\otto-the-win\gentoo\  C:\Users\otto-the-win\Downloads\rootfs.tar.gz --version 2  #在Powershell执行

5.Download Launch.exe from wsldl, rename Launch.exe to gentoo.exe

上面这个解决方案是个人觉得非常完美的一个

6.put rootfs.tar.gz and gentoo.exe in to same directory

7. under a windows terminal, change to the above folder, run gentoo (will install gentoo linux)

8. start the installed Gentoo linux by just run the gentoo.exe in a terminal

9. run “wsl –set-default-version gentoo 2 “to convert gentoo from wsl 1 to wsl 2.


做好以上步骤之后我们就可以在wsl上捣鼓了
运行 Linux GUI 应用

注:Windows 11 版本22000或更高版本支持无脑直接用图形界面。

如果您在使用Windows10,也不用着急,MS Store上也有相应的软件来支持。

若要运行 Linux GUI 应用,你应该首先安装与你的系统匹配的预览驱动程序

这使你能够使用虚拟 GPU (vGPU) 以便你可以用上 OpenGL 。

AMD WSL 的 GPU 驱动程序

NVIDIA WSL 的 GPU 驱动程序

剩下安装的过程可以直接参考wiki,这里不多赘述,但值得提醒的一点是:在merge的过程中,如果没有提前修改 “无人参与系统睡眠超时”,你编译的过程很可能被你亲爱的Windows打断

ps:关于kenel的配置,配置好后,你可能用neofetch检查会发现kernel还是wsl2的,这时你需要在.wslconfig文件里指定好vmlinux。

Falco on WSL2 with a custom kernel

像是上面的步骤。

2021-10-24

Go Back

Projects by Ottodeng.

Content on this site is licensed under CC BY 4.0 unless specified.

Leave a comment