Difference between revisions of "Virtual Machine (KVM)"

Jump to navigation Jump to search
954 bytes added ,  09:44, 14 February 2018
→‎Create Server (no GUI): Added "Create Workstation (GUI)", still WIP
(Still WIP - added Create Server (no GUI))
(→‎Create Server (no GUI): Added "Create Workstation (GUI)", still WIP)
Line 41: Line 41:


=== Create Server (no GUI) ===
=== Create Server (no GUI) ===
Update paths to reflect where install ISO, and where VM disk files are intended to be
Update paths to reflect where install ISO, and where VM disk files are intended to be
 
The <code>--extra-args "console=ttyS0"</code> option allows a local console to be accessed from the host machine (to allow OS install etc before the VM is on a network), though note that it can't be used with <code>--cdrom</code>, so <code>--location</code> has been used instead.
 
<pre>
<pre>
virt-install \
virt-install \
Line 49: Line 52:
--vcpus=1 \
--vcpus=1 \
--os-variant=ubuntu16.04 \
--os-variant=ubuntu16.04 \
--network=bridge=virbr0,model=virtio \
--network=bridge=br0,model=virtio \
--graphics none \
--graphics none \
--disk path=/mnt/md0/kvm/vm/server-name.img,size=20,bus=virtio \
--disk path=/mnt/md0/kvm/vm/server-name.img,size=20,bus=virtio \
Line 56: Line 59:
</pre>
</pre>


=== Create Workstation (GUI) ===
<pre>
virt-install \
--virt-type=kvm \
--name ubuntu-desktop \
--ram 2048 \
--vcpus=1 \
--os-variant=ubuntu16.04 \
--cdrom=/mnt/md0/kvm/iso/ubuntu-16.04.3-desktop-amd64.iso \
--network=bridge=br0,model=virtio \
--graphics vnc \
--disk path=/mnt/md0/kvm/vm/ubuntu-desktop.img,size=40,bus=virtio
</pre>
Once the command has got as far as <code>Waiting for installation to complete.</code> you need to connect to the VNC console session, to find the port number to connect on query the config from anothet SSH session connected to the host (typically VNC uses ports starting from 5900 upwards).
  virsh dumpxml ubuntu-desktop | grep vnc
[[Category:KVM]]
[[Category:KVM]]

Navigation menu