Difference between revisions of "Virtual Machine (KVM)"

Jump to navigation Jump to search
m (→‎Auto Start: Minor update)
 
Line 43: Line 43:


=== 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 <code>location</code> path to reflect where your install ISO is located, and the <code>disk</code> path for 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.
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.  Note that where installing Ubuntu guests v22.04 and upwards the kernel and initrd paths on the ISO need to be specified with the ISO location.


<pre>
<pre>
virt-install \
virt-install \
--virt-type=kvm \
--virt-type=kvm \
--name server-name \
--name ubuntu22-vm \
--ram 1024 \
--ram 2048 \
--vcpus=1 \
--vcpus=1 \
--os-variant=ubuntu16.04 \
--os-variant=ubuntu16.04 \
--network=bridge=br0,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/ubuntu22-vm.img,size=20,bus=virtio \
--extra-args "console=ttyS0" \
--extra-args "console=ttyS0" \
--location /mnt/md0/kvm/iso/ubuntu-16.04.3-server-amd64.iso
--location ubuntu-22.04-live-server-amd64.iso,kernel=casper/vmlinuz,initrd=casper/initrd
</pre>
</pre>


Navigation menu