OR simply use an arg --true-userspace-wg with newt command
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/fosrl/newt/pull/212
**Author:** [@dpurnam](https://github.com/dpurnam)
**Created:** 12/18/2025
**Status:** ❌ Closed
**Base:** `main` ← **Head:** `main`
---
### 📝 Commits (2)
- [`d8fbdfd`](https://github.com/fosrl/newt/commit/d8fbdfd741dcd6c3fc18f7b7be51ec8d8997090e) Wireguard: support userspace mode (Rootless Android/Termux)
- [`575c99a`](https://github.com/fosrl/newt/commit/575c99ac856adc3c0a31f6c35a044594e2d85c9c) Wireguard: support userspace mode (Rootless Android/Termux)
### 📊 Changes
**1 file changed** (+35 additions, -12 deletions)
<details>
<summary>View changed files</summary>
📝 `main.go` (+35 -12)
</details>
### 📄 Description
## Description
This PR fixes Newt running in userspace WireGuard environments
(e.g. Termux on a non-root Android).
**Problem:**
- dev.Up() fails with "permission denied"
- ICMP-based health checks always fail
- Tunnel never becomes usable despite UDP connectivity working
**Solution:**
- Introduce TRUE_USERSPACE_WG=1
- Skip dev.Up() when running in userspace mode (for ex. rootless androids or termux)
- Do not treat initial ICMP ping failure as fatal in userspace mode
**Verified working:**
- Android (Termux, non-root)
- Pangolin endpoint reachable
- Sites and Resources successfully created and accessible
**Reference:**
https://github.com/fosrl/newt/issues/161#issuecomment-3587573498
**Additional Comments:**
sing-box WireGuard works in the same environment when system=false, which matches this change.
## How to test?
```
export TRUE_USERSPACE_WG=1;
newt --id .... --secret ....
```
OR simply use an arg `--true-userspace-wg` with `newt` command
## Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/fosrl/newt/pull/212
Author: @dpurnam
Created: 12/18/2025
Status: ❌ Closed
Base:
main← Head:main📝 Commits (2)
d8fbdfdWireguard: support userspace mode (Rootless Android/Termux)575c99aWireguard: support userspace mode (Rootless Android/Termux)📊 Changes
1 file changed (+35 additions, -12 deletions)
View changed files
📝
main.go(+35 -12)📄 Description
Description
This PR fixes Newt running in userspace WireGuard environments
(e.g. Termux on a non-root Android).
Problem:
Solution:
Verified working:
Reference:
https://github.com/fosrl/newt/issues/161#issuecomment-3587573498
Additional Comments:
sing-box WireGuard works in the same environment when system=false, which matches this change.
How to test?
OR simply use an arg
--true-userspace-wgwithnewtcommandCommunity Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.