Difference between revisions of "Windows Subsystem for Linux"

From Funtoo
Jump to navigation Jump to search
Line 18: Line 18:


{{console|body=
{{console|body=
%PowerShell> % ##i##wsl --install
%PowerShell>% ##i##wsl --install
}}
}}


Line 28: Line 28:


{{console|body=
{{console|body=
%PowerShell> % ##i##wget -Uri https://build.funtoo.org/next/x86-64bit/amd64-zen3/2023-09-25/stage3-amd64-zen3-next-2023-09-25.tar.xz -OutFile stage3.tar.xz
%PowerShell>% ##i##wget -Uri https://build.funtoo.org/next/x86-64bit/amd64-zen3/2023-09-25/stage3-amd64-zen3-next-2023-09-25.tar.xz -OutFile stage3.tar.xz
}}
}}


Line 34: Line 34:


{{console|body=
{{console|body=
%PowerShell> %  ##i##.\Downloads\7zr.exe x stage3.tar.xz
%PowerShell>%  ##i##.\Downloads\7zr.exe x stage3.tar.xz
}}
}}


Line 40: Line 40:


{{console|body=
{{console|body=
%PowerShell> % ###i## wsl.exe --import "funtoo" funtoo stage3.tar --version 2
%PowerShell>% ###i## wsl.exe --import "funtoo" funtoo stage3.tar --version 2
}}
}}


{{console|body=
{{console|body=
%PowerShell> % ###i## wsl -d funtoo
%PowerShell>% ###i## wsl -d funtoo
%funtoo w11-bdfl%
%funtoo w11-bdfl%
}}
}}

Revision as of 18:05, November 7, 2023

Windows Subsystem for Linux

Introduction

Windows Subsystem for Linux provides support for running Funtoo Linux under Windows 10 and Windows 11. The latest version is WSL 2, which provides full system call compatibility, and improvement over the original WSL.

Requirements

To install WSL 2 on Windows, you need the following things:

  • Windows 11 (any version, including Home), or:
  • Windows 10 (any version, including Home) builds 18917 or higher

Technically you can install WSL 2 on an “insider” build of Windows 10 build 18917 or later.

Installation

To initially set up WSL 2, run a PowerShell prompt as an administrator and type:

PowerShell> # wsl --install

After this command completes, and you reboot your system, it is then recommended to install Windows Terminal, which is available from this link -- this is actually a Microsoft Learn site describing Windows Terminal, but it does provide a link to the Microsoft Store page for Windows Terminal:

https://learn.microsoft.com/en-us/windows/terminal/

Start Windows Terminal. You can now use wget under PowerShell to download the stage3 of your choice:

PowerShell> # wget -Uri https://build.funtoo.org/next/x86-64bit/amd64-zen3/2023-09-25/stage3-amd64-zen3-next-2023-09-25.tar.xz -OutFile stage3.tar.xz

Once the download completes, you will need to decompress it. This can be done by directly downloading the .exe for Windows, available from https://7-zip.org/a/7zr.exe, and running the following command:

PowerShell> #  .\Downloads\7zr.exe x stage3.tar.xz

Now run the following command in PowerShell -- you do not need to be administrator to run this as long as you have previously installed WSL 2:

PowerShell> # # wsl.exe --import "funtoo" funtoo stage3.tar --version 2
PowerShell> # # wsl -d funtoo
funtoo w11-bdfl #

you are now running Funtoo under @indows.

root # ego sync
root # emerge -C debian-sources
root # emerge -avuND @world

wsl behaves similar to a chroot instance regarding init.

root # mkdir /run/openrc
root # touch /run/openrc/softlevel
root # rc
  • gwsl in the microsoft store can run graphical applications that are installed.

Xming uses ssh x11 forwarding to render x11 under windows:

bash_profile

instead of putting goodies to be executed at start in .bashrc, you should place them in .bash_profile

Bind USB to WSL

to attach usb devices to wsl you need to add usbipd.

root # emerge usbip

uninstall

  • in powershell:
root # wsl.exe --unregister funtoo