Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Qemu vs Libvirt for everday desktop use?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
carcajou
Apprentice
Apprentice


Joined: 10 Jun 2008
Posts: 250

PostPosted: Thu Mar 06, 2025 8:43 am    Post subject: Qemu vs Libvirt for everday desktop use? Reply with quote

Hello all.

Approx. 2 years ago I switched to "raw" qemu/kvm from virt-manager (libvirt). Libvirt seemed an enterprise-grade overkill for my use case where I am running:


  • a single Windows 10 VM (mainly because of MS Office and legacy games) and
  • some Linux/BSD throwaway VMs either in desktop mode or "container-style" where I SSH into for terminal based tools.


I am not doing anything "funny", it is mostly to keep my Gentoo host clean, especially when I need to try out something fast, so binary distros have an advantage here. I literally have 2 bash aliases/scripts (one for Windows which I occasionally run in -snapshot mode), executed as normal user, which I can share this evening (in case you can give me some feedback or a tip).

My questions:

1) is there any reason not to use raw qemu? Like performance-wise and security-wise (for my use case)? The worst (most dangerous) thing I do on these desktop-Linux-VMs is opening a shady website while mostly using VPN and occasional torrent-ing.

2) do you maybe have some tips regarding performance/security/setup/user-interface tuning of Qemu and related options?

Thank you very much for your help and feedback.
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3542

PostPosted: Thu Mar 06, 2025 11:16 am    Post subject: Reply with quote

Quote:
1) is there any reason not to use raw qemu?
Protecting your sanity.
Libvirt is a launcher for qemu (and I think LXC and maybe something else too). It is convenient. Unless you're doing something funny, there is little reason not to use it on top of qemu.
Quote:
2) do you maybe have some tips regarding performance/security/setup/user-interface tuning of Qemu and related options?

Virt-manager provides both, user and management inerfaces for qemu VMs :lol:

This said, there's nothing inherently wrong with DIY launchers for your VMs. If you like it raw, go ahead and use it raw.
_________________
Make Computing Fun Again
Back to top
View user's profile Send private message
NichtDerHans
Apprentice
Apprentice


Joined: 27 Jan 2023
Posts: 192

PostPosted: Thu Mar 06, 2025 11:40 am    Post subject: Reply with quote

Virt-Manger <3
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Thu Mar 06, 2025 11:42 am    Post subject: Reply with quote

carcajou,

What szatox said but libvirt cannot do it all.
I had to use virt-sh to add IPv6 to my virtbr0 interface.
In the early days of KVM support for arm64, it was a while before arm64 came to libvirt.

libvirt makes memory ballooning, moving RAM between VMs, trivial.

I've got lazy. I use libvirt where I can and virt-sh where I must.

Raw qemu is a bit 'hair shirt' but its all there.
_________________
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
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6236
Location: Dallas area

PostPosted: Thu Mar 06, 2025 11:56 am    Post subject: Reply with quote

I always use qemu cmdline.
There is a bit of a learning curve when using cmdline,
but once you know the parameters to use, it's easy to slap it into a shell script (or a bash alias *lol*).

All the vm managers do is pick a common subset of all qemu parms to expose to the user.
It's convenient, but you do give up some control.
_________________
UM780, 6.12 zen kernel, gcc 13, openrc, wayland
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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