On 2017-05-09 22:18, Unman wrote:
On Tue, May 09, 2017 at 02:09:56PM +0000, atlahua wrote:
Hi there!
I need to be able to start DVM's from different templates
simultaneously.
This feature is not available as far as I know.
For this reason I am trying the next best thing which is to make /home
and
/usr/local to make sure that nothing is left when I power down a
standard
Template based VM.
How can I achieve that?
Thnx in advance for your contributions,
A.
This will be incorporated in r4.
I've posted before with details of a simple way of running DVMs based
on
different templates. It relies on the fact that generating a new
DVMTemplate leaves old DVMTemplates in place on disk.
I'll just quote my earlier mail:
First generate assorted disposableVMs using qvm-create-default-dvm and
customize
them as you will. (Strictly this isn't necessary but you may as well
get
your disposableVM just the way you want it.)
Because you can set disposableVMs with different netvms, and alternate
Qubes networking paths, it's possible to trigger disposableVMs using
different torVMs/ VPNs through different NICs, in the same time it
takes
to load a disposableVM ordinarily.
I have a number of keyboard shortcuts to call a script with different
parameters, to do exactly this. It's multi-template disposableVMs on
the
cheap, and works for me.
#!/bin/sh
if [ $# -eq 0 -o $# -gt 2 ] ; then
echo 'Usage: switch_dvm templatename [command]'
exit 1
fi
TEMPLATENAME=$1
DVMTMPL="$TEMPLATENAME"-dvm
DVMTMPLDIR="/var/lib/qubes/appvms/$DVMTMPL"
ROOT=/var/lib/qubes/dvmdata/savefile-root
DEFAULT=/var/lib/qubes/dvmdata/default-savefile
CURRENT=/var/run/qubes/current-savefile
SHMDIR=/dev/shm/qubes
SHMCOPY=$SHMDIR/current-savefile
if [ -d $DVMTMPLDIR ] ; then
rm -f $ROOT $DEFAULT $CURRENT
ln -s "$DVMTMPLDIR/dvm-savefile" $DEFAULT
ln -s "/var/lib/qubes/vm-templates/$TEMPLATENAME/root.img" $ROOT
rm -f $SHMCOPY
cp $DEFAULT $SHMCOPY || exit 1
chgrp qubes $SHMCOPY
chmod 660 $SHMCOPY
ln -s $SHMCOPY $CURRENT
rm /var/lib/qubes/dvmdata/vmdir
ln -s $DVMTMPLDIR /var/lib/qubes/dvmdata/vmdir
else
echo "Creating new dvm"
qvm-create-default-dvm $1
fi
if [ $2 ] ; then
echo $2 | /usr/lib/qubes/qfile-daemon-dvm qubes.VMShell dom0 DEFAULT
red
fi
unman
__________________________________________________________________
Thanks Unman.
I do not have a full understanding of how dvm's are created and
therefore I am going to need some time to understand how your script
works.
I have one initial question though: what is the second argument, the
[command]?
--
You received this message because you are subscribed to the Google Groups
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/qubes-users/a70e150537660fd120ba50045bed4ad3%40krutt.org.
For more options, visit https://groups.google.com/d/optout.