Virtual machines: kvm or VirtualBox, in this computer?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Virtual machines: kvm or VirtualBox, in this computer?
Hello, I am unsure of which virtualization tool i should use in this computer.
To start, i ran these 2 commands:
Code:
# check-bios-nx --verbose
ok: the NX bit is operational on this CPU.
# kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
I have asked about it in VirtualBox users mailing list, but the answers are not clear enough for me.
So, which option should i use? Or what benefits i have with each, if any, to decide?
VirtualBox has a package to be installed. But if kvm is the chosen option, i am not sure of what package i should choose in Debian. I searched with aptitude, and found: kvmtool, qemu-kvm (same description as qemu-kvm:i386), kvm (which is a virtual package provided by (!!) qemu-kvm). So, it seems there are only 2 options? kvmtool and qemu-kvm?
apt show kvmtool
Package: kvmtool
Version: 0.20170904-1
Priority: optional
Section: kernel
Maintainer: Riku Voipio <riku.voipio@linaro.org>
Installed-Size: 238 kB
Depends: libaio1 (>= 0.3.93), libc6 (>= 2.15), libsdl1.2debian (>= 1.2.11), libvncserver1 (>= 0.9.10), zlib1g (>= 1:1.1.4)
Homepage: https://git.kernel.org/cgit/linux/kernel/git/will/kvmtool.git/
Tag: uitoolkit::sdl
Download-Size: 86.9 kB
APT-Sources: http://ftp.uk.debian.org/debian sid/main amd64 Packages
Description: Native Linux KVM TOOL
kvmtool is a lightweight tool for hosting KVM guests. As a pure virtualization
tool it only supports guests using the same architecture, though it supports
running 32-bit guests on those 64-bit architectures that allow this.
Code:
apt show qemu-kvm
Package: qemu-kvm
Version: 1:4.1-1+b1
Priority: optional
Section: oldlibs
Source: qemu (1:4.1-1)
Maintainer: Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>
Installed-Size: 110 kB
Depends: qemu-system-x86
Homepage: http://www.qemu.org/
Tag: role::shared-lib
Download-Size: 71.7 kB
APT-Manual-Installed: no
APT-Sources: http://ftp.uk.debian.org/debian sid/main amd64 Packages
Description: QEMU Full virtualization on x86 hardware
QEMU is a fast processor emulator. This package provides just a wrapper
script /usr/bin/kvm which run qemu-system-x86 in kvm mode for backwards
compatibility.
what kind of VM do you need?
virt-manager , may suit you ( this is what I tend to use )
VirtualBox , is a bit more hand holding, but would be fine
depending on what you need
lxc may be an option
akin to a BSD Chroot Jail
it is much lighter on memory..
good for setting up compiler toolchains
for instance, I have a Pure 32bit and a Pure 64bit for compiling "wine WoW64"
I do not want to create any fancy machine. A fairly old hardware, with little RAM, compared to the several GiBs we have today. I do not want to use swap for my daily activities just because the VM is open. Unless, which is rare, my memory is full. The VM will mostly run graphical OSes.
virt-manager manager features (!) are not really useful to me. If i can guarantee they will be limited, i do not care much about the distance this point is from the VM at some time.
lxc seems to need mastering a command toolset. Is this right? Thank you for showing the "apt show [package" command, i had never seen it (probably due never having read fully its manpage, or did not give much attention to some parts).
But all you said does not point me to something: with this computer, and the output of those 2 commands, should i choose a VM tool that uses one of them, or that let me choose which to use?
with this computer, and the output of those 2 commands, should i choose a VM tool that uses one of them, or that let me choose which to use?
We don't know your computer, and the two commands don't provide a clue whether VirtualBox or KVM is better. I doubt that there are commands that help you make that decision; you need to look at your needs, not the computer's properties.
lxc doesn't create or manage virtual machines. It's for container management. If your needs can be fulfilled with containers, they have the advantage of putting orders of magnitude less load on your system than virtual machines. I don't know if containers are good for graphics, though.
I consider VirtualBox very "GUI-centric". It's GUI is much nicer and has more features than VMM. That's its main appeal, apart from the fact that it is also availble on Windows. If you don't need VMM, by extension you need VirtualBox even less.
VirtualBox still doesn't offer nested virtualization on Intel CPUs, although they are working on it. KVM has this feature.
Therefore, I recommend KVM. I am, however, concerned by the small RAM size of your computer.
Last edited by berndbausch; 09-22-2019 at 05:07 PM.
We don't know your computer, and the two commands don't provide a clue whether VirtualBox or KVM is better. I doubt that there are commands that help you make that decision; you need to look at your needs, not the computer's properties.
lxc doesn't create or manage virtual machines. It's for container management. If your needs can be fulfilled with containers, they have the advantage of putting orders of magnitude less load on your system than virtual machines. I don't know if containers are good for graphics, though.
I consider VirtualBox very "GUI-centric". It's GUI is much nicer and has more features than VMM. That's its main appeal, apart from the fact that it is also availble on Windows. If you don't need VMM, by extension you need VirtualBox even less.
VirtualBox still doesn't offer nested virtualization on Intel CPUs, although they are working on it. KVM has this feature.
Therefore, I recommend KVM. I am, however, concerned by the small RAM size of your computer.
What you shortened as "VMM"? "virt-manager manager" ?
My computer does not have little RAM. It has 16G, which is enough for me, although sometimes i need to reopen all firefox windows (i usually have 2 profiles opened, and each of them with possibly more than one window opened, and also private windows, and all of them with several tabs; but FF does not load the ones i do not look at, so it is not much trouble); thunderbird is also a memory hogger, sometimes, and i am trying to exchange it for something else - i even opened a thread here for that-; what is left in use does not matter much, terms of memory use. But i still do not want to use swap, since it is possible. I do not use much more resources than when i used when computers with 128MB RAM, and top notch ones had 256MB.
Yes, i do not know much about my computer. If those two commands does not say much about it, how about 'lscpu'? Here:
You recommend kvm, but will it be hard to use? Even if it is not as fancy and gui friendly as VB, i may not mind it. I will want to use virtual machines for nothing specific. But surely for things i do not want to do on my daily setup, at least in the first try.
VMM is the virtual machine manager, the GUI used as a graphical frontend to KVM. You said that its features are not really useful for you.
If you have never used virtualization, you will have a learning curve, and a steeper one with KVM and VMM than with Virtualbox. So I guess you do need the features of VMM, and Virtualbox's features may provide you with an easier start.
16GB is a comfortable memory size, but it contradicts what you said earlier about not having gigabytes and having old hardware with little RAM.
Apart from memory, the other big requirement is a modern CPU with virtualization extensions. Your CPU has the VMX flag, which enables you to run virtual machines at almost physical speed. Your computer is powerful enough for running virtual machines, be it KVM or Virtualbox or another hypervisor.
virt-manager full title is "Virtual Machine Manager"
it is my fault for using just the package name
its a gui for kvm/qemu-kvm ( as well as others, including lxc )
kvmtool will only do VM as same arch. as your cpu
qemu will emulate many different cpu arch. and take advantage of kvm when it can
as detailed in the "show" I provided.
VMM is simple enough to use
it has some nice feature, for instance I can attach to and manage VMs running on my desktop with my laptop over ssh.
VirtualBox's GUI is much nicer than VMM , but for basic needs there is not much difference.
but, you still have not mentioned what you want to do with the VM.
a VM will most likely be able to do what you want.
but if all you want is to have a VM to set up a compiler toolchain then it is overkill.
a bog standard chroot might be enough,
a LinuX Container may be better suited, if for instance you wanted to compile a project for a Ubuntu Target on your Debian system.
if you want to test a desktop environment then a VM is a better ( certainly easier ) solution than lxc
Thank you very much for the explanations, Firerat. The details are something that get me lost many times. I did not say what the VM is for, because i do not have any specific need waiting for it. The troubles i had with Qt3 in the last few days could use it. An eventual host of WinXP/2000/NT could be nice too.
The idea of connecting remotely to a virtual machine is very nice! Would that leave my machine potentially more protected to network attacks? (since it is kept connected 24/7, mostly, anyway)
security?
larger surface area to attack = less secure
if the outside world can't get to your internal network , more secure
having discontinued windows versions on your network... well I wouldn't
wine would be a better option, easier to control and performance would likely be better.. depends what you wanted to do.... there I go again.. look for a clear goal to come up with a good solution..
without a clear goal it is all just a waste of time.
I do not want to create any fancy machine. A fairly old hardware, with little RAM, compared to the several GiBs we have today. I do not want to use swap for my daily activities just because the VM is open. Unless, which is rare, my memory is full. The VM will mostly run graphical OSes.
[...]
Edit: I meant to write "A fairly old hardware, with little RAM, [...]" instead of "I fairly old hardware, with little RAM, [...].
At most, i would want to create a VM equal to the computer i have, to use one of its cores, since (all-1) of them are idle 99% of the time.
Do you mean the package xen-hypervisor? Please, always say the package meant, because what i will do with names i do not know, and are mentioned, is search for it with aptitude (or synaptic, sometimes), and if that fails completely, search the web. But there may be noise results, like happened now, and then i cannot decide what is right, and ask another question to complete the idea of an answer.
Quote:
Originally Posted by Firerat
easier with amd gpu ( I think )
I gave up with my Nvidia card
but my laptop worked ok ( AMD video )
(...)
Quote:
Originally Posted by Firerat
but I still see no clear goal with this VM of yours
That is because there is no clear goal. I just exemplified a few possibilities with i will hardly use; other possibility is to create similar systems to what i use, to test similar setups. With this thread, I only want to know which kind of tool would be best fitted to my computer. If there is no answer for that, unless i have a clear and very specific goal to the VM use, just say that, possibly enumerating the useful cases - that would, for sure, walk toward closing the thread.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.