KVM + qemu + virt-manager - A better way to Virtualize on Linux?
Вставка
- Опубліковано 29 тра 2020
- In this video I show you how to setup qemu/kvm/virt-manager aswell as how to install a virtual machine in it, and convert an already existing vdi that you would use with virtual box into a qcow2 image to use with qemu/kvm/virt-manager
Subscribe to my UA-cam channel goo.gl/9U10Wz
and be sure to click that notification bell so you know when new videos are released. ₿💰💵💲Help Support the Channel by Donating Crypto💲💵💰₿
Bitcoin
3MMKHXPQrGHEsmdHaAGD59FWhKFGeUsAxV
Ethereum
0xeA4DA3F9BAb091Eb86921CA6E41712438f4E5079
Litecoin
MBfrxLJMuw26hbVi2MjCVDFkkExz8rYvUF
Dash
Xh9PXPEy5RoLJgFDGYCDjrbXdjshMaYerz
Zcash
t1aWtU5SBpxuUWBSwDKy4gTkT2T1ZwtFvrr
Chainlink
0x0f7f21D267d2C9dbae17fd8c20012eFEA3678F14
Bitcoin Cash
qz2st00dtu9e79zrq5wshsgaxsjw299n7c69th8ryp
Etherum Classic
0xeA641e59913960f578ad39A6B4d02051A5556BfC
USD Coin
0x0B045f743A693b225630862a3464B52fefE79FdB - Наука та технологія
Plot twist: He's actually using linux mint in a VM on windows 10
no he is running his vm on gentoo
@@devikakrishna4464 no he is running linux mint/windows and gentoo In virtual box
he likes gentoo
This would make me so sad
He runs linux mint on a vm on Mac os
Hey MentalOutlaw, you might find the 'Noise Removal' tool in audacity useful when recordings go bad. I used to own a very cheap mic and it'd always pick up a shit ton of noise, but audacity filtered it out pretty well. Keep up the good work!
its better if keeps the noise honestly that much noise damage his voice quality when using a noise reduction tool
@@tylermurphy2231 no it only really damages audio if there's an insane amount of noise or you don't set it properly in audacity, you're supposed to take a little part of just the noise so the program knows exactly what to filter, in a case like this, you wouldn't even notice any noise removal, it would just sound like a better recording.
@@ChristopherGray00 I agree with both. It can ruin the voice and I've been there, but this is just background rumble and does not overlap a lot with the frequency of his voice. So he should be fine if he uses smart removal where he provides a sample of the noise.
I thought this was a Luke Smith video... You know, the thumbnail...
meme thumbnails = more views. The boomer was right about that.
@@MentalOutlaw Ill watch ur vids just cuz of seeing your name, but the memes honestly turn at least me off lol
he doesn't know...
This channel will blow up in any given time
The things that you talk about technology are 200% connected with my heart
thank you OP and comments section, i just got stuck trying to use virt-manager earlier 🙏
I have long experience with KVM. I also had same difficulty when i started to use KVM. The reason why it was hard is lack of knowledge for modules of libvirt(libvirtd sock), virsh(definition file XML you may see in GUI), qemu-img, virt-manager, cloud-init and VNC.
I do recommend to find information about the above keywords. And please try to be adopted to virsh command line if you only run linux server because virsh allows you to access guest machine's console directly without VNC.
extra tips for performance.
- You need to install virt-io driver for disk, network and GPU because it is fastest driver.
- If you need GUI based guest host, you must go with PCI paththrough. I've never gotten better performance than this composition in VMware, VirtualBox and Hyper-V. VNC based connection is very poor performance even you are running on localhost. But it requires a lot of information because you have to understand how linux's device works because bare-metal system is always different by having different hardware. I could run guest OS with Nvidia and AMD graphic card for MAC OS, windows and Ubuntu.
Reference access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/virtualization/chap-virtualization-pci_passthrough.
- Everything you will try is can be done with KVM but you always need to have knowledge for the technology. If you
Kenny I am hoping you consider an update to this in the near future...your explanations are clear and I watch every one you produce. Thank you.
Are you planning to make video about doing gpu passthough?
yeah it'll be cool, especially using multiple gpus for different OS'es
@@oakbricks Im talking about having one videocard of each brand, so you can run multiple OS VM's simultaneously. Also most of the monitors have multiple ports for variety of different standards, so you can hook up all your gpu's directly to one monitor (using same setup right now, but instead of different gpus I just switching between desktop and notebook).
Update & correction: the command should be `sudo addgroup libvirt`, so everywhere use `libvirt`, NOT `libvirtd` as the group.
isn't the command groupadd?
Here's a tip, switch from Listen Type Address to None in Spice menu
Change Video to Virtio and tick enable 3d acceleration
Go back to Spice menu and enable OpenGL.
There you have now all draw calls ran directly on your GPU
If you want to use other GPU (like a dedicated) ran virt-manager with DRM_PRIME=1 (or other number according to gpu)
And pick that GPU in Spice menu.
Very Sadly this doesn't work with Windows guest, because GPU passthrough not only is harder to do but also needs hardware support for passing through feature, While this VirGL method i told before is hardware agnostic
when I do that, the vm screen looks really wonky, with dots everywhere, would you know what's causing this?
@@johannvaniperen7249 weird what's the host and guest os? What's the output of dmesg? Piping it to grep "accel" should suffice I think...(dmesg | grep "accel") But if unsure put the full dmesg output on Pastebin or sth.
@@johannvaniperen7249 probably 2 gpu system, are you sure you're picking the right one?
As one of the commentors, thanks a lot bro.
Happy 6k
I started with virtbox too... Then switched to qemu when I wanted to do pass through. (I run a windows vm on linux - so I can run cad on my laptop. Passing the dedicated video card to it.) It has been rock solid. (not that I remember having any problems with virtbox)
What CPU and What GPU does your laptop have in it?
Additional to that, how difficult was it to do pass-through on your laptop?
Do you have any reference guides or materials that you could share with the community about setting up GPU Pass-through on a laptop?
Thanks for your time, all the best!
Peace :)
@@longnamedude3947 hey, have you found anything useful in your search? I’m pretty familiar with the qemu man page at this point but not sure what options can squeeze out more perfrormance (Windows barely can run at the moment, despite KVM acceleration).
cool video. Will eventually try this to make virtual machines and maybe pass in an extra gpu to make it even faster.
it took me a grand total of 2 weeks. 2 WEEKS. to get KVM passthrough working propperly. and a new graphics card for a 1x slot. And figuring out how to map samba shared. Lots of headaches but I haven't touched it in months and it runs like a champ because I stay on the arch LTS kernel and blacklisted nvidia driver updates so it doesn't kill my linux install.
I've found that most of my linux problems stem to nvidia drivers, I really should get an AMD card.
i had a similar problem recently, i ran pacman -Syu and tried to reboot, but then it wouldnt boot, so i looked at the /var/log/Xorg.0.log and it couldnt find the nvidia driver anymore, so i reinstalled it and i could finally boot
Aye, I also struggle with Virt Manager. But every time I am tempted to switch to VirtualBox I remember the joys of working on a terminal the size of a mail stamp because VirtualBox won't resize the damn window unless you have virtualbox-tools installed (not compatible with 90% of my guest VM) and I stick with Virt-Manager
You can use the screen scale option in View to increase the screen size
kvm qemu has been fairly easy and reliable for me for the last decade. I don't know what trouble you've had with it, I'd assume just a missing package. the most trouble I've had with it was long ago when I needed to install a custom networking script to set up a wan connection to a router in a vm. that custom script hasn't been needed in a very long time and everything just works. it's very reliable and easy to use, and doesn't require a gui.
About your comment at 5:27. Actually there is no such difference between modern virtualization. VMware, Virtualbox, KVM, Bhyve, Xen and Hyper-V all run the guest code directly on the host CPU (with the help of the Intel VT-x, AMD-V or other virtualization extensions for various architectures). Any difference in performance are due to other "bottlenecks" in the hypervisor, for example quality of hardware emulation and/or use of paravirtualization.
Gnome boxes seems to be the easiest choice today and if im not wrong you can also run a gnomeboxes vm with virtmanager
Yes you can, just Klick on file and add a connection. Use the drop down menu to select user session and add that. Done :)
flawless distro hopping in virtual box.
with virt-M I have issues when I exit and go back again, it seems to need a fresh install every time! this shouldn't be some problem a user has to "fix": surely out-of-the-box basics dictates that a virtual machine doesn't do that!
Have you tried using qemu in command line? I'm a smoothbrain and even I think it's easy
Try virt-install ;)
like wifi adapter passthrough? nope
but if you just want internet access it works ootb on my machine
though id say its not difficult at all you should try asking on ##linux or arch linux forums/subreddit/irc
@Lord Brookie Virt-manager should spit out the qemu command line options, have you checked what it's doing?
I discovered QEMU/KVM out of necessity because as of the time this comment if being written, VBox doesn't support Ubuntu 22.04. So I had to install and learn how to use QEMU/KVM (with the GUI)and it's not bad at all.
I'd say VirtualBox is way easier to use. But QEMU/KVM + VirtManager/libvirt is more powerful to like do advanced things like hardware passthrough for GPUs and finer control over virtual networking.
Altough, I admit I'd like to see libvirt improve to be more accesible. For example, is somewhat complicated to do a "linked clone" of a VM, while in VirtualBox is straighforward. Also I have had some problems with EFI in libvirt.
Would be awesome if you could show how to install and setup KVM + qemu + virt-manager on Gentoo
Actually gnome-boxes is the noob virtualization in my opinion and if you're running fedora it's installed by default and It just works!
I think the main reason people use virtualbox is because unlike qemu it also work on other platform so people coming to Linux automatically goes for it while in fact it's much harder to use than something like gnome-boxes and don't offer the same extensibility of virt-manager and it's slower in my experience.
If you switched to Linux please do yourself a favor and switch to qemu.
Boxes is pretty nice for accessing multiple VM's or remote clients. For setup and management of the VM it's fairly limited.
Once you get libvirt and qemu set up, it can be pretty slick.
Hey Mental, VirtualBox doesn't even support software emulation.
It also directly executes code on the CPU.
Btw I use virt-manager.
Are you planning to make single gpu passthrough tutorial?
Good video.
What happened to the microphone?
GNOME BOXES (KVM) works out of the box for simple scenarios. But yes, maybe VirtualBox is easier for GPU acceleration and networking
Yeah I like Gnome boxes as well and it works for super basic stuff. But once there is only a slight thing off you need to edit the XML with either Virt-Manager or virsh which makes it pretty much useless. It's a little too simplified. It's a bummer, it's such a beautiful and easy to use program... At least you can import the VMs to Virt-Manager easily and edit it there... It could be an awesome showcase for GNOME
Would you be interested in revisiting the QEMU/Virt-manager/Virtio stack? I just spent the weekend getting Win10 and Pop_OS working with GPU & peripheral pass-through, getting better performance than I would bare metal surprisingly. Would be willing to help you give it another shot if you are at all interested.
Have done the same using Manjaro as the host, although admittedly my windows guest with 6 cores out of the 8 on my Ryzen 7 1700x nested through Hyper-V to get around some anticheat shenanigans regarding VMs, I do not get bare metal performance. Nearly, but not quite
Nice guide...though i'm wondering same about web based virtualization solution is good ? PS : background noise is little ...
Not great you'd have to use a NoVNC backend or sth like that and those are painfully slow. On some you can download a spice config to open it in in virt-viewer and then it's pretty good.
I just tried VirtualBox - seems to just work. Then I read about nested virtualizations...recursives all the way down!
So there's an extension that allows the VM to share files with the host? Cool - trying to figure access to SD cards (running Kubuntu as VM)..cheers.
Does anyone know how to bridge the network on vert-manager as I have tried all different kind of network settings and cant get it to bridge as vert-manager always has this strange allocated IP address for the VM so its not possible to SSH into the vm which it does simply on virtualBox but I dont want to use virtualBox vm's as I want to SSH into VertManager vm's?
I have 10 guest OS ..can u please tell me how to Start/stop host on a schedule
Really nice & in-detail video!!!
While installation I didn't get the bridge network option as you....And now I am unable to have internet connection on my virtual machine.
Can you please give a solution
Have you found a solution yet lol? I have the same problem
i just installed gentoo in kvm but i ran into the issue sort of what he ran into at the end of the video... i cant get the the full screen to work and the "auto resize vm with window is grayed out" and i cant copy cut paste into the vm... i know i have to setup something but not sure... its driving me crazy that i cant seem to get this to go! i really like kvm and use it alot unfortunately im new to gentoo if anyone have any ideas please reply...
TBH, virtualization is not tech noob stuff. I wrapped my head around virtualbox for quite some time before knowing which buttons to push and which to not push. QEMU alone is quite jarring, but once you crossreference the options and their arguments with your past experience in VMware or VirtualBox, you can get around it (still can't boot a VM in UEFI mode on MacOS). Virt-manager adds another layer. When you imagine the average Racecar Johnny which doesn't even see the installation process of windows because he buys a computer with OEM Windows, you can be sure this isn't going to be simple.
You got copy/paste like Virtualbox?
Maybe you can make a video about how to share a folder. Share a folder is quite troublesome. Peace.
4⁴455⁵5⁵⁵5⁶⁵⁵⁵⁵⁶66⁷⁸76⁸8777⁷777787²2²⅔3²²⅗3367⁶⁵3456⁸7⁷
@@syedia what?
Its not hard. Use samba
@@lordofwizard835 I tried it...and I tried it hard but never achieve it...ce'st la vie! 😔
It"s hard to get done!
You speak that you released the virt-man, do You have a github account ?
What if your using RC (gentoo)
There is no need to promote the use of KVM, it's what 80% of the internet runs on (AWS, Google Cloud) and even for enterprises and big corporations hosting their own servers - Nutanix AHV is a KVM-based hypervisor for businesses with added features. For small businesses there's Proxmox, so KVM is literally everywhere. If anything, you'd have to fear for the survival of VirtualBox .... but... do we really even want an Oracle product to survive?
No, Oracle is the new Microsoft that we can hate on now that Microsoft apparently loves open source :P
@Xero yeah kind of, they both deserve hate to be fair
Oooo great can't wait to see people saying M$ and oracl$ and aggressive annoying people who don't agree with them along with them trying to act cool by saying "I use arch btw", good amount of Linux community in a nut shell
@@battlebuddy4517 it's oracl€ not oracl$
brosky what are your thoughts, on the Windows Linux Subsystem 2? supposedly you can run a linux kernel on your machine... so you cam run linux command line tools on windows, they even have a new windows terminal that you can customize
What's the point of putting golden rims into a Honda civic, if you are forced to use Windows just use it and switch to a not shit OS the second you are done with your work.
It works annoyingly well and integrates superb with Docker desktop and VSCode. But hey I'm a Linux guy so nothing could drag me away from it :P
@@southgonholditdown dude honda civics are the shit
@@southgonholditdown The point is that the wheels are the same size as the supercar you are entering the race with, but if the wheels fall off, you aren't destroying an expensive production system.
@@southgonholditdown believe it or not some people actually like windows you need keep in mind people have different ideas and use cases
I am on Linux Mint Cinnamon 19.3. I followed the installation instructions provided in the video. When I launch virt-manager I get the following error: "python 3.4 or later is required, your's is sys.version_info(major=2, minor=7, micro=17, releaselevel='final', serial=0)". The command "python3 --version" gives me Python 3.6.9 as my version, which is later than python 3.4. Looks like a bug to me. I tried uninstalling virt-manager and re-installing via Software Manager. I noticed that in Software Manager it states "NOTE: the GUI is still considered experimental." Maybe it is not fully baked yet.
Please run ls -l /usr/bin/python
I use vmware and its has worked issue is installing vmware tools on my Mx linux.
agree, i dont even understand what to search for getting info about how to use virt-manager
i have some decent notes that can get you started overall
@@reasonmath can we see them? i'm interested hehe
also you should check out a suckless distro like morpheus or sabotage linux
The simplest way is gnome-boxes, if you need to tweak settings you can tweak that VM using virt-manager
Hi ... If I simulate windows and download drivers for my hardware ... Is it possible that suppose a level 0 kernel malware can influence my hardware through the virtual machine?... Just curious thanks
You just passthrough another GPU and windows can use that
There too are vulnerabilities that can affect you(as in the VM) and the host as well. Due to how hyperthreading and memory access works there will never be a 100% solution but normal malware won't affect your host os.
I hope that kind of answers your question!
Yes VM escapes are possible, but tend to get patched quickly and the hardware makes it hard to do. Also if the IOMMU is mis-configured, disabled, or missing, hardware assigned to one system can snoop/mess with other devices on the same bus.
Always did that since 2013 and never looked back to virtualbox again.
I can't get the guest OS to use my actual display resolution, and can't find anywhere how to force the guest display to be a certain resolution :P The guest is not a Linux/X11/Windows so none of the information I found works for changing from within the guest
Also for some reason whenever I try using Spice, losing focus of the window (going to another desktop) freezes it
I use virtual manager for gpu passthrough with mac os vm, and windows 10 vm. I would never use virtual box. I'm able to play vermintide 2 at 40-60 fps on this old 3rd gen intel cpu with nvidia gtx 1060 3gb inside the VM. My hardrive being even older. I won't give up linux for mac or windows ever again.
Same it's really awesome :) Tho I gave up on Passthrough as the framedrops are too bad for me, especially in GTA and other triple A games. So I mostly only play games that work with Lutris either with a hack to disable Anti-Cheat or normally. The only game that I needs windows now is Forza... Dammit can't give up that game...
@@LampJustin You mention that you had "Frame-Drops".....
What hardware did you have, and how much of the hardware was assigned to the "Windows 10" virtual machine?
There's a feature on Windows that can help in some cases, Memory Ballooning, look into it.
Gnome Boxes on fedora 34 seems to work well enough for my W10 CAD/CAE VM. UI seems smooth enough even without proper GPU acceleration, so maybe old games would run well too (haven't tried yet).
As I understand it, Boxes is just another front end for KVM/QEMU with some sensible defaults which made my W10 VM "just work".
I didn't know boxes was a lvl 1 hypervisor.
Btw have you tried using tiny10 instead of win 10, tiny10 is a stripped down win 10 that uses like 450 mb of ram.
@@godfather7339 It's not, it's just a front end for KVM/QEMU. If you need more options (where to store the image, for instance) you're better off with something like virt-manager, but for quick & dirty stuff boxes works a treat.
Tiny10 sounds like a good idea, thanks! 😊
Hold up, you are using a debian based distro?
I think he sometimes uses mint for privacy we all know he's a Gentoo user
@@jacobhinchliffe6659 why mint for privacy?
I wish it had seamless windows.
i use virt manager to play roblox on linux lol, besides sudo apt install virt-manager, reboot and sudo systemctl status libvirtd is all it takes to install it
Use grapefruit to play roblox on Linux it works great
@@jacobhinchliffe6659 yeah this comment was made before u could play roblox on linux with wine lol. Now i use the method ur saying
@@Demrish I just thought to mention in case lol
@@jacobhinchliffe6659 yeah
Hey mam just remember or investigate about the meltdown vulnerability on Intel CPUs
Dafuq you can just enable the mitigation in the CPU tab in Virt-Manager, what's the deal?
@@LampJustin It is good to be aware of any potential risks that your hardware is exposed to.
I say the above comment as a general comment in regards to all hardware and software.
"Meltdown" and other "SCEA's" pose a genuine threat to many systems out in the wild, and so practicing safe security measures is a good thing to do if you want to ensure you're best protected.
mfw no `sudo systemctl start --now libvirtd`
Now amateurish that´s a thumbnail