Thinking about how best to solve this, maybe you move update- alternatives --install/--remove calls into a start/stop actions service triggered by detection of the appropriate environment, instead of the package postinst/prerm? I think you should be able to do it with a systemd unit that has WantedBy=graphical.target, Before=graphical.target, and ConditionVirtualization=oracle.
That (as long as those alternative links are left on --auto) should yield that VM image can just "do the right thing" based on what hardware it finds itself on, though it would still be a little messy in handling an unclean shutdown (you could start up with stale links still present). Probably not a big deal, since most reasonable use cases are authoring an image customers might launch different hosts, not actually migrating a dirty disk image around. ** Changed in: virtualbox (Ubuntu) Status: Incomplete => New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1762491 Title: No graphics after update, caused by virtualbox To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1762491/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs