Testing Windows and QWT in R4.1

The whole point is command line program to be started first, and everything else works then. Logical choice is cmd.exe.

So in a win-template is to be put in a ProgramData/Startup folder shortcut to cmd.exe and to shut down the template. Then , and only then to create win-dvm-template in a standard way, not before that.

[user@dom0 ~]$ qvm-create --template win-template --label red win-dvm-template
[user@dom0 ~]$ qvm-prefs win-dvm-template template_for_dispvms True
[user@dom0 ~]$ qvm-features win-dvm-template appmenus-dispvm 1

Open its Settings again then choose Default disposable template - itself. Back to win-template and choose win-dvm-template for Default disposable template, too (the latter is not mandatory, but naturally).

Now we should get Disposable: win-dvm-template entry in the Apllication menu.

If applications aren’t listed there, they’re neither listed in win-dvm-template, so we need to Refresh applications in win-dvm-template, so we could get list in Disposable: win-dvm-template too.

If this doesn’t work for some reason, we can try to create correspondent desktop file in dom0’s /home/user/.local/share/qubes-appmenus/win-dvm-template/apps.templates/Accessories-cmd.desktop:

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
X-Qubes-VmName=%VMNAME%
X-Qubes-AppName=Accessories-cmd
Icon=%VMDIR%/apps.icons/Accessories-cmd.png
Name=%VMNAME%: Accessories cmd
Comment=
Categories=X-Qubes-VM;
Exec=qvm-run -q -a --service – %VMNAME% qubes.StartApp+Accessories-cmd
X-Qubes-DispvmExec=qvm-run -q -a --service --dispvm=%VMNAME% – qubes.StartApp+Accessories-cmd

and/or (didn’t test neither because Refresh worked for me out of a box)

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
X-Qubes-VmName=win-dvm-template
X-Qubes-AppName=Accessories-cmd
Icon=/home/user/.local/share/qubes-appmenus/win-dvm-template/apps.icons/Accessories-cmd.png
Name=win-dvm-template: Accessories cmd
Comment=
Categories=X-Qubes-VM;
X-Qubes-NonDispvmExec=qvm-run -q -a --service – win-dvm-template qubes.StartApp+Accessories-cmd
Exec=qvm-run -q -a --service --dispvm=win-dvm-template – qubes.StartApp+Accessories-cmd

in /home/user/.local/share/qubes-appmenus/win-dvm-template/apps/org.qubes-os.dispvm.win-dvm-template.Accessories-cmd.desktop

Either way, we want to assure to get an entry in application menu for cmd.exe.

Now, there are 2 use cases of such dispxxxVMs:

  1. If we want to start dispVM directly from the Application menu, we have to choose command line program there - cmd.exe. When started, such dispVM will have 2 cmd windows opened: one from the startup folder and the other one from our choice on start up. If we try to start any GUI program, it will not work regardless of the fact cmd.exe is in startup folder. We can now close one instance of cmd.exe. Annoyance a bit, but it works. From here, WIN key and the menu opens and we can use DVM as needed.
  2. If we are in some other win or any other Linux based VM for which we choose win-dvm-template as default disposable VM, viewing/copying/editing works well and only one instance of cmd.exe will be opened prior to GUI editing/viewing program - the one from the Startup folder ensuring win-dispxxxVM will be started and functional.

Final remark: such win based dispxxxVMs will not be shutdown automatically by closing first opened program (meaning cmd.exe) like Linux based disposables would be and I didn’t investigate the possibility to overcome this yet. Hopefully, someone might be able to help with this. Until then, and instead, these disposables have to be shutdown via WIN key -> Shutdown regular Windows procedure.

I’ll be glad to further clarify, being aware that my English is far from good.

1 Like