EasyWSL
让部署WSL更轻松!
使用环境
操作系统:Windows 10 1803以上版本
Python版本:>= 3.5
注意:该工具只能运行在Windows系统上,不支持在WSL中运行!
使用帮助
查看已安装的WSL系统列表
> ezwsl ls
Microsoft Windows 10 专业版 2004 Version 10.0.19041
WSL distribution installed:
=> Ubuntu-20.04(WSL2)
安装WSL发行版
> ezwsl install -d Ubuntu-20.04
目前只能安装官方支持的几款发行版:Ubuntu-20.04,Ubuntu-18.04,Ubuntu-16.04,Debian,Kali-Linux,OpenSUSE-42,SLES-12,FedoraRemix。
如果尚未开启WSL,执行该命令会先开启WSL,用户需要在开启后重启一次系统,然后再次执行该命令。
卸载WSL发行版
> ezwsl uninstall -d Ubuntu-20.04
设置默认的发行版
> ezwsl set-default -d Ubuntu-20.04
默认情况下第一次安装的发行版会自动成为默认系统,如果想设置为其它系统,可以使用该命令。
设置默认的WSL版本
> ezwsl set-default-version -v 2
WSL默认使用的是WSL1,可以使用该命令修改默认的WSL版本。
升级WSL2需要开启VirtualMachinePlatform特性,如果尚未开启,工具会自动开启并提示重启系统。请在重启后再次执行该命令。
设置发行版使用的WSL版本
> ezwsl set-dist-version -d Ubuntu-20.04 -v 2
与set-default-version命令相比,该命令只是设置指定的发行版WSL版本,不会修改默认的WSL版本。使用该命令也需要开启VirtualMachinePlatform特性。
安装zsh
zsh是目前使用非常广泛的shell,这里提供了一键安装zsh的命令,并且会安装oh-my-zsh以及Noto Mono for Powerline字体。
> ezwsl install-zsh -p password -d Ubuntu-20.04 --theme agnoster --set-default-shell
-p是Linux系统的当前用户密码(必选)
-d是要安装的发行版名字,不指定则使用当前发行版(可选)
--theme是使用zsh主题,默认是agnoster(可选)
--set-default-shell表示设置默认的shell为zsh(可选)
安装命令行终端
> ezwsl install-terminal -n wsl-terminal -p password --install-path C:\ --default-shell /bin/zsh
-n是terminal名称,目前只支持wsl-terminal、windows-terminal(必选)
-p是当前Linux系统的当前用户密码(必选)
--install-path是安装路径,默认为%APPDATA%(可选,只对wsl-terminal有效)
--default-shell是终端默认使用的shell,默认是bash(可选)
端口转发
WSL2中,WSL中不能通过回环地址访问Windows中创建的TCP服务。因此,easywsl提供了端口转发能力,允许在WSL中像访问本地服务一样访问Windows上的服务。
> ezwsl forward -p password --ports 80;443
-p是当前Linux系统的当前用户密码(必选)
--ports是要转发的端口列表,端口间使用;分割
Metadata
Release files for easywsl 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| easywsl-0.1.2.tar.gz | 14.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| easywsl-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.7 kB
Release files / easywsl-0.1.2.tar.gz
| Download URL | easywsl-0.1.2.tar.gz |
|---|---|
| Size | 14.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3374212c1d80ae9ebd9c1669f3b3bc2ad90e2f5f194915bccc13d18ddb643649
|
|
BLAKE2b-256 checksum How to use checksums |
adacb84050ac21464641da471f45aad0a8820c8ca09651bc884e97fca16e1950
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Release files / easywsl-0.1.2-py3-none-any.whl
| Download URL | easywsl-0.1.2-py3-none-any.whl |
|---|---|
| Size | 14.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
494b6397622cba5db8b174f1f9853c2814068dfdb5427ecfee54e495c9ba50b8
|
|
BLAKE2b-256 checksum How to use checksums |
d40f0a77a62afcf92921e4a2533433122634ce63a03d0469d1da989b1d0a5eb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Security for easywsl 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.