echo 'ACTION=="change",KERNEL=="card0", SUBSYSTEM=="drm", RUN+="/usr/local/bin/x-resize" ' | sudo tee /etc/udev/rules.d/50-x-resize.rules
sudo mkdir /var/log/autores
sudo curl "https://gist.githubusercontent.com/3lpsy/4cc344ae031bf77595991c536cbd3275/raw/4965f04913626eb94485a5e6a67938b16c16b6e0/x-resize" -o /usr/local/bin/x-resize
sudo chmod +x /usr/local/bin/x-resize
sudo udevadm control --reload-rules
sudo systemctl enable --now spice-vdagentd
sudo apt install -y qemu-guest-agent spice-vdagent xserver-xspice xserver-xorg-video-qxl x11-xserver-utils || sudo dnf install qemu-guest-agent spice-vdagent spice-server xorg-x11-drv-qxl xrandr -y

https://gist.github.com/3lpsy/4cc344ae031bf77595991c536cbd3275

https://dannyda.com/2020/10/22/how-to-fix-cant-resize-kali-linux-vm-scr…

https://forum.proxmox.com/threads/spice-vdagent-not-resizing-screen-res…

https://superuser.com/questions/1183834/no-auto-resize-with-spice-and-v…