====== 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 800x600). 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 1920x1080 resolution: ... [Seat:*] ... display-setup-script=xrandr --output Virtual-1 --mode 1920x1080 (Replace Virtual-1 with your actual output name and 1920x1080 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: - Shut down the virtual machine. - Open the VM's hardware details window (the Lightbulb icon in virt-manager). - Select the Video device: - Recommended Layout: Set the model to Virtio (with 3D Acceleration disabled if XFCE experiences black screen bugs) or QXL. - RAM Allocation: If using higher resolutions (like 1440p or 4K), increase the Video RAM or vgamem value from 16MB to 64MB or 128MB to ensure the virtual framebuffer can support the pixel density. - Make sure your Display device is set to Spice server. - Boot the VM ===== Step 4: Fallback Script for Sticky XFCE Resizing ===== If XFCE forgets your resolution on reboot despite spice-vdagent running, you can force it into your user profile via XFCE Autostart: * Open Applications Menu > Settings > Session and Startup. * Go to the Application Autostart tab. * Click the + Add button. * Fill in the prompt: * Name: Force Resolution * Command: xrandr --output Virtual-1 --mode 1920x1080 (adjust to match your setup) * Click OK. 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!