Skip to content

Instantly share code, notes, and snippets.

@whi-tw
Last active April 14, 2024 14:54
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whi-tw/30878179fffd9b994cc978beb894bd9b to your computer and use it in GitHub Desktop.
Save whi-tw/30878179fffd9b994cc978beb894bd9b to your computer and use it in GitHub Desktop.
UTM dynamic resolution fix (workaround)

Steps

  1. mkdir /opt/utm-resolution-fix/
  2. cp watch-and-fix.sh /opt/utm-resolution-fix/watch-and-fix.sh
  3. chmod +x /opt/utm-resolution-fix/watch-and-fix.sh
  4. cp utm-resolution-fix.service /etc/systemd/user/utm-resolution-fix.service
  5. systemctl --user daemon-reload
  6. systemctl --user enable --now utm-resolution-fix.service

Now, resizing the UTM window should actually resize the guest automatically.

[Unit]
Description=Watch for SPICE errors and resize display
[Service]
Type=simple
Restart=always
RestartSec=1
Environment=DISPLAY=:0
ExecStart=/opt/utm-resolution-fix/watch-and-fix.sh
[Install]
WantedBy=default.target
#!/usr/bin/env bash
journalctl -fu spice-vdagentd -g 'invalid message size for VDAgentMonitorsConfig' -n0 |\
while read line; do
echo "window changed, resizing"
xrandr --output Virtual-1 --auto
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment