Workaround for system suspension issue for Lenovo Thinkpad L460

94 views
Skip to first unread message

moritzbr...@gmail.com

unread,
Apr 14, 2017, 12:41:39 PM4/14/17
to qubes-devel, moritz...@freenet.de
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.
Qubes-HCL-LENOVO-20FUCTO1WW-20170408-212032.yml

Marek Marczykowski-Górecki

unread,
Apr 14, 2017, 12:46:27 PM4/14/17
to moritzbr...@gmail.com, qubes-devel, moritz...@freenet.de
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
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-----

moritzbr...@gmail.com

unread,
Apr 16, 2017, 3:17:18 PM4/16/17
to qubes-devel, moritzbr...@gmail.com, moritz...@freenet.de
I'm not longer able to reproduce the problem.It seems like some update I did last week solved the problem...

Andrew Clausen

unread,
Apr 16, 2017, 3:29:39 PM4/16/17
to moritzbr...@gmail.com, qubes-devel, moritz...@freenet.de
On 16 April 2017 at 16:15, <moritzbr...@gmail.com> wrote:
I'm not longer able to reproduce the problem.It seems like some update I did last week solved the problem...

Me too, on a Lenovo X230.
 
Reply all
Reply to author
Forward
0 new messages