Difference between revisions of "Virtual Machine (KVM)"

From vwiki
Jump to navigation Jump to search
(Draft)
 
m (→‎Create Virtual Machine: Minor update to table - Still WIP/draft)
Line 13: Line 13:
== Create Virtual Machine ==
== Create Virtual Machine ==


 
virt-install
{| class="vwikitable"
{| class="vwikitable"
|-
|-
Line 24: Line 24:
| <code>os-type</code>        || Linux                      || OS family, can be  Linux, Solaris, Unix or Windows
| <code>os-type</code>        || Linux                      || OS family, can be  Linux, Solaris, Unix or Windows
|-
|-
| <code>os-variant</code>      || ubuntu16.04                 || Distribution type for the above (run <code>osinfo-query os</code> to view what is available)
| <code>os-variant</code>      || ubuntu16.04                 || Distribution type for the above (run <code>osinfo-query os</code> to view what is available)
|-
| <code>ram</code>            || 2048                        || vRAM in GB
|-
| <code>vcpus</code>          || 2                          || vCPUs (cores)
|-
| <code>vcpus</code>          || 2                          || vCPUs (cores)
|-
| <code>disk path</code>      || /vm-store/images/VM-Name.img,bus=virtio,size=50 || Virtual disk path, using virtio bus and with a 50GB disk
|-
| <code>graphics</code>        || none                        || If noneset, VM will be created with a serial display output (as opposed to VNC window)
|-
| <code>cdrom</code>          || /home/user/cdrom.iso        || Path to installation ISO
|-
| <code>network</code>        || bridge:br0                  || Network connection details
|}
|}


[[Category:KVM]]
[[Category:KVM]]

Revision as of 17:12, 6 February 2018

Prerequisites

This guide assumes you have a basic working environment, run the kvm-ok command to sanity check...

root@kvm-host:# kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used

Install Media

You need to have a local copy of the appropriate ISO. If you have the ISO file already, upload to your KVM server, alternatively download from the site using wget

Create Virtual Machine

virt-install

Parameter Example Usage
name VM-Name Name of virtual machine (typically this should match the intended hostname of the VM)
description "Test VM to be used for X" Description of virtual machine's purpose etc
os-type Linux OS family, can be Linux, Solaris, Unix or Windows
os-variant ubuntu16.04 Distribution type for the above (run osinfo-query os to view what is available)
ram 2048 vRAM in GB
vcpus 2 vCPUs (cores)
vcpus 2 vCPUs (cores)
disk path /vm-store/images/VM-Name.img,bus=virtio,size=50 Virtual disk path, using virtio bus and with a 50GB disk
graphics none If noneset, VM will be created with a serial display output (as opposed to VNC window)
cdrom /home/user/cdrom.iso Path to installation ISO
network bridge:br0 Network connection details