This post carries on from my previous article on how to install KVM on Ubuntu 14.04.
To make life easier, I have created a PHP script to dynamically generate the KVM commands you need in order to create guests. Run these commands to install the PHP CLI package and download the script.
sudo apt-get install php5-cli -y cd ~ wget https://raw.githubusercontent.com/programster/KVM-Command-Generator/master/main.php wget https://raw.githubusercontent.com/programster/KVM-Command-Generator/master/distro.class.php
Run the script and answer all the questions.
Copy the command it outputs and execute it.
Watch the guest get set up in text mode in front of your eyes.
Voila! You know have a guest instance. The username and password are both
ubuntu for Ubuntu VMs, and
root for Debian. You may want to change this.
- If you use the kvm script to deploy an ubuntu guest, the default username and password are both "ubuntu". Please change this after installation.
- The kvm script will deploy guests as minimally as possible. You will need to install the acpi package in the guests for the virsh commands on the host to be able to shutdown/reboot guests.
If you see the following message:
Error in network device parameters: Virtual network 'default' has not been started.
Then run the following command:
sudo virsh net-start default
KVM and Virtualbox appear to not work simultaneously on the same host. If you are running Virtualbox whilst you try to create an instance, you may see the following:
ioctl(KVMCREATEVM) failed: 16 Device or resource busy failed to initialize KVM: Device or resource busy