Questions tagged [kvm]

KVM (for Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V).

KVM was envisioned and created by Qumranet, which was later acquired by Red Hat.

KVM is a very neat implementation of virtualization for x86 as the original code was less than 10,000 lines of code. It is implemented as a kernel module, and uses a number of features of the Linux kernel, instead of implementing them (e.g., scheduling of virtual machines is taken care by the kernel), unlike where all these features had to be taken care of by the hypervisor. Thus code reuse is something that KVM relies upon.

Following are the ways how KVM virtualizes various components of the real PC.

CPU Virtualization: CPU virtualization is taken care of by Intel VT or AMD-V technology, and KVM adds glue code to effectively use these technologies. KVM loads and saves a number of registers when a VM is scheduled or when it exits respectively.

I/O Virtualization: KVM does I/O virtualization with the help of , which emulates devices. KVM also supports passthrough devices where the VM can directly access I/O devices using IOMMU.

Memory Virtualization: Earlier design of KVM virtualized memory using shadow page tables, which is a software only approach to virtualizing memory. There is a high cost of synchronizing the shadow page tables with the page tables belonging to OS. Later, Intel and AMD came up with their own versions of nested page tables which is mostly a hardware approach to virtualizing memory.

1138 questions
8
votes
1 answer

qemu memory operations

I intend to use Qemu to generate a memory trace for the execution of a x86 guest operating system. According to tcg wiki page, Qemu uses a handful of helpers to generate load/stores to the target(guest) memory. This list of instructions is…
prathmesh.kallurkar
  • 5,468
  • 8
  • 39
  • 50
7
votes
3 answers

kvm hypercall with multiple args

I'm currently trying to build a small hypervisor and kernel using kvm and I struggle to get hypercalls with multiple args working correctly. Here is what I've tried: // guest.c #define KVM_HYPERCALL vmcall // #define KVM_HYPERCALL vmmcall //…
Gaetano
  • 1,090
  • 1
  • 9
  • 25
7
votes
0 answers

CPU acceleration status: This user doesn't have permissions to use KVM (/dev/kvm) in docker

I have built a docker with appium, java8, android sdk, node 8.11.0, cucumber and ruby Once I have created the device I check kvm-ok getting root@994d47ae73ce:/opt/android-sdk/emulator# kvm-ok …
7
votes
1 answer

host doesn't support requested feature: CPUID.01H:EDX.ds [bit 21] Does this warn affect virtual machine performance or use?

I found a lot of warning from the VM qemu log, Does this warn affect virtual machine performance or use? , is my libvirt.xml file problem? Or support hot-plug will have these warnings This is my libvirt xml configuration:
Paul
  • 195
  • 2
  • 4
  • 12
7
votes
2 answers

Nvidia GPU passthrough fail with code 43

I'm currently trying to pass a nvidia GPU to Windows 10 guest using qemu 2.5 and libvirt 1.3.5. I see "Error 43" on Nvidia GPU in Device Manager. I had tried to hide the hypervisor by adding "kvm=off" and "hv_vendor_id=123456780ab", but it does not…
Sev_Y
  • 115
  • 1
  • 2
  • 8
7
votes
1 answer

kvm setup for linux without default modules

Ok, so the KVM setup guide in this question does not work for me, this is because I am using crouton with a trusty (14.04) chroot. Apparently somewhere along the line kvm modules were not shipped in ChromeOS or the crouton virtual images that I…
M Y
  • 1,831
  • 4
  • 24
  • 52
7
votes
0 answers

How to set folder permissions for a kvm 9p filesystem share?

I have a virtual machine setup through virt-manager, and I am trying to give the vm access to a folder on the host system. I added a Filesystem, and I can read from the host directly but I cannot write to it.
Aractor
  • 79
  • 4
7
votes
1 answer

Python libvirt API - create a Virtual Machine

I am trying to create a python script to handle basic VM operations like: create a VM, delete a VM, start, stop, etc. Currently I'm rather "stuck" on create From the command line you would do something like: qemu-img create -f qcow2 vdisk.img…
Pandrei
  • 4,843
  • 3
  • 27
  • 44
7
votes
2 answers

Can KVM be used inside a GCE instance?

Is it possible to run a KVM virtual machine inside of a Google Compute Engine instance? Nested virtualization, in short?
John
  • 443
  • 4
  • 13
7
votes
1 answer

File download speed from Amazon S3 drops to <2 kb/s = very slow download (on the machine it has been uploaded from)

Basic Problem: We've been experiencing very strange behaviour in our current infrastructure setup: file download speed from Amazon S3 drops to <2 kb/s (after ~10 downloads that have perfectly normal download speed) if the file is downloaded from…
pangdudu
  • 391
  • 2
  • 6
7
votes
1 answer

x86 PIC, is it correct for QEMU to raise interrupts on all CPUs?

I recently had to work around a proprietary OS issue with the x86 PIC where the OS expected timer interrupts ONLY on CPU0. I enabled the IO-APIC to get around this and did CPU steering so the interrupts went only to CPU0. Problem solved. I was told…
Goblinhack
  • 2,859
  • 1
  • 26
  • 26
7
votes
1 answer

how KVM handle interrupt

i have been doing the KVM stuff and have a couple of questions that can not figure out. 1> as we know, normally the external interrupt will cause VMexit and the hypervisor will inject a virtual interrupt if it is for guest. Then which irq will be…
user1073939
  • 151
  • 2
  • 5
6
votes
1 answer

kernel stills schedules code to run on isolated cores

I have a system running Linux kernel 4.19.71 with Intel Xeon Platinum 8160 CPU, it features 24 physical cores and with 2 threads per core it makes 48 logical cores. I'm experimenting with virtualization (qemu and kvm) and would like to isolate a set…
Mark
  • 6,052
  • 8
  • 61
  • 129
6
votes
3 answers

x2go issue with XFCE and Ubuntu 20.04

When I connect x2go with XFCE Ubuntu 20.04 (KVM VM) after ~10 minutes of idle time, x2go will lose its mouse focus and keyboard focus and there is no way to grab control of the session. Even restarting x2go will not bring the focus back. The XFCE VM…
admiles
  • 403
  • 1
  • 5
  • 12
6
votes
2 answers

Vagrant The machine is in the 'gurumeditation' state After Installing Android Emulator and Minikube

Hy folks, I'm using Vagrant box provisioned with Ansible and provider Oracle virtualbox, it was working fine for me. But one day i installed Android Studio and it's Emulator and Minicube wit KVM. Afterwards vagrant with virtual-box just stop…
Muhammad Taqi
  • 5,356
  • 7
  • 36
  • 61