7 | | First update the Ubuntu package repository. |
| 7 | First we have do the network configuration. If we need the VMs to receive the same IP range as in the Host server, then we need to create a network bridge interface. Network bridge 'virbr0' is already created with NAT enabled. Now need to configure it in bridge mode. Change the configuration as in the below, |
| 8 | |
| 9 | {{{ |
| 10 | network: |
| 11 | ethernets: |
| 12 | eno1: |
| 13 | dhcp4: no |
| 14 | eno2: |
| 15 | dhcp4: true |
| 16 | eno3: |
| 17 | dhcp4: true |
| 18 | eno4: |
| 19 | dhcp4: true |
| 20 | version: 2 |
| 21 | |
| 22 | bridges: |
| 23 | virbr0: |
| 24 | interfaces: [eno1] |
| 25 | addresses: |
| 26 | - 192.168.0.10/24 |
| 27 | gateway4: 192.168.0.254 |
| 28 | nameservers: |
| 29 | addresses: [192.248.1.161,1.1.1.1] |
| 30 | }}} |
| 31 | |
| 32 | Once done execute below to test the connection and if OK Enter to accept the changes, |
| 33 | |
| 34 | {{{ |
| 35 | sudo netplan try |
| 36 | }}} |
| 37 | |
| 38 | and then check the connectivity. |
| 39 | |
| 40 | Once we are done with the network configuration we will go to installation of the KVM. |
| 89 | }}} |
| 90 | |
| 91 | To list the created VM, |
| 92 | {{{ |
| 93 | virsh list --all |
| 94 | }}} |
| 95 | |
| 96 | [[Image(https://ws.learn.ac.lk/raw-attachment/wiki/Csle2022/Agenda/databaseandweb/kvm1.png)]] |
| 97 | |
| 98 | Now the VM is created with a installation image mounted and ready for the installation. To continue the installation we will use a VNC client to connect to the graphical console of the VM. |
| 99 | To connect with the VM we need to get the TCP port number the VM is listening on. To get the port number we will execute this first. |
| 100 | |
| 101 | {{{ |
| 102 | virsh vncdisplay perfsonar |
| 103 | }}} |
| 104 | |
| 105 | [[Image(https://ws.learn.ac.lk/raw-attachment/wiki/Csle2022/Agenda/databaseandweb/kvm2.png)]] |
| 106 | |
| 107 | The given is the VNC port number which is not exactly same as TCP port number. But we can derive the TCP port number using VNC port number because they have correlation. If the VNC port is :0 then TCP port will be 5900 and if the VNC port is :1 TCP port will be 5901 and so on. Using this relationship we can get the TCP port number and connect the graphical console of the VM. Then we can continue the installation as we normally do in a computer with monitor. |
| 108 | |
| 109 | |
| 110 | |