Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builds for other targets #3

Open
8 of 16 tasks
dswd opened this issue Apr 11, 2016 · 27 comments
Open
8 of 16 tasks

Builds for other targets #3

dswd opened this issue Apr 11, 2016 · 27 comments

Comments

@dswd
Copy link
Owner

dswd commented Apr 11, 2016

This is a tracking issue on building VpnCloud for other operating systems and other architectures.

  • Linux x86_64
    • Compiles and links
    • Packaged for Debian/Ubuntu
  • Linux x86 (i686-unknown-linux-gnu)
    • Compiles and links
    • Packaged for Debian/Ubuntu
  • Linux ARMv7 (armv7-unknown-linux-gnueabihf)
    • Compiles and links
    • Packaged for Debian/Ubuntu
  • Linux ARM (arm-unknown-linux-gnueabihf)
    • Compiles and links
    • Packaged for Debian/Ubuntu
  • MacOS (developer wanted)
    • Problem: dependency "ring" does not compile
    • Problem: tun/tap is different on MacOS
    • Compiles and links
    • Packaged
  • FreeBSD (developer wanted)
    • Problem: polling and signal handling
    • Compiles and links
    • Packaged
  • Windows (developer wanted)
    • Problem: tun/tap is different on Windows
    • OpenVPN has a subproject tap-windows that provides TAP interfaces for windows (Tutorial).
    • Compiles and links
    • Packaged
  • iOS (iPad, iPhone) (developer wanted)
    • Compiles and links
    • Packaged

Implementation hints:

@fourbytes
Copy link
Contributor

I might have a look at getting it running on OS X, another one to add would be freebsd (pfSense package too).

@dswd
Copy link
Owner Author

dswd commented Jun 20, 2016

That would be great. I also added FreeBSD.

@fourbytes
Copy link
Contributor

May be worth looking at OpenVPN's implementation for OS X and FreeBSD.

@dswd
Copy link
Owner Author

dswd commented Jun 30, 2016

I added some more documentation and changed the polling mechanism to be more flexible (could now implement kqueue) to make porting easier for you.

@fourbytes
Copy link
Contributor

fourbytes commented Aug 8, 2016

I've started working on kqueue (bsd/osx) support, just waiting on nix-rust/nix#396 at the moment.

@fourbytes
Copy link
Contributor

Signal also seems to only be supported on linux so will have to sort that out.

@m6ram
Copy link

m6ram commented Feb 22, 2018

I adore this software. I'm a complete noob. I really want to run it on my RPi and my phone. I've been unable to cross-compile it (and I even tried compiling on the RPi). Here is a sample output:

$ cargo build --target=armv7-unknown-linux-gnueabihf
Compiling vpncloud v0.8.1 (file:///home/h0p3/vpncloud.rs)
error: failed to run custom build command for vpncloud v0.8.1 (file:///home/h0p3/vpncloud.rs)
process didn't exit successfully: /home/h0p3/vpncloud.rs/target/debug/build/vpncloud-641c68931705eb78/build-script-build (exit code: 101)
--- stdout
TARGET = Some("armv7-unknown-linux-gnueabihf")
OPT_LEVEL = Some("0")
TARGET = Some("armv7-unknown-linux-gnueabihf")
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("armv7-unknown-linux-gnueabihf")
TARGET = Some("armv7-unknown-linux-gnueabihf")
HOST = Some("x86_64-unknown-linux-gnu")
CC_armv7-unknown-linux-gnueabihf = None
CC_armv7_unknown_linux_gnueabihf = None
TARGET_CC = None
CC = None
HOST = Some("x86_64-unknown-linux-gnu")
CROSS_COMPILE = None
TARGET = Some("armv7-unknown-linux-gnueabihf")
HOST = Some("x86_64-unknown-linux-gnu")
CFLAGS_armv7-unknown-linux-gnueabihf = None
CFLAGS_armv7_unknown_linux_gnueabihf = None
TARGET_CFLAGS = None
CFLAGS = None
PROFILE = Some("debug")
running: "arm-linux-gnueabihf-gcc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-march=armv7-a" "-I" "src" "-o" "/home/h0p3/vpncloud.rs/target/armv7-unknown-linux-gnueabihf/debug/build/vpncloud-6ec0f618f669dc21/out/src/c/tuntap.o" "-c" "src/c/tuntap.c"
exit code: 0
TARGET = Some("armv7-unknown-linux-gnueabihf")
TARGET = Some("armv7-unknown-linux-gnueabihf")
HOST = Some("x86_64-unknown-linux-gnu")
AR_armv7-unknown-linux-gnueabihf = None
AR_armv7_unknown_linux_gnueabihf = None
TARGET_AR = None
AR = None
TARGET = Some("armv7-unknown-linux-gnueabihf")
TARGET = Some("armv7-unknown-linux-gnueabihf")
running: "ar" "crs" "/home/h0p3/vpncloud.rs/target/armv7-unknown-linux-gnueabihf/debug/build/vpncloud-6ec0f618f669dc21/out/libtuntap.a" "/home/h0p3/vpncloud.rs/target/armv7-unknown-linux-gnueabihf/debug/build/vpncloud-6ec0f618f669dc21/out/src/c/tuntap.o"
exit code: 0
TARGET = Some("armv7-unknown-linux-gnueabihf")
cargo:rustc-link-lib=static=tuntap
cargo:rustc-link-search=native=/home/h0p3/vpncloud.rs/target/armv7-unknown-linux-gnueabihf/debug/build/vpncloud-6ec0f618f669dc21/out

--- stderr
make: *** No rule to make target 'clean'. Stop.
sh: 0: Can't open autogen.sh
sh: 0: Can't open configure
make: *** No targets specified and no makefile found. Stop.
thread 'main' panicked at 'called Result::unwrap() on an Err value: Error { repr: Custom(Custom { kind: InvalidInput, error: StringError("the source path is not an existing regular file") }) }', /checkout/src/libcore/result.rs:916:5
note: Run with RUST_BACKTRACE=1 for a backtrace.

Can anyone point me in the right direction?

@dswd dswd mentioned this issue Dec 4, 2019
@luckypoem
Copy link

@fourbytes
so ,have u successfully compiled vpncloud on mac?

@luckypoem
Copy link

@fourbytes

on mac:
git clone /~https://github.com/dswd/vpncloud vpncloud-by-dswd
cd vpncloud-by-dswd
cargo build --release
it shows:
...
Compiling rand v0.7.2
error: failed to run custom build command for vpncloud v1.0.0 (/Users/brite/vpncloud-by-dswd)

Caused by:
process didn't exit successfully: /Users/brite/vpncloud-by-dswd/target/release/build/vpncloud-d91f8ff6549d48b0/build-script-build (exit code: 1)
--- stdout
cargo:rerun-if-changed=src/c/tuntap.c
TARGET = Some("x86_64-apple-darwin")
OPT_LEVEL = Some("3")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = None
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = Some("cmpxchg16b,fxsr,mmx,sse,sse2,sse3,ssse3")
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src" "-Wall" "-Wextra" "-o" "/Users/brite/vpncloud-by-dswd/target/release/build/vpncloud-5215daba07884332/out/src/c/tuntap.o" "-c" "src/c/tuntap.c"
cargo:warning=src/c/tuntap.c:7:10: fatal error: 'linux/if_tun.h' file not found
cargo:warning=#include <linux/if_tun.h>
cargo:warning= ^
cargo:warning=1 error generated.
exit code: 1

--- stderr

error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src" "-Wall" "-Wextra" "-o" "/Users/brite/vpncloud-by-dswd/target/release/build/vpncloud-5215daba07884332/out/src/c/tuntap.o" "-c" "src/c/tuntap.c" with args "cc" did not execute successfully (status code exit code: 1).

warning: build failed, waiting for other jobs to finish...
Building [==============================================> ] 91/105
error: build failed

i saw: "fatal error: 'linux/if_tun.h' file not found",how to fix this issue?

@dswd
Copy link
Owner Author

dswd commented Dec 4, 2019

I am sorry, but it won't just compile like that. OS X has a different way of using virtual network devices to Linux, so it will need some code changes.

@ofer-dev
Copy link

On windows wintun can be used.

@ofer-dev
Copy link

Just to update wintun 0.9 has been released and should be much nicer to work with.
https://lists.zx2c4.com/pipermail/wireguard/2020-November/005921.html

@dswd
Copy link
Owner Author

dswd commented Nov 28, 2020

@ofer-dev does wintun also support tap devices? Vpncloud supports tun and tap and I would like to have one lib for windows if possible.

@ofer-dev
Copy link

ofer-dev commented Nov 29, 2020

Wintun only support tun devices. However, it is faster and smaller than tap-windows6, so less room for bugs. But if tap devices are necessary to the best of my knowledge tap-windows6 is the only option.

references:
https://lists.zx2c4.com/pipermail/wireguard/2019-March/004038.html
https://lists.zx2c4.com/pipermail/wireguard/2019-May/004168.html
https://www.wintun.net/

p.s.
As of version 2.5 OpenVPN also ships with wintun.
https://openvpn.net/community-downloads-2/

@bmullan
Copy link

bmullan commented Feb 8, 2021

Any thought to packaging VPNCloud as a SNAP?

Quite a number of Linux distributions support Snap out of the box such as Ubuntu (and e.g. Kubuntu), Manjaro, Zorin OS, KDE Neon, Solus and Li-f-e.

Snap is also available for many other distributions such as CentOS, Debian, Elementary OS, Fedora, GalliumOS, Kali Linux, Linux Mint, OpenEmbedded, Parrot Security OS, Pop! OS, Raspbian, Red Hat Enterprise Linux and openSUSE.

Snap also supports upgrade/rollbacks etc..

Snap's goal was to ease the load on developers and also "containerize" the applications installed instead of speading config files etc all over a disk.

https://snapcraft.io/docs/creating-a-snap

Just an idea.

@dswd
Copy link
Owner Author

dswd commented Feb 8, 2021

Hi Brian. I thought about that but haven't followed that up since I have no experience in writing snaps. So if you want to help, you can create a snap and I will add it to the build process and maintain it as good as I can.

@m6ram
Copy link

m6ram commented Feb 8, 2021

It's been two three years, and I've yet to find a serious alternative to this piece of software. I have no idea why this tool is not much bigger than it is, btw. It's amazing (and thank you for providing such a gift to the world). You write code with moral merit. I might not be able to write the snap, but I'd donate for it.

@dswd
Copy link
Owner Author

dswd commented Feb 9, 2021

Hi, thanks a lot for the kind words.
I looked into building snaps a little and managed to build a simple snap from the deb package.
However:

  • I can't install the manpage as snap does not seem to support manpages
  • I have not found a good way to add vpncloud as a service since snap does not seem to support services with dynamic instances
  • Also I haven't found out how to create a config directory in /etc with a default config using snap

Right now the snap just provides the binary. Any help would be appreciated.

I just thought about something else. Since VpnCloud really just comes as a binary with 3 support files (manpage, system service, example config), maybe I can provide a standalone executable which has install and uninstall commands that create/delete those 3 files. Alternatively, the binary could get the ability to manage instances (create config, delete config) which also creates the required service file. This would work on any Linux system I can think of. What do you think about that? Would that be useful to you?

@bmullan
Copy link

bmullan commented Feb 9, 2021

@dswd

I don't know if this helps but here is the OpenVPN SNAP:

IBCNServices/easy-openvpn-server: Plug-and-play OpenVPN server which generates server and client config files for you.

SnapStore - OpenVPN SNAP

@m6ram
Copy link

m6ram commented Feb 10, 2021

@dswd

First, I want to introduce myself to you. Hi there! My name is h0p3. It's an honor and a pleasure to meet you. I've been an admirer from afar. Maybe that will change; I don't know. If you ever need a friend, a madman, or a retard in your life, HMU: https://philosopher.life/ (feel free to ignore my public self-modeling; it's currently being quietly written [can check the diffs]). I record my conversations (including this one, and I'm happy to think about that with you, if you want), and if you prefer an alias, let me know (you've already earned one with me).

I've been thinking about your words. I like many of the changes you've made to this software over the years (to my poor understanding, of course). I'm sure I sound like an entitled user, and I apologize. I am grateful for this gift.

Perhaps all I can offer in return at the moment is my paranoid, ignorant opinion here (might not be worth much, sorry). I think you have a tool that competes with Zerotier (this is the tit I'm trying to get off) and perhaps even /~https://github.com/yggdrasil-network/yggdrasil-go. Having something that "just werx" on any Linux machine is quite an accomplishment, especially if there is a simple installation (if you had more people helping you, it seems like it could be used on most unlocked platforms [perhaps even inside the browser via WASM one day]). I like to think that this tool could be the basis of the decentralization that so many applications are really seeking in the end. Here's some dumb questions and uses I have in mind:

  • Can I hand my brother a key and few lines to run almost blindly with zero compilation?
  • Can I connect to hundreds of networks, some of them quite large?
  • Can I nest VPNs?
  • Can I route this over i2p/loki/tor with ease? (ws-proxy and hooks are dope, btw)
  • Can I run it on a potato (in some mode, perhaps), especially an android phone (I'm close to just giving up and going for a pinephone)? (would it need to leverage other machines to limit battery usage?)
  • Given the continued centralization of and censorship within internet infrastructures, is it easy to run a volunteer beacon-router-tracker-proxy on behalf of any vpnclouds that may need the extra foothold? (I admit that federation may still be a required, though avoiding it is preferred).

You need a dozen people to solve these problems maybe. Please ignore my questions (they are insane, I know). You have already given more than you have to.

I don't know what fitting assumptions you ought to make here. I'm not a dev; I'm just a skiddie who uses his computer to get shit done. If you can avoid package managers, then why not avoid them? I like the last binary option you mentioned the most.

@dswd
Copy link
Owner Author

dswd commented Feb 12, 2021

@m6ram Thanks for the compliments. As those questions go beyond the topic of this issue, I quoted and answered them in #159.

@xek
Copy link
Contributor

xek commented Dec 16, 2021

Debian packages for armel (eg. raspberry pi zero and older raspberry pi) would be much appreciated

@xek
Copy link
Contributor

xek commented Dec 17, 2021

Created a pull request for armel #274

@uliluckas
Copy link

With armel build target support merged (#274) and version 2.3.0 released, a deployment of the latest debs to https://repo.ddswd.de/deb would be much appreciated.

@Lyamc
Copy link

Lyamc commented Jul 25, 2022

A new crate may be of help, particularly for running as a Windows service: /~https://github.com/chipsenkbeil/service-manager-rs

@neoOpus
Copy link

neoOpus commented Aug 3, 2022

Any chance to have this packaged for OpenWRT with LUCI support?

@aa51513
Copy link

aa51513 commented Oct 23, 2023

Very much looking forward to vpncloud supporting windows platform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests