- first off the praise:
- kvm-qemu is a high performance nicely scriptable virtualization system
- if it works, it can do pretty things 🙂
- IN CONTRAST TO iESXI SH** WARE CLONING A VM IS A EASY AS:
virt-clone --original debian12 --name debian12-clone --file /where/to/store/debian12-clone.qcow2
- NO COMPLICATED “HACKS” REQUIRED X-D (ALMOST FELL OFF THE CHAIR, THAT THE WIDELY USED ESXI HAS NO SUCH EASY FUNCTIONALITY? IF COMPANIES WERE SMART THEY WOULD ALL MIGRATE TO KVM) or via GUI:
- especially like the x11 forwarded virt-manager gui over ssh (yes it is a bit slow… but simplicity at it’s best)
- ssh-logged in and when trying to start a x11 application, getting the error “Unable to init server: Could not connect: Connection refused”?
- try ssh-re-login with:
-
ssh -v -X username@ip.of.server
- now the critique:
- it does not feel very user friendly X-D
- why is thin provisioning not the disk-saving default option?
- or at least should be possible for the user to select this option in virt-manager
- do not drop windows 7 support just yet… many virtualization systems such as VirtualBox are actually intended to run “outdated” OS on newer hardware for the sake of getting programs to run, that are incompatible with recent OS.
- please double check that virtio 64Bit drivers actually work under win 7 64bit (home, pro and ultimate)
hostnamectl; # host is Chassis: desktop Operating System: Debian GNU/Linux 10 (buster) Kernel: Linux 4.19.0-17-amd64 Architecture: x86-64 # hardware used cat /proc/cpuinfo |head processor : 0 vendor_id : AuthenticAMD cpu family : 23 model : 113 model name : AMD Ryzen 5 3600 6-Core Processor stepping : 0 microcode : 0x8701021 cpu MHz : 1870.721 cache size : 512 KB physical id : 0 dmidecode | less Manufacturer: ASUSTeK COMPUTER INC. Product Name: Pro WS 565-ACE Version: Rev X.0x # in combination with smartctl -a /dev/nvme0 smartctl 6.6 2017-11-05 r4594 [x86_64-linux-4.19.0-17-amd64] (local build) Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Model Number: SAMSUNG MZVL2512HCJQ-00B00 smartctl -a /dev/nvme1 smartctl 6.6 2017-11-05 r4594 [x86_64-linux-4.19.0-17-amd64] (local build) Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Model Number: SAMSUNG MZVL2512HCJQ-00B00
# MZVL2512HCJQ OEM version of Samsung NVMe 980 Pro qemu-system-x86_64 --version QEMU emulator version 3.1.0 (Debian 1:3.1+dfsg-8+deb10u8) Copyright (c) 2003-2018 Fabrice Bellard and the QEMU Project developers # installed software dpkg -l|grep virt ii gir1.2-libvirt-glib-1.0:amd64 1.0.0-1 amd64 GObject introspection files for the libvirt-glib library ii libgovirt-common 0.3.4-3.1 all GObject-based library to access oVirt REST API (common files) ii libgovirt2:amd64 0.3.4-3.1 amd64 GObject-based library to access oVirt REST API ii libvirglrenderer0:amd64 0.7.0-2 amd64 virtual GPU for KVM virtualization ii libvirt-clients 5.0.0-4+deb10u1 amd64 Programs for the libvirt library ii libvirt-daemon 5.0.0-4+deb10u1 amd64 Virtualization daemon ii libvirt-daemon-system 5.0.0-4+deb10u1 amd64 Libvirt daemon configuration files ii libvirt-glib-1.0-0:amd64 1.0.0-1 amd64 libvirt GLib and GObject mapping library ii libvirt0:amd64 5.0.0-4+deb10u1 amd64 library for interfacing with different virtualization systems ii ovmf 0~20181115.85588389-3+deb10u3 all UEFI firmware for 64-bit x86 virtual machines ii python3-libvirt 5.0.0-1 amd64 libvirt Python 3 bindings ii qemu-kvm 1:3.1+dfsg-8+deb10u8 amd64 QEMU Full virtualization on x86 hardware ii virt-manager 1:2.0.0-3 all desktop application for managing virtual machines ii virt-viewer 7.0-2 amd64 Displaying the graphical console of a virtual machine ii virtinst 1:2.0.0-3 all Programs to create and clone virtual machines
something is pretty off here.
it all starts of with virt-manager (keep saying virsh-manager) not detect Windows 7 iso correctly, and having to chose it manually enabling the legacy checkbox.
the idea was to install:
- Windows 7 64Bit Ultimate
- SP1
-
- Windows 7 Service Pack 1 (32 Bit)
- Windows 7 & Server 2008 R2 Service Pack 1 (64 Bit)
- Windows 7 & Server 2008 R2 Service Pack 1 (ISO-Image, enthält 32-, 64-Bit und IA64)
-
- WinFuture Update pack
actually managed to install it once… but when trying to install the updates, things became very very slow aka stuck.
next try… it won’t go over this screen: “windows files are being extracted 0%” just sits there doing nothing.
TURNS OUT: that is just what windows does X-D (let it sit overnight if the user must… it will finish evenutally)
for the screen to resize automatically: for GNU Linux the spice drivers are required, for Windows the virtio drivers (for some reason the latest version fails to install for Win 10 so get the bit older version)
- install https://github.com/virtio-win/virtio-win-pkg-scripts/blob/master/README.md#downloads=
- install https://www.spice-space.org/download/windows/spice-guest-tools/spice-guest-tools-latest.exe
- if it is NOT possible to download the file directly inside the vm (with iexplore)
- try this:
- on host system (GNU Linux Debian tested)
-
su - root
-
apt update && apt install genisoimage
-
genisoimage -o spice-guest-tools-latest.exe.iso ./spice-guest-tools-latest.exe
- this should give a mountable.iso
- install the exe and restart vm
- in virt-manager: make sure this is checked
GNU Linux guest vm integration: qemu-guest-agent
- the Debian 11 installer automatically detects running inside a virtual machine and automatically installs the qemu-guest-agent
-
# otherwise install it manually apt search qemu|grep guest qemu-guest-agent/stable-security 1:5.2+dfsg-11+deb11u2 amd64 # install it also the spice-vdagent su - root apt update; apt install qemu-guest-agent spice-vdagent; # then reboot /scripts/reboot.sh
RHEL7 and CENTOS7
# for RHEL7 and CENTOS7 there is a package called yum search virtio qemu-guest-agent.x86_64 : QEMU guest agent # how to install RHEL7 and CENTOS7 kvm guest integration yum install qemu-guest-agent.x86_64
not done yet…
with some window managers, the resize needs to be triggered “manually”
GNU Linux guest vm auto resize screen
to get a more “virtualbox” like behaviour of the vm, this can be acchieved by a little scripting “hack”:
vim /scripts/kvm/guest_vm_auto_resize_screen.sh #!/bin/bash # will auto resize the gnu linux guest vm screen every 2 sec while true; do xrandr --output Virtual-1 --auto; sleep 2; clear; done # mark it runnable chmod +x /scripts/kvm/*.sh
- reboot the VM
- also make sure this is checked:
- run the script for testing
- clipboard pasting host-guest should already work
- put this script into auto start
if it works, let’s automate: auto resize after startup
- re-activate rc.local
- at the very end add something like:
- reboot and it should change resolution, when window is resized
export DISPLAY=:0;su -c /scripts/kvm/guest_vm_auto_resize_screen.sh user &
Windows guest vm integration: what about clipboard host-guest?
yes, that can be done via https://www.spice-space.org/download/windows/spice-guest-tools/spice-guest-tools-latest.exe
- download it
- put it into an diskimage.iso file to be mounted via virt-manager
- install it within windows
- reboot vm
- host-to-guest clipboard should be working
cudos: https://dausruddin.com/how-to-enable-clipboard-and-folder-sharing-in-qemu-kvm-on-windows-guest/
what worked: virtio & 32Bit
the only success that can be reported is for 32Bit! (virtio-win-0.1.173.iso being the last version supporting Windows 7, the newer versions support win 8 and higher)
checkout this archive: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/
now the performance is pretty decent X-D (of course this is all RAM cached stuff)
no chance to select any 64Bit drivers!? in any virtio iso!?
Debian 10 vm: failed to decrypt root after RAM reduction
this might be a bug or something else.
when creating a Debian 10 vm guest with 2048MB of RAM, then later reducing that to 1024MB of RAM, will result in a problem, that the user can not decrypt the lvm2 encrypted root harddisk anymore…
putting the RAM settings back to 2048MB fixes the problem.
very very strange X-D
(assigning more RAM probably not a problem, but reducing RAM assigned to vm might have such strange effects)
Links:
How to Enable clipboard and folder sharing in Qemu/KVM on Windows Guest
liked this article?
- only together we can create a truly free world
- plz support dwaves to keep it up & running!
- (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
- really really hate advertisement
- contribute: whenever a solution was found, blog about it for others to find!
- talk about, recommend & link to this blog and articles
- thanks to all who contribute!