hubisan / emacs-wsl

Install and run Emacs with the Windows Subsystem for Linux (WSL 2) in Windows 10 or 11.
572 stars 42 forks source link

Update WSL installation section #55

Closed hubisan closed 11 months ago

hubisan commented 1 year ago

Installing WSL has gotten easier, need to update the sections.

See Install Ubuntu on WSL2 and get started with graphical applications.

This is important as not mentionned on that page above: https://learn.microsoft.com/en-us/windows/wsl/install

wsl --install only works if WSL is not installed at all:

The above command only works if WSL is not installed at all, if you run wsl --install and see the WSL help text, please try running wsl --list --online to see a list of available distros and run wsl --install -d to install a distro. To uninstall WSL, see Uninstall legacy version of WSL or unregister or uninstall a Linux distribution.

So need to do this before trying:

Also add enabling systemd:

https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/

You will need to edit the wsl.conf file to ensure systemd starts up on boot.

Add these lines to the /etc/wsl.conf (note you will need to run your editor with sudo privileges, e.g: sudo nano /etc/wsl.conf):

[boot] systemd=true

And close out of the nano editor using CTRL+O to save and CTRL+X to exit. Final steps

With the above steps done, close your WSL distro Windows and run wsl.exe --shutdown from PowerShell to restart your WSL instances. Upon launch you should have systemd running. You can check this with the command systemctl list-unit-files --type=service which should show your services’ status.

hubisan commented 11 months ago

Closing as PR #60 has been merged.