icflorescu / expose-wsl Goto Github PK
View Code? Open in Web Editor NEWThe simplest way to expose apps running on WSL to local network devices.
License: ISC License
The simplest way to expose apps running on WSL to local network devices.
License: ISC License
root> npx expose-wsl@latest
Need to install the following packages:
expose-wsl@1.1.3
Ok to proceed? (y) y
_
_____ ___ __ ___ ___ ___ __ _____| |
/ _ \ \/ / '_ \ / _ \/ __|/ _ \____\ \ /\ / / __| |
| __/> <| |_) | (_) \__ \ __/_____\ V V /\__ \ |
\___/_/\_\ .__/ \___/|___/\___| \_/\_/ |___/_|
|_|
⏳ Downloading WSLHostPatcher... extracting... running... done ✔️
🎉 WSL should be accessible at: 'Select-Object' is not recognized as an internal or external command,
operable program or batch file.
failed to run ❌
🔥 Please report this issue at https://github.com/icflorescu/expose-wsl/issues
Error: Command failed: powershell.exe 'Get-NetIPAddress -AddressFamily IPv4 -InterfaceIndex $(Get-NetConnectionProfile | Select-Object -ExpandProperty InterfaceIndex) | Select-Object -ExpandProperty IPAddress'
at checkExecSyncError (node:child_process:887:11)
at execSync (node:child_process:959:15)
at file:///C:/Users/ahmetcetinkaya/AppData/Local/npm-cache/_npx/0e95d415fb20f5d8/node_modules/expose-wsl/run.js:43:3 {
status: 255,
signal: null,
output: [ null, null, null ],
pid: 11448,
stdout: null,
stderr: null
}
But the command works when in terminal.
root> powershell.exe 'Get-NetIPAddress -AddressFamily IPv4 -InterfaceIndex $(Get-NetConnectionProfile | Select-Object -ExpandProperty InterfaceIndex) | Select-Object -ExpandProperty IPAddress'
192.168.0.3
Need to install the following packages:
[email protected]
Ok to proceed? (y) y
_
_____ ___ __ ___ ___ ___ __ | |
/ _ \ / / ' \ / _ / |/ _ _\ \ /\ / / | |
| /> <| |) | () __ \ /\ V V /__ \ |
_/_/_\ ./ _/|/_| _/_/ |/|
||
⏳ Downloading WSLHostPatcher... extracting... running... /home/support/.npm/_npx/0e95d415fb20f5d8/node_modules/expose-wsl/WSLHostPatcher.exe: Invalid argument
failed to run ❌
🔥 Please report this issue at https://github.com/icflorescu/expose-wsl/issues
/home/support/.npm/_npx/0e95d415fb20f5d8/node_modules/expose-wsl/WSLHostPatcher.exe: Invalid argument
npx expose-wsl@latest
Need to install the following packages:
[email protected]
Ok to proceed? (y) y
_
_____ ___ __ ___ ___ ___ __ _____| |
/ _ \ \/ / '_ \ / _ \/ __|/ _ \____\ \ /\ / / __| |
| __/> <| |_) | (_) \__ \ __/_____\ V V /\__ \ |
\___/_/\_\ .__/ \___/|___/\___| \_/\_/ |___/_|
|_|
⏳ Downloading WSLHostPatcher... extracting... running... failed to run ❌
🔥 Please report this issue at https://github.com/icflorescu/expose-wsl/issues
After getting #3 and installing unzip
, the command still fails:
stafford@deskt0p:~$ npx expose-wsl@latest
Need to install the following packages:
[email protected]
Ok to proceed? (y) y
_
_____ ___ __ ___ ___ ___ __ _____| |
/ _ \ \/ / '_ \ / _ \/ __|/ _ \____\ \ /\ / / __| |
| __/> <| |_) | (_) \__ \ __/_____\ V V /\__ \ |
\___/_/\_\ .__/ \___/|___/\___| \_/\_/ |___/_|
|_|
⏳ Patching WSL... node:internal/errors:867
const err = new Error(message);
^
Error: Command failed: /home/stafford/.npm/_npx/0e95d415fb20f5d8/node_modules/expose-wsl/WSLHostPatcher.exe
at checkExecSyncError (node:child_process:885:11)
at execSync (node:child_process:957:15)
at file:///home/stafford/.npm/_npx/0e95d415fb20f5d8/node_modules/expose-wsl/run.js:28:1
at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
status: 255,
signal: null,
output: [
null,
Buffer(135) [Uint8Array] [
68, 108, 108, 32, 112, 97, 116, 104, 58, 32, 92, 92,
119, 115, 108, 46, 108, 111, 99, 97, 108, 104, 111, 115,
116, 92, 85, 98, 117, 110, 116, 117, 92, 104, 111, 109,
101, 92, 115, 116, 97, 102, 102, 111, 114, 100, 92, 46,
110, 112, 109, 92, 95, 110, 112, 120, 92, 48, 101, 57,
53, 100, 52, 49, 53, 102, 98, 50, 48, 102, 53, 100,
56, 92, 110, 111, 100, 101, 95, 109, 111, 100, 117, 108,
101, 115, 92, 101, 120, 112, 111, 115, 101, 45, 119, 115,
108, 92, 87, 83,
... 35 more items
],
Buffer(0) [Uint8Array] []
],
pid: 8869,
stdout: Buffer(135) [Uint8Array] [
68, 108, 108, 32, 112, 97, 116, 104, 58, 32, 92, 92,
119, 115, 108, 46, 108, 111, 99, 97, 108, 104, 111, 115,
116, 92, 85, 98, 117, 110, 116, 117, 92, 104, 111, 109,
101, 92, 115, 116, 97, 102, 102, 111, 114, 100, 92, 46,
110, 112, 109, 92, 95, 110, 112, 120, 92, 48, 101, 57,
53, 100, 52, 49, 53, 102, 98, 50, 48, 102, 53, 100,
56, 92, 110, 111, 100, 101, 95, 109, 111, 100, 117, 108,
101, 115, 92, 101, 120, 112, 111, 115, 101, 45, 119, 115,
108, 92, 87, 83,
... 35 more items
],
stderr: Buffer(0) [Uint8Array] []
}
Node.js v18.16.1
Ubuntu 22.04.2 LTS
⏳ Downloading WSLHostPatcher... extracting... running... ~/.npm/_npx/0e95d415fb20f5d8/node_modules/expose-wsl/WSLHostPatcher.exe: Invalid argument
failed to run ❌
🔥 Please report this issue at https://github.com/icflorescu/expose-wsl/issues
~/.npm/_npx/0e95d415fb20f5d8/node_modules/expose-wsl/WSLHostPatcher.exe: Invalid argument
When I debugged little, It was actually blocked by windows defender.
root> npx expose-wsl@latest
_
_____ ___ __ ___ ___ ___ __ _____| |
/ _ \ \/ / '_ \ / _ \/ __|/ _ \____\ \ /\ / / __| |
| __/> <| |_) | (_) \__ \ __/_____\ V V /\__ \ |
\___/_/\_\ .__/ \___/|___/\___| \_/\_/ |___/_|
|_|
node:fs:1899
handleErrorFromBinding(ctx);
^
Error: EPERM: operation not permitted, unlink 'C:\Users\ahmetcetinkaya\AppData\Local\npm-cache\_npx\0e95d415fb20f5d8\node_modules\expose-wsl/WSLHostPatch.dll'
at unlinkSync (node:fs:1899:3)
at file:///C:/Users/ahmetcetinkaya/AppData/Local/npm-cache/_npx/0e95d415fb20f5d8/node_modules/expose-wsl/run.js:17:44
at ModuleJob.run (node:internal/modules/esm/module_job:192:25)
at async DefaultModuleLoader.import (node:internal/modules/esm/loader:228:24)
at async loadESM (node:internal/process/esm_loader:40:7)
at async handleMainPromise (node:internal/modules/run_main:66:12) {
errno: -4048,
syscall: 'unlink',
code: 'EPERM',
path: 'C:\\Users\\ahmetcetinkaya\\AppData\\Local\\npm-cache\\_npx\\0e95d415fb20f5d8\\node_modules\\expose-wsl/WSLHostPatch.dll'
}
Node.js v20.5.0
Hi @icflorescu,
I love the idea of this project. Currently trying to use it with expo.
Here is what the command line is spitting out:
Windows 11
WSL2 with Ubuntu 22.04.1 LTS
Any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.