How to enable auto resizing guest display on VirtualBox?

I’ve downloaded official OVA file and try to set up NixOS on virtual machine.

One of the things I need is auto adjusting screen size to the size of screen of my host machine. As far as I know, I need to have VirtualBox Guest Additions for that. I found that I can enable it this way: https://nixos.wiki/wiki/VirtualBox

{
  virtualisation.virtualbox.guest.enable = true;
  virtualisation.virtualbox.guest.x11 = true;
}

But when I do that, then run sudo nixos-rebuild switch (which completes successfully, but does not change in terms of screen resolution) and reboot virtual machine, here is what I see:

end Kernel panc - not syncing: Attempted to kill init!

How can I solve this?