`/rw/config/rc.local` doesn't seem to be working

I’ve entered a set of commands into a /rw/config/rc.local file in a qube. They aren’t working.

The qube is based on @unmans’s mullvad template. I want the qube to launch the Mullvad app with my account and chosen location.

The commands look like:

mullvad account login ###[secret number]###

mullvad relay set location XX

mullvad connect

/opt/'Mullvad VPN'/mullvad-gui

I know these commands work on the command line manually and separately.

What am I doing wrong here?

Since mullvad-gui is a graphical application, it needs a display to work.
Running commands with rc.local doesn’t provide the necessary envs, so it will crash.
Also, the application needs to run as ID 1000 (user) to work properly, so something like that should work:

export DISPLAY=:0
sudo -u user "/opt/Mullvad VPN/mullvad-gui" &

I normally use a desktop file with autostart, when I need a GUI app to start automatically.

The simplest way to do this is to use bind-dirs on
/etc/mullvad-vpn. This is what is done in sys-mullvad, and will store
all settings, including account, location, and allocated device.

I never presume to speak for the Qubes team.
When I comment in the Forum I speak for myself.

^ has worked well for settings.

^ hasn’t worked. However, the app has its own autostart option and that seems to do the trick.

Thanks all for help.

And… it doesn’t work as a vpn-vm.

Try my guide: Using Mullvad VPN on Qubes OS | PrivSec - A practical approach to Privacy and Security

/rw/config/rc.local is not a good place to run this - you can’t do proper scheduling with it.

Also, you don’t actually need the app to open, as the daemon should already be running with the settings from the previous session.