VMs are an easy copout to a problem that shouldn't be a problem in the first place.
There's never a need to mess with root access -- not even to install headers/dev packages. Dev tools and compilers can also be made to look to custom locations. I mean, there's never a need aside from self-imposed limitations our OSes and tooling places upon us.
Nothing inherently complex: just tons of accidental complexity.
Those things are only hard because we never did any coordinated effort to fix them.