Giter VIP home page Giter VIP logo

easywsl's Introduction

easyWSL


Create WSL distros based on Docker Images.

Made with ❤ by @redcode-labs team.

What does this project do?

easyWSL makes it way easier to use the wonders of WSL functionality on Windows 10 and 11 systems. Thanks to our efforts, easyWSL grants you an access to use most (almost all) system images from Docker Hub as WSL distros. Our C# sorcery allows us to use Docker Hub API in order to get .tar or .tar.gz images from there. After getting an image, single or multi-layered, we turn it into single image (multi-layered Docker image case) which we easily import as WSL distro.

getDistro.mp4

Features

In our latest release, we've added even more features than ever before. All of them wrapped around GUI app using a beauty of WinUI framework.

We've managed to add management features to WSL. With a single click, you can unregister, open .vhdx location as well as see the filesystem of the given distro.

manageDistro.mp4

While this sounds so good so far, we've also made a separate 'Settings' page, to manage your WSL in general. There you can easily adjust things like memory, the number of cores or the swap size assigned with WSL VM. You can also point to different swap file, custom Linux kernel and provide it with custom command line arguments. The given page has also a number of switches, with which you can manage things like localhost forwarding, page reporing, GUI applications (WSLg) support, debug console, nested virtualization. Don't worry if you get lost - you can always just 'Revert to defaults'.

We've added a functionality to register currently or previously used WSL distros using their .vhdx file. Going further down the rabbit hole, we've turned it into more advanced feature - easyWSL can now make snapshots, which can easily be used as a backups/restore points for your distros.

snapshots.mp4

We've added several experimental features as well. One of them, is creating a new user at the time of installing a distro. You now can set the username and password, and, if you want to, use experimental integration of WSL-Hello-sudo.

Furthermore, you can use an experimental feature to install development environments during the install process. This includes environments such as Python, Node.js, C/C++ and more. Not to mention, that it works cross-distro and more can be added along the way.

manageDistro.mp4

How to get it?

Just go to our Microsoft Store page, which you can find here. Get it, install, and voilà!

Building on your own

Prerequisites

  • Windows 10 1607 or later (for WSL1) or Windows 10 1903 (18362) or later
    • Note: you might want to check instructions on how to enable WSL here
  • Developer Mode enabled
  • Visual Studio 2022 (recommended by Microsoft)
  • The following workloads:
    • .NET Desktop Development
  • Individual components:
    • Windows 10 SDK (10.0.19041.0)
  • The following extensions:

More detailed info, including building on older releases of Visual Studio, can be found here

(Upon opening the repo in Visual Studio, it will prompt you to install any missing workloads and features.)

Building

We currently only build using the solution; command line methods of building a VS solution should work as well.

Future plans

CLI

We are looking forward to make a CLI compatible with all of our latest features, in order to make our tool usable in scripts.

If you're looking into using easyWSL as a CLI, the only current option is to use the older version (easyWSL 1.2), which you can get from the release page here.

easywsl's People

Contributors

aslafy-z avatar dependabot[bot] avatar dewjunkie avatar scadu avatar thatbakamono avatar unrooted avatar wr0belj avatar yurunsoft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

easywsl's Issues

Failed to translate C:\WINDOWS after creating Ubuntu 24.04 distribution

I tried to register an Ubuntu 24.04 LTS and I get errors when I try to start it.

Steps:

  • Add new distribution
  • Select distro source: Docker Hub
  • Docker image: ubuntu:24.04
  • Register distro
  • wsl -d Ubuntu-2404docker

And I get this:

Full log
D:\>wsl -d Ubuntu-2404docker                                                                                                          
<3>WSL (12) ERROR: CreateProcessParseCommon:711: Failed to translate D:\                                                              
<3>WSL (12) ERROR: CreateProcessParseCommon:757: getpwuid(0) failed 2                                                                 
<3>WSL (12) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files (x86)\Common Files\Oracle\Java\javapath           
<3>WSL (12) ERROR: UtilTranslatePathList:2866: Failed to translate C:\WINDOWS\system32                                                
<3>WSL (12) ERROR: UtilTranslatePathList:2866: Failed to translate C:\WINDOWS                                                         
<3>WSL (12) ERROR: UtilTranslatePathList:2866: Failed to translate C:\WINDOWS\System32\Wbem                                           
<3>WSL (12) ERROR: UtilTranslatePathList:2866: Failed to translate C:\WINDOWS\System32\WindowsPowerShell\v1.0\                        
<3>WSL (12) ERROR: UtilTranslatePathList:2866: Failed to translate C:\ProgramData\chocolatey\bin                                      
<3>WSL (12) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Users\yuryw\AppData\Local\Microsoft\WindowsApps                 
Processing fstab with mount -a failed.                                                                                                
Failed to mount C:\, see dmesg for more details.                                                                                      
Failed to mount D:\, see dmesg for more details.                                                                                      
Failed to mount C:\, see dmesg for more details.                                                                                      
Failed to mount D:\, see dmesg for more details.                                                                                      
                                                                                                                                      
<3>WSL (12) ERROR: CreateProcessEntryCommon:334: getpwuid(0) failed 2                                                                 
<3>WSL (12) ERROR: CreateProcessEntryCommon:505: execvpe /bin/sh failed 2                                                             
<3>WSL (12) ERROR: CreateProcessEntryCommon:508: Create process not expected to return                                                

Tried to register Ubuntu 21.10 both via "Supported distro list" and via ubuntu:21.10 - works fine.

P.S. Also tried to register ubuntu:20.04, ubuntu:22.04, ubuntu:23.10 - same error. So, I guess it's not specific to a version but easyWSL has to support a particular distro in some way?

[Feature] Automatically add entry to Windows Terminal window selector

For me, the settings file was on C:\Users\%USERNAME%\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3dbbwe\localState\settings.json. It would only be necesarry to add an entry under "list" like this:

,
{
    "commandline": "wsl -d %DISTRONAME%",
    "guid": "%AUTO-GENERATED-GUID%",
    "hidden": false,
    "icon": "%easyWSL-ICON-PATH%",
    "name": "%DISTRONAME-CAPITALISED%"
}

Where AUTO-GENERATED-GUID can be generated with:[1]

[guid]::NewGuid()

I'd make a PR but I don't know csharp 😅

EasyWSL hopes to be able to improve

EasyWSL希望能够得到的改进
EasyWSL hopes to be able to improve
希望能优化一下标题栏,默认主题为白色的情况下,标题栏显示成了黑色,UI界面没有统一。
Winui3标题栏的自定义您可以参考微软苏州员工(云之幻)写的一篇文章来定制。
I hope to optimize the title bar, the default theme is white, the title bar is displayed in black, and the UI interface is not unified.
The customization of the Winui3 title bar can be customized by referring to an article written by a Microsoft Suzhou employee (Yunzhihuan).
https://www.cnblogs.com/richasy/p/winui3_custom_title_bar.html
希望能够提供多语言版本支持,目前应用只有英语版本。
It is desirable to be able to provide support in multiple languages, and the current application is only available in English.

Does not open when no wsl distribution is installed

I installed the latest version of this app from the Microsoft Store and after trying to launch the app was closing. After manually installing ubuntu-wsl from the Microsoft Store, everything worked. How can I help in solving this problem?

Ability to move VHD

For many reasons, it is sometimes beneficial to keep VHD off of arcane folders like AppData. Can you implement a way to move VHD (automate stoping/exporting/imporintg via wsl.exe) or maybe add honouring an environment variable such as EASYWSL_VHD_HOME to store them somewhere outside AppData from the start?

docker run command

How do I start a WSL Docker Container with specifc run commands e.g. --publish?

easyWSL can't find WSL Distros

I have several distros of Ubuntu installed, but when I open easyWSL, no distros show up. From another WSL app like WSL Manager or GWSL, the distros show up like normal. And wsl -l shows that the distros exist. (see screenshot)

How do I get the distros to show up in easyWSL?

easy_wsl_no_distro

Error mounting one of the file systems. Run 'dmesg' for more details.

I manage to install manjaro on wsl2 with kernel 5.10 but I'm not being able to run it.
At this point, how can I proceed? Thank you very much.

C:\Users\user>wsl -l
Windows Subsystem Distributions for Linux:
Manjaro (Default)

C:\Users\user>wsl Manjaro
Error mounting one of the file systems. Run 'dmesg' for more details.

post-install script is failing

While playing with the easyWSL I noticed that the post-install script doesn't work correctly.

Examples:

  • Arch Linux:
A number of a distro you want to install: 1
A name for your distro (default ArchLinux):
A path to a directory where you want to store your distro (default is C:\Users\easywsl\AppData\Local\easyWSL\distros\ArchLinux):
Downloading 1. layer ...
Downloading 2. layer ...
Creating install.tar file ...
Registering the distro ...
Cleaning up ...
/mnt/c/Users/easywsl/Downloads/Release/post-install.sh: line 1: echo: command not found
/mnt/c/Users/easywsl/Downloads/Release/post-install.sh: line 34: syntax error near unexpected token `$'\r''
'mnt/c/Users/easywsl/Downloads/Release/post-install.sh: line 34: `add_user()
  • Alpine Linux, where Bash and shadow aren't available by default:
A number of a distro you want to install: 4
A name for your distro (default Alpine):
A path to a directory where you want to store your distro (default is C:\Users\easywsl\AppData\Local\easyWSL\distros\Alpine):
Downloading 1. layer ...
Creating install.tar file ...
Registering the distro ...
Cleaning up ...
/mnt/c/Users/easywsl/Downloads/Release/post-install.sh: line 1: echo: not found
/mnt/c/Users/easywsl/Downloads/Release/post-install.sh: line 64: syntax error: unexpected word (expecting "in")

