[我通过wsl --export
从另一台计算机导入了通过wsl --import
制作的wsl备份文件。
但是与在Window Store上安装WSL Ubuntu时不同,未创建distro.exe
这样的ubuntu.exe
文件(位于开始菜单上)。因此,从JetBrain IDE获取WSL支持存在问题。这是因为JetBrain IDE通过distro.exe
文件识别到WSL的路径。
[如果有人解决了这个问题,我想寻求帮助。感谢您阅读。
编辑:Windows为v.1909(操作系统内部版本18363.592),而我尝试https://winaero.com/blog/export-import-wsl-linux-distro-windows-10/
我找到了解决方案。(Windows 10 build 18363.592)
wsl --export {your_distribution_name} rootfs.tar.gz
导出您的wsl发行版。 (您的发行版将保存到tarball中。)
我使用了Yuk7's version。首先,下载Launcher.exe,并将其重命名为your_distro_name.exe
,然后创建目录以放置WSL发行版。将your_distro_name.exe
和rootfs.tar.gz
放在其中。
现在您可以安装发行版,只需运行your_distro_name.exe
。安装后,您可以在powershell中运行发行版。 PS > your_distro_name
C:\users\\{user_name}\\.{jetbrains_ide_name_version}\config\options\wsl.distributions.xml
Jetbrains IDE通过wsl.distributions.xml
支持WSL,您应将distro.exe
添加到其中以在Jetbrains IDE上使用WSL。
<application>
<component name="WslDistributionsService" version="1">
<descriptors>
<set>
<descriptor>
<id>DEBIAN</id>
<microsoft-id>Debian</microsoft-id>
<executable-path>debian.exe</executable-path>
<presentable-name>Debian GNU/Linux</presentable-name>
</descriptor>
<descriptor>
<id>KALI</id>
<microsoft-id>kali-linux</microsoft-id>
<executable-path>kali.exe</executable-path>
<presentable-name>Kali Linux</presentable-name>
</descriptor>
...
</set>
</descriptors>
</component>
</application>
<!-- DESCRIPTOR FOR YOUR DISTRO -->
<descriptor>
<id>YOUR_DISTRO_NAME</id>
<microsoft-id>Your-distro-name</microsoft-id>
<executable-path>your_distro_name.exe</executable-path>
<presentable-name>your_distro_name</presentable-name>
</descriptor>
只需将<descriptor>
添加到<set>
。
最后,我可以在另一台计算机的WebStorm中使用导出的wsl发行版:)