是否可以通过“ wsl --import”制作distro.exe?

问题描述 投票:0回答:1

[我通过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-subsystem-for-linux jetbrains-ide
1个回答
0
投票

我找到了解决方案。(Windows 10 build 18363.592)

1。导出您的WSL发行版

wsl --export {your_distribution_name} rootfs.tar.gz导出您的wsl发行版。 (您的发行版将保存到tarball中。)

2。通过Distro-Launcher安装发行版

我使用了Yuk7's version。首先,下载Launcher.exe,并将其重命名为your_distro_name.exe,然后创建目录以放置WSL发行版。将your_distro_name.exerootfs.tar.gz放在其中。

现在您可以安装发行版,只需运行your_distro_name.exe。安装后,您可以在powershell中运行发行版。 PS > your_distro_name

3。 Settig wsl.distributions.xml

C:\users\\{user_name}\\.{jetbrains_ide_name_version}\config\options\wsl.distributions.xml

Jetbrains IDE通过wsl.distributions.xml支持WSL,您应将distro.exe添加到其中以在Jetbrains IDE上使用W​​SL。

<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>

4。重新启动您的JetBrains IDE

最后,我可以在另一台计算机的WebStorm中使用导出的wsl发行版:)

© www.soinside.com 2019 - 2024. All rights reserved.