To fix or automate the display resolution for an XFCE guest using LightDM inside virt-manager (QEMU/KVM), you generally need to address two distinct parts: the LightDM login screen and the XFCE user desktop session.
This enables Auto-Resizing for your desktop environment to automatically match your virt-manager window size, you must have the guest agent installed and running inside the virtual machine.
# apt install spice-vdagent qemu-guest-agent # systemctl enable --now spice-vdagentd
The LightDM login screen loads before your XFCE session profile, which often makes it fallback to a tiny default resolution (like 800×600). You can force it to a specific size using xrandr. Find out the display output name of your virtual monitor. Run this in a terminal inside the VM:
xrandr
Look for the connected device name. In virt-manager, it is usually Virtual-1 (or Virtual-0, VGA-1). Open the LightDM configuration file:
# nano /etc/lightdm/lightdm.conf
Scroll down or search (Ctrl + W) for the [Seat:*] section. Look for the display-setup-script line. Uncomment it (remove the #) and add your targeted xrandr command. For example, to force a 1920×1080 resolution:
... [Seat:*] ... display-setup-script=xrandr --output Virtual-1 --mode 1920x1080
(Replace Virtual-1 with your actual output name and 1920×1080 with your desired target resolution). Save file and restart the client.
(If still limited)If you cannot select higher resolutions inside XFCE's Settings > Display, you may need to adjust the virtual hardware layout:
If XFCE forgets your resolution on reboot despite spice-vdagent running, you can force it into your user profile via XFCE Autostart:
With these configurations in place, LightDM will scale elegantly on startup, and your XFCE desktop will automatically expand to match your host monitor. If your screen stays black or fails to register changes, let me know your Linux host/guest distribution and the exact Video model type you selected in virt-manager!