You are not logged in.

#1 2017-04-30 05:01:35

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,018

Thoughts on kvm ?

Been dorking with the subject off/on for awhile. So finally went ahead and installed qemu-kvm, libvirt etc.

Figure since it's officially integrated into the kernel and classed as a true hyper-visor would see what it's like.

Yep seems dandy, setting up vms gui style with "virt-manager" is about as simple as doing so in say virtualbox. Though for the aforementioned reasons feel a preference towards kvm.

Haven't extensively forked with it much but seems like good nixy-ness. Any comments on this topic fellows ? Facts, experiences or info you'd like to share ?

Vll! smile

Offline

#2 2017-04-30 05:35:14

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,018

Re: Thoughts on kvm ?

In the interests of full disclosure a couple things I've noticed.

When I installed the libvirt packages and upon checking "sudo systemd-analyze" they had added over 5secs to boot-time. So ran "sudo systemd-analyze blame" or "sudo systemd-analyze critical-chain", turned up two new service files running, libvirtd.service and another libvirt-guests.service.

They also load several additional kernel modules and add a bit of memory overhead. My solution was to stop and then disable them with systemctl ie:

sudo systemctl disable libvirtd

Then the other. Yep boot's back to where it was/normal. Though in order to use vms in virt-manager I now have to enable these w systemctl and reboot.

No biggie and I'm planning on adding an alias for it to reduce typing. Just a FYI, heads up advisory. Don't feel the added overhead is a big deal either way but don't see myself using kvm vms frequently enough to leave them running.

Also you'll need to add your user to the following groups to run vms as non-root.

"sudo adduser yourusername kvm"
"sudo adduser yourusername libvirt"

There ya go, launch in run dialogue with "virt-manager".

Last edited by BLizgreat! (2017-04-30 05:46:26)

Offline

#3 2017-04-30 07:48:16

o9000
tint2 developer
From: Network Neighborhood
Registered: 2015-10-24
Posts: 399
Website

Re: Thoughts on kvm ?

Most of the cloud service providers use KVM for their virtual machines. KVM works well, but qemu is a bit more fragile. QEMU is sometimes replaced with other emulation software.

As for the extra kernel modules, one would get the same thing with VirtualBox or VMWare.

User mode linux is something else you might want to play with. You run another kernel with its own OS image as a process.

Offline

#4 2017-04-30 09:40:54

twoion
ほやほや
Registered: 2015-08-10
Posts: 2,482

Re: Thoughts on kvm ?

There's also Xen. A desktop OS which makes good use of Xen is QubesOS.


A silent kite against the blue, blue sky

Offline

#5 2017-04-30 10:55:32

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,018

Re: Thoughts on kvm ?

^Fail ! The thread is about kvm ! Messing round, no worries but thread is about kvm. smile

The mention of those two service units and the loading of modules and other misc stuff is just for benefit of nixers who got curious and decided to install libvirt-etc packages.

Don't want them doing so and then looking at me going what gives dude, I installed this crap you mentioned and now got some effects I don't like!

Got about 20 pdf's on kvm atm. When I'll actually get around to more than skimming some of them is something else entirely. smile

Based on some really brief gui'ey dorking virt-manager looks cool, seems easy to use and will be doing further dorking with it and virsh.

Mentioned in another thread, thought about creating a custom install specifically tailored for kvm hosting and ripping off or custom compiling some kernels to install on kvm guests tailored to the purpose.

Though atm just not up to the time such a challenge would entail and are already existing projects in the niche.

End brain-fart babble. All kvm goodness or commentary please feel free to keep coming fellow nixers.

Vll! smile

Last edited by BLizgreat! (2017-04-30 10:55:58)

Offline

#6 2017-04-30 11:03:58

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 643

Re: Thoughts on kvm ?

I'm a happy user of xen virtualization solution: on debian jessie I have 4 concurrent virtual machines. Three debians (stable, testing and sid), one for git, one cups printer server with non trivial printer configuration, and one sagemath notebook server. The fourth is FreeBSD running mainly apache web server. Note: only servers, no GUI so far, but it should be simple matter of setting up the vnc.

Everything (save for /boot) is lvm-based. I cannot recommend it enough, as backing-up entire virtual machine is extremely simple and with zero time offline via lvm's snapshot feature. (Of course, btrfs and zfs are also possible, but lvm seems to be best/easiest solution for my case.)

