项目作者: Biswa96

项目描述 :
Install any GNU/Linux userspace in WSL
高级语言: C
项目地址: git://github.com/Biswa96/WSLInstall.git
创建时间: 2017-12-21T08:41:37Z
项目社区:https://github.com/Biswa96/WSLInstall

开源协议:GNU General Public License v3.0

下载


WSLInstall

Install any GNU/Linux distribution userspace in Windows Subsystem for Linux (WSL)
with compressed RootFS tarballs :package: (tar.gz) or
with Docker containers :whale: or with ISO files :cd:

Build

Clone this GitHub repository with this link https://github.com/Biswa96/WSLInstall.git .
Use MSBuild (or mingw-w64) to make executable file from project file(.vcxproj).
Or use the makefile in WslFunctions folder. The project file only provides x64-Release version.

Build wslapi export libraries:

  • Generate DEF file: gendef /c/Windows/System32/wslapi.dll
  • For MSVC: lib /DEF:wslapi.def /MACHINE:X64
  • For GCC: dlltool -D /c/Windows/System32/wslapi.dll -d wslapi.def -l libwslapi.a

wslapi export library was added in latest mingw-64 toolchain. See this commits
for further details:

How to use

WslInstall: Installs GNU/Linux distributions

  1. First make a folder where you want to install that distribution,
    that may be any partition of internal drives only. External drives are not supported now.
  2. Place both WslInstall.exe and {distribution}.tar.gz files in that same folder.
  3. Open command prompt in that folder and type the command like this:
    WslInstall.exe <distro_name> <distribution.tar.gz>. Always put a space
    between the two command arguments like between and .
  4. After some seconds, that distribution will be installed. Confirm it with
    wslconfig.exe /list /all command. Also you may see a rootfs folder in that
    directory where you want to install.

How does it work

  • WslInstall: In the source code, the main function imports the
    WslRegisterDistribution function from wslapi.dll file. Then it passes
    the provided two commandline arguments in distroName and in tarGzFilename
    string parameters of that function respectively and the imported function
    installs that distribution. See details of WSL Functions and WSL_DISTRIBUTION_FLAGS.

Table Of Contents:

Other repositories

  1. LxRunoffline
  2. WSL-DistroLauncher
  3. runnix
  4. miniwsl
  5. wslbridge

License

This project is licensed under GNU General Public License v3 or higher. See LICENSE for more details. You are free to study, change, modify the source code and make your own version and publish that.