2,187
edits
(→Installation: Updated) |
(→Networking: Added Ubuntu 18 instructions) |
||
(One intermediate revision by the same user not shown) | |||
Line 16: | Line 16: | ||
Install using the following command | Install using the following command | ||
apt install qemu qemu-kvm libvirt-bin bridge-utils virt-manager | apt install qemu qemu-kvm libvirt-bin bridge-utils virt-manager | ||
Once completed, ensure libvirtd is running | |||
systemctl status libvirtd | |||
== Networking == | == Networking == | ||
By default, you'll end up with a new <code>virbr0</code> interface, on which all virtual machines will be deployed to. These will not be accessible to the outside world, which is sometimes fine for a private lab environment, but otherwise fairly useless. In order to all your VMs to be accessible, you need to create a new bridge interface, and move your server's IP address onto that. Once done, VMs can also be provisioned onto the same interface, and will be as accessible as your KVM server. | |||
=== Ubuntu 18.04 === | |||
Network config is achieved via Netplan, for an existing config such as show... | |||
<pre> | |||
root@kvm-svr:~# cat /etc/netplan/50-cloud-init.yaml.orig | |||
# This file is generated from information provided by the datasource. Changes | |||
# to it will not persist across an instance reboot. To disable cloud-init's | |||
# network configuration capabilities, write a file | |||
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following: | |||
# network: {config: disabled} | |||
network: | |||
ethernets: | |||
eno1: | |||
addresses: | |||
- 192.168.1.50/24 | |||
gateway4: 192.168.10.1 | |||
nameservers: | |||
addresses: | |||
- 192.168.1.1 | |||
- 8.8.8.8 | |||
- 8.8.4.4 | |||
search: | |||
- vwiki.co.uk | |||
version: 2 | |||
</pre> | |||
...add a new bridge network and move most of the config over... | |||
<pre> | |||
root@media-svr:~# cat /etc/netplan/50-cloud-init.yaml | |||
# This file is generated from information provided by the datasource. Changes | |||
# to it will not persist across an instance reboot. To disable cloud-init's | |||
# network configuration capabilities, write a file | |||
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following: | |||
# network: {config: disabled} | |||
network: | |||
version: 2 | |||
ethernets: | |||
eno1: | |||
dhcp4: no | |||
dhcp6: no | |||
bridges: | |||
br0: | |||
interfaces: | |||
- eno1 | |||
dhcp4: no | |||
addresses: | |||
- 192.168.1.50/24 | |||
gateway4: 192.168.1.1 | |||
nameservers: | |||
addresses: | |||
- 192.168.1.1 | |||
- 8.8.8.8 | |||
- 8.8.4.4 | |||
search: | |||
- vwiki.co.uk | |||
</pre> | |||
...and apply using... | |||
netplan apply | |||
== Configuration == | == Configuration == |