Using Mullvad (VPN) on OpenSUSE

HI all, I just installed OpenSUSE on a VM to see if I could use all the programs I need, but I’m having problem with Mullvad.
I sent an e-mail to the Mullvad team and they told me to try to do it installing these packages

**openvpn
python
python-appindicator
**python-wxgtk2.8
resolvconf
gksu

****the problem is that the last three seem to not be available for OpenSUSE, or to be available under other names. Can you tell me how are called the OpenSUSE alternatives for those?

Also if I need to do something more comlex than launching YAST, look for a package and install it, explain it like you would explain it to a dumb kid… Thanks

python-wxgtk2.8
Use the Tumbleweed package (1-click install). Do not install and enable the Tumbleweed repo, else you will become a Tumbleweed deployment. Instead, simply download and install the package only.
http://software.opensuse.org/package/python-wxGTK?search_term=python-wxgtk

resolvconf
Read the comments in /etc/resolv.conf to understand how to modify

gksu
http://software.opensuse.org/package/gksu

The above packages were found by

  • First seeing whether the files were provided by any packages in your existing repos with the following command. None were found
zypper se --provides *filename *
  • Type the filenames into http://software.opensuse.org
    This is how python-wxgtk2.8 and gksu were found.
  • resolvconf is apparently a program used to configure /etc/resolv.conf according to various Internet sources. With recent changes in openSUSE many of these legacy apps may have been replaced but we know what is the purpose of resolvconf. As I described, the comments in /etc/resolv.conf describe how to configure the creation of this file.

HTH,
TSU

Thanks a lot! Sorry but I looked for those packages on Yast and thought I was done… anyways, now I’m trying to run the mullvad.py script, where the tenth line says “import wx”, but the terminal tells me: “Importerror: No module named wx”, even if I installed python-wxgtk2.8
Do you have any idea what could I be doing wrong?

Remove python-wxgtk2.8, and install python-wxWidgets instead which is included in openSUSE (you should find it in YaST).
This should be compatible.

wxGTK is an older name for wxWidgets, and the package you installed is incompatible with your installed wxWidgets and your installed python.

did that, thanks, but now I get this message instead

/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/init.py:57: GtkWarning: could not open display
warnings.warn(str(e), _gtk.Warning)
UNable to access the X DIsplay, is $DISPLAY set properly?

Are you trying to run it as root inside the user’s session? (with sudo or su?)
This cannot work. If you have to run it as root, use something like kdesu or gnomesu (or gksu which you already installed).

Or are you even trying to run it in text mode?

Anyway, please post exactly what you do when you get that error message. I.e. Copy/paste your input as well as the output.

You are right, I’ll try to be more clear.They told me to be sure that all those packages are installed, after that I have to put this script (https://gist.github.com/multiple1902/1675504) in the openvpn folder and download the source package of mullvad, from which I extract the content.
Then I was told run mullvad by running:
sudo python mullvad.py
I thought I was supposed to do it from the terminal? ofc in my case I specified the directory where mullvad.py is.

Yes, you can do that from the terminal.
But again, running a GUI application with sudo doesn’t work in openSUSE (at least not with the default settings) as it won’t find the current X session ($DISPLAY is not set). Using sudo for everything is an Ubuntu-specific thing (some would call it a flaw… :wink: ).

As I said, use “kdesu python mullvad.py” or “gnomesu python mullvad.py”, or this:

su -
python mullvad.py

The script should be able to open a window then.

ok, I didn’t understand gnomesu and kdesu were the command to get the root priviledges in OpenSUSE

Well thanks, now I managed to start the program, this was a big improvement. The problem is that now it just tries to keep connecting but he never actually connect… while the terminal says

/bin/sh.ifconfig: command not found

I also followed the instruction here (mullvad.net/en/setup/openvpn) and put the linux.conf file in openvpn… Maybe what I’m doing wrong is that I should use also the VPN Network Interface together with the mullvad.py in some way?

Again, you can use sudo to get root privileges in openSUSE as well. But this won’t work for applications that want to open a window.
For this you have to use kdesu (part of standard KDE, not openSUSE specific at all), or similar. A general distribution- and desktop-agnostic tool for that is xdg-su.

Well thanks, now I managed to start the program, this was a big improvement. The problem is that now it just tries to keep connecting but he never actually connect… while the terminal says

/bin/sh.ifconfig: command not found

There is no command “/bin/sh.ifconfig”, not on openSUSE and I don’t think anywhere else either.
This rather looks like a typo to me, it should probably be /bin/sh followed by a linefeed, and then ifconfig.

I also followed the instruction here (mullvad.net/en/setup/openvpn) and put the linux.conf file in openvpn… Maybe what I’m doing wrong is that I should use also the VPN Network Interface together with the mullvad.py in some way?

I have no idea. I don’t even know what mullvad is.

it was “/bin/sh: ifconfig” indeed
and Mullvad is a VPN client. Thanks for the help anyways, I still can’t use it but at least I’m not stuck where I was before this thread

Oh. So it was a type in the error message. I was thinking about a typo in the script… :wink:

Anyway, the reason is probably that ifconfig is in /sbin/ which normally is not in the user’s path.
Try to run this before running mullvad (in the same shell):

export PATH=$PATH:/sbin

and Mullvad is a VPN client.

Any particular reason why you want to use Mullvad then?
NetworkManager can connect to VPN’s as well, and there are other GUI clients included in the distribution, like kvpnc.

But apparently Mullvad offers a VPN service too, which you probably want to use. No idea if you can use that with another client as well, but from what I read from your previous posts this is just based on openvpn anyway, which is supported by NetworkManager and kvpnc e.g.

So there might be alternatives if you cannot get Mullvad to run/connect… :wink:

wow man every advice you give me actually improves the situation, now I still get some error messages
https://i.imgur.com/oiGpfPa.png
but nonetheless mullvad went from showing just a “connecting…” to actually showing the location it’s trying to connect, the port number and a protocol

anyway, I wanted to use Mullvad cause I was using it on windows already, so I still have some months booked, also I was really satisfied with their service, too bad I’m a total noob with linux and technology in general

what I don’t get is, if OpenVPN is supported by networkmanager, why doesn’t it work if I selected both the two certificates it asks for, a private key and a gateway

Well, Mullvad calls “route” with the ‘-6’ option (for IPv6), which isn’t understood by openSUSE’s route (which supports IPv6 by default).
Try to edit the file route.pl and remove the ‘-6’ in line 227.
No idea if it will work then, but the rest of the line looks like route’s help would suggest.

what I don’t get is, if OpenVPN is supported by networkmanager, why doesn’t it work if I selected both the two certificates it asks for, a private key and a gateway

No idea.
What do you mean with “doesn’t work”? Are your certificates/settings not accepted? Can’t you connect? Do you get an error message?
You have to have NetworkManager-openvpn installed, then it should work if you click on “Add” and choose “OpenVPN”, I’d suppose.
Btw, this page describes the settings, apparently you can also use PPTP (which is also supported by NetworkManager) as well:
https://mullvad.net/en/get-started/
PPTP should be straightforward to setup, but has some drawbacks. In particular:

but it should only be used to hide your IP address, not for protecting the content of your communication. There are numerous weaknesses in PPTP that make the tunnel encryption essentially useless.

On that page another option is explained via OpenVPN directly. That should work too on openSUSE (openvpn should even be installed by default I think), but starting the service would be slightly different in recent openSUSE versions.
Essentially you just need to download your configuration, put it to /etc/openvpn/ and start it with “sudo systemctl start openvpn@name_of_the_configfile” (you should omit the trailing “.conf” for the configfilename).

After removing the -6, the terminal still gives me the same message. And removing the other “-6” in the file (maybe it doesn’t make sense, but I tried anyways) it just gives a “no host found”

When I say it doesn’t work I mean that according to the network manager I am connected to the VPN, but I actually can’t reach any site, it just keep trying without reaching anything, not even an error page. And I tried doing this after moving the conf file to the openvpn folder.
If I tried your command I get this

duuude@linux-qy86:~> sudo systemctl start openvpn@mullvad_linux
root's password:
Job for openvpn@mullvad_linux.service failed. See "systemctl status openvpn@mullvad_linux.service" and "journalctl -xn" for details.
duuude@linux-qy86:~> systemctl status openvpn@mullvad_linux.service
openvpn@mullvad_linux.service - OpenVPN tunneling daemon instance using /etc/openvpn/mullvad_linux.conf
   Loaded: loaded (/usr/lib/systemd/system/openvpn@.service; disabled)
   Active: failed (Result: exit-code) since Sat 2015-02-14 20:27:12 CET; 27s ago
  Process: 3719 ExecStart=/usr/sbin/openvpn --daemon --suppress-timestamps --writepid /var/run/openvpn/%i.pid --cd /etc/openvpn/ --config %i.conf (code=exited, status=1/FAILURE)

duuude@linux-qy86:~> journalctl -xn
-- Logs begin at Sun 2015-02-08 15:35:19 CET, end at Sat 2015-02-14 20:26:53 CET
Feb 14 20:26:25 linux-qy86.site org.gnome.Caribou.Daemon[1508]: ** (caribou:1668
Feb 14 20:26:25 linux-qy86.site org.gnome.Caribou.Daemon[1508]: ** (caribou:1668
Feb 14 20:26:27 linux-qy86.site org.gnome.OnlineMiners.GData[1508]: Gom-Message:
Feb 14 20:26:28 linux-qy86.site org.gnome.Caribou.Daemon[1508]: ** (caribou:1668
Feb 14 20:26:29 linux-qy86.site org.gnome.OnlineMiners.Owncloud[1508]: Gom-Messa
Feb 14 20:26:29 linux-qy86.site org.gnome.OnlineMiners.Zpj[1508]: Gom-Message: S
Feb 14 20:26:29 linux-qy86.site org.gnome.Caribou.Daemon[1508]: ** (caribou:1668
Feb 14 20:26:30 linux-qy86.site org.gnome.Documents[1508]: Gjs-Message: JS LOG: 
Feb 14 20:26:53 linux-qy86.site org.freedesktop.Tracker1[1508]: (tracker-store:1
Feb 14 20:26:53 linux-qy86.site org.freedesktop.Tracker1[1508]: (tracker-store:1
lines 1-11/11 (END)


Well, then the route command is incompatible in other ways too.
I cannot tell you what else to change, as I cannot try here.

If I tried your command I get this

duuude@linux-qy86:~> sudo systemctl start openvpn@mullvad_linux
root's password:
Job for openvpn@mullvad_linux.service failed. See "systemctl status openvpn@mullvad_linux.service" and "journalctl -xn" for details.
duuude@linux-qy86:~> systemctl status openvpn@mullvad_linux.service
openvpn@mullvad_linux.service - OpenVPN tunneling daemon instance using /etc/openvpn/mullvad_linux.conf
   Loaded: loaded (/usr/lib/systemd/system/openvpn@.service; disabled)
   Active: failed (Result: exit-code) since Sat 2015-02-14 20:27:12 CET; 27s ago
  Process: 3719 ExecStart=/usr/sbin/openvpn --daemon --suppress-timestamps --writepid /var/run/openvpn/%i.pid --cd /etc/openvpn/ --config %i.conf (code=exited, status=1/FAILURE)

Run “sudo systemctl status openvpn@mullvad_linux” after that command and post the output, to find out why it fails.
The file is called /etc/openvpn/mullvad_linux.conf right?

openvpn@mullvad_linux.service - OpenVPN tunneling daemon instance using /etc/openvpn/mullvad_linux.conf
   Loaded: loaded (/usr/lib/systemd/system/openvpn@.service; disabled)
   Active: failed (Result: exit-code) since Sat 2015-02-14 21:37:50 CET; 29s ago
  Process: 2217 ExecStart=/usr/sbin/openvpn --daemon --suppress-timestamps --writepid /var/run/openvpn/%i.pid --cd /etc/openvpn/ --config %i.conf (code=exited, status=1/FAILURE)

Feb 14 21:37:50 linux-qy86.site openvpn[2217]: Options error: --up script fa...d
Feb 14 21:37:50 linux-qy86.site openvpn[2217]: Options error: Please correct....
Feb 14 21:37:50 linux-qy86.site openvpn[2217]: Use --help for more information.


Yes

Oops, sorry.
Please repeat with:

sudo systemctl -l status openvpn@mullvad_linux

here it is

openvpn@mullvad_linux.service - OpenVPN tunneling daemon instance using /etc/openvpn/mullvad_linux.conf
   Loaded: loaded (/usr/lib/systemd/system/openvpn@.service; disabled)
   Active: failed (Result: exit-code) since Sat 2015-02-14 22:08:09 CET; 22s ago
  Process: 2632 ExecStart=/usr/sbin/openvpn --daemon --suppress-timestamps --writepid /var/run/openvpn/%i.pid --cd /etc/openvpn/ --config %i.conf (code=exited, status=1/FAILURE)

Feb 14 22:08:09 linux-qy86.site openvpn[2632]: Options error: --up script fails with '/etc/openvpn/update-resolv-conf': Permission denied
Feb 14 22:08:09 linux-qy86.site openvpn[2632]: Options error: Please correct this error.
Feb 14 22:08:09 linux-qy86.site openvpn[2632]: Use --help for more information.


Permission denied?
I suppose this is a script included in your openvpn settings archive, but it doesn’t have the executable bit (‘x’) set.
Try:

sudo chmod +x /etc/openvpn/update-resolv-conf