New KVM Host

Mister Me

New Member
Joined
Jun 11, 2020
Messages
3
Reaction score
0
Credits
41
All,

I have fairly basic knowledge of linux - I need to build a virtual host and KVM seems to be the best option

I have decided to build a kvm host. This host will be sitting under my desk with a gui as my main computer (i7 3770 32GB ram)
I will only be logging locally (or remotely from laptop) to VMs, i won't be doing anything with the host.

I have a question regarding partitioning
I have 2 SSDs: 120GB and 500 GB
I am hoping to build a system where the host can be rebuilt without having to reconfigure anything apart from installing the software
So it would be:
  1. Restore sda (i would use clonezilla)
  2. Install kvm binaries and related (i might even image that) in which case this step is not required
  3. start
  4. update
  5. job done
So i am thinking..
  • sda
    • Linux OS (that will be debian) + kvm binaries and related
  • sdb:
    • kvm config
    • /home
    • vms + ISO's
My questions:
  1. Would my plan work? i had in mind manually mounting during build these 2 directories /etc/libvirt and /var/lib/libvirt/...? to sdb
    My previous research would seem to suggest that's where it all lives in terms of kvm config and vms, iso... Is that correct?
  2. Where do i put the pagefile? sda or sdb, the vm's will live on sdb but run from sda (os?)
  3. I am hoping to disable networking on the host to the outside world - just to protect it really (the host, not the outside world)- I have 2 nics if that is relevant
  4. and finally, is there such a thing as portable kvm (say i have an external drive with VMs i could plug into any linux box and go)?
  5. and finally again is kvm type 1 or type 2?

Thanks.
 


I have decided to build a kvm host. This host will be sitting under my desk with a gui as my main computer (i7 3770 32GB ram)
I will only be logging locally (or remotely from laptop) to VMs, i won't be doing anything with the host.
Why? Why would you need a virtual host? I'm just trying to understand here cause thing is, hosts are supposed to be real to handle the virtual ones, otherwise you may encounter undesired results like virtual guests not running properly inside the virtual host due to the lack of real hardware to rely on.
Would my plan work?
It might or might not, but then again and IMHO, whatever it is you're trying to do you'll propably get better results by creating virtual guests and doing it in there than creating a virtual host which honestly seems like a waste of time and resources.
 
Why? Why would you need a virtual host? I'm just trying to understand here cause thing is, hosts are supposed to be real to handle the virtual ones, otherwise you may encounter undesired results like virtual guests not running properly inside the virtual host due to the lack of real hardware to rely on.
There is no reason why my virtual guests wouldn't run properly. As i said i have a cpu that can handle many guests and in terms of memory, i am covered too.
My question was not around capacity - i know my box can handle more vm's than i need, the question was more around the design/build

It might or might not, but then again and IMHO, whatever it is you're trying to do you'll propably get better results by creating virtual guests and doing it in there than creating a virtual host which honestly seems like a waste of time and resources.
This is not going to be production server, it will be purely to mess around, at home
Creating a virtual host is not going to be a waist of time, i am not entirely sure how you can assume it would be?
 
There is no reason why my virtual guests wouldn't run properly. As i said i have a cpu that can handle many guests and in terms of memory, i am covered too.
My question was not around capacity - i know my box can handle more vm's than i need, the question was more around the design/build


This is not going to be production server, it will be purely to mess around, at home
Creating a virtual host is not going to be a waist of time, i am not entirely sure how you can assume it would be?

I've been playing around with VMs for quite some time now, using either qemu/kvm, virtualbox and vmware, that's why I think creating a virtual host "purely to mess around" is a waste of time and resources, and I don't mean this in a rude way or any of the sort, truth is, unless you're planning on using hardware-passthrough to almost "fully" utilize that hardware, which is not an easy procedure https://www.linux-kvm.org/page/How_to_assign_devices_with_VT-d_in_KVM https://access.redhat.com/documenta...alization/chap-virtualization-pci_passthrough https://documentation.suse.com/sles/12-SP4/html/SLES-all/cha-qemu-host.html there's no way your virtual host is going to use whatever real hardware you use, it simply won't, that's not the way VMs work, hence the name "virtual machines"; they use virtual hardware. What is it exactly you want/plan to do on this "virtual host" anyway? What do you want to "purely mess around" with? I'm pretty sure you can create virtual guest and do just the same, I mean, I have several VMs here and do lots of different stuff on each; try new/unknown software, customizations, dual-booting, install procedures, troubleshooting, experimenting ... really, you can do whatever you can think of. You could use /sdb as your playground, yes. For example, Install qemu-kvm and place your isos on /sdb and run qemu-kvm from terminal:
1. cd into /sdb
Code:
cd /dev/sdb/isos
2. create a qemu-kvm disk image
Code:
qemu-img create some_virtual_disk.qcow2 20G
change/add options as per your needs.
3. run qemu-kvm
Code:
kvm -hda some_virtual_disk.qcow2 -cdrom some_distro.iso -boot d -m RAM -vga virtio

Again, change/add options as per your needs. This will launch a VM for you to install the system/distro of your choice.
I have several VMs that run from a USB HDD, in fact, most of them, but they all run from a real host, like they're supposed to; a VM uses some resources from your real machine, if you create a virtual host which will use resources from a real host and then run a virtual guest inside the virtual host, will it run better than it would from the real host? Given the fact that its limited virtual resources are already using limited resources from a virtual host? Cause, your virtual host will run from your real one, this will use some limited resources, so if you have 32gb of RAM your virtual host could use 12-14, if 8 cores will use 4. FWIW, I'm not against this idea, I just think that all the work you'll put into creating a virtual host with no guarantee whatsoever it'll work, could be put into a better use, like creating VMs in the real host so you get the best possible experience.

Just my 2 cents.
 
Last edited:
Look, i know how virtualisation work and i am familiar with passthrough and what's it. I have no intention of doing doing anything graphics intensive.
I am sysadmin and have lived with virtualization (vpshere and hyperv), for the last 20 or so years (remember gsx?).
I know excatly what i want, and i don't need someone to tell what is good for me or not.
So the question was around the build of the kvm host, purely. Thanks for your input but you're not addressing the original question. No disrespect, so unless you have anything of any value to add...
 
I know excatly what i want, and i don't need someone to tell what is good for me or not. I am sysadmin and have lived with virtualization (vpshere and hyperv), for the last 20 or so years (remember gsx?).
And I never intended to, sorry it if looked that way cause that was not my intention and you seem to know better than me so ...
So the question was around the build of the kvm host, purely. Thanks for your input but you're not addressing the original question. No disrespect, so unless you have anything of any value to add...
Well, this link goes around it https://documentation.suse.com/sles/12-SP4/html/SLES-all/cha-qemu-host.html you could check and see if there's anything in there you can use. Also, try looking here https://b-ok.lat/s/kvm/?regionChanged= . Also, when you succeed it'd be nice if you post your procedure here and how you got it done. That would be really interesting to read.

Cheers! :)
 

Members online


Latest posts

Top