Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Almost Solved] QEmu and Windows 10 Guest Resize display
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1579
Location: Adelaide/Australia

PostPosted: Sat Nov 18, 2023 9:38 am    Post subject: [Almost Solved] QEmu and Windows 10 Guest Resize display Reply with quote

Hi,
I am fiddling with migrating from VirtualBox to QEmu.
I have converted 2 existing Win10 VirtualBox machines to QEmu and they boot just fine.
I connect using the 'spice' client rather than using 'virt-manager' after having setup the display server as 'spice' rather than 'vnc'
I have installed spice-guest-tools in the Windows 10 Guest
I have uninstalled Oracle Guest Additions
Everything seems to be working just swimmingly, except, if I increase the size of the guest window, the guest does not change resolution.
It will scale (as in stretch and compress) but it does not automatically change resolution of the guest to match the window size, like the VirtualBox Guest still does.
I can use the Windows 10 Guest Display resolution controls to change the resolution, however.
My 'video' is 'Virtio'
My 'display' is spice server, but I have not got OpenGL enabled because my QEMU binary does not support 3d acceleration.
My physical Video card is an nVidia with the proprietary nvidia driver installed.
I am running current (as at 18-Nov-2023) versions of all software.
Happy to provide additional info, if requested.

Actual software installed is listed below, and I followed the Gentoo wiki with regard to Kernel settings for qemu, re-built and re-booted.

I do still have VirtualBox installed, along with it's modules, if that makes any difference.

Oh, and I use FluxBox as my window manager.

Code:
root@Lyalls-PC ~
# eix --installed qemu
[I] acct-group/qemu
     Available versions:  0-r2
     Installed versions:  0-r2(09:58:58 18/11/23)
     Description:         System group: qemu

[I] acct-user/qemu
     Available versions:  0-r2
     Installed versions:  0-r2(09:59:45 18/11/23)
     Description:         System user: qemu

[I] app-emulation/qemu
     Available versions:  7.2.4^t ~7.2.6^t 8.0.4^t ~8.0.5^t ~8.1.2^t **9999*l^t {accessibility +aio alsa bpf bzip2 capstone +curl debug (+)doc +fdt +filecaps fuse glusterfs +gnutls gtk infiniband io-uring iscsi jack jemalloc +jpeg keyutils lzo multipath ncurses nfs nls numa opengl +oss pam +pin-upstream-blobs pipewire plugins +png pulseaudio python rbd sasl sdl sdl-image +seccomp selinux +slirp smartcard snappy spice ssh static static-user systemtap test udev usb usbredir vde +vhost-net virgl virtfs +vnc vte xattr xen zstd PYTHON_TARGETS="python3_10 python3_11 python3_12" QEMU_SOFTMMU_TARGETS="aarch64 alpha arm avr cris hppa i386 loongarch64 m68k microblaze microblazeel mips mips64 mips64el mipsel nios2 or1k ppc ppc64 riscv32 riscv64 rx s390x sh4 sh4eb sparc sparc64 tricore x86_64 xtensa xtensaeb" QEMU_USER_TARGETS="aarch64 aarch64_be alpha arm armeb cris hexagon hppa i386 loongarch64 m68k microblaze microblazeel mips mips64 mips64el mipsel mipsn32 mipsn32el nios2 or1k ppc ppc64 ppc64le riscv32 riscv64 s390x sh4 sh4eb sparc sparc64 sparc32plus x86_64 xtensa xtensaeb"}
     Installed versions:  8.0.4^t(15:58:07 18/11/23)(aio alsa bzip2 curl fdt filecaps gnutls gtk jpeg ncurses nls opengl oss pam pin-upstream-blobs png pulseaudio sdl seccomp slirp spice udev usb vhost-net vnc xattr -accessibility -bpf -capstone -debug -doc -fuse -glusterfs -infiniband -io-uring -iscsi -jack -jemalloc -lzo -multipath -nfs -numa -plugins -python -rbd -sasl -sdl-image -selinux -smartcard -snappy -ssh -static-user -systemtap -test -usbredir -vde -virgl -virtfs -vte -xen -zstd PYTHON_TARGETS="python3_11 -python3_10 -python3_12" QEMU_SOFTMMU_TARGETS="x86_64 -aarch64 -alpha -arm -avr -cris -hppa -i386 -loongarch64 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -nios2 -or1k -ppc -ppc64 -riscv32 -riscv64 -rx -s390x -sh4 -sh4eb -sparc -sparc64 -tricore -xtensa -xtensaeb" QEMU_USER_TARGETS="-aarch64 -aarch64_be -alpha -arm -armeb -cris -hexagon -hppa -i386 -loongarch64 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -mipsn32 -mipsn32el -nios2 -or1k -ppc -ppc64 -ppc64le -riscv32 -riscv64 -s390x -sh4 -sh4eb -sparc -sparc64 -sparc32plus -x86_64 -xtensa -xtensaeb")
     Homepage:            https://www.qemu.org https://www.linux-kvm.org
     Description:         QEMU + Kernel-based Virtual Machine userland tools

Found 3 matches
root@Lyalls-PC ~
# eix --installed spice
[I] app-emulation/spice
     Available versions:  0.15.1-r1^t 0.15.2^t **9999*l^t {gstreamer lz4 sasl smartcard static-libs test}
     Installed versions:  0.15.2^t(15:50:18 18/11/23)(-gstreamer -lz4 -sasl -smartcard -static-libs -test)
     Homepage:            https://www.spice-space.org/
     Description:         SPICE server

[I] app-emulation/spice-protocol
     Available versions:  0.14.1 0.14.3 0.14.4 **9999*l
     Installed versions:  0.14.4(10:20:52 18/11/23)
     Homepage:            https://spice-space.org/
     Description:         Headers defining the SPICE protocol

[I] net-misc/spice-gtk
     Available versions:  0.42-r3 **9999*l {gtk-doc +gtk3 +introspection lz4 mjpeg policykit sasl smartcard usbredir vala valgrind wayland webdav}
     Installed versions:  0.42-r3(10:21:57 18/11/23)(gtk3 introspection policykit usbredir wayland -gtk-doc -lz4 -mjpeg -sasl -smartcard -vala -valgrind -webdav)
     Homepage:            https://www.spice-space.org https://cgit.freedesktop.org/spice/spice-gtk/
     Description:         Set of GObject and Gtk objects for connecting to Spice servers and a client GUI

Found 3 matches
root@Lyalls-PC ~
# eix --installed virt-manager
[I] app-emulation/virt-manager
     Available versions:  4.1.0^t **9999*l^t {gui policykit sasl test PYTHON_SINGLE_TARGET="python3_10 python3_11"}
     Installed versions:  4.1.0^t(10:34:21 18/11/23)(gui policykit -sasl -test PYTHON_SINGLE_TARGET="python3_11 -python3_10")
     Homepage:            https://virt-manager.org https://github.com/virt-manager/virt-manager
     Description:         A graphical tool for administering virtual machines

root@Lyalls-PC ~
#


[Not Quite Solved]
Resizing the window up to a certain point seems to work, but once I exceed roughty 1.5 monitors wide (I have 4 monitors in a 2x2 grid), the guest does not automatically resize.
If I resize to less than roughly 1.5 monitors wide, the guest will resize down.
So, I cannot make my guest span 2 HD monitors (I don't have 4k or 8k)

However, I have found 'virt-viewer' and having added a second "Video QXL" monitor to my windows 10 guest hardware and setting one of them as having 2 heads, I can have two heads open on the VM, which is close enough :)

This has been done using 'virt-manager', which, apparently does not support multiple heads, whereas 'virt-viewer' does.
_________________
...Lyall


Last edited by lyallp on Wed Nov 29, 2023 4:09 am; edited 3 times in total
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 325
Location: Naarm/Melbourne, Australia

PostPosted: Sat Nov 18, 2023 11:21 am    Post subject: Reply with quote

i might be misunderstanding you, but do you get the result you want if you add
Code:
-display gtk,zoom-to-fit=on
as an option when starting qemu?
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1579
Location: Adelaide/Australia

PostPosted: Sat Nov 18, 2023 11:50 am    Post subject: Reply with quote

I am somewhat confused.

I have established services 'virtlogd', 'libvirtd' and 'libvirt-guests' as being auto started at my default runlevel (I use OpenRC, not systemd).

In order to start qemu, I simply run /usr/bin/virt-manager.

I use this to start/stop my guests.

I use spicy --host localhost --port 5900 to connect to the guests.

It is my understanding that having the above services will auto stop/start the VM's if I leave them running and I reboot the host.

I don't understand where this apparent command line option is to be used.
_________________
...Lyall
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 374

PostPosted: Sat Nov 18, 2023 11:54 am    Post subject: Reply with quote

Do you have app-emulation/open-vm-tools installed in the guest system?
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1579
Location: Adelaide/Australia

PostPosted: Sat Nov 18, 2023 11:56 am    Post subject: Reply with quote

I have spice-guest-tools installed.
I will investigate open-vm-tools....

...quick investigation...

...I am using QEmu, not VMWare.... the way I read it, this an open source implementation of VMWare tools...

How is that relevant to QEmu?
_________________
...Lyall
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 374

PostPosted: Sat Nov 18, 2023 12:23 pm    Post subject: Reply with quote

Yes, my fault. I was thinking that open-vm-tools are "open-virtual-machine-tools" (originally developed by and for vmware, but adopted by Qemu). But indeed it looks like the tools are used only for vmware VMs.
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1579
Location: Adelaide/Australia

PostPosted: Sat Nov 18, 2023 1:31 pm    Post subject: Reply with quote

Just a point to note, the exact same VM, takes 1 minute 22 to get to the login screen under VirtualBox from power on.

Under QEmu, it's 20 seconds.

Huge difference, considering the exact same underlying hardware, including the same Host disk.
_________________
...Lyall
Back to top
View user's profile Send private message
papu
l33t
l33t


Joined: 25 Jan 2008
Posts: 709
Location: Sota algun pi o alzina...

PostPosted: Sat Nov 18, 2023 4:52 pm    Post subject: Reply with quote

...
_________________
"~amd64" --cpu 7700 non-x --DDR5 2x16GB 6000MHz --gpu RX 470


Last edited by papu on Sun Nov 19, 2023 2:26 am; edited 1 time in total
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 325
Location: Naarm/Melbourne, Australia

PostPosted: Sat Nov 18, 2023 11:43 pm    Post subject: Reply with quote

lyallp wrote:
I don't understand where this apparent command line option is to be used.


Oh, sorry, i should have paid attention to your mention of your use of virt-manager. i don't use it myself; i've found it unnecessarily complicated and overpowered for my use-case. i just call the qemu binary directly from the command line, and it's there that i use the option i described in my previous comment, e.g.:
Code:
$ qemu-system-x86_64  -enable-kvm -m 512M -k en_us -boot order=dc -cdrom test.iso -display gtk,zoom-to-fit=on

And i've written a simple POSIX shell script to automate much of this.

i presume there's some way to pass qemu options to qemu via virt-manager; hopefully someone familiar with virt-manager will be able to help.
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1579
Location: Adelaide/Australia

PostPosted: Sat Nov 18, 2023 11:55 pm    Post subject: Reply with quote

I think I would put the parameters you identified in virt-manager once I build qemu with the required support.

I suspect I did not have the nouveau use flag set in my media-libs/mesa to be the root cause of my problem.

For my use case, virt-manager is exactly what I want, I could not be bothered setting up scripts to start the virtuals (of which I only have 2) when virt-manager seems to do the job quite nicely.

Ok, I have to interact with with virt-manager to actually start the Virtuals up but once they are running, I can use spice to view their console and, though I have not tested it yet, if I re-boot the host, the virt related services will stop/start the VM's for me.

At this point, I am still uncertain how the spice guest modules work and how they are updated, I guess they are similar to VirtualBox Guest Additions but how they are updated for new versions I have yet to discover, short of manually downloading and installing.

I will let you know how things go.
_________________
...Lyall
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1579
Location: Adelaide/Australia

PostPosted: Sun Nov 19, 2023 12:12 am    Post subject: Reply with quote

Not having much luck at this early stage, a bit more research I think.

I have display Spice, video Virtio, I have spice Listen type None, and OpenGL enabled with a path to what appears to be my nVidia card selected.

However, EGL_NOT_INITIALIZED.

Will keep fiddling, might even try setting up a run script....
_________________
...Lyall
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 325
Location: Naarm/Melbourne, Australia

PostPosted: Sun Nov 19, 2023 12:25 am    Post subject: Reply with quote

lyallp wrote:
I could not be bothered setting up scripts to start the virtuals

Well, that's why i made my script publicly available for download and use: it's not a script for starting specific VMs, it's a generic script with a simple text-based interface to help create and manage arbitrary VMs (e.g. create a virtual hard disk, boot a particular VM config with a particular ISO, etc.). But if virt-manager works for you, great!
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1579
Location: Adelaide/Australia

PostPosted: Sun Nov 26, 2023 10:49 pm    Post subject: Reply with quote

I re-converted the VM from VirtualBox to QEmu
I installed SPICE guest tools latest
I have not uninstalled Oracle VM VirtualBox Guest Additions 7.0.12

However, my guest resizes when I re-size the host window, which is all I am interested in.
_________________
...Lyall
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 325
Location: Naarm/Melbourne, Australia

PostPosted: Mon Nov 27, 2023 12:38 am    Post subject: Reply with quote

This has been marked '[Solved]'; could you please add a comment describing how you solved it, for people who might have this problem in the future?
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1579
Location: Adelaide/Australia

PostPosted: Mon Nov 27, 2023 4:31 am    Post subject: Reply with quote

See the entry above.
_________________
...Lyall
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum