Why is my Ubuntu build laggy when moving windows?
You didnt mention what virtual machine software you are using. More than likely running the virtual machine at 4K resolution is using all the video memory assigned to it. If possible, assign more video memory. Depending on your hypervisor, you can try enabling/disabling 2D/3D acceleration to find an optimal setting.
I've seen similar issues in XFCE with very slow window moving & resizing, when not using a discrete video card (onboard video). It's likely related to your virtualization software & hardware integration, as Keltari mentions. Try running [X]Ubuntu directly (outside of Windows, without virtualization) to get an idea of the "best case scenario" performance.
Enabling display compositing should help, though it uses a little more resources. It's in Settings, Window Manager Tweaks, Compositor:
A workaround is to hide the contents of windows when moving & resizing them. Strangely, if using display compositing, then hiding window contents when resizing again makes it very slow (at least for me). In XFCE it's in the red box in the Window Manager settings: