注意:

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "Windows Subsystem for Linux"

From Funtoo
Jump to navigation Jump to search
m (→‎install: set wsl.conf to run openrc @ start)
Line 48: Line 48:
}}
}}


wsl behaves similar to a chroot instance regarding init.
wsl behaves similar to a chroot instance regarding init:


*make wsl run openrc soft level once immediately:
{{console|body=
{{console|body=
###i## mkdir /run/openrc
###i## mkdir /run/openrc
###i## touch /run/openrc/softlevel
###i## touch /run/openrc/softlevel
###i## rc
###i## rc
}}
*make wsl run openrc in every instance:
{{file|name=/etc/wsl.conf|desc=wsl.conf file|body=
[boot]
systemd=false
command = "/sbin/openrc default"
}}
}}



Revision as of 17:35, 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:

root # 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/

decompress tarball

  • use 7zip to convert the .tar.xz to .tar:

https://www.7-zip.org/download.html

install

  • search for power shell, right click it's icon and select run as administrator:
root # wsl.exe --import "funtoo" "C:\funtoo" "C:\Users\$MYUSER\Downloads\gnome-stage3-amd64-piledriver-1.4-release-std-2020-12-16.tar" --version 2
root # wsl -d funtoo

you are now running funtoo under windows.

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

wsl behaves similar to a chroot instance regarding init:

  • make wsl run openrc soft level once immediately:
root # mkdir /run/openrc
root # touch /run/openrc/softlevel
root # rc
  • make wsl run openrc in every instance:
   /etc/wsl.conf - wsl.conf file
[boot]
systemd=false
command = "/sbin/openrc default"
  • 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