Lachu
June 8, 2021, 5:46pm
1
I install (on virtual machine) opensuse tumbleweed twice. Host is OpenSUSE Tumblewed. On my (VM) setup, I set different swap partition to each system. I also tries arch linux. In each scenario, I cannot wakeup system - it normally boot. I checked resume= is properly set and it is. Also, on real hardware (similar partition/system setup, but different components), hibernation do not work. The same problem.
I will attach hardware information in near future (XML file with machine settings and I will copy data from information center/Plasma5).
I wrote the post before gathering information to asks it is supposed hibernation do not worked on VM and on different OS.
Lachu
June 11, 2021, 2:00pm
2
Real Hardware:
Operating System: openSUSE Tumbleweed 20210524
KDE Plasma Version: 5.21.5
KDE Frameworks Version: 5.82.0
Qt Version: 5.15.2
Kernel Version: 5.12.4-1-default
OS Type: 64-bit
Graphics Platform: X11
Processors: 2 × Intel® Celeron® CPU E3300 @ 2.50GHz
Memory: 1.9 GiB of RAM
Graphics Processor: Mesa DRI Intel® G33
VM:
<domain type="kvm">
<name>Gamming-OS-Old</name>
<uuid>27827591-d57c-4097-a176-b3b522e967da</uuid>
<metadata>
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<libosinfo:os id="http://opensuse.org/opensuse/tumbleweed"/>
</libosinfo:libosinfo>
</metadata>
<memory unit="KiB">2097152</memory>
<currentMemory unit="KiB">2097152</currentMemory>
<vcpu placement="static">2</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch="x86_64" machine="pc-q35-4.2">hvm</type>
</os>
<features>
<acpi/>
<apic/>
<vmport state="off"/>
</features>
<cpu mode="custom" match="exact" check="partial">
<model fallback="forbid">Skylake-Client-IBRS</model>
<vendor>Intel</vendor>
<feature policy="require" name="ss"/>
<feature policy="require" name="vmx"/>
<feature policy="require" name="pdcm"/>
<feature policy="require" name="hypervisor"/>
<feature policy="require" name="tsc_adjust"/>
<feature policy="require" name="clflushopt"/>
<feature policy="require" name="umip"/>
<feature policy="require" name="md-clear"/>
<feature policy="require" name="stibp"/>
<feature policy="require" name="arch-capabilities"/>
<feature policy="require" name="ssbd"/>
<feature policy="require" name="xsaves"/>
<feature policy="require" name="pdpe1gb"/>
<feature policy="require" name="ibpb"/>
<feature policy="require" name="amd-stibp"/>
<feature policy="require" name="amd-ssbd"/>
<feature policy="require" name="skip-l1dfl-vmentry"/>
<feature policy="require" name="pschange-mc-no"/>
<feature policy="disable" name="hle"/>
<feature policy="disable" name="rtm"/>
</cpu>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
<timer name="hpet" present="no"/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<pm>
<suspend-to-mem enabled="no"/>
<suspend-to-disk enabled="no"/>
</pm>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type="file" device="cdrom">
<driver name="qemu" type="raw"/>
<target dev="sda" bus="sata"/>
<readonly/>
<boot order="1"/>
<address type="drive" controller="0" bus="0" target="0" unit="0"/>
</disk>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2"/>
<source file="/stary-system/var/lib/libvirt/images/opensusetumbleweed.qcow2"/>
<backingStore/>
<target dev="sdb" bus="sata"/>
<boot order="2"/>
<address type="drive" controller="0" bus="0" target="0" unit="1"/>
</disk>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2"/>
<source file="/zamiast-winshita/Maszyny/OpenSUSEForGamming.qcow2"/>
<target dev="sdc" bus="sata"/>
<address type="drive" controller="0" bus="0" target="0" unit="2"/>
</disk>
<controller type="usb" index="0" model="qemu-xhci" ports="15">
<address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0"/>
</controller>
<controller type="sata" index="0">
<address type="pci" domain="0x0000" bus="0x00" slot="0x1f" function="0x2"/>
</controller>
<controller type="pci" index="0" model="pcie-root"/>
<controller type="pci" index="1" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="1" port="0x10"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0" multifunction="on"/>
</controller>
<controller type="pci" index="2" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="2" port="0x11"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x1"/>
</controller>
<controller type="pci" index="3" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="3" port="0x12"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x2"/>
</controller>
<controller type="pci" index="4" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="4" port="0x13"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x3"/>
</controller>
<controller type="pci" index="5" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="5" port="0x14"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x4"/>
</controller>
<controller type="pci" index="6" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="6" port="0x15"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x5"/>
</controller>
<controller type="pci" index="7" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="7" port="0x16"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x6"/>
</controller>
<controller type="pci" index="8" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="8" port="0x17"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x7"/>
</controller>
<controller type="pci" index="9" model="pcie-to-pci-bridge">
<model name="pcie-pci-bridge"/>
<address type="pci" domain="0x0000" bus="0x07" slot="0x00" function="0x0"/>
</controller>
<controller type="virtio-serial" index="0">
<address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
</controller>
<controller type="scsi" index="0" model="lsilogic">
<address type="pci" domain="0x0000" bus="0x09" slot="0x01" function="0x0"/>
</controller>
<interface type="network">
<mac address="52:54:00:f7:47:00"/>
<source network="default"/>
<model type="virtio"/>
<address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
</interface>
<serial type="pty">
<target type="isa-serial" port="0">
<model name="isa-serial"/>
</target>
</serial>
<console type="pty">
<target type="serial" port="0"/>
</console>
<channel type="unix">
<target type="virtio" name="org.qemu.guest_agent.0"/>
<address type="virtio-serial" controller="0" bus="0" port="1"/>
</channel>
<channel type="spicevmc">
<target type="virtio" name="com.redhat.spice.0"/>
<address type="virtio-serial" controller="0" bus="0" port="2"/>
</channel>
<input type="tablet" bus="usb">
<address type="usb" bus="0" port="1"/>
</input>
<input type="mouse" bus="ps2"/>
<input type="keyboard" bus="ps2"/>
<graphics type="spice">
<listen type="none"/>
<image compression="off"/>
<gl enable="no"/>
</graphics>
<sound model="ich9">
<address type="pci" domain="0x0000" bus="0x00" slot="0x1b" function="0x0"/>
</sound>
<audio id="1" type="spice"/>
<video>
<model type="virtio" heads="1" primary="yes">
<acceleration accel3d="no"/>
</model>
<address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
</video>
<hostdev mode="subsystem" type="usb" managed="yes">
<source>
<vendor id="0x125f"/>
<product id="0xdc1a"/>
</source>
<address type="usb" bus="0" port="4"/>
</hostdev>
<redirdev bus="usb" type="spicevmc">
<address type="usb" bus="0" port="2"/>
</redirdev>
<redirdev bus="usb" type="spicevmc">
<address type="usb" bus="0" port="3"/>
</redirdev>
<memballoon model="virtio">
<address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
</memballoon>
<rng model="virtio">
<backend model="random">/dev/urandom</backend>
<address type="pci" domain="0x0000" bus="0x06" slot="0x00" function="0x0"/>
</rng>
</devices>
</domain>
有点不明白
The host doesn’t resume or the virtual machine?
Sometimes it takes a little bit time
Hibernation is restricted if secure boot is turned on.
dmesg | grep -i hiber
Lachu
June 22, 2021, 3:43pm
5
>dmesg | grep -i hiber
3.373710] systemd[1]: Created slice system-systemd\x2dhibernate\x2dresume.slice
Hibernation is disabled by default in Tumbleweed.
Look at this similar thread for more information https://forums.opensuse.org/showthread.php/555820-Hibernation-Sleep-Configuration
Lachu
July 5, 2021, 6:56pm
7
It woks on real hardware, but today I’ve decided to made the same steps on VM. When going from hibernation, there is black screen only.
You may have better chances asking in the Virtualization subforum, but I think that with a VM it is better to take a snapshot of the VM status and then resume from that.
Lachu
July 6, 2021, 1:55pm
9
I known this, but not for my problem . I am trying to create a platform (hardware + OS), but most important part will be software, so I must test solutions-around-hibernation.
Lachu:
I known this, but not for my problem . I am trying to create a platform (hardware + OS), but most important part will be software, so I must test solutions-around-hibernation.
Enable persistent journal in the VM by editing /etc/systemd/journald.conf so that it reads:
[Journal]
Storage=persistent
Then if you get a black screen and are forced to reboot you may see if the journal recorded something meaningful at the time of hibernation in the previous boot by:
journalctl -b -1
Lachu
August 3, 2021, 5:44pm
11
Message tells, there vga arbiter is started during boot, but next vesafb was loaded.
I found systemd cannot start virtual console. Message tells:
Dependency failed for dracut asks for additional cmdline parameters.
dracut-cmdline-ask.service: job dracut-cmdline-ask.service/start failed with result: dependency.
/usr/bin/loadkeys failed with exit status 1.
Lachu:
Message tells, there vga arbiter is started during boot, but next vesafb was loaded.
I found systemd cannot start virtual console. Message tells:
Dependency failed for dracut asks for additional cmdline parameters.
dracut-cmdline-ask.service: job dracut-cmdline-ask.service/start failed with result: dependency.
/usr/bin/loadkeys failed with exit status 1.
Please post the result of:
dmesg | egrep "Command line|Activating swap"
(on the running system, that is before hibernating).
vesafb is a backup driver, but it should offer a virtual terminal and command prompt at least… not simply a black screen, so there is something else going on.
Lachu
August 4, 2021, 2:23pm
13
Everything looks normal.
0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-5.5.11-1-default root=UUID=1b94e5bc-2eed-41fd-9241-4947c3357f0c splash=silent resume=/dev/sda5 quiet mitigations=auto
0.158545] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.5.11-1-default root=UUID=1b94e5bc-2eed-41fd-9241-4947c3357f0c splash=silent resume=/dev/sda5 quiet mitigations=auto
23.005272] systemd[1]: Activating swap /dev/disk/by-uuid/bb6f804e-b910-44f0-afea-917093fe9f64...
Are you sure that /dev/sda5 and /dev/disk/by-uuid/bb6f804e-b910-44f0-afea-917093fe9f64 are pointing to the same partition? Is that the VM setting or the real HW setting? Which of the two are you referring to in the last few posts?
Reviewing the VM settings you posted in post #2 I see:
<disk type="file" device="cdrom">
<driver name="qemu" type="raw"/>
<target dev="sda" bus="sata"/>
<readonly/>
<boot order="1"/>
<address type="drive" controller="0" bus="0" target="0" unit="0"/>
</disk>
so I doubt that /dev/sda5 is a swap partition in the VM, since in the VM config “sda” is supposed to be a “readonly cdrom” (unless you changed the configuration meanwhile).
And a few lines before that, I read:
<pm>
<suspend-to-mem enabled="no"/>
<suspend-to-disk enabled="no"/>
</pm>
so little surprise that hibernating on the VM doesn’t work.
It’s really hard to help you if we cannot deal with one problem at a time and I still think that questions related to the VM have better chance of being answered in the Virtualization subforum.
Lachu
August 4, 2021, 7:38pm
15
From running VM:
> LANG=C stat /dev/disk/by-uuid/bb6f804e-b910-44f0-afea-917093fe9f64
File: /dev/disk/by-uuid/bb6f804e-b910-44f0-afea-917093fe9f64 -> ../../sda5
Size: 10 Blocks: 0 IO Block: 4096 symbolic link
Device: 6h/6d Inode: 15510 Links: 1
Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2021-08-04 19:37:29.586587272 +0200
Modify: 2021-08-04 19:34:23.952000000 +0200
Change: 2021-08-04 19:34:23.952000000 +0200
Birth: -
> LANG=C stat /dev/sda5
File: /dev/sda5
Size: 0 Blocks: 0 IO Block: 4096 block special file
Device: 6h/6d Inode: 1261 Links: 1 Device type: 8,5
Access: (0660/brw-rw----) Uid: ( 0/ root) Gid: ( 487/ disk)
Access: 2021-08-04 19:34:23.952000000 +0200
Modify: 2021-08-04 19:34:23.952000000 +0200
Change: 2021-08-04 19:34:23.952000000 +0200
Birth: -
On real hardware everything works for now.
Nice to read it works on real HW, so the basic Tumbleweed config is sound.
So you have a problem in the VM, but this is no surprise since (… I repeat) in the config you posted in post #2 I read :
<pm>
<suspend-to-mem **enabled="no"/**>
<suspend-to-disk **enabled="no"**/>
</pm>
You need something like the following instead:
<pm>
<suspend-to-mem enabled='yes'/>
<suspend-to-disk enabled='yes'/>
</pm>
Now I’m not a KVM user nor a virtualization expert, but reading e.g. this RedHat bug it looks like you need to add to your QEMU command line something like:
-global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 \
Maybe there are other means to the same effect, but you need a KVM expert if you cannot find your way out of it.
Lachu
August 6, 2021, 7:21pm
17
I remember there exist possibility to set an additional QEmu parameters in libvirt GUI, but cannot find this feature.
Lachu
August 11, 2021, 3:31pm
18
My VM configuration looks like this now:
<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">
<name>Gamming-OS-Old</name>
<uuid>27827591-d57c-4097-a176-b3b522e967da</uuid>
<metadata>
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<libosinfo:os id="http://opensuse.org/opensuse/tumbleweed"/>
</libosinfo:libosinfo>
</metadata>
<memory unit="KiB">2097152</memory>
<currentMemory unit="KiB">2097152</currentMemory>
<vcpu placement="static">2</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch="x86_64" machine="pc-q35-4.2">hvm</type>
</os>
<features>
<acpi/>
<apic/>
<vmport state="off"/>
</features>
<cpu mode="custom" match="exact" check="partial">
<model fallback="forbid">Skylake-Client-IBRS</model>
<vendor>Intel</vendor>
<feature policy="require" name="ss"/>
<feature policy="require" name="vmx"/>
<feature policy="require" name="pdcm"/>
<feature policy="require" name="hypervisor"/>
<feature policy="require" name="tsc_adjust"/>
<feature policy="require" name="clflushopt"/>
<feature policy="require" name="umip"/>
<feature policy="require" name="md-clear"/>
<feature policy="require" name="stibp"/>
<feature policy="require" name="arch-capabilities"/>
<feature policy="require" name="ssbd"/>
<feature policy="require" name="xsaves"/>
<feature policy="require" name="pdpe1gb"/>
<feature policy="require" name="ibpb"/>
<feature policy="require" name="amd-stibp"/>
<feature policy="require" name="amd-ssbd"/>
<feature policy="require" name="skip-l1dfl-vmentry"/>
<feature policy="require" name="pschange-mc-no"/>
<feature policy="disable" name="hle"/>
<feature policy="disable" name="rtm"/>
</cpu>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
<timer name="hpet" present="no"/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<pm>
<suspend-to-mem enabled="yes"/>
<suspend-to-disk enabled="yes"/>
</pm>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type="file" device="cdrom">
<driver name="qemu" type="raw"/>
<target dev="sda" bus="sata"/>
<readonly/>
<boot order="1"/>
<address type="drive" controller="0" bus="0" target="0" unit="0"/>
</disk>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2"/>
<source file="/stary-system/var/lib/libvirt/images/opensusetumbleweed.qcow2"/>
<backingStore/>
<target dev="sdb" bus="sata"/>
<boot order="2"/>
<address type="drive" controller="0" bus="0" target="0" unit="1"/>
</disk>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2"/>
<source file="/zamiast-winshita/Maszyny/OpenSUSEForGamming.qcow2"/>
<target dev="sdc" bus="sata"/>
<address type="drive" controller="0" bus="0" target="0" unit="2"/>
</disk>
<controller type="usb" index="0" model="qemu-xhci" ports="15">
<address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0"/>
</controller>
<controller type="sata" index="0">
<address type="pci" domain="0x0000" bus="0x00" slot="0x1f" function="0x2"/>
</controller>
<controller type="pci" index="0" model="pcie-root"/>
<controller type="pci" index="1" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="1" port="0x10"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0" multifunction="on"/>
</controller>
<controller type="pci" index="2" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="2" port="0x11"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x1"/>
</controller>
<controller type="pci" index="3" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="3" port="0x12"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x2"/>
</controller>
<controller type="pci" index="4" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="4" port="0x13"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x3"/>
</controller>
<controller type="pci" index="5" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="5" port="0x14"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x4"/>
</controller>
<controller type="pci" index="6" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="6" port="0x15"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x5"/>
</controller>
<controller type="pci" index="7" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="7" port="0x16"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x6"/>
</controller>
<controller type="pci" index="8" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="8" port="0x17"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x7"/>
</controller>
<controller type="pci" index="9" model="pcie-to-pci-bridge">
<model name="pcie-pci-bridge"/>
<address type="pci" domain="0x0000" bus="0x07" slot="0x00" function="0x0"/>
</controller>
<controller type="virtio-serial" index="0">
<address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
</controller>
<controller type="scsi" index="0" model="lsilogic">
<address type="pci" domain="0x0000" bus="0x09" slot="0x01" function="0x0"/>
</controller>
<interface type="network">
<mac address="52:54:00:f7:47:00"/>
<source network="default"/>
<model type="virtio"/>
<address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
</interface>
<serial type="pty">
<target type="isa-serial" port="0">
<model name="isa-serial"/>
</target>
</serial>
<console type="pty">
<target type="serial" port="0"/>
</console>
<channel type="unix">
<target type="virtio" name="org.qemu.guest_agent.0"/>
<address type="virtio-serial" controller="0" bus="0" port="1"/>
</channel>
<channel type="spicevmc">
<target type="virtio" name="com.redhat.spice.0"/>
<address type="virtio-serial" controller="0" bus="0" port="2"/>
</channel>
<input type="tablet" bus="usb">
<address type="usb" bus="0" port="1"/>
</input>
<input type="mouse" bus="ps2"/>
<input type="keyboard" bus="ps2"/>
<graphics type="spice">
<listen type="none"/>
<image compression="off"/>
<gl enable="no"/>
</graphics>
<sound model="ich9">
<address type="pci" domain="0x0000" bus="0x00" slot="0x1b" function="0x0"/>
</sound>
<audio id="1" type="spice"/>
<video>
<model type="virtio" heads="1" primary="yes">
<acceleration accel3d="no"/>
</model>
<address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
</video>
<redirdev bus="usb" type="spicevmc">
<address type="usb" bus="0" port="2"/>
</redirdev>
<redirdev bus="usb" type="spicevmc">
<address type="usb" bus="0" port="3"/>
</redirdev>
<memballoon model="virtio">
<address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
</memballoon>
<rng model="virtio">
<backend model="random">/dev/urandom</backend>
<address type="pci" domain="0x0000" bus="0x06" slot="0x00" function="0x0"/>
</rng>
</devices>
<qemu:commandline>
<qemu:arg value="-global"/>
<qemu:arg value=" PIIX4_PM.disable_s3=0"/>
<qemu:arg value="-global"/>
<qemu:arg value="PIIX4_PM.disable_s4=0"/>
</qemu:commandline>
</domain>
I added XML namespace for qemu XML application (language) and added command line bellow.
The same result.
This is a QEMU problem: to get help on that you should open a thread in the Virtualization subforum with a catching title, something like “Configuring QEMU guest for suspend/hibernate”, to attract the attention of experts there.
You may link this discussion to avoid telling the whole story.