Bug 254458 - emulators/virtualbox-ose some versions of FreeBSD do not work, if started from a snapshot that was saved whilst the working FreeBSD guest ran
Summary: emulators/virtualbox-ose some versions of FreeBSD do not work, if started fro...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL: https://lists.freebsd.org/pipermail/f...
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-21 10:40 UTC by Graham Perrin
Modified: 2021-04-05 18:00 UTC (History)
3 users (show)

See Also:


Attachments
Screenshot, shortly after attempting ACPI shutdown (628.35 KB, image/png)
2021-03-21 10:40 UTC, Graham Perrin
no flags Details
Log (161.67 KB, text/plain)
2021-03-21 10:45 UTC, Graham Perrin
no flags Details
An export of a bugged appliance. OVF version: 2.0. (8.00 KB, application/x-tar)
2021-03-28 03:57 UTC, Graham Perrin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Perrin 2021-03-21 10:40:16 UTC
Created attachment 223470 [details]
Screenshot, shortly after attempting ACPI shutdown

FreeBSD 14.0-CURRENT host with virtualbox-ose 6.1.18. 

FreeBSD 13.0-RC3 guest with virtualbox-ose-additions 6.1.18. Other guests are similarly affected, I'm not yet sure of the scope. 

If the guest runs (is not stopped) at the time of a snapshot, then after starting from the snapshot: 

* there's no visible response to keyboard input

* in response to input from a Kensington Orbit Trackball, the on-screen pointer moves as expected, window decorations and other aspects appear OK (twm)

* if I'm lucky, Control-F2 will switch to a tty however there's blackness, no text, no visible response to keyboard input and Control-F9 might not switch back to the window manager

* ACPI shutdown does not shutdown the machine, the screen shrinks and there remains blackness with a rapidly blinking underline cursor at top left.
Comment 1 Graham Perrin 2021-03-21 10:45:58 UTC
Created attachment 223471 [details]
Log

Around seventeen minutes after attempting ACPI shutdown, I closed the window to the guest and chose to not save.
Comment 2 Graham Perrin 2021-03-21 10:55:45 UTC
Not reproducible with a Windows 10 guest that was running when I saved its state on 2021-03-09.
Comment 3 Graham Perrin 2021-03-28 03:07:06 UTC
Tentatively changing this to a FreBSD base system bug …
Comment 4 Graham Perrin 2021-03-28 03:23:58 UTC
From <https://lists.freebsd.org/pipermail/freebsd-current/2021-March/079272.html>: 

> A screen recording of 13.0-RC3 not responding to keyboard input:
> 
> <https://photos.app.goo.gl/zbmcL7B7k5v1UR1x8>
> 
> At 01:40 on the timeline, keyboard input 
> (visible with x11/screenkey in the host) has 
> no effect on the FreeBSD guest. …

(When I posted to the list, I forgot that this bug report existed. Sorry. Attempting to refine the bug, on my own, has been quite mind-bending.)

> … To anyone who's interested: find me in Matrix or IRC for #freebsd 
> and I'll let you have a copy of the file below, which can be used with 
> FreeBSD-13.0-RC3-amd64.vhd.xz
> 
> FreeBSD-13.0-RC3-amd64.vhd.ova
> 
> Thanks
Comment 5 Graham Perrin 2021-03-28 03:57:02 UTC
Created attachment 223658 [details]
An export of a bugged appliance. OVF version: 2.0.

For me, the bug was easily reproducible with 
FreeBSD-13.0-RC3-amd64.vhd.xz
from: 

<https://download.freebsd.org/ftp/releases/VM-IMAGES/13.0-RC3/amd64/Latest/>

From what I recall, these steps should make the bug reproducible: 

01. FreeBSD 14.0-CURRENT host

02. import the appliance

03. extract FreeBSD-13.0-RC3-amd64.vhd from FreeBSD-13.0-RC3-amd64.vhd.xz

04. attach the .vhd to the virtual machine

05. increase the capacity of the virtual hard disk to 32 GB

06. boot the VM in single user mode

07. <https://docs-dev.freebsd.org/en/books/handbook/disks/#disks-growing>

08. _ignore_ FreeBSD Handbook directions to disable the swap partition and 
    delete the third partition (FreeBSD no longer defaults to this layout)

09. resize the _fourth_ partition, maybe    gpart resize -i 4 -s 27G -a 4k ada0

10. _ignore_ the Handbook direction to use growfs (it does not work in 
    this context)

11. reboot in normal mode

12. observe automated growth of the UFS filesystem

13. Control-F2

14. login as root, no password

15. save the state of the running VM

16. ACPI shutdown

17. save the state of the stopped VM

18. start the saved state of the stopped VM

19. df -h

20. close, and restore the state from which you started

21. restore then start from the saved state of the running VM

22. key 'df -h' (or anything) – no response to keyboard input

23. ACPI shutdown – the VM does not stop.
Comment 6 Graham Perrin 2021-03-28 04:00:43 UTC
If this is a base system bug, it'll need a change of assignee; I can't make the change (sorry).
Comment 7 Graham Perrin 2021-03-31 17:50:53 UTC
(In reply to Graham Perrin from comment #5)

A few hours ago in IRC, someone kindly tested with: 

* Windows 7 in lieu of FreeBSD-CURRENT as the host at step (01)

* their own guest appliance in lieu of the import at step (02). 

I paraphrased an outcome: 

>> … Do I understand correctly, that you could not (secondarily) 
>> save a snapshot of a stopped FreeBSD guest after (firstly) 
>> saving a snapshot of its running state? 

> correct, with an ACPI shutdown in between.
Comment 8 Graham Perrin 2021-04-05 05:39:41 UTC
> … do not work, if started from a snapshot that was 
> saved whilst the working FreeBSD guest ran

Not reproducible with FreeBSD-13.0-RC5-amd64.vhd in VirtualBox 6.1.18 on a Windows 10 host. 

Reproducible with FreeBSD-13.0-RC5-amd64.vhd in VirtualBox 6.1.18 on FreeBSD 14.0-CURRENT.
Comment 9 Graham Perrin 2021-04-05 08:17:14 UTC
From <https://forums.freebsd.org/threads/254458-freebsd-with-virtualbox-on-freebsd-saved-states-of-running-machines-are-unusable.79668/>: 

> … Please, can anyone tell whether the bug is reproducible with a RELEASE or release candidate of FreeBSD as the host? …
Comment 10 Alexander Vereeken 2021-04-05 17:40:57 UTC
Hello,

i cannot reproduce this problem with FreeBSD 13 RC 5 amd64 as host.

Tested using an empty VHD and installed with the FreeBSD-13.0-RC5-amd64-disc1.iso.
Comment 11 Graham Perrin 2021-04-05 18:00:50 UTC
(In reply to Alexander Vereeken from comment #10)

Thanks; and (confirmed in chat) that was with VirtualBox 6.1.18 as the host