Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upBash Scripting VM operations in dom0 #3913
Comments
andrewdavidwong
added
the
C: core
label
May 20, 2018
andrewdavidwong
added this to the Release 4.0 updates milestone
May 20, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
andrewdavidwong
May 20, 2018
Member
I've written a Bash script which runs from dom0 to automate creation and configuration of VMs
[...]
If there is a better way to do this I'd like to know.
I think this is intended to be the better way:
I think this is intended to be the better way: |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
0pcom
May 20, 2018
Thank you Andrew.
However, as stated in the doc, it is not easy to understand at first introduction.
I have struggled to make it even as far as I have
in an area where I have little previous experience and am barely competent.
The bash script I have will work with minimal alteration if I simply require users to start the per VM configuration scripts manually- requiring ~40 keystrokes on the part of the user to complete the configuration. This will have to do for now.
This is currently intended as an experimental system which holds no sensitive data and need not be as secured as absolutely possible. The script was only intended to save the time of setting up this configuration per every VM instance. So far it's taken more time to do this than it has saved.
I will study salting, per your recommendation.
Though, I would like to know if there is a solution that will allow the existing VM scripts to succeed in their configuration when they are called from dom0; without requiring the user to start them manually?
Perhaps something like what andrewclausen suggested at the end of: #2581
0pcom
commented
May 20, 2018
|
Thank you Andrew. However, as stated in the doc, it is not easy to understand at first introduction. The bash script I have will work with minimal alteration if I simply require users to start the per VM configuration scripts manually- requiring ~40 keystrokes on the part of the user to complete the configuration. This will have to do for now. This is currently intended as an experimental system which holds no sensitive data and need not be as secured as absolutely possible. The script was only intended to save the time of setting up this configuration per every VM instance. So far it's taken more time to do this than it has saved. I will study salting, per your recommendation. Though, I would like to know if there is a solution that will allow the existing VM scripts to succeed in their configuration when they are called from dom0; without requiring the user to start them manually? Perhaps something like what andrewclausen suggested at the end of: #2581 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
andrewdavidwong
May 21, 2018
Member
This is currently intended as an experimental system which holds no sensitive data and need not be as secured as absolutely possible.
[...]
Though, I would like to know if there is a solution that will allow the existing VM scripts to succeed in their configuration when they are called from dom0; without requiring the user to start them manually?
Have you tried the qvm-run --no-filter-escape-chars option? (This option is a security risk, but given what you've said, it sounds like this might be an acceptable risk for your experimental system.)
Have you tried the |
0pcom commentedMay 20, 2018
Qubes OS version:
4.0
Affected component(s):
qvm-run
Steps to reproduce the behavior:
I've written a Bash script which runs from dom0 to automate creation and configuration of VMs
Here is a basic outline:
qvm-run my-new-qube '~/QubesIncoming/dom0/config' --pass-iothe output of this command executes in the dom0 terminal, but is unsuccessful
qvm-run my-new-qube 'xterm ~/QubesIncoming/dom0/config' --pass-iothis outputs in xterm, and also does not succeed
qvm-run my-new-qube 'gnome-terminal -e ~/QubesIncoming/dom0/config' --pass-iothis launches gnome-terminal, runs the script, but does not succeed.
qvm-run my-new-qube 'xfce4-terminal -e ~/QubesIncoming/dom0/config' --pass-iothis launches xfce4-terminal, runs the script, but does not succeed.
failed to connect to session manager: failed to connect to session manager:`SESSION_MANAGER environment variable not defined'
However, when I otherwise launch the VM terminal and run the script, it works
Expected behavior:
https://github.com/0pcom/qubes-skywire/blob/master/skydom0
Actual behavior:
It seems the issue is special characters
avoiding special characters is why I tried passed files containing scripts to the VMs
after sending individual commands failed because of nested commands like echo echo, etc.
General notes:
If there is a better way to do this I'd like to know.
Related issues:
/usr/lib/qubes/qubes-rpc-multiplexer: 36: /usr/lib/qubes/qubes-rpc-multiplexer:
/home/user/.bahrc: not found
This error occurs frequently but doesn't appear to affect anything.
.bahrc is not a valid name in any case