-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Fri, Apr 14, 2017 at 08:42:20AM -0700, [email protected] wrote:
> Hi,
> I have a Lenovo Thinkpad L460 (hcl file attached) and nearly every time I 
> tried a suspension of the whole system with running appvms my laptop froze 
> in a state after "suspension" of the OS and before the hardware entered the 
> final suspension state.
> I found out that the suspension will work, if you pause all appvms before 
> suspending the system, but you probably have to reset the hardware once by 
> holding the power-button until it blinks to clean the hardware's state from 
> previous failed tries.
> 
> Warning: Only add or edit scripts, if you know what you're doing!!!
> Notice: This is only a workaround it's not fixing the issue/bug itself.
> 
> To automate the process you can create a script 
> "/usr/lib/systemd/system-sleep/pause_vms_on_suspension.sh" containing:
> #!/bin/bash
> if [ "$1" = "pre" ]; then
>     qvm-run --pause --all --exclude=dom0 --exclude=sys-usb 
> --exclude=sys-firewall 
> --exclude=sys-net;
> fi
> 
> Please exclude system-vms like sys-usb, otherwise the resume of the system 
> could fail.

Interesting that you need something like this - very similar thing is
already included there (see below). Check logs about qubes-suspend
service - maybe it doesn't work on your system for some reason?

- ---------

[marmarek@dom0 ~]$ cat /usr/lib/systemd/system/qubes-suspend.service 
[Unit]
Description=Qubes suspend hooks
Before=sleep.target
StopWhenUnneeded=yes

[Service]
Type=oneshot
RemainAfterExit=yes
StandardOutput=syslog
ExecStartPre=/usr/lib64/pm-utils/sleep.d/01qubes-sync-vms-clock suspend suspend
ExecStartPre=/usr/lib64/pm-utils/sleep.d/51qubes-suspend-netvm suspend suspend
ExecStart=/usr/lib64/pm-utils/sleep.d/52qubes-pause-vms suspend suspend
ExecStop=/usr/lib64/pm-utils/sleep.d/52qubes-pause-vms resume suspend
ExecStopPost=/usr/lib64/pm-utils/sleep.d/51qubes-suspend-netvm resume suspend
ExecStopPost=/usr/lib64/pm-utils/sleep.d/01qubes-sync-vms-clock resume suspend

[Install]
WantedBy=sleep.target
[marmarek@dom0 ~]$ cat /usr/lib64/pm-utils/sleep.d/52qubes-pause-vms
#!/usr/bin/python

from qubes.qubes import QubesVmCollection,QubesException
import sys

qc = QubesVmCollection()
qc.lock_db_for_reading()
qc.load()
qc.unlock_db()

if sys.argv[1] in ["suspend", "hibernate"]:
    for vm in qc.values():
        if vm.is_running():
            try:
                vm.run_service("qubes.SuspendPreAll", user="root")
                vm.suspend()
            except Exception as e:
                print >>sys.stderr, "Failed to suspend VM %s: %s" % (vm.name, 
e.message)

elif sys.argv[1] in ["resume", "thaw"]:
    for vm in qc.values():
        if vm.get_power_state() in ["Paused", "Suspended"]:
            try:
                vm.resume()
                vm.run_service("qubes.SuspendPostAll", user="root")
            except Exception as e:
                print >>sys.stderr, "Failed to resume VM %s: %s" % (vm.name, 
e.message)


- -- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJY8PzdAAoJENuP0xzK19csgysIAJn6OXoblws4QJzUguJ8yp7c
rP5E8YgUUl6PxJIB9cHRuB1xuGQ4XQ+X/xJYBRYSGagJ6tus293WRgxlVIxSD+rV
w+ezfqqO2dIz6xQE0EpcwIkP+uMx9eIIuhPKoe4sa+CSC4nbj9+dF+yjPL+Qxprp
oOyXe3p+ascedvYlVrnK/vKT/zPSm2eYSdBivDyC6OxhIRnI0BvxQHYMBn5siG/H
WQOnwvrGGgJ+bL4+0/NcnmQOmBb0X0RLzrETSjELukKeKH5RVCMvx1tTACDmPXT2
OLwBpc1xsPoyr8XxJqSBGo+4BcgKceOWWjz8tlXrR+Sk+FVZJfMqVsgB/6TpKmU=
=k+M6
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-devel" 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-devel/20170414164622.GC1486%40mail-itl.
For more options, visit https://groups.google.com/d/optout.

Reply via email to