Under qeum-kvm / virt-manager, how to add custom resolution

With Fedora-Everything-netinst-x86_64-38-20230217.n.0 , install Workstation using virt-manager.

As I have one monitor physically rotated 90deg using 1280x1920 resolution, I would like the F38 guest with virt-manager able to using that resolution as well.

Continuing the discussion from How to set custom resolution in Fedora, with VGA-DVI set up?:

After finding this thread, I install wlr-randr, but got “failed to connect to display” .

Is it possible for Guests using rotated 90deg resolutions?

I thought the guest would auto-detect the right resolution? But if not, maybe you can force what you want on the kernel command line?

https://wiki.archlinux.org/title/kernel_mode_setting#Forcing_modes

It works for me basically OOTB like this:

# Guest
sudo dnf install spice-vdagent
sudo systemctl restart spice-vdagentd.service
systemctl --user restart spice-vdagent.service

# Host
> virsh list
 Id   Name     State
------------------------
 1    fedora   running

> virsh dumpxml fedora --xpath //video
<video>
  <model type="virtio" heads="1" primary="yes">
    <acceleration accel3d="no"/>
  </model>
  <alias name="video0"/>
  <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
</video>

> virsh dumpxml fedora --xpath //graphics
<graphics type="spice">
  <listen type="none"/>
  <image compression="off"/>
  <gl enable="no"/>
</graphics>

No. No autodetect.

Following your link,

$ for p in /sys/class/drm/*/status; do con=${p%/status}; echo -n "${con#*/card?-}: "; cat $p; done

Virtual-1 connected

Then I added this to kernel command line:
video=Virtual-1:768x1024

At the second stage of boot, text console changed to 768x1024. Once GUI mode is activated, it changed back to Wide format. After logon to, resolution used is 1280 x 800 . But, 768x1024 is now available in Display Settings. And chaning to 768x1024 works.

Thank you very much!

Further Google Search, got this article:

The same idea as the Arch article.

# virsh dumpxml f38-eb-0217-0 --xpath //graphics
<graphics type="spice">
  <listen type="none"/>
  <image compression="off"/>
</graphics>

[root@fedora fcc]# virsh dumpxml f38-eb-0217-0 --xpath //video
<video>
  <model type="virtio" heads="1" primary="yes">
    <acceleration accel3d="no"/>
  </model>
  <alias name="video0"/>
  <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
</video>

I changed the Guest config like the above. Still no Tall resolutions listed.

I only have 1 active physical monitor with 1200x1920 mode when tested.

The exact resolution might not be listed, but it should change automatically based on the size of the graphical console window:
Virtual Machine Manager > VM > View > Scale Display > Auto resize VM with window > Enable

I got what you mean.

Yes, out of the box Fedora guests works out of the box using:
Virtual Machine Manager > VM > View > Scale Display > Auto resize VM with window > Enable

Although the particular resolution is not listed under Gnome’s Display Settings.

Thank you very much!