Manual Implementation of Auto Resizing For Non-Gnome Environments (like XFCE) running under Spice/Libvirt

echo 'ACTION=="change",KERNEL=="card0", SUBSYSTEM=="drm", RUN+="/usr/local/bin/x-resize" ' | sudo tee /etc/udev/rules.d/50-x-resize.rules
sudo mkdir /var/log/autores
sudo curl "https://gist.githubusercontent.com/3lpsy/4cc344ae031bf77595991c536cbd3275/raw/4965f04913626eb94485a5e6a67938b16c16b6e0/x-resize" -o /usr/local/bin/x-resize
sudo chmod +x /usr/local/bin/x-resize
sudo udevadm control --reload-rules
sudo systemctl enable --now spice-vdagentd

criação de utilizador com home na ram

useradd aluno -m -d /dev/shm/aluno -c 'Utilizador aluno' -s /bin/bash
nano /etc/systemd/system/mkhomedir_helper.service

e introduzir o texto

[Unit]
Description=Run mkhomedir_helper to generate the /home from /etc/skel.
[Service]
ExecStart=/usr/sbin/mkhomedir_helper aluno
[Install]
WantedBy=graphical.target

ativar o serviço:
systemctl enable --now mkhomedir_helper

Subscrever