Jason Wang
2021-Nov-23 07:49 UTC
Kvm virtual machine uses virtio graphics card, the rotating screen is stuck
On Tue, Nov 23, 2021 at 3:00 PM ?? <gouhao at uniontech.com> wrote:> > Hello, > > I use `xrandr -o left` to rotate the screen in the kvm virtual machine. > When configured as a Virtio graphics card, the screen will freeze after rotating the screen, and the keyboard and mouse will not respond. > When configured as a VGA graphics card, it is normal after rotating the screen. > > Is the Virtio graphics card not supporting rotating?Adding list and Gerd for the answer. Thanks> > > Thanks!
Gerd Hoffmann
2021-Nov-23 08:20 UTC
Kvm virtual machine uses virtio graphics card, the rotating screen is stuck
On Tue, Nov 23, 2021 at 03:49:28PM +0800, Jason Wang wrote:> On Tue, Nov 23, 2021 at 3:00 PM ?? <gouhao at uniontech.com> wrote: > > > > Hello, > > > > I use `xrandr -o left` to rotate the screen in the kvm virtual machine. > > When configured as a Virtio graphics card, the screen will freeze after rotating the screen, and the keyboard and mouse will not respond. > > When configured as a VGA graphics card, it is normal after rotating the screen. > > > > Is the Virtio graphics card not supporting rotating? > > Adding list and Gerd for the answer.Hmm dunno. Never tried that. Can't see an obvious reason why virtio should show different behavior than stdvga, so probably a bug somewhere. I'm wondering why you want rotate the screen in the first place though. You can add any resolution you want using xrandr, including portrait modes like 768x1024 ... take care, Gerd ----------------------------- cut here ------------------------ #!/bin/sh width="$1" height="$2" if test "$width" = "" -o "$height" = ""; then echo "usage: $0 width height" exit 1 fi output=$(xrandr --query | awk '/ connected/ { print $1; exit }') mode="${width}x${height}" echo "# setting mode $mode on output $output" if xrandr --query | grep -q -e " $mode "; then true # mode already there else modeline=$(cvt $width $height | grep Modeline | cut -d" " -f3-) (set -x; xrandr --newmode "$mode" $modeline; xrandr --addmode "$output" "$mode") fi (set -x; xrandr --output "$output" --mode "$mode")