Score:0

QEMU/KVM virtualization problem (probably SGX)

mx flag

I am trying to setup my own computer lab for networking, pen testing and learning in my own local network using virtual machines, a raspberry-pi, a Linux machine and a windows machine. My Linux machine is an X1 Yoga 3 Thinkpad with a Core i7-8550U processor.

My problem is I cannot seem to enable virtualization on my Linux machine. To be clear I have it partitioned and running dual boot with Windows 10, just because I still have a need for Windows occasionally while away from home and my other laptop is a heavy Legion gaming system with poor battery life. I am running two VM's in hyperviser on that Windows 10 machine with no problems. On my Linux machine (X1 Thinkpad) I am running Windows 10 on sda3 and Kubuntu 22.04 on sda5. I have VBS enabled in Windows, but have not installed hypervisor. I do have virtualization enabled in BIOS and Secure Boot is disabled.

I have installed QEMU/KVM, Virtual machine manager and QEMU/KVM does connect. I have tried to mount two ISO's, the first being 2022-07-01-raspios-bullseye-i386.iso. That mounted and ran in VMM until it updated then it would not boot. Second is kali-linux-2023.1-qemu-amd64.qcow2. That would not boot at all.

Error message in VMM window is:

SeaBIOS version (1.15.01)
Machine UUID 549d6bdd-8fd8-4442-bb93-6c2abed72a8d
iPXE (https://ipxe.org) 01.00.0 CA00 PC12.10 PnP PMM+7FF8AB20+7FECA20 CA00
Booting from DVD/CD...
Boot failed: Could not boot from CDROM (code 0003)
Booting from Hard Disk..
Boot failed: not a bootable disk
No bootable device.

When I run kvm-ok I get this output:

kvm-ok  
INFO: /dev/kvm exists
KVM acceleration can be used

When I check processor I get:

egrep -c '(vxm|svm)' /proc/cpuinfo
0

So it is not showing a supported CPU.

dmesg=
sudo dmesg | grep sgx
[    0.618588] sgx: EPC section 0x50200000-0x55f7ffff

I updated my kernel to 6.2.8-060208-generic hoping that a patch would have been upstreamed.

Using UEFI BIOS. Secure Boot is toggled off.

Other things I have tried are toggling BIOS switches on and off. Resetting BIOS to factory defaults. Disabling VBS in windows where no hypervisor was detected in Sysinfo (still showed security policies in place for VBS) then reenabled VBS. I have turned off all memory protection in BIOS (TPM), everything I know to do and still haven't been able to get QEMU/KVM to work in Linux. I have left the SGX setting alone (in software mode) because I have read that intel SGX is supposed to work with QEMU/KVM.

I feel like I am missing something very simple to fix this, but I really don't have the knowledge in Linux to figure it out by myself (at least not as of yet). I still consider myself a noob even though I do have much experience in Linux. I used to run Debian Woody on a workstation. I'm not going to get frustrated because this is why I wanted to install and use Linux. I want to learn how to execute commands and become as proficient in CLI as I am in Windows using front-ends. I am learning my way around the command line and can navigate files and directories and execute basic commands.

David avatar
cn flag
What version of Ubuntu are you using? Why the 6.2 kernel?
dino avatar
mx flag
Hi David, Thanks for your reply. I had read in a github document to update to the latest kernel for intel SGX to work in linux. I updated to latest kernel from mainline. I'm on Ubuntu 22.04.1.
David avatar
cn flag
Mainline kernels are not tested to work with Ubuntu. I am sure they meant the latest tested kernel for Ubuntu.
dino avatar
mx flag
OK so I rolled back to my previous kernel (5.15.0-67-generic), just to be on the safe side. I rolled back through GRUB advanced boot options, this kernel will remain persistent right?
David avatar
cn flag
Not if it is not the top one in the list.
dino avatar
mx flag
Yeah I see that after reboot.I guess I'll have to edit grub... Another thing to learn.
Christian Ehrhardt avatar
sl flag
Hi @dino you accidentially had a typo in `egrep -c '(vxm|svm)' /proc/cpuinfo? it is `vmx` not `vxm`. Most likely you have all you need as also kvm-ok is reporting ok. Furthermore the issue you report (No bootable device) is not what would occur if KVM didn't work, it usually just means your guest isn't set up right. For a completely different try, run `sudo qemu-system-x86_64 -enable-kvm -cdrom http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/netboot/mini.iso` if it brings up an installer, then KVM works and you can focus on actually setting a guest up.
Christian Ehrhardt avatar
sl flag
BTW - do not mind about the message in regard to svm that will show up, if on intel it misses svm if on amd it misses vmx, that is fine (not one more red herring).
dino avatar
mx flag
Thank you so much Christian. I corrected the typo and this is the output: egrep -c '(vmx|svm)' /proc/cpuinfo 16
dino avatar
mx flag
What's funny is I only have 8.
Score:0
mx flag

I have been studying and working on my problem and figured out that my hardware is working. I just need to fix my permissions and get my hardware pass through set up right. I tried UIEF BIOS in my VM last night and what is funny is it brought up a shell with a DOS prompt... I almost didn't recognize it it has been so long since I have seen one of those. I have have gotten to the point where I am not getting a boot error but a monitor error. I need to figure out how to configure the spice display. Plus I have to get permissions right. The VM is running in session mode instead of system mode. I can see where this is a much more configurable hypervisor when compared to windows. There's just a steeper learning curve. Thanks to all for your help.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.