You are not logged in.
I have Arch Linux (kernel 6.16.7-arch1-1) installed on VirtualBox 7.1.12 r169651 with the LXQt desktop environment. It worked fine for a few days, but after that, the automatic screen resize stopped working.
As a workaround, I checked the VirtualBox logs and found that resize events were being sent repeatedly but ignored by the guest system. For example:
02:07:21.638437 VMMDev: SetVideoModeHint: Got a video mode hint (1024x965x32)@(0x0),(1;0) at 0
02:07:21.639236 GUI: UIMediumEnumerator: Medium-enumeration finished!
02:07:21.645153 GUI: UIMachineView::sltPerformGuestResize: Omitting to send size-hint 1024x965 to guest-screen 0 because this hint was previously sent.
02:07:21.654891 GUI: UIMachineView::sltPerformGuestResize: Omitting to send size-hint 1024x965 to guest-screen 0 because this hint was previously sent.
02:07:21.664796 GUI: UIMachineView::sltPerformGuestResize: Omitting to send size-hint 1024x965 to guest-screen 0 because this hint was previously sent.
02:07:21.673522 GUI: UIMachineView::sltPerformGuestResize: Omitting to send size-hint 1024x965 to guest-screen 0 because this hint was previously sent.
To fix this, I created a udev rule that triggers a script on each relevant event:
SUBSYSTEM=="drm", ACTION=="change", KERNEL=="card0", RUN+="/home/pacman/drm-script.sh"
The script forces a screen resize and includes a cooldown to avoid rapid repeated execution: (looks like a spam of events hehe)
#!/bin/bash
export XAUTHORITY=/home/pacman/.Xauthority
export DISPLAY=:0
COOLDOWN_FILE="/tmp/drm_event_cooldown"
COOLDOWN_SECONDS=1
CURRENT_TIME=$(date +%s)
if [ -f "$COOLDOWN_FILE" ]; then
LAST_RUN=$(cat "$COOLDOWN_FILE")
DIFF=$((CURRENT_TIME - LAST_RUN))
if [ "$DIFF" -lt "$COOLDOWN_SECONDS" ]; then
exit 0
fi
fi
echo "$CURRENT_TIME" > "$COOLDOWN_FILE"
logger "DRM card0 change event detected at $(date)"
RESOLUTION=$(xrandr | grep -A1 "^Virtual-1 connected" | tail -n1 | awk '{print $1}')
xrandr --output Virtual-1 --mode "$RESOLUTION" >> /tmp/urLogFile 2>&1
touch /home/pacman/Desktop/scriptworkedhauhuahua.txt
exit 0
With this setup, auto-resize works perfectly fine and faster than before. However, it feels a bit complicated and unnecessary.
Is there a simpler, more elegant solution to fix this issue?
Last edited by pacmanVT (2025-09-19 21:15:30)
Offline
https://wiki.archlinux.org/title/Virtua … t_services
Is "VBoxClient --vmsvga" running?
Offline