I have a dual-boot setup on my laptop: Ubuntu 18.04 and Windows 10. From within ubuntu, I can boot to my existing windows partition using qemu with the help of this guide. The command I am using is this:
sudo qemu-system-x86_64 --enable-kvm -cpu host -smp 8 -m 8192 \
-drive format=raw,file=/dev/nvme0n1,index=1 \
-bios /usr/share/ovmf/OVMF.fd \
-display sdl -vga qxl \
-device qemu-xhci,id=xhci \
-netdev user,id=vmnic,smb=/home/generic/Downloads \
-device virtio-net,netdev=vmnic -cdrom ~/Downloads/virtio-win-0.1.171.iso
The last line was only to install the virtio drivers so I'm pretty sure I don't need it every time.
The second line determines the partition /dev/nvme0n1p1
.
The guide mentions SPICE, which is apparently good for
dynamic screen resize, clipboard between guest/host, etc.
I'd like to have the virtual screen change its size and adapt the resolution when I resize the window. I tried to follow the guide on https://www.linux-kvm.org/page/SPICE and realized that spicec
is no longer a thing - that means I cannot connect to the guest with spicec -h 127.0.0.1 -p 5900
.
The Spice User Manual agrees:
The recommended client is remote-viewer (which is shipped with virt-viewer).
GNOME Boxes can also be used as a Spice client.
spicec is an obsolete legacy client, and spicy is only a test application.
So I had a go with adding -spice port=5900,addr=127.0.0.1,disable-ticketing
to my qemu
command and running remote-viewer
on spice://127.0.0.1:5009
. That actually opened a spice window - so now I have two windows that show my win10 guest.
The Spice window reacts more nicely when it is resized, but it keeps the same resolution and just adds white borders when necessary.
The question
How can I get a borderless view of my guest system that adapts well to being resized?
And if that is not a completely distinct question: How can I have only one window for that, instead of both the qemu and the spice window?
Further Details
When I connected remote-viewer
, its console window showed
** (remote-viewer:3066): CRITICAL **: 15:54:52.441: virt_viewer_util_extract_host: assertion 'uri != NULL' failed
And the qemu
output showed
main_channel_link: add main channel client
main_channel_client_handle_pong: net test: latency 0.110000 ms, bitrate 34711864406 bps (33103.813559 Mbps)
inputs_connect: inputs channel client create
red_qxl_set_cursor_peer:
Ozymandias42 suggested to try using
virt-manager
as a frontend and stepped me through it.virt-manager
on the host ubuntuvirt-manager
and go toView -> Edit -> Preferences -> Console
. ActivateResize guest with window: On
/dev/nvme0n1
I am not certain if/how it is possible to only give the VM access to certain partitions (I first tried only giving it the EFI partition, but that of course did not work. Maybe it is possible to add each partition needed for windows as a separate virtual disk. Or maybe using confinedrv)
Firmware: UEFI x86_64: /usr/share/OVMF/OVMF_CODE.fd
which I already had on my linux. I think I installed that usingapt install ovmf
but no guarantees.Begin Installation
again, this sounds scary. But it does not mess with the installed windows.View -> Scale Display -> Auto resize VM with window
You need to add a virtio-serial device for the VM to communicate with the spice client on the host. Had you used virt-manager with libvirtd instead of using qemu directly it most likely would have taken care of that for you automatically.
Try adding
If that doesn't work, I'd suggest using virt-manager as frontend.