Local via WSL2 GUI Is Much Faster Than Windows 10 Native

Do you have nodejs installed? To confirm you’re on Windows 11?

Ok, so I finally got it up and running. All I did was to run an update of wsl and I got a new kernel update. After that I simply ran /opt/Local/local again and it worked.

Awesome! If you figure out site domains let me know.

This thread has been invaluable so far, thank you!

I’m coming up against a brick wall with this error after successfully installing the Debian package:

/opt/Local/local: error while loading shared libraries: libatk-1.0.so.0: cannot open shared object file: No such file or directory

I’ve installed the suggested dependencies earlier in the thread, but still no joy.

Has anyone managed to crack this?

 sudo apt-get update
 sudo apt-get install libatk1.0-0

Doesn’t do it for you?

1 Like

Managed to get through the dependency part (thanks for the tip), needed to install a few things, now I’m getting this when I try to fire up local

/opt/Local/local
9/26/2022, 7:38:25 PM [info] [main] AddonLoaderService: Loading Add-on: %%resourcesPath%%/lightning-services/mailhog-1.0.0+3/lib/main.js
9/26/2022, 7:38:25 PM [info] [main] AddonLoaderService: Successfully Loaded Add-on: %%resourcesPath%%/lightning-services/mailhog-1.0.0+3/lib/main.js
9/26/2022, 7:38:25 PM [info] [main] AddonLoaderService: Loading Add-on: %%resourcesPath%%/lightning-services/mariadb-10.4.10+4/lib/main.js
9/26/2022, 7:38:25 PM [info] [main] AddonLoaderService: Successfully Loaded Add-on: %%resourcesPath%%/lightning-services/mariadb-10.4.10+4/lib/main.js
9/26/2022, 7:38:25 PM [info] [main] AddonLoaderService: Loading Add-on: %%resourcesPath%%/lightning-services/mysql-8.0.16+6/lib/main.js
9/26/2022, 7:38:25 PM [info] [main] AddonLoaderService: Successfully Loaded Add-on: %%resourcesPath%%/lightning-services/mysql-8.0.16+6/lib/main.js
9/26/2022, 7:38:25 PM [info] [main] AddonLoaderService: Loading Add-on: %%resourcesPath%%/lightning-services/nginx-1.16.0+6/lib/main.js
9/26/2022, 7:38:25 PM [info] [main] AddonLoaderService: Successfully Loaded Add-on: %%resourcesPath%%/lightning-services/nginx-1.16.0+6/lib/main.js
9/26/2022, 7:38:25 PM [info] [main] AddonLoaderService: Loading Add-on: %%resourcesPath%%/lightning-services/php-7.4.1+18/lib/main.js
9/26/2022, 7:38:25 PM [info] [main] AddonLoaderService: Successfully Loaded Add-on: %%resourcesPath%%/lightning-services/php-7.4.1+18/lib/main.js
9/26/2022, 7:38:25 PM [info] [main] AddonLoaderService: Add-on does not have “productName” specified in package.json: %%appPath%%/node_modules/@getflywheel/local-components/package.json
9/26/2022, 7:38:25 PM [info] [main] AddonLoaderService: Add-on does not have “productName” specified in package.json: %%appPath%%/node_modules/@getflywheel/localcert/package.json
9/26/2022, 7:38:25 PM [info] [main] AddonLoaderService: Add-on does not have “productName” specified in package.json: %%appPath%%/node_modules/@getflywheel/localtunnel/package.json
9/26/2022, 7:38:25 PM [info] [main] AddonLoaderService: Add-on does not have “main” or “renderer” specified in package.json: %%appPath%%/node_modules/@getflywheel/replacestream/package.json
The futex facility returned an unexpected error code.
Aborted

@oeknudsen how did you overcome this? i see you posted a similar report earlier in the thread?

In an effort to reproduce my earlier instructions which, obviously, ceased to work on later versions of WSL2, I’ve tracked down the problem to policykit (specifically pkexec) being unable to pop up the GUI sudo box on WSL2, as is required by LocalWP. The earlier instructions used systemd-genie to fix this dbus/policykit/WSL2 issue. That no longer working, I was able to resolve the issue by creating a stub to an alternative GUI sudo utility which Local will use in its place.

Here are the full instructions to get LocalWP running under the latest version of WSL2 Debian on Windows 11 (I haven’t tried Ubuntu):

Install dependencies:

sudo apt-get update && sudo apt-get upgrade
sudo apt-get -y install libaio1 libncurses5 libnss3-tools rsync shared-mime-info desktop-file-utils libxshmfence1 libglu1 libatk1.0-0 libatk-bridge2.0-0 libgtk2.0-0 libgtk-3-0 libgbm-dev libasound2 libnuma-dev libxslt1.1 lxqt-sudo libzip4
sudo apt --fix-broken install
curl -O http://snapshot.debian.org/archive/debian/20190501T215844Z/pool/main/g/glibc/multiarch-support_2.28-10_amd64.deb
sudo dpkg -i multiarch-support_2.28-10_amd64.deb
curl -O http://snapshot.debian.org/archive/debian/20141009T042436Z/pool/main/libj/libjpeg8/libjpeg8_8d1-2_amd64.deb
sudo dpkg -i libjpeg8_8d1-2_amd64.deb
sudo cp /usr/lib/x86_64-linux-gnu/libonig.so.5 /usr/lib/x86_64-linux-gnu/libonig.so.4

Install LocalWP:

sudo dpkg -i local-6.4.3-linux.deb

LocalWP fixes:

sudo setcap 'cap_net_bind_service=+ep' /opt/Local/resources/extraResources/lightning-services/nginx-1.16.0+6/bin/linux/sbin/nginx

sudo nano /usr/bin/kdesudo and set to:

#!/bin/bash
/usr/bin/lxqt-sudo $7
sudo chmod +x /usr/bin/kdesudo

Miscellanous fixes:

If you want the site domain accessible from Windows, sudo nano /mnt/c/Windows/system32/drivers/etc/hosts and add 127.0.0.1 SITENAME.local

If you want the site to open from LocalWP into Windows Chrome:

sudo update-alternatives --install "/bin/host_chrome" "chrome" "/mnt/c/Program Files/Google/Chrome/Application/chrome.exe" 1

and add export BROWSER=host_chrome to ~/.bashrc

Now you can pull your site, sit back, and make a cup of coffee.

2 Likes

Addendum for the Flywheel devs: the only reason Local doesn’t work out of the box on WSL2 (aside from the dependencies) is your use of the sudo-prompt package.

sudo-prompt requires either pkexec or kdesudo, neither of which work on WSL2. Swapping in lxqt-sudo and manually running the nginx setcap command were enough to get it working.

1 Like

This is SO awesome. The performance with WSL is way better, and now I can run my node scripts inside WSL, which is way faster.

This is a much better experience for Local on Windows, and I would love to see official support by Flywheel with this.

2 Likes

Thanks for this update, robert! Just ran Local successfully on Win10/WSL2/Debian. Just one flaw: i couldnt run the line about libonig.so but so far no error.

I can get this to run but I then have windows with white and green static. When I click on them I see the actual GUI for Local but when I release the mouse the static reappears. Has anyone else come across this?

@fencer04 Welcome to the Local Community Forums! What you’re describing sounds… interesting. Do you have a screenshot or recording of that behavior?

What’s your computer setup like – laptop, desktop? Do you have an external monitor?

1 Like