`Settings` tab show nonreal (empty) values for settings not present in `.wslconfig`

Issue

When .wslconfig does not have every possible config options set (for example, in case when only memory=1024MB option is set), Settings tab show nonreal (empty) values for settings not present in .wslconfig.

How to reproduce

  • Put this text to file %USERPROFILE%\.wslconfig
[WSL]
memory=1024MB
  • Close easyWSL
  • Open easyWSL
  • Open Settings tab

Actual behaviour

Settings tab show nonreal (empty) values for settings not present in .wslconfig.

image image

Expected behaviour

Settings tab show real default values for settings not present in .wslconfig.

image image

System configuration

  • easyWSL 1.8.0
  • Windows 11 22H2 22621.1413
  • WSL version: 1.1.3.0

Windows 10 LTSC: KERNELBASE.dll causes crash on app startup

Hi all, I'm experimenting with Windows LTSC, and thus don't consider it to be a supported OS. That said, if anyone has any ideas what could cause this crash, I'd appreciate it!

OS:
Windows 10 IoT Enterprise LTSC 2021
Version 21H2 (OS Build 19044.3086)

  • I've installed Microsoft Store, winget, Windows Desktop Runtime on my machine

  • Installed easyWSL from MS Store

  • App successfully installs

  • Launching app brings up a blank window momentarily, before crashing / disappearing.

  • Event log shows:
    Faulting module name: KERNELBASE.dll

Any ideas? Thanks!

Event Log message:

Faulting application name: easyWSL.exe, version: 1.0.0.0, time stamp: 0x6216d2c0
Faulting module name: KERNELBASE.dll, version: 10.0.19041.3086, time stamp: 0xe1ac3f79
Exception code: 0xc000027b
Fault offset: 0x000000000012d8b2
Faulting process id: 0x1494
Faulting application start time: 0x01d9a2148f0a06fc
Faulting application path: C:\Program Files\WindowsApps\27302RedCodeLabs.easyWSL_0.1.8.0_x64__m9ag49q0nrza2\easyWSL.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: 8787c2ce-f9f7-46e4-92bb-e3c6cc254ded
Faulting package full name: 27302RedCodeLabs.easyWSL_0.1.8.0_x64__m9ag49q0nrza2
Faulting package-relative application ID: App

Cannot install Elementary OS 6

Hi devs, first of all, AWESOME work so far!!!

OK, let's cut to the chase. I want to install Elementary OS 6, which is from the docker image: elementary/docker:odin-unstable.

The code linked below only supports :tag for library/ images and :latest for namespaced images.

if (distroImage.Contains('/'))
{
string[] imageArray = distroImage.Split('/');
tag = "latest";
repository = distroImage;
}
else
{
string[] imageArray = distroImage.Split(':');
string imgage = imageArray[0];
tag = imageArray[1];
repository = $"library/{imgage}";
}

Exception on Docker installation

Hi redcode team,

I tried to install a docker container and ran in to an exception. It looks like a hardcoded path to your projects folder.

Unbehandelte Ausnahme: System.IndexOutOfRangeException: Der Index war außerhalb des Arraybereichs. bei easyWSL.DistroInstaller.InstallDistro(String distroImage, String distroName, String distroPath, String easyWSLDataDirectory, String easyWSLDirectory, Boolean isCustomImageSpecified) in C:\Users\unrooted\Documents\projects\easyWSL\easyWSL\DistroInstaller.cs:Zeile 91. bei easyWSL.Program.Main(String[] args) in C:\Users\unrooted\Documents\projects\easyWSL\easyWSL\Program.cs:Zeile 147.PS

[FEATURE] Cache downloads / Resume Downloads per layer

Sometimes, when using easyWSL the connection might get interrupted, and the whole process will come to a halt, and will have to be restarted from the beggining. It'd be really good if we could cache layer downloads so only the failed layers have to be downloaded again.

Right now, it is practically impossible to download heavy docker images on an unstable connection using easyWSL

Problems with registering a new distribution

I was trying to install Arch Linux but I couldn't cause this error. I tried with another distributions but it always shows the same error. I'm new to easyWSL, so I don't know what maybe causes it. Thanks for your help.
image

Unintuitive message when distro name not provided

Summary

When registering a distribution, without Distro name provided, a vague error message is show that doesn't really tell anything.

Expected Result

An error with a message somewhere along the lines of "Distro name empty. Please provide one."

Actual Result

An error message "There were problems with registering your distribution"

What URL for 'release page'?

The readme says:

Just go to our release page, download latest release and just run it. Done!

What is the URL as it seems to lead to endless loops otherwise.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.