How to Install and Configure KVM on Ubuntu 18.04 LTS Server

11 Responses

  1. Mac says:

    Great article.. straight to the point..

  2. Steve says:

    Helpful – but virt-install wasn’t recognised for me, I had to install virtinst also:
    sudo apt install virtinst
    Also I needed to replace –location with –cdrom and remove the extra-args (even though I was not using a cd rom, otherwise I got a ‘Couldn’t find hvm kernel .. error)

    • Smarty says:

      Its because of wrong ISO! Do not use the cloud based standard version – instead use the alternativ: at the moment:
      ‘http://cdimage.ubuntu.com/releases/18.04.2/release/ubuntu-18.04.2-server-amd64.iso’
      If you get an Error 404 there is a newer version. Check instead
      ‘http://cdimage.ubuntu.com/releases’

  3. Gannet says:

    I think it is better to remove netplan and use networkd to configure network including bridges. But thanks for how to use netplan for creating bridges. Now I know it.

  4. Chitzle says:

    Sorry if this is sill question but why do we configure the br0 with a static IP and not the hardware interface ens33? Does this result in the host and the guest OS using the same IP?

    • Pradeep Kumar says:

      Hi Chitzle,

      If you want your virtual machines to be accessed from outside of KVM host then you need to create a bridge, remove the IP from eth0 or ens33 and assign the same ip to bridge interface.
      Map VMs interface to the bridge either via command line or virt-manager.After that you can assign the IP from the VLAN which is associated to bridge.

  5. MikeP says:

    Everything seemed to work, but I don’t see the new vm assigned its own IP via dhcp as I expected.
    ‘This is my xml dump

    virsh dumpxml Node01

    Node01
    dc38066a-f428-4990-b2d1-cf88c6b346a2
    4194304
    4194304
    2

    /machine

    hvm

    Opteron_G5
    AMD

    destroy
    restart
    destroy

    /usr/bin/kvm-spice

    libvirt-dc38066a-f428-4990-b2d1-cf88c6b346a2
    libvirt-dc38066a-f428-4990-b2d1-cf88c6b346a2

    +64055:+115
    +64055:+115

  6. MAksym says:

    GUYS,

    ALWAYS use YAML validators BEFORE you make ANY changes in vi /etc/netplan/50-cloud-init.yaml

    Thanks author for article.

  7. Arvind Pal says:

    Very nice article, step by step very helpful, Thanks

  8. Michael Cooper says:

    You must have installed this on a desktop because I cannot get virt-manager to work I get an error that it cannot start because of something with GTK-warning

    [email protected]:~$ sudo virt-manager
    [email protected]:~$ Unable to init server: Could not connect: Connection refused
    Unable to init server: Could not connect: Connection refused
    Unable to init server: Could not connect: Connection refused

    (virt-manager:1875): Gtk-WARNING **: 17:59:02.848: cannot open display:

    Anyone have a luce as to why it’s not starting?

    Thanks,
    Michael

Leave a Reply to Mac Cancel reply

Your email address will not be published. Required fields are marked *