I am running Kubuntu 17.04 with 5.10.5 and 5.37 and when a VirtualBox guest with Windows 10 is in the foreground the screen is not locked when I close my lid and then reopen it. In this case I do not need to enter my password. In other cases the screen is locked when I reopen the lid.
Does VirtualBox hold a grab for the keyboard?
Yes, VirtualBox does hold a grab.
Long standing issue with X11, fixed on Wayland. A lock screen does not work if another window holds the grab.
OK, thanks for the info. Then I will have to live with it for some time until KDE is Wayland - do you know when it would be ready?