xmikos / qopenvpn

Simple OpenVPN GUI written in PyQt for systemd based distributions
GNU General Public License v3.0
43 stars 11 forks source link

How to use it ? #5

Open elswerky opened 6 years ago

elswerky commented 6 years ago

I installed QopenVpn in manjaro but i don't know how to use it

and didn't find any tutorial on web showing to configure and use it either on manjaro on in another distro

can you post simpole step by step tutorial on how to use it ???

kingcc commented 5 years ago

Same question.

You should provide a more complete documentation

dahikino commented 4 years ago

if you readed the main file in the source :

    # Checks for the new location of OpenVPN configuration files introduced in OpenVPN 2.4
    # See https://github.com/OpenVPN/openvpn/blob/master/Changes.rst#user-visible-changes
    # "The configuration files are picked up from the /etc/openvpn/server/ and
    # /etc/openvpn/client/ directories (depending on unit file)."
    # Remove this unaesthetic version check when openvpn 2.4 is widely accepcted
trougnouf commented 3 years ago

if you readed the main file in the source :

    # Checks for the new location of OpenVPN configuration files introduced in OpenVPN 2.4
    # See https://github.com/OpenVPN/openvpn/blob/master/Changes.rst#user-visible-changes
    # "The configuration files are picked up from the /etc/openvpn/server/ and
    # /etc/openvpn/client/ directories (depending on unit file)."
    # Remove this unaesthetic version check when openvpn 2.4 is widely accepcted

I thought this was a GUI o_O Regardless a source file is not a place for documentation. Even --help doesn't do anything. When I launch qopenvpn, I get an icon in the taskbar. Double clicking on it prompts a password in the terminal, which results in Failed to start None@None.service: Unit None@None.service not found.

twoyang0917 commented 2 years ago
  1. use tab to complete command like below to find the unit file
    
    sudo systemctl status openvpn-client@None.service
    × openvpn-client@None.service
     Loaded: loaded (/usr/lib/systemd/system/openvpn-client@.service; disabled; preset: disabled)
     Active: failed (Result: exit-code) since Sat 2022-11-19 11:01:30 CST; 25min ago
    Main PID: 1105407 (code=exited, status=1/FAILURE)
        CPU: 19ms

11月 19 11:01:30 systemd[1]: Starting OpenVPN tunnel for None... 11月 19 11:01:30 openvpn[1105407]: Options error: In [CMD-LINE]:1: Error opening configuration file: None.conf 11月 19 11:01:30 openvpn[1105407]: Use --help for more information. 11月 19 11:01:30 systemd[1]: openvpn-client@None.service: Main process exited, code=exited, status=1/FAILURE 11月 19 11:01:30 systemd[1]: openvpn-client@None.service: Failed with result 'exit-code'. 11月 19 11:01:30 systemd[1]: Failed to start OpenVPN tunnel for None.


2. now you can see what's the None means. it get from the unit filename and pass to the config filename.
```bash
sudo cat /usr/lib/systemd/system/openvpn-client@.service
[Unit]
Description=OpenVPN tunnel for %I
After=syslog.target network-online.target
Wants=network-online.target
Documentation=man:openvpn(8)
Documentation=https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
Documentation=https://community.openvpn.net/openvpn/wiki/HOWTO

[Service]
Type=notify
PrivateTmp=true
WorkingDirectory=/etc/openvpn/client
ExecStart=/usr/bin/openvpn --suppress-timestamps --nobind --config %i.conf
User=openvpn
Group=network
AmbientCapabilities=CAP_IPC_LOCK CAP_NET_ADMIN CAP_NET_RAW CAP_SETGID CAP_SETUID CAP_SYS_CHROOT CAP_DAC_OVERRIDE
CapabilityBoundingSet=CAP_IPC_LOCK CAP_NET_ADMIN CAP_NET_RAW CAP_SETGID CAP_SETUID CAP_SYS_CHROOT CAP_DAC_OVERRIDE
LimitNPROC=10
DeviceAllow=/dev/null rw
DeviceAllow=/dev/net/tun rw
ProtectSystem=true
ProtectHome=true
KillMode=process

[Install]
WantedBy=multi-user.target
  1. try to fix it, below is my way. you may have a better one, please share it if you'd like to.
    sudo mv /usr/lib/systemd/system/openvpn-client@.service /usr/lib/systemd/system/openvpn-client@my.service
    # put your config file into WorkingDirectory (find it in unit file). name it my.conf, keep the prefix same as unit file.
    # and correct the ownership User & Group (find it in unit file)
    # here we go. reload the unit then start the service.
    sudo systemctl daemon-reload
    sudo systemctl start openvpn-client@my.service