KVM Installation and VM Creation on Fedora 25
-
#install KVM and it's associated packages
dnf -y install qemu-kvm qemu-img virt-manager libvirt libvirt-python libvirt-client virt-install virt-viewer bridge-utils
#start and enable the libvirtd service
systemctl start libvirtd
systemctl enable libvirtd
#check if KVM module is loaded
lsmod | grep kvm
kvm_intel 200704 4
kvm 598016 1 kvm_intel
irqbypass 16384 3 kvm#create VM and install
sudo virt-install --name Plex --ram 4096 --vcpus 2 --disk size=12000,format=qcow2 --cdrom /etc/iso/Fedora-Server-dvd-x86_64-25-1.3.iso --virt-type kvm --os-variant fedora24 --graphics none
This is where I'm at:
Questions:
-
It doesn't seem like I can input anything and if I attempt to escape it tells me I cancelled the installation. Unsure what this is supposed to look like when it finishes allocating to my VM.
-
How do I interface with the VM to continue the installation process?
-
How do you determine the IP address of a guest from KVM?
-
-
Not sure where you found your instructions, but this is the recommend method
https://fedoraproject.org/wiki/Getting_started_with_virtualizationAssuming you are logged in as yourself, using su means you will need the root password, not your sudo password.
su -c "dnf group install --with-optional virtualization" su -c "systemctl start libvirtd" su -c "systemctl enable libvirtd"
You can manage everything with Virtual Machine Manager
-
But if you are doing this on a system with no desktop environment, then you have to pass the --graphics parameter. RTFM, the
man
file has this information.Now that you have already ran it though, you launch
virt-viewer
. -
@wirestyle22 said in KVM Installation and VM Creation on Fedora 25:
#install KVM and it's associated packages
dnf -y install qemu-kvm qemu-img virt-manager libvirt libvirt-python libvirt-client virt-install virt-viewer bridge-utils
#start and enable the libvirtd service
systemctl start libvirtd
systemctl enable libvirtd
#check if KVM module is loaded
lsmod | grep kvm
kvm_intel 200704 4
kvm 598016 1 kvm_intel
irqbypass 16384 3 kvm#create VM and install
sudo virt-install --name Plex --ram 4096 --vcpus 2 --disk size=12000,format=qcow2 --cdrom /etc/iso/Fedora-Server-dvd-x86_64-25-1.3.iso --virt-type kvm --os-variant fedora24 --graphics none
This is where I'm at:
Questions:
-
It doesn't seem like I can input anything and if I attempt to escape it tells me I cancelled the installation. Unsure what this is supposed to look like when it finishes allocating to my VM.
-
How do I interface with the VM to continue the installation process?
-
How do you determine the IP address of a guest from KVM?
You can interface to the graphic console of the hypervisor with a software like virt-manager o other web interfaces; or you can expose the vnc/spice graphical port in this way and connect to it with any vnc/spice client.
Regarding the IP of the machine: if you are using the NAT networking with the addresses released by the host, just look at net-dhcp-leases. Otherwise, use domifaddr.
-
-
But, really, don't install a guest in the '90s way with KVM, instead use a proper tool like virt-builder.
The old way of install a guest is completely unneeded in a virtualized/cloud world; instead of installing through an ISO, a procedure that is slow and requires kickstart/manual intervention, you can just use a cloud image pre-built and optimized to run as a virtual guest and inject the customizations (credential, additional software, config) with tools like virt-builder.
AWS and the other cloud providers works this way. -
Did it not give you the option for a virtualization host during the install? I just choose that and all of this work is done already.
If it's the Workstation Edition all of this should be done by default.
-
Also, maybe it's just me, but I think it's a ton easier if you don't use any caps for VM names.
And if you keep the VM OS disks the same name as the VM it makes things easier.
-
Also, I think I saw @JaredBusch mention it, but if you're already root you don't need to run sudo.
-
I posted this about a month ago and has worked out great for me.
-
@stacksofplates said in KVM Installation and VM Creation on Fedora 25:
Also, I think I saw @JaredBusch mention it, but if you're already root you don't need to run sudo.
I didn't actually do that, it was late and I neglected to remove that part of the instructions. Thank you though
-
So the point of me doing this is to learn how to do it from the CLI and then I can move forward and use a GUI. I need to know everything about both. I appreciate the help. I'm going to reinstall Fedora 25 and start over using @JaredBusch's linked instructions
-
@Francesco-Provino said in KVM Installation and VM Creation on Fedora 25:
But, really, don't install a guest in the '90s way with KVM, instead use a proper tool like virt-builder.
The old way of install a guest is completely unneeded in a virtualized/cloud world; instead of installing through an ISO, a procedure that is slow and requires kickstart/manual intervention, you can just use a cloud image pre-built and optimized to run as a virtual guest and inject the customizations (credential, additional software, config) with tools like virt-builder.
AWS and the other cloud providers works this way.How would I use virt-builder to install a windows guest?
-
@black3dynamite said in KVM Installation and VM Creation on Fedora 25:
@Francesco-Provino said in KVM Installation and VM Creation on Fedora 25:
But, really, don't install a guest in the '90s way with KVM, instead use a proper tool like virt-builder.
The old way of install a guest is completely unneeded in a virtualized/cloud world; instead of installing through an ISO, a procedure that is slow and requires kickstart/manual intervention, you can just use a cloud image pre-built and optimized to run as a virtual guest and inject the customizations (credential, additional software, config) with tools like virt-builder.
AWS and the other cloud providers works this way.How would I use virt-builder to install a windows guest?
Sure a Windows guest you have to build that way, and even then you would create a template first so you can clone it. But any Linux distribution can be built with it.
-
@stacksofplates said in KVM Installation and VM Creation on Fedora 25:
Also, maybe it's just me, but I think it's a ton easier if you don't use any caps for
VMnames.FTFY. It's a Windows-ism that is best left behind. Hostnames, filenames, whatever... caps are generally best avoided.
-
@scottalanmiller said in KVM Installation and VM Creation on Fedora 25:
@stacksofplates said in KVM Installation and VM Creation on Fedora 25:
Also, maybe it's just me, but I think it's a ton easier if you don't use any caps for
VMnames.FTFY. It's a Windows-ism that is best left behind. Hostnames, filenames, whatever... caps are generally best avoided.
Ya. And I don't get the capitalization of cmdlets. I know you don't have to type it that way but seems weird they go through the trouble of that.
-
@stacksofplates said in KVM Installation and VM Creation on Fedora 25:
@scottalanmiller said in KVM Installation and VM Creation on Fedora 25:
@stacksofplates said in KVM Installation and VM Creation on Fedora 25:
Also, maybe it's just me, but I think it's a ton easier if you don't use any caps for
VMnames.FTFY. It's a Windows-ism that is best left behind. Hostnames, filenames, whatever... caps are generally best avoided.
Ya. And I don't get the capitalization of cmdlets. I know you don't have to type it that way but seems weird they go through the trouble of that.
MS has a weird hangup about their use of caps, they always have. It makes me feel like an original Apple ][ junkie is still running much of the show.
-
@stacksofplates said in KVM Installation and VM Creation on Fedora 25:
@scottalanmiller said in KVM Installation and VM Creation on Fedora 25:
@stacksofplates said in KVM Installation and VM Creation on Fedora 25:
Also, maybe it's just me, but I think it's a ton easier if you don't use any caps for
VMnames.FTFY. It's a Windows-ism that is best left behind. Hostnames, filenames, whatever... caps are generally best avoided.
Ya. And I don't get the capitalization of cmdlets. I know you don't have to type it that way but seems weird they go through the trouble of that.
Readability. That's the whole point of capitalization in this sense. I don't carr either way, but if you are combining words, capital letters make it easier to read.
-
@stacksofplates said in KVM Installation and VM Creation on Fedora 25:
@scottalanmiller said in KVM Installation and VM Creation on Fedora 25:
@stacksofplates said in KVM Installation and VM Creation on Fedora 25:
Also, maybe it's just me, but I think it's a ton easier if you don't use any caps for
VMnames.FTFY. It's a Windows-ism that is best left behind. Hostnames, filenames, whatever... caps are generally best avoided.
Ya. And I don't get the capitalization of cmdlets. I know you don't have to type it that way but seems weird they go through the trouble of that.
Functionally, with Microsoft it doesn't make a difference in just about every case... which is how I think it should be. If I capitalize something, it should not change how it functions... but that's just my quick opinion.
-
@Tim_G said in KVM Installation and VM Creation on Fedora 25:
@stacksofplates said in KVM Installation and VM Creation on Fedora 25:
@scottalanmiller said in KVM Installation and VM Creation on Fedora 25:
@stacksofplates said in KVM Installation and VM Creation on Fedora 25:
Also, maybe it's just me, but I think it's a ton easier if you don't use any caps for
VMnames.FTFY. It's a Windows-ism that is best left behind. Hostnames, filenames, whatever... caps are generally best avoided.
Ya. And I don't get the capitalization of cmdlets. I know you don't have to type it that way but seems weird they go through the trouble of that.
Readability. That's the whole point of capitalization in this sense. I don't carr either way, but if you are combining words, capital letters make it easier to read.
Just avoid making long, weird names for things
-
@Tim_G said in KVM Installation and VM Creation on Fedora 25:
@stacksofplates said in KVM Installation and VM Creation on Fedora 25:
@scottalanmiller said in KVM Installation and VM Creation on Fedora 25:
@stacksofplates said in KVM Installation and VM Creation on Fedora 25:
Also, maybe it's just me, but I think it's a ton easier if you don't use any caps for
VMnames.FTFY. It's a Windows-ism that is best left behind. Hostnames, filenames, whatever... caps are generally best avoided.
Ya. And I don't get the capitalization of cmdlets. I know you don't have to type it that way but seems weird they go through the trouble of that.
Functionally, with Microsoft it doesn't make a difference in just about every case... which is how I think it should be. If I capitalize something, it should not change how it functions... but that's just my quick opinion.
I prefer accuracy and not the "soft" approach. I like to know that I have to get it right, not close. It works, but it's weird to me. Having certain ASCII pairs turn into the same thing to the filesystem feels really hokey and weird to me. If I mean X I'd type X, not x.