Hello,

On 10 March 2018 at 17:14, Yuraeitha <yuraei...@gmail.com> wrote:

> On Saturday, March 10, 2018 at 8:21:02 AM UTC+1, hopkins...@gmail.com
> wrote:
> > >32 GB RAM.  launch times (~15-19 sec)
> >
> > This was the reason why i left Qubes OS. I cant coupe with hours
> starting vm-s. 3.2 version were faster.


I came up with an idea to accelerate the start of an application in a
Disposable VM to ~2 seconds.
The idea came to my mind when I thought about how we accelerate stateless
virtual desktops for our customers who are running VMware virtual desktop
(Horizon View),
We can build desktops that only exist as long as the user is logged in,
after logout the desktop is destroyed and he gets a complete new desktop
(build from an image) on the next login.
To make it possible that users have a good user experience and don't have
to wait during logon, when their desktop is provisioned we are prebuilding
desktops, so that a certain amount of desktops is always available.
If a new users takes a desktop, the system is automatically reprovisioning
a new one, for the next user.

I took the same idea to accelerate the launch of applications within
disposable VMs.
I have one or more disposable AppVMs available that can be used to launch
an application within it.
If the application ends the DispVM will be killed and for the next
application another disposable AppVM will be provisioned in advance.

The downside is that those started Disposable VMs may use some ressources
but as long as they are not running any calculation, the overhead shouldn't
be to big.
This approach is a workarround not a very smart solution, but it works.

Please don't be to hard judging the current state of the work, as I am
missing some scripting skills to make it do a first alpha version.
But someone with some more skills might be able to fill in the gaps.

This is how it works:

1) Launch a new disposable VM with nothing more than an empty xterm window.
This is only to have something like a container, to start the application in

2) move the xterm window to the last desktop (default Qubes installation
has 4 desktops (=desktop overview pager left of the clock in the menubar)

3) If you need to open a disposable Application, start this application in
the already running disposable VM
    add a qvm-kill/qvm-shutdown after the command launch

4) provision a new disposable AppVM in the background which will be used
when the next disposable Application must be started.

This is far away from being perfect but it would be good enough for me,
I've run the commands manually and proved that something like this can
work, but I am missing some more scripting skills.
I hope someone can support me, filling the missing gaps.

=====
Quick'n dirty notes, playing arround with the above idea / needs to be
polished.

# Create list of all open windows = Window-List-1
wmctrl -l | gawk '{ print $1 }'

# Show all Running DispVMs = List-DVMs-1
qvm-ls | grep DispVM


# Create a new AppVM and open an xterm window in it
# This will open up a new xterm window in the current window
qvm-run -q -a --service --dispvm=fedora-26-dvm -- qubes.StartApp+xterm &


# Show all Running DispVMs = List-DVMs-2
qvm-ls | grep DispVM


# TODO: commands to get the name of the newly created DispVM
# This DispVM will be called "Newest-DispVM"


# Create a new list of all open windows = Window-List-2
wmctrl -l | gawk '{ print $1 }'


# TODO:
# Commands to find out which is the new window ID from the xterm-window
# The DispVM-window-ID = Window-List-2 - Windows-List-1
# we call this window here DispVM-xterm-Window-ID


# List of all available desktops
# First desktop = 0
wmctrl -d |  gawk '{ print $1 }'
# TODO: Get the greatest number from this list = LastDesktop


# move the new xterm window to the last desktop, so that is it out of the
way
wmctrl -i -r $DispVM-xterm-Window-ID -t $LastDesktop


# If a new DisposableVM is needed, the following steps need to be done:

1) $Current-DispVM = Newest-DispVM

2) Prepare another DispVM in the background (!)
   Create a new DispVM  by opening an xterm session and
   move it to the last desktop (see above)
   This DVM will be the "Newest-DispVM

3) Run the application in Current-DispVM
   and kill the DispVM when the command has been ended
   qvm-run $Current-DispVM <COMMAND> && qvm-kill $Current-DispVM
   this will also kill the xterm window on the last desktop


What do you think?
Can someone can tell me the neccessary command to find out what is the
Windows-ID of the xterm window and the DisposableVM-Name after launching a
new App-VM?

[799]

-- 
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 qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/CAJ3yz2tAs4YbS-GoCwYU2DZXJ_WX5g7TKj7EiGNMV_GDUpUbDw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to