Win 10 WSL 不会设置默认值 2 [英] Win 10 WSL won't set default 2

查看:44
本文介绍了Win 10 WSL 不会设置默认值 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

完全不熟悉 Windows 上的开发(因为我的 Mac 正在维修中),我正在尝试按照这些说明进行操作

解决方案

转到任务管理器,确保在 BIOS 中启用了虚拟化 ->更多详情 ->性能 ->CPU 和名为 Virtualisation 的选项应设置为启用.如果未启用,请转到您的 BIOS 并在 AMD CPU 上启用 SVM 模式或在英特尔 CPU 上启用英特尔虚拟化技术.

接下来,通过在 powershell 中运行它来确保 WSL 已启用:

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

并通过运行以下命令启用虚拟机功能:

dism.exe/online/enable-feature/featurename:VirtualMachinePlatform/all/norestart

重新启动计算机.然后,转到 Microsoft Store 并下载您选择的发行版.然后,通过运行

设置您的默认发行版

wsl --setdefault <分发名称>

并通过运行启用 WSL 2

wsl --set-default-version 2

再说一遍.如果这不起作用,请运行 wsl --help 并确保列出了 --set-default-version.如果未列出,则您的操作系统不支持它,您需要更新.如果它抛出这个错误:

WSL 2 需要更新其内核组件.有关信息,请访问 https://aka.ms/wsl2kernel

此处更新并运行 MSI 更新包.

Completely new to developing on windows (as my mac is in for repair) and I'm trying to follow these instructions https://docs.microsoft.com/en-us/windows/wsl/install-win10

But while I seem to have an adequate version, my wsl does not seem to have the right option. I have installed the wsl update, but was not asked for elevated privaledges while doing so. Any ideas?

解决方案

Make sure virtualisation is enabled in your BIOS by going to Task Manager -> More Details -> Performace -> CPU and an option called Virtualisation should be set to enabled. If it isn't enabled then go to your BIOS and enable SVM Mode on AMD CPUs or Intel Virtualisation Technology on Intel CPUs.

next, make sure WSL is enabled by running this in powershell:

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

and that the virtual machine feature is enabled by running this:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Restart your computer. Then, go to the microsoft store and download your distro of choice. Then, set your default distro by running

wsl --setdefault <DistributionName>

and enable WSL 2 by running

wsl --set-default-version 2

again. If this doesn't work, run wsl --help and make sure --set-default-version is listed. If it isn't listed, your operating system does not support it and you need to update. If it throws this error:

WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernel

Update here and run the MSI update package.

这篇关于Win 10 WSL 不会设置默认值 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