Re: Kvm virtual machine uses virtio graphics card, the rotating screen is stuck

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 23, 2021 at 03:49:28PM +0800, Jason Wang wrote:
> On Tue, Nov 23, 2021 at 3:00 PM 苟浩 <gouhao@xxxxxxxxxxxxx> 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")

_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization




[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux