How to launch and ssh to a KVM instance

This posts assumes that you’ve already synced the OS images on to your virtual box. If you haven’t, check out this blog post.

While launching a new virtual machine for project1, I kept on running into variants of the following error:

vagrant@ubuntu-bionic:~$ sudo uvt-kvm ssh aos_vm1 
ubuntu@192.168.122.183: Permission denied (publickey).

To get this to work, here are the steps I took:

vagrant@ubuntu-bionic:~$ sudo uvt-kvm create aos_vm1 release=bionic --memory 256 --ssh-public-key-file /root/.ssh/id_rsa.pub
vagrant@ubuntu-bionic:~$ sudo uvt-kvm wait aos_vm1
vagrant@ubuntu-bionic:~$ sudo uvt-kvm ssh aos_vm1