This is an old revision of the document!
Table of Contents
Client Resolution
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.
Step 1: Install Spice Guest Tools
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
- In your virt-manager window menu on the host, make sure View > Scale Display > Auto resize VM with window is checked.Note: XFCE sometimes requires you to manually pull a corner of the window or toggle Fullscreen (F11) once after logging in to trigger the first dynamic resize.
- On the client menu go to settings > Display and set the proper resolution
Step 2: Fix LightDM Login Screen Resolution
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: <code> … [Seat:*] … display-setup-script=xrandr –output Virtual-1 –mode 1920×1080 </code> (Replace Virtual-1 with your actual output name and 1920×1080 with your desired target resolution). Save file and restart the client. ===== Step 3: Optimize Virt-Manager Hardware Settings ===== (If still limited)If you cannot select higher resolutions inside XFCE's Settings > Display, you may need to adjust the virtual hardware layout
