VMApp files from template

23 views
Skip to first unread message

Dave Albiston

unread,
Jan 15, 2019, 7:14:00 AM1/15/19
to qubes...@googlegroups.com
Hi there

I am new to Qubes so please be patient!

How can I access files in my VMApp folders from the template? I need to
do this to add a menu option to run a script stored in the VMApp.

Many thanks

--
Dave Albiston

Phone No. +44 (0)1383 729087
Mobile No. +44 (0)7711 904030

unman

unread,
Jan 15, 2019, 7:31:36 AM1/15/19
to qubes...@googlegroups.com
On Tue, Jan 15, 2019 at 12:13:55PM +0000, Dave Albiston wrote:
> Hi there
>
> I am new to Qubes so please be patient!
>
> How can I access files in my VMApp folders from the template? I need to do
> this to add a menu option to run a script stored in the VMApp.
>
> Many thanks
>
> --
> Dave Albiston

Hi Dave

If you want to customise the menu, then the process is carried out in
dom0, not in a template.
If you are using the default of Xfce, then look at:
https://wiki.xfce.org/howto/customize-menu
In general, to run a program in a qube, you use something like this:
qvm-run -q --service -- <qube> qubes.StartApp+<program>
or:
qvm-run -q <qube> <program>

The former form expects a desktop file, the latter uses a program name.
You can test these from a command line in dom0 to make sure that you
have the right format, and then create an appropriate menu item using
the command.

If you need more help, feel free to ask

cheers

unman



Dave Albiston

unread,
Jan 15, 2019, 8:26:05 AM1/15/19
to qubes...@googlegroups.com
Thanks, uman

I followed alternative instructions and the menu option is
provided by placing a .desktop file in
/usr/share/applications. This works and the command is
attempted. But it cannot find the script which is in the
VMApp folders, so there is a file not found error.

I presume the command is executing in dom0. How can I make
it look for the script file in the VMApp space?

many thanks, Dave

unman

unread,
Jan 15, 2019, 7:55:54 PM1/15/19
to qubes...@googlegroups.com
What does your desktop file look like?
If you compare with the files used in other menu items, and look at my
last post, you will see how to run files in qubes by executing commands in
dom0.

Dave Albiston

unread,
Jan 16, 2019, 4:22:39 AM1/16/19
to qubes...@googlegroups.com
Thanks for your patience, uman

It is the exec line that is the problem. In the work domain
I can run the script using:

sh /home/Scripts/myscript.sh

I guess that the menu exec statement is being run in dom0.
So how can the statement be changed to point to a file in
the work domain? Or, alternatively, how can the command be
forced to execute in the work domain?

It's a learning curve!

unman

unread,
Jan 16, 2019, 7:02:14 AM1/16/19
to qubes...@googlegroups.com
We're all learning.

Make the script executable in the work qube.
Then in dom0 , try 'qvm-run work /home/Scripts/myscript.sh' at console.
Assuming that works, then you have the exec statement to use in the menu
item.
If it doesnt work, then you can use 'qvm-run -p' to get stdin/out in the
console, which may help with troubleshooting. Or start logging in the
script to see where it breaks.
You can also use '-u <user>' to run as specified user.

Once you can call the command from dom0, use that as the exec line.

Dave Albiston

unread,
Jan 16, 2019, 10:41:08 AM1/16/19
to qubes...@googlegroups.com
I have not been successful in accessing VMApp files from
dom0. So I have bowed to the inevitable and placed my script
in the template. Now it works.

Thanks for your help, uman.
Reply all
Reply to author
Forward
0 new messages