Script net-vm of dvm at startup

27 views
Skip to first unread message

Dominique

unread,
Apr 23, 2020, 10:15:58 PM4/23/20
to qubes-users
Good day Qubes community,

I have multiple sys-vpn machine connecting to different vpn provider. I would like to have a DVM that ask at startup which sys-vpn machine to use as its net-vm.
I was wondering if anyone had done it before? Or if anyone had brilliant idea how I could do it.

Thanks

Dominique

unman

unread,
Apr 26, 2020, 6:36:06 AM4/26/20
to qubes-users
One way to do this is with a script that :
1. Asks for the target sys-vpn
2. Starts a new instance of the disposableVM
3. Sets the new instance to use the target sys-vpn.

You could use whiptail or zenity to display the options and
capture the input choice.
`qvm-run -q -a --service --dispvm=<qube> -- qubes.startApp+firefox-esr`
Set the netvm using `qvm-prefs <new_qube> netvm `

The only issue might be in step 3, in identifying the new instance - you
could use `qvm-ls ` to find Transient qubes, or (better) `xl list` which
shows you the uptime, and will allow you to find the most recently
created qube. This may occasionally get confused if you start qubes at
the same time.
Look at the output of `xl list `, and parse it with sort, grep and cut
to get the name of the disposableVM.

An alternative would be to use `qvm-prefs` to change the netvm of the
DVMTemplate, start the disposableVM, and change the netvm back to the
default value. That would be fool proof.

If you need help with any part of this, just post back with details of
what you have tried and where you are stuck.

unman
Reply all
Reply to author
Forward
0 new messages