The hardest part for me was setting up network routing on dom0: as I'm not very familiar with networking it took me some time to figure it out (for example, how to redirect port 80 coming to xen0 to FreeBSD virtual machine and similar). In the end I did it with iptables (I can post details if anyone is interested).

And, so far I'm very happy with it.

Except, later I learned that I should have gone via kvm route, not xen. Basically, they are the same, but kvm is embraced by RedHat, so its development is probably faster.

So, BLizgreat, go fo kvm, but beware of steep learning curve. AFAIU, you want emulate desktops ... there is always question of the performance with graphics, being it virtualbox, xen or kvm. There are some ways to make it really fast (so called pass-through to the graphics card), but I have no experience on this.

EDIT: Oh sh**, I mentioned xen ... oh dear ... BLizkvm, will you ever forgive me?  devil

Last edited by iMBeCil (2017-04-30 11:13:46)


Postpone all your duties; if you die, you won't have to do them ..

Offline

#7 2017-04-30 11:51:54

twoion
ほやほや
Registered: 2015-08-10
Posts: 2,482

Re: Thoughts on kvm ?

iMBeCil wrote:

So, BLizgreat, go fo kvm, but beware of steep learning curve. AFAIU, you want emulate desktops ... there is always question of the performance with graphics

The problem of graphics performance under KVM even without gfx card passthrough is solved with virgl + SPICE (3D acceleration) for suitable guests; the problem of 2D graphics performance is solved with qxl + SPICE. Not on Debian, because their packages are too old. Always use an unstable Debian or rolling distro for high-performance KVM applications…


A silent kite against the blue, blue sky

Offline

#8 2017-04-30 12:51:48

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: Thoughts on kvm ?

I use QEMU/KVM quite a bit, it's much easier than VirtualBox and free (as in speech) as well smile

Been playing around with vmm(4) recently, that can now boot Linux systems.


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#9 2017-04-30 13:40:49

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,018

Re: Thoughts on kvm ?

Ummm dear Imbecile, FAIL, FAIL, FAILLLLLLL! Ah I can't stay mad atcha fellow nixer, all's forgiven. wink

Thanks for the interesting adds guys. Yeah has just seemed to me for a long time kvm's the way I want to go and the hypervisor I'm going to focus on.

Long time been well integrated into the kernel and as mentioned Redhat muscle behind development. Also thanks Imbecile for the Bsd mention. Been wanting to try it and basic research seemed to indicate it doesn't like sharing a hdd. Ha it'll never know it's in vm !

Oh yeah buddy, got the disk all to yaself, no ya don't, fooled ya, who's your daddy Bsd !?! tongue

One of those pdf's is a 500+ pg Redhat on kvm. Just scrolling the index makes my eyeballs squirm. But guess ya know what they say, nothing worth having comes easy.

Gonna have to buckle my seat belt and study up on kvm.

Last edited by BLizgreat! (2017-04-30 13:44:01)

Offline

#10 2017-04-30 14:23:13

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 643

Re: Thoughts on kvm ?

BLizgreat! wrote:

Ummm dear Imbecile, FAIL, FAIL, FAILLLLLLL! Ah I can't stay mad atcha fellow nixer, all's forgiven. wink

Phew, that was close big_smile

BLizgreat! wrote:

One of those pdf's is a 500+ pg Redhat on kvm. Just scrolling the index makes my eyeballs squirm. But guess ya know what they say, nothing worth having comes easy.

Oh ... I feel your pain dear fellow BLcake. That's the second worst thing about kvm (and xen, as well) ... either documentation is immense and too technical, or examples are outdated. (I were unlucky to start with xen when they switched from 'xm' to 'xl' toolstack. Almost every f***ing example and tutorial across internet has been 'wrong' ...) But nothing a few beer couldn't cure  devil

Apparently, all this stuff is for experienced nixers, and it has not reached its 'stable shape' (don't know how to put it in english) ... everything is still fluid i.e. changing (I mean: toolstack)

In the end, I'd say it boils to:
1) google the most recent (short!) examples/tut-s of that you think you want to achieve
2) carefully examine all commands with the help of documentation
3) try it - and be prepared to fail miserably
4) go drink some booze and relax
5) ????????
6) profit

NB: about three years ago, I tried to switch from VirtualBox to kvm, with the hope that the Windwos XP in kvm be faster and smoother (and of course free). I recall that it was more-less the same, except that at that time front-end for kvm were less advanced compared to VirtualBox's one. Today, I'm still with VirtualBox, but for no particular reason ... except that I have no enough time to try to swtich.

