How to get the public key of a Mullvad Wireguard cxn in a ProxyVM

First, I think this is legitimately a Qubes question, so I’ll ask it here.

TL;DR : in the ProxyVM, how do I find the public key of the Wireguard connection to my VPN ?

I’m trying to manage the number of devices I have on Mullvad. I need to delete some keys on my account before I add another device (you only get 5 keys).

The public keys for each of your devices are printed on your account page, and you can delete them there. They are even named to be more human-friendly. For a ‘normal’ non-Qubes device, you can just go the device’s Mullvad app, open Account settings, and read the device’s name. So its pretty easy to see which key belongs to which device, and which key you do/do not want to delete.

However, its not that simple in Qubes - there is no app. I’ve got several ProxyVMs set up with Mullvad’s Wireguard for Qubes instructions.

So again, my question is, how do I find the public key on the ProxyVM?

I assume that when you download the configuration file from the mullvad website, it should contain the public key inside the PEER. The name of the file may be different depending on the server location you choose, e.g. se3-wireguard.conf or fra11-wireguard.conf.

You have 2 way to do this:

  • If connected, run sudo wg show and it will show you the public key
  • If not connected, run sudo awk -F' = ' '/PrivateKey/{print $2}' [path to wireguard conf] | wg pubkey

I’m connected, but that doesn’t seem to work:

$ wg show
Unable to access interface us-nyc-wg-301: Operation not permitted

You need to run that using “sudo”

got it, works perfectly - thanks!


1 Like

actually just got a reply form Mullvad help line. Turns out sudo wg also works.