Hi. I am looking for some guidance on installing virtual machines
under gentoo. I have a 5.10.82 kernel and I would like to use kvm if possible to do this. I have seen lots of instructions for installing
vms using virtualbox but not much else. I have a gentoo system with
enough memory to run a vm or two and would like to use it as the host.
I have downloaded xen to take a look at it as well.
I hope this is not too vague, so please bare with me.
Thanks in advance for any suggestions.
On 07:33 Fri 31 Dec , John Covici wrote:
Hi. I am looking for some guidance on installing virtual machines
under gentoo. I have a 5.10.82 kernel and I would like to use kvm if possible to do this. I have seen lots of instructions for installing
vms using virtualbox but not much else. I have a gentoo system with
enough memory to run a vm or two and would like to use it as the host.
I have downloaded xen to take a look at it as well.
I hope this is not too vague, so please bare with me.
Thanks in advance for any suggestions.
I'd suggest to try qemu kvm + libvirt
Am Freitag, 31. Dezember 2021, 15:31:43 CET schrieb Yixun Lan:
On 07:33 Fri 31 Dec , John Covici wrote:
Hi. I am looking for some guidance on installing virtual machines
under gentoo. I have a 5.10.82 kernel and I would like to use kvm if possible to do this. I have seen lots of instructions for installing vms using virtualbox but not much else. I have a gentoo system with enough memory to run a vm or two and would like to use it as the host.
I have downloaded xen to take a look at it as well.
I hope this is not too vague, so please bare with me.
Thanks in advance for any suggestions.
I'd suggest to try qemu kvm + libvirt
For a graphical GUI frontend for this you can use app-emulation/virt-manager.
++
This is just a front-end to libvirt and kvm, so you're building
entirely on solid technologies, and anything you set up with the
GUI can be edited or run or otherwise managed from the command line,
and vice-versa.
It ends up resembling something like VirtualBox or the old VMWare
Workstation edition, but it is all FOSS and in-kernel so it just is
more reliable/etc.
That said, I only use VMs situationally and at this point just
about everything I'm doing is in containers if it can be linux-based.
Way lighter all-around, even if I'm running a full OS in the container.
I personally prefer to run my containers with nspawn and virtual
ethernet, so each container gets its own IP via DHCP.
Oh, and for kvm if you want to run your guests on your main LAN you'll probably need to set up a bridge interface.
On Fri, Dec 31, 2021 at 9:40 AM Petric Frank <pfrank@gmx.de> wrote:
Am Freitag, 31. Dezember 2021, 15:31:43 CET schrieb Yixun Lan:
On 07:33 Fri 31 Dec , John Covici wrote:
Hi. I am looking for some guidance on installing virtual machines under gentoo. I have a 5.10.82 kernel and I would like to use kvm if possible to do this. I have seen lots of instructions for installing vms using virtualbox but not much else. I have a gentoo system with enough memory to run a vm or two and would like to use it as the host.
I have downloaded xen to take a look at it as well.
I hope this is not too vague, so please bare with me.
Thanks in advance for any suggestions.
I'd suggest to try qemu kvm + libvirt
For a graphical GUI frontend for this you can use app-emulation/virt-manager.
++
This is just a front-end to libvirt and kvm, so you're building
entirely on solid technologies, and anything you set up with the GUI
can be edited or run or otherwise managed from the command line, and vice-versa. It ends up resembling something like VirtualBox or the
old VMWare Workstation edition, but it is all FOSS and in-kernel so it
just is more reliable/etc.
That said, I only use VMs situationally and at this point just about everything I'm doing is in containers if it can be linux-based. Way
lighter all-around, even if I'm running a full OS in the container. I personally prefer to run my containers with nspawn and virtual
ethernet, so each container gets its own IP via DHCP.
Oh, and for kvm if you want to run your guests on your main LAN you'll probably need to set up a bridge interface.
On 12/31/21 8:12 AM, Rich Freeman wrote:
++
+++ to KVM / libvirt / VirtManager (GUI)
This is just a front-end to libvirt and kvm, so you're building
entirely on solid technologies, and anything you set up with
the GUI can be edited or run or otherwise managed from the
command line, and vice-versa.
Close, but not quite.
Yes, anything that can be done in the GUI can be done at the CLI
/ config files.
Though I have had some more essoteric things that had to be done
at the CLI / config files that couldn't be done in the GUI. This
usually has to do with more advanced things like iSCSI, Fibre
Channel, ZFS pools / dataset per guest, etc.
The vast majority of the things that someone starting with KVM
will want to do can be done with the Virtual Machine Manager GUI.
It ends up resembling something like VirtualBox or the old
VMWare Workstation edition, but it is all FOSS and in-kernel so
it just is more reliable/etc.
Yep. There are only so many ways that you can present a concept;
inventory of VMs, VM console, VM management. They start to look
similar after a while.
That said, I only use VMs situationally and at this point just
about everything I'm doing is in containers if it can be
linux-based. Way lighter all-around, even if I'm running a full
OS in the container. I personally prefer to run my containers
with nspawn and virtual ethernet, so each container gets its
own IP via DHCP.
The Virtual Machine Manager GUI can also administer / manage some
aspects of containers.
I would highly suggest giving Virtual Machine Manager GUI for KVM+libvert+qemu a try. It is probably the quintessential Linux virtualization method.
Oh, and for kvm if you want to run your guests on your main LAN
you'll probably need to set up a bridge interface.
Yes, bridging is very nice and is my preferred way for most VM
use cases. Though it might be a bit more than someone wants to
tackle while getting their feet wet with virtualization.
Especially if you're trying to share a single NIC for other
aspects of the hosting system. It can all be done, but there is
a lot of minutia (methods and configurations therein) that are
easy to get lost in. I'd probably recommend a second NIC, even
if it's an inexpensive USB NIC just for the virtualization. Doing
that will avoid complexities that don't need to be dealt with
/now/. -- Reduce the number of variables that you're working
with at one time.
OK, I made some progress -- I emerged qemu/kvm packages including
libvirtd and virt-manager came along. Now, when I start virt-manager,
it complains the qqemu/kvm not connected. I am running virt-manager
as my regular user.
On 1/1/22 12:08 PM, John Covici wrote:<SNIP>
OK, I made some progress -- I emerged qemu/kvm packages including
libvirtd and virt-manager came along. Now, when I start virt-manager,
it complains the qqemu/kvm not connected. I am running virt-manager
as my regular user.
You may need to add your user account to -- what I think is -- the "kvm" group. (Don't forget the usual dance when adding yourself to a new group.)
On Sat, Jan 1, 2022 at 12:28 PM Grant Taylor <gtaylor@gentoo.tnetconsulting.net> wrote:
On 1/1/22 12:08 PM, John Covici wrote:<SNIP>
OK, I made some progress -- I emerged qemu/kvm packages including libvirtd and virt-manager came along. Now, when I start virt-manager,
it complains the qqemu/kvm not connected. I am running virt-manager
as my regular user.
You may need to add your user account to -- what I think is -- the "kvm" group. (Don't forget the usual dance when adding yourself to a new group.)
kvm and libvirt
In my experience it often takes either a logout/in or a reboot
HTH,
Mark
On 1/1/22 6:04 PM, John Covici wrote:
It more seems to have to do something with the uri -- libvertd is
certainly running, and I added myself to the kvm group, but still get qem/kvm not connected.
Run `id` as your current user and make sure that it's showing the
kvm & libvirt groups.
I did not do the libvertd group, did not know that. When I look at /etc/group, I see kvm, but even though I had logged out, when I do
the id command in a terminal frame under gnome, it does not list
kvm.
It more seems to have to do something with the uri -- libvertd is
certainly running, and I added myself to the kvm group, but still get qem/kvm not connected.
In my experience it often takes either a logout/in or a reboot
On 1/1/22 1:19 PM, Mark Knecht wrote:
In my experience it often takes either a logout/in or a reboot
Ya....
Depending on what you actually /need/ to use the new group for
you can probably ssh to localhost or possibly use the `newgrp`
command go switch your primary group to the group that you've
been added to which hasn't been loaded (?) instantiated (?)
... in the current session.
Maybe I have to log out of everything with my user name even though
most of the logins are to virtual consoles?
On 1/1/22 1:19 PM, Mark Knecht wrote:
In my experience it often takes either a logout/in or a reboot
Ya....
Depending on what you actually /need/ to use the new group for
you can probably ssh to localhost or possibly use the `newgrp`
command go switch your primary group to the group that you've
been added to which hasn't been loaded (?) instantiated (?)
... in the current session.
Well, I foujnd out something. If I go to the file menu, I can add the connection manually and it works,
but I wonder why I have to do that?
Also, before I do anything, it asks me for the root password and
says system policy prevents local management of virtual machines.
Do you know why this is so?
On 1/1/22 11:05 PM, John Covici wrote:
Well, I foujnd out something. If I go to the file menu, I can
add the connection manually and it works,
That sounds familiar.
but I wonder why I have to do that?
Because the KVM Virtual Manager is designed such that it can
administer KVM / libvirt / qemu on multiple systems. It's really client-server infrastructure. You're just needing to point the
client at your local server one time.
Also, before I do anything, it asks me for the root password
and says system policy prevents local management of virtual
machines. Do you know why this is so?
This also seems familiar.
Try re-starting the libvirt / kvm daemons. They may not be aware
that your user is now a member of the proper group. -- Aside:
This is why a reboot is ... convenient, but not required.
This /should/ be taken care of proper group administration for
your normal user.
I ran into this a long time ago when I set up KVM on my last
Gentoo system. I don't remember exactly what I had to do to
resolve it. I do know that it was less than five minutes of
searching the web to find the answer, cussing at what needed to
be done, and doing it. That system has been running perfectly
fine for many years.
On 1/1/22 11:05 PM, John Covici wrote:
Well, I foujnd out something. If I go to the file menu, I can
add the connection manually and it works,
That sounds familiar.
but I wonder why I have to do that?
Because the KVM Virtual Manager is designed such that it can
administer KVM / libvirt / qemu on multiple systems. It's really client-server infrastructure. You're just needing to point the
client at your local server one time.
Also, before I do anything, it asks me for the root password
and says system policy prevents local management of virtual
machines. Do you know why this is so?
This also seems familiar.
Try re-starting the libvirt / kvm daemons. They may not be aware
that your user is now a member of the proper group. -- Aside:
This is why a reboot is ... convenient, but not required.
This /should/ be taken care of proper group administration for
your normal user.
I ran into this a long time ago when I set up KVM on my last
Gentoo system. I don't remember exactly what I had to do to
resolve it. I do know that it was less than five minutes of
searching the web to find the answer, cussing at what needed to
be done, and doing it. That system has been running perfectly
fine for many years.
OK, I fixed it, the group name was wrong when I tried the last time, I
had libvirtd and its only libvirt and that seems to have fixed things.
OK, more progress and a few more questions.
In the virt-manager, I could not figure out how to add disk storage
to the vm. I have a partition I can use for the disk storage --
is this different from the virtual machine image?
Of even more importance, how do I bridge the vm onto my existing
network?
I have a nic for internal items named eno1 and another nic which
connects to the outside world, I would like to bridge to the internal network, that would give the vm a dhcp address, etc.
OK, more progress and a few more questions.
In the virt-manager, I could not figure out how to add disk storage to
the vm. I have a partition I can use for the disk storage -- is this different from the virtual machine image?
Of even more importance, how do I bridge the vm onto my existing
network? I have a nic for internal items named eno1 and another nic
which connects to the outside world, I would like to bridge to the
internal network, that would give the vm a dhcp address, etc.
--
Your life is like a penny. You're going to lose it. The question is:
How do
you spend it?
John Covici wb2una
covici@ccs.covici.com
What I remember doing was re-configuring the (primary) network interface
so that it came up without an IP address and was added as a member to a
newly created bridge. As part of that I moved the system's IP
address(es) from the underlying Ethernet interface to the newly created Bridge interface.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 293 |
Nodes: | 16 (2 / 14) |
Uptime: | 234:21:09 |
Calls: | 6,624 |
Files: | 12,172 |
Messages: | 5,319,694 |