• Home
  • About Us
  • Contact
  • Privacy Policy

LinuxAdmin.io

  • Home
  • Tutorials
    • System Administration
    • Linux Tutorials
    • Web Hosting
    • WordPress
    • Virtualization
    • Troubleshooting
    • OpenStack

Creating A New Virtual Machine with KVM

This article covers creating a new virtual machine with KVM. It is based on CentOS however the majority applies to any OS using KVM. We are going to build a CentOS 7 virtual machine.

Virtual Machine CLI Installation:

Install wget if you don’t already have it:

yum -y install wget

Part of this requires desktop

First grab a  CentOS iso:

wget -O /tmp/CentOS-7-x86_64-Minimal-1611.iso http://mirror.tocici.com/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1611.iso

Next start virt-installer:

virt-install  --name=centos7-1  --ram=1024  --vcpus=1  --cdrom=/tmp/CentOS-7-x86_64-Minimal-1611.iso --os-type=linux --os-variant=rhel7  --network bridge=bridge1 --graphics=spice   --disk path=/var/lib/libvirt/images/centos7-1.dsk,size=4

-name – Name of the virtual machine
-ram – Memory allocation in MB
-vcpus – Virtual CPU allocation
-cdrom – Location of the ISO
-os-type – OS type(linux, windows etc)
-os-variant – OS variant (rhel 6, rhel7, solaris etc)
-network – network configuration
-graphics – display for install
-disk path – path to create disk image associated with virtual machine

Once you have entered the command, It will then start then install then open virt-viewer to finish the installation

You should see a install screen appear similar to the screen shot below. Go ahead and select Install and follow the installation.

Virtual machine virt-viewer install screen

Graphical Installation

To perform a complete install over the graphical user interface, you will need to type the following on the command line:

virt-manager

Virt-manager should open, click on the new icon to add a new virtual machine. Fill out the name field to what you want to call the virtual machine and select a Local install Media and click on Forward

virt-manager-create-new-virtual-machine

 

 

 

 

 

 

 

 

On step 2, select the path to the ISO image, if you did the wget earlier you can fill in /tmp/CentOS-7-x86_64-Minimal-1611.iso and select OS Type: Linux, Version: Red Hat Enterprise Linux 7 or later:

Virtual Machine virt-manager iso

For Step 3, Select the amount of memory and CPUs for the VM

Virtual Machine add memory and cpu

 

 

 

 

 

 

 

 

For step 4, Select the size of the Disk for the Virtual Machine:

Virtual Machine add disk size

 

 

 

 

 

 

 

 

For step 5, Under advanced options choose the bridge and click on finish:

Virtual Machine Finish install

 

 

 

 

 

 

 

 

After this the same install screen will open as you would see if you did virt-viewer, you can follow the instructions to finish the install.

 

Part 1: KVM Installation on CentOS
Part 2: Bridged Networking Setup for KVM Virtualization
Part 3: Creating A New Virtual Machine with KVM

Apr 26, 2017LinuxAdmin.io
0 0 vote
Article Rating
Linux Access Control ListsNginx Compile From Source On CentOS
You Might Also Like
 
How To Setup SSH Key Authentication
 
Journalctl Introduction and Examples
Subscribe
Notify of
guest
guest
0 Comments
Inline Feedbacks
View all comments
6 years ago Virtualization centos, kvm, linux987
Recent Posts
  • Laravel Installation Guide For CentOS
  • Openstack Services Explanation And Overview
  • OSSEC Intrusion Detection Installation On Centos 7
  • Configure ProFTPd for SFTP on CentOS
  • How To Check And Repair MyISAM Tables In MySQL
Most Commented
Hot Clone Linux Server with Rsync
Hot Clone A CentOS Server With Rsync
14 Comments
ngx_cache_purge module
Install The ngx_cache_purge Module In Nginx
8 Comments
piwik-nginx
Piwik Analytics on Nginx
8 Comments
Tags
linuxcentosLinux Performance Tuningsysadminkvmnetworkingmemcachedanalyticssystemd
About

We love Linux and are dedicated to creating Linux administration tutorials for System Administrators since 2016.

Most Viewed
Default Gateway
How To Configure A Default Gateway on CentOS
63,001 views
Zend Opcache
Setup and Optimize Zend OpCache
46,714 views
Install ffmpeg
FFMpeg Install On CentOS 7
20,912 views
Archives
Email subscription

Sign up for our newsletter to receive the latest news and event postings.

2018 © LinuxAdmin.io
wpDiscuz