Anyway, have fun BLcake!


Postpone all your duties; if you die, you won't have to do them ..

Offline

#11 2017-04-30 15:45:53

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,018

Re: Thoughts on kvm ?

Lmao, understood every word and well said fellow nixer. The 586pg deal from Redhat is 2017 RHEL. RH-enterprise-linux.

Arghhhh, thought of trying to translate this sucker into general Nix, or Debian specific is also causing parts of my anatomy to twitch.

Paths are going to be different, cmds different, utils and packages diff to whatever extent but probably plenty of quality concepts which can be applied to kvm on Nix in general.

Also been meaning to mess with CentOS, about to see how big the iso is going to be. Shudder though have staunchly resisted moving far away from Debian(or based).

Other than brief forays into Arch and Slackware/based. CentOS is going to be outside my not all that skilled Debian comfort-zone.

Sighs gnu/nix is gnu/nix. Yum and rpm's can't be all that radically different than apt/titude and debs. Hopefully anyway. wink

Last edited by BLizgreat! (2017-04-30 15:47:30)

Offline

#12 2017-04-30 16:03:32

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,018

Re: Thoughts on kvm ?

3.8gbs for CentOS v. 7, 64bit DVD.

Last edited by BLizgreat! (2017-04-30 16:03:49)

Offline

#13 2017-04-30 17:16:54

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,018

Re: Thoughts on kvm ?

On the other hand, screw that noise, that's 3hrs download time alone.

Just going to scrape away a bit through the RH pdf for now. Anyone wants a copy, just went to Google and searched for "pdf kvm" it'll pop up and it's not swiping,  RH puts it out there for folks.

Should be plenty of general kvm goodness for whoever's interested. Pinning vcpu's to actual cores, tuning vm disk i/o, memory tuning kvm-vms, network bridging etc blah blah.

Last edited by BLizgreat! (2017-04-30 17:17:53)

Offline

#14 2017-05-02 17:18:49

Krisbee
Member
From: Londinium
Registered: 2016-01-08
Posts: 10

Re: Thoughts on kvm ?

Debian is my comfort zone: Siduction on the desktop, bunsenlabs on a laptop.

Stuck to VirtualBox until a couple weeks ago when I needed nested virtualisation and so turned to KVM. Just scraped the surface so far and I would hate to have to rely on the CLI for some of those long complex command chains, so the Virtual Machine Manager gives a good route into using KVM. Set-up on Debian is straightforward and has the systemd side-effects already mentioned.

KVM allows remote connections too. There are KVM webclients. but if you have a remote host with a few simple VMs then KVM virt manager allows you to set up & control them in the same way you do any local VMs. Use spice for local, and VNC for remote connections. Supposedly it even supports connections to VMs running under byhve, but you need to have libvirtd running on the remote host.

Apart from other tests, it allowed to see what the basics of proxmox was about by creating a VM in KVM. Nested Virtualisation (assuming hardware support) is worth exploring.

Offline

#15 2017-05-02 20:35:11

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 643

Re: Thoughts on kvm ?

Krisbee wrote:

Stuck to VirtualBox until a couple weeks ago when I needed nested virtualisation and so turned to KVM. Just scraped the surface so far and I would hate to have to rely on the CLI for some of those long complex command chains, so the Virtual Machine Manager gives a good route into using KVM. Set-up on Debian is straightforward and has the systemd side-effects already mentioned..

Any links, perhaps, for us of more lazy inclination? smile

Krisbee wrote:

Nested Virtualisation (assuming hardware support) is worth exploring.

Oh ... yes ... it works with VirtualBox too. I remember trying to understand basics of KVM inside VirtualBox Debian VM ...


Postpone all your duties; if you die, you won't have to do them ..

Offline

#16 2017-05-02 20:42:12

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: Thoughts on kvm ?

iMBeCil wrote:

Any links

https://wiki.debian.org/KVM


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#17 2017-05-02 20:45:10

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 643

Re: Thoughts on kvm ?

^I meant "... links, except the obvious ones ...". Not to mention that this one is not the newest one ... tongue tongue

(Did you really think that I didn't find it already?)


Postpone all your duties; if you die, you won't have to do them ..

Offline

#18 2017-05-02 20:48:50

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: Thoughts on kvm ?

iMBeCil wrote:

(Did you really think that I didn't find it already?)

I though perhaps you were posting from the brewery again...

devil


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#19 2017-05-02 20:51:01

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 643

Re: Thoughts on kvm ?

You got me ... almost. It is not Friday today.  monkey  monkey


Postpone all your duties; if you die, you won't have to do them ..

Offline

#20 2017-05-03 03:04:48

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,018

Re: Thoughts on kvm ?

This about vga pass-through in kvm. Apparently it's becoming poss for near native window$ gaming performance in kvm nowadays.

I don't game and haven't had win anything installed in quite awhile but that type of thing could appeal to some nixers.

Last edited by BLizgreat! (2017-05-03 05:41:22)

Offline

#21 2017-05-03 06:52:22

Krisbee
Member
From: Londinium
Registered: 2016-01-08
Posts: 10

Re: Thoughts on kvm ?

iMBeCil wrote:

Any links, perhaps, for us of more lazy inclination? smile

I can only commment on using KVM on Debian. I started from the handbook page and then just  searched for info on "KVM + jessie" and "Virtual Machine Manager":

https://debian-handbook.info/browse/sta … ation.html

You will need to install bridge-utils.

If you want an example of using "Virtual Machine Manager" have a look at this:

http://rockstor.com/docs/kvm_setup.html

What is not mentioned is that if you have a single nic on your KVM host and no existing bridge, then the installation of "Virtual Machine Manager" GUI creates the bridge and adds the nic as its single member.  In my case, I was pleasantly surprised to find this did not interfere with network manager.

If you need to create UEFI guests, then install the ovmf package and edit the /etc/libvirt/qemu.conf file.

Background reading:
https://libvirt.org/ , especially the networking handbook https://jamielinux.com/docs/libvirt-net … -full.html

https://doc.opensuse.org/documentation/ … index.html

https://access.redhat.com/documentation … _this_book


BLizgreat! wrote:

This about vga pass-through in kvm. Apparently it's becoming poss for near native window$ gaming performance in kvm nowadays.

I don't game and haven't had win anything installed in quite awhile but that type of thing could appeal to some nixers.

The holy grail of Pci pass-through is not just confined to gamers who don't want to multi-boot. It's a requirement for storage appliance VMs in all-in-one setups.

PS Don't forget Centos 7 minimal ...  An exmaple setup using KVM:

http://www.beginswithdata.com/2016/12/3 … vm-coreos/

Last edited by Krisbee (2017-05-03 07:59:34)

Offline

#22 2017-05-03 13:40:05

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 643

Re: Thoughts on kvm ?

^Thank you very much Krisbee, appreciated. Few of those I knew, but it is always good to know stuff which worked for others. Thanks again.


Postpone all your duties; if you die, you won't have to do them ..

Offline

#23 2017-05-04 09:30:44

Krisbee
Member
From: Londinium
Registered: 2016-01-08
Posts: 10

Re: Thoughts on kvm ?

iMBeCil wrote:

^Thank you very much Krisbee, appreciated. Few of those I knew, but it is always good to know stuff which worked for others. Thanks again.

Left this one of yesterdays' list:

https://scottlinux.com/2016/08/28/gpu-p … ian-linux/

It may not be entirely current, but it provides a starting point. 

Doing this is not something of interest to me, but I believe this now extends to Intergrated graphic Passthrough on supported hardware.

Offline

#24 2017-05-25 01:47:50

KrunchTime
Member
Registered: 2015-09-29
Posts: 857

Re: Thoughts on kvm ?

Here's part 1 of a ?-part series on using KVM.

@BLizgreat!:  How is accessing peripherals on the host from the client under KVM?

I've pretty much used VirtualBox up to now (Windows 8 VM), but am considering other options.  Using peripherals connected to the host from the client always seems problematic under VirtualBox; e.g. doesn't work.  Last week I attempted to install a customized Windows disk & partition utitity on a USB thumb drive and was unable to do so because I just could never get VirtualBox to even see the drive.

Last edited by KrunchTime (2017-05-25 01:54:12)

Offline

#25 2017-05-25 21:45:39

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,018

Re: Thoughts on kvm ?

Haven't really tried much Krunch but virt-manager is really easy to use overall imo. So if you've got the time would try it out and see. I like the fact that it's supposed to be so well integrated into gnu/Linux, so should be well supported now and in future.

Offline

Board footer

Powered by FluxBB