Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Need help wrapping my head around KVM
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
eLusive
n00b
n00b


Joined: 09 Oct 2012
Posts: 4

PostPosted: Tue Oct 09, 2012 1:17 pm    Post subject: Need help wrapping my head around KVM Reply with quote

Sorry for the noobishness with this, however I've recently applied for a Sys Admin position and they've explicitly stated that their systems use KVM.

Being the Gentoo user I am, I've decided to try this intriguing sounding alternative to ESXi or OpenBox (well, that's how I'm picturing it), but I need some clarification on some things before I just jump into an installation

My research tells me that KVM runs on a level just above the kernel; ie where the OS usually is. This leads me to believe that it's a replacement for my Gentoo OS... however from the Wiki pages, it's sounding like it's a module I can build into the kernel that will provide QEMO with the ability to Virtualize and optimzize virtualized operating systems...


I'm actually confusing myself here... So can someone help me wrap my head around how KVM runs; does it run as apart of your OS (and controllable from the command line like iptables), or is it something that will sit a level below my Gentoo system and allow me to create other machines, which I can control from my Gentoo system...

Okay, I just confused myself again :oops:
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Tue Oct 09, 2012 4:43 pm    Post subject: Reply with quote

Quote:
My research tells me that KVM runs on a level just above the kernel; ie where the OS usually is.


That makes no sense what so ever. The kernel is the OS.

The host runs a Linux kernel. Maybe Gentoo, maybe some other flavour of Linux.

This linux install runs KVM. It's part user space program, part kernel module. It emulates a virtual hardware onto which you can boot another Linux or Windows system.

KVM running on a level above the kernel, must refer to the kernel running in the virtualized environment. Naturally since KVM provides that environment, KVM is "above the kernel" there. But the host itself is just a regular Linux box.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54096
Location: 56N 3W

PostPosted: Tue Oct 09, 2012 8:17 pm    Post subject: Reply with quote

eLusive,

Welcome to Gentoo.

I think what you are referring to is the priviledge rings, or levels provided by Intel/AMD CPUs.

The CPU hardware provides four of these, known as ring 0 to ring 3 with right 0 being the most priviledged can execute any instruction on the CPU level to 3 being the least.
On a normal system, the kernel is at level 0 and userspace is at level 3. The other two are not used.

Some virtualisation solutions run the guest OS at level 1. This mostly just works until the guest tries to execute a level 0 only instruction. This causes an exception, which if the guest is to continue to run, must be handled in such a way that the guest thinks that the instruction executed correctly.

Details of the exception hander vary from implementation to implementation. Exception handing is expensive in terms of performance and best avoided. However, thats all there is if you want to run an unmodified binary guest OS. In the case of a Linux host and Linux guest, both the hose and guest can be modified to cooperate.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
eLusive
n00b
n00b


Joined: 09 Oct 2012
Posts: 4

PostPosted: Wed Oct 10, 2012 1:09 am    Post subject: Reply with quote

Awesome replies; exactly what I was looking for :)

Frostschutz; I was under the impression that the kernel was a layer between the OS and the hardware, but clearly I was wrong. Thank you for clearing up where KVM sits in everything :)

NeddySeagoon; Thanks for the welcoming and for explaining the privilege rings :) It's definitely sparked an interest, but looking into that will have to wait until I get a bunch of VM's running haha

Thanks for the replies guys! Do you think it would be worthwhile adding something to the KVM section on Gentoo-Wiki that answers this question?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54096
Location: 56N 3W

PostPosted: Wed Oct 10, 2012 5:43 pm    Post subject: Reply with quote

eLusive,

The easy way is with Virtualbox. KVM is only slightly harder.

If you only want to get a feel for Virtual Machines, emerge virtualbox and play.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum