Hi folks
Now working (ist pass)
As I suspected it's that package trousers which gets implemented either by default ubuntu install or by some SWTPM's implementations .which hoses up the whole swtpm emulaton thing as it's based on TPM V 1.2.
Using basic server |20.04 LTS install and adding minimal GUI doesn't have those "rogue" packages in them. You can't fix it either by removing the packages as the damage is already done -- in parts of the kernel and I'm too old and not minded enough to even THINK of repairing that -- easier to install the whole thing again !!!!.
I'll replicate what I did again then post instructions
so far

On 2nd pass now


After next pass will update this post with instructions -- follow exactly though -- 3 good attempts on totally cleaned HDD's should be reproduceable enough.
Lunch and Beer now - then pass 3
Working -- follow this order though and execute ALL the linux commands from the server after it's been installed - there aren't many !!
1) Have these before starting - Disk for Ubuntu server LTS installation -- I suggest an external USB - USB 3 is fast enough - even better if you have external SSD via SATA->USB3 adapter. No need to format it or whatever plus of course your Windows 11 installation iso and a USB stick for server installation.
2) Download the 20.04 LTS server from Get Ubuntu Server | Download | Ubuntu (manual server installation)
3) use Rufus / DD or whatever tool you like to create a bootable system on your USB stick.
4) boot from the USB - from your BIOS or whatever to ensure boot is from the USB
5) ensure the target disk is also plugged in to the computer.
6) follow on screen instructions - choose language (GB) , keyboard (GB) extended with win keys (or choose lang and keyboard to choice)
7) choose guided - use whole disk and use drop down to select the disk -- I also used LVM but NOT encrypted
8) take rest of defaults by hitting done at bottom of screen on each page -- until installation starts - On services i added open-ssh server when the option appears but skipped the rest. I only used that as I needed to get my windows iso from remote server. You'll see things like server (host name) user name password etc just enter your desired names.
9) when complete (you'll see a prompt for remove installation medium and hit enter) - remove the usb stick and reboot.
10) ensure reboot is done from the target disk.
11 when all the text has finished hit enter and you should see a login prompt
12 now enter these commands (if you don't want to keep prefixing by sudo type initially sudo su. (Debian / ubuntu type systems don't allow a user to login specifically as root) that will keep you in root mode -- I use sudo as there's less chance of typing a mistake and deleting your system files !!!
a) first apply upgrades
sudo apt upgrade
b) add the CORRECT SWTPM REPOSITORY -- if this fails / done wrongly the process will fail
sudo add-apt-repository ppa:itrue/swtpm
sudo apt-get update
sudo apt-get install swtpm
sudo apt-get install swtpm-tools -- do this AFTER installing swtpm AND
ABSOLUTELY ENSURE PACKAGE TROUSERS IS NOT INSTALLED
b) remove redundant package(s)
sudo apt autoremove
Now we need a GUI for easy management of virtual machines
I'm using the barebones KDE GUI as it doesn't install zillions of packages which I dont need and could hose the whole thing up - If you are just testing you could try any other GUI but this one works (I've repeated this 3 times all with 100% success) and for Windows users it's the most Windows like system e.g the icon at the bottom left of the screen throws up a menu aka Windows.
We will install the KVM. QEMU virtual machine manager and the GUI for managing virtual machines AFTER installing the KDE GUI and booting into the GUI
sudo apt-get install plasma-desktop (KDE base desktop)
sudo apt-get install sddm (mandatory window manager for kde)
sudo systemctl enable sddm (need to start automatically at boot)
sudo apt-get install konsole firefox dolphin kate
konsole -> console / terminal from within the GUI or you'll forever have to press ctrl+F2 to switch to a terminal;
firefox ->web browser -- choose any you like though
dolphin ->a file / windows explorer like file browser
kate ->wsiswg screen text editor like notepad
after it all finishes reboot
After reboot you'll see a login screen - ignore the USA flag on the top if you've installed GB and ENG keyboard. If you've got the wrong keyboard you can change it all with system settings from the menu -- up to you to experiment - you can change login screen, splash screens, wallpaper etc to taste- this post is to help you to get Win 11 running as a VM on a UBUNTU 20.04 LTS host with a working TPM emulator. Other stuff - up to you.

After login choose konsole from the menu (type konsole on the search area) and then install the following
sudo apt install -y qemu qemu-kvm libvirt-daemon libvirt-clients bridge-utils virt-manager
enable the libvirtd service to start at boot
sudo systemctl enable --now libvirtd
now you need to reboot even though the service / daemon is running - this is because some kernel modules have to be loaded at boot.
then after reboot and login start virtual machine manager from the menu
You should be in business -- just add the hardware you want and the TPM
when adding the TPM you should see this

If you see that you know it's working -- doesn't matter if you use crb or tis in the dropdown. Ensure of course you add your Windows iso to the hardware and set the boot options to secure boot. (package OVMF is installed automatically on UBUNTU server so no need for extra installs).
Have fun !!!!
BTW to get to this stage shouldn't take more than around 15 to 20 mins asuming even modest hardware. Installing the Guest actually takes longer !!!!! but I've done this 3 times all from scratch so it should work
@cereberus please have a go at this if you aren't fed up with the whole thing by now !!!!!!!
You can tidy up e.g better video etc by getting the virtio iso for windows and add that as a cd image to the guest and run all the W11 drivers from within windows.
Up to you -- the point of this post was to show that running Windows 11 as a VM on KVM/QEMU on ubuntu 20.04 LTS server wasn't impossible -- actually quite easy in fact -- though only after about a zillion failed google searches and umpteen efforts at making it work.
If a few people try this successfully perhaps this could be added to Tutorials in the VM section -- I would like others to try it first though as I might have missed something or done a command which was obvious to me but not listed causing the thing to fail.
Cheers
jimbo
Now working (ist pass)
As I suspected it's that package trousers which gets implemented either by default ubuntu install or by some SWTPM's implementations .which hoses up the whole swtpm emulaton thing as it's based on TPM V 1.2.
Using basic server |20.04 LTS install and adding minimal GUI doesn't have those "rogue" packages in them. You can't fix it either by removing the packages as the damage is already done -- in parts of the kernel and I'm too old and not minded enough to even THINK of repairing that -- easier to install the whole thing again !!!!.
I'll replicate what I did again then post instructions
so far

On 2nd pass now


After next pass will update this post with instructions -- follow exactly though -- 3 good attempts on totally cleaned HDD's should be reproduceable enough.
Lunch and Beer now - then pass 3
Working -- follow this order though and execute ALL the linux commands from the server after it's been installed - there aren't many !!
1) Have these before starting - Disk for Ubuntu server LTS installation -- I suggest an external USB - USB 3 is fast enough - even better if you have external SSD via SATA->USB3 adapter. No need to format it or whatever plus of course your Windows 11 installation iso and a USB stick for server installation.
2) Download the 20.04 LTS server from Get Ubuntu Server | Download | Ubuntu (manual server installation)
3) use Rufus / DD or whatever tool you like to create a bootable system on your USB stick.
4) boot from the USB - from your BIOS or whatever to ensure boot is from the USB
5) ensure the target disk is also plugged in to the computer.
6) follow on screen instructions - choose language (GB) , keyboard (GB) extended with win keys (or choose lang and keyboard to choice)
7) choose guided - use whole disk and use drop down to select the disk -- I also used LVM but NOT encrypted
8) take rest of defaults by hitting done at bottom of screen on each page -- until installation starts - On services i added open-ssh server when the option appears but skipped the rest. I only used that as I needed to get my windows iso from remote server. You'll see things like server (host name) user name password etc just enter your desired names.
9) when complete (you'll see a prompt for remove installation medium and hit enter) - remove the usb stick and reboot.
10) ensure reboot is done from the target disk.
11 when all the text has finished hit enter and you should see a login prompt
12 now enter these commands (if you don't want to keep prefixing by sudo type initially sudo su. (Debian / ubuntu type systems don't allow a user to login specifically as root) that will keep you in root mode -- I use sudo as there's less chance of typing a mistake and deleting your system files !!!
a) first apply upgrades
sudo apt upgrade
b) add the CORRECT SWTPM REPOSITORY -- if this fails / done wrongly the process will fail
sudo add-apt-repository ppa:itrue/swtpm
sudo apt-get update
sudo apt-get install swtpm
sudo apt-get install swtpm-tools -- do this AFTER installing swtpm AND
ABSOLUTELY ENSURE PACKAGE TROUSERS IS NOT INSTALLED
b) remove redundant package(s)
sudo apt autoremove
Now we need a GUI for easy management of virtual machines
I'm using the barebones KDE GUI as it doesn't install zillions of packages which I dont need and could hose the whole thing up - If you are just testing you could try any other GUI but this one works (I've repeated this 3 times all with 100% success) and for Windows users it's the most Windows like system e.g the icon at the bottom left of the screen throws up a menu aka Windows.
We will install the KVM. QEMU virtual machine manager and the GUI for managing virtual machines AFTER installing the KDE GUI and booting into the GUI
sudo apt-get install plasma-desktop (KDE base desktop)
sudo apt-get install sddm (mandatory window manager for kde)
sudo systemctl enable sddm (need to start automatically at boot)
sudo apt-get install konsole firefox dolphin kate
konsole -> console / terminal from within the GUI or you'll forever have to press ctrl+F2 to switch to a terminal;
firefox ->web browser -- choose any you like though
dolphin ->a file / windows explorer like file browser
kate ->wsiswg screen text editor like notepad
after it all finishes reboot
After reboot you'll see a login screen - ignore the USA flag on the top if you've installed GB and ENG keyboard. If you've got the wrong keyboard you can change it all with system settings from the menu -- up to you to experiment - you can change login screen, splash screens, wallpaper etc to taste- this post is to help you to get Win 11 running as a VM on a UBUNTU 20.04 LTS host with a working TPM emulator. Other stuff - up to you.

After login choose konsole from the menu (type konsole on the search area) and then install the following
sudo apt install -y qemu qemu-kvm libvirt-daemon libvirt-clients bridge-utils virt-manager
enable the libvirtd service to start at boot
sudo systemctl enable --now libvirtd
now you need to reboot even though the service / daemon is running - this is because some kernel modules have to be loaded at boot.
then after reboot and login start virtual machine manager from the menu
You should be in business -- just add the hardware you want and the TPM
when adding the TPM you should see this

If you see that you know it's working -- doesn't matter if you use crb or tis in the dropdown. Ensure of course you add your Windows iso to the hardware and set the boot options to secure boot. (package OVMF is installed automatically on UBUNTU server so no need for extra installs).
Have fun !!!!
BTW to get to this stage shouldn't take more than around 15 to 20 mins asuming even modest hardware. Installing the Guest actually takes longer !!!!! but I've done this 3 times all from scratch so it should work
@cereberus please have a go at this if you aren't fed up with the whole thing by now !!!!!!!
You can tidy up e.g better video etc by getting the virtio iso for windows and add that as a cd image to the guest and run all the W11 drivers from within windows.
Up to you -- the point of this post was to show that running Windows 11 as a VM on KVM/QEMU on ubuntu 20.04 LTS server wasn't impossible -- actually quite easy in fact -- though only after about a zillion failed google searches and umpteen efforts at making it work.
If a few people try this successfully perhaps this could be added to Tutorials in the VM section -- I would like others to try it first though as I might have missed something or done a command which was obvious to me but not listed causing the thing to fail.
Cheers
jimbo
Last edited:
My Computer
System One
-
- OS
- Windows XP,7,10,11 Linux Arch Linux
- Computer type
- PC/Desktop
- CPU
- 2 X Intel i7