fatedier/frp · error

virtual net is not supported on this platform (%s/%s)

Error message

virtual net is not supported on this platform (%s/%s)

What it means

Build-tag stub returned by openTun on platforms where frp's vnet has no TUN implementation (tun_unsupported.go compiles everywhere except supported platforms like linux). If vnet is enabled on such a platform, TUN device creation immediately fails with this message naming GOOS/GOARCH. It is a hard capability gap, not a runtime fault.

Source

Thrown at pkg/vnet/tun_unsupported.go:28

// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build !darwin && !linux

package vnet

import (
	"context"
	"fmt"
	"runtime"

	"golang.zx2c4.com/wireguard/tun"
)

func openTun(_ context.Context, _ string) (tun.Device, error) {
	return nil, fmt.Errorf("virtual net is not supported on this platform (%s/%s)", runtime.GOOS, runtime.GOARCH)
}

View on GitHub (pinned to 6c8a8d0a97)

Solutions

  1. Disable vnet on that platform: set vnet.enabled = false (or remove the [vnet] section) in frpc.toml
  2. Run the vnet-enabled frpc on Linux, where the TUN implementation exists
  3. If cross-platform vnet is required, track upstream frp for platform support rather than patching the stub
  4. Guard configs per-OS: keep separate config files for local dev and the Linux deployment

Example fix

# before (frpc.toml on macOS/Windows)
[vnet]
enabled = true

# after (local dev on unsupported OS)
[vnet]
enabled = false
Defensive patterns

Strategy: validation

Validate before calling

// gate vnet on platform support before starting frpc
if runtime.GOOS != "linux" {
    cfg.Vnet.Enabled = false
}

Type guard

func vnetSupported() bool { return runtime.GOOS == "linux" }

Prevention

When it happens

Trigger: Setting vnet.enabled = true in frpc.toml (or a config loading vnet) on Windows, macOS, FreeBSD, or any non-supported GOOS/GOARCH, then starting frpc — openTun hits the stub and returns this error during vnet controller setup.

Common situations: Developing on a Mac/Windows workstation with a config borrowed from a Linux server; running frpc in a container built on an unusual base image; CI tests enabling vnet on non-Linux runners.

Related errors


AI-assisted analysis of fatedier/frp@6c8a8d0a97 (2026-08-15). Data as JSON: /api/errors/5d7ff1e07893f581. Report an issue: GitHub.