Dispvms created with salt aren't updating appmenu properly

i’m trying to write a salt config for disposable vms and i’m struggling to get the appemenus to update properly.

in this case i’m making a disposable “template” called dvm-browsers, with the following configuration:

---
'dvm-browsers.vm':
  qvm.vm:
    - name: {{ pillar.names.dispvms.browsers }}
    - present:
      - template: {{ pillar.names.templates.providers.flatpak }}
      - label: red
    - prefs:
      - template-for-dispvms: true

'qvm-volume extend {{ pillar.names.dispvms.browsers }}:private 12Gi':
  cmd.run

'dvm-browsers.vm - qvm.features':
  qvm.features:
   - name: {{ pillar.names.dispvms.browsers }}
   - set:
     - menu-items: "io.gitlab.librewolf-community.desktop io.github.ungoogled_software.ungoogled_chromium.desktop"
     - default-menu-items: "io.gitlab.librewolf-community.desktop io.github.ungoogled_software.ungoogled_chromium.desktop"

'qvm-sync-appmenus --regenerate-only --force-root {{ pillar.names.dispvms.browsers }}':
  cmd.run

i’m using the whisker menu on xfce in dom0. this above code creates the Template (disp): dvm-browsers group, but there is no Disposable: dvm-browsers group. i’m still on 4.1, too

if you’d like to see the rest of the repo, it’s here: ~xyhhx/qubes-salt - rewriting my qubes setup as salt formulae - sourcehut git

thanks in advance

I think you need to add these lines to dvm-browsers.vm:

- features:
  - enable:
    - appmenus-dispvm

So:

---
'dvm-browsers.vm':
  qvm.vm:
    - name: {{ pillar.names.dispvms.browsers }}
    - present:
      - template: {{ pillar.names.templates.providers.flatpak }}
      - label: red
    - prefs:
      - template-for-dispvms: true
    - features:
      - enable:
        - appmenus-dispvm
      - set:
        - menu-items: "io.gitlab.librewolf-community.desktop io.github.ungoogled_software.ungoogled_chromium.desktop"
        - default-menu-items: "io.gitlab.librewolf-community.desktop io.github.ungoogled_software.ungoogled_chromium.desktop"

'qvm-volume extend {{ pillar.names.dispvms.browsers }}:private 12Gi':
  cmd.run

In the previous code, I moved qvm.features in the shortcut qvm.vm. Maybe the cmd.run thing is useless?

1 Like

You can also use

- features:
  - set:
    - appmenus-dispvm: True

As you use set to create the menu, you may wish to combine the
settings under one head.
I find this clearer - I use it when creating a disposable Mullvad VPN
in salt shaker
As you will see, I follow it with a call to qvm-appmenus --update

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

thanks @parulin @unman - your suggestions did the trick