This is a slightly modified version of the reference WSL package found at Microsoft/WSL-DistroLauncher, customized for Gentoo.
This is intended for people who are already at least somewhat experienced with Gentoo.
Filesystem access is slow. This has a significant impact on the amount of time it takes to emerge anything.
32-bit programs will not run, so multilib profiles cannot be used.
GUIs are officially unsupported under WSL. VNC and X over TCP seem to work fine in practice, but your mileage may vary.
WSL provides its own init. It sets up a reasonable environment for a user session, but it won't automatically start any services.
At least for now, systemd doesn't work at all.
This project can be built using Visual Studio Community 2017. The "Universal Windows Platform development" feature is required, along with the following subfeatures:
- C++ Universal Windows Platform tools
- Windows 10 SDK (10.0.16299.0) for UWP: C#, VB, JS
The system must be in Developer mode (found in Settings -> Update & Security -> For developers)
The Windows Subsystem for Linux is not enabled by default, and is required to run the app. You can add the feature to your Windows installation by running C:\Windows\System32\OptionalFeatures.exe
and selecting it from the list.
Windows 10 version 1803 (the April 2018 update) or later is strongly recommended.
- Open Gentoo.sln in Visual Studio.
- Generate a test certificate:
- In the Solution Explorer, open
Gentoo-Appx\Gentoo.appxmanifest
- Select the Packaging tab
- Select "Choose Certificate"
- Click the Configure Certificate drop down and select Create test certificate.
- In the Solution Explorer, open
- Set up the stage3 tarball:
- Go to your favorite Gentoo mirror and get the latest stage3-amd64-nomultilib tarball (WSL doesn't support 32-bit binaries, so a multilib profile is likely to cause problems)
- Extract the .xz file and recompress it as a .gz file, using 7-zip or the software of your choice
- Rename the resulting file to install.tar.gz and place it in the x64 folder
- Build the package:
- Open a
Developer Command Prompt for VS 2017
and change directory to the project root. - Run
build.bat
- (Theoretically you should be able to build the project from within Visual Studio as well, but it hangs every time I try. You may have better luck with this than me.)
- Open a
- If everything's gone right, you should find your app package in a subfolder under the
AppPackages\Gentoo-Appx
folder.- First, install the certificate:
- Double-click on the security certificate file.
- Click the Install Certificate button.
- Select Local Machine for the store location.
- Select "Place all certificates in the following store", then click the Browse button.
- Select "Trusted Root Certification Authorities" from the list, then click OK.
- Proceed through the rest of the wizard.
- Once that's done, you should be able to double-click on the package file and install it.
- First, install the certificate:
The launcher provides the following functionality:
-
gentoo.exe
- Launches the user's default shell in the user's home directory.
-
gentoo.exe install [--root]
- Install the distribution and do not launch the shell when complete.
--root
: Do not create a user account and leave the default user set to root.
- Install the distribution and do not launch the shell when complete.
-
gentoo.exe run <command line>
- Run the provided command line in the current working directory. If no command line is provided, the default shell is launched.
- Everything after
run
is passed to WslLaunchInteractive.
-
gentoo.exe config [setting [value]]
- Configure settings for this distribution.
- Settings:
--default-user <username>
: Sets the default user to . This must be an existing user.
-
gentoo.exe help
- Print usage information.