Installing KVM Guests With virt-install On Ubuntu 11.04 Server - Page 2
On this page
5 Connecting To The Guest
Ubuntu 11.04 Desktop:
The KVM guest will now boot from the CentOS 5.6 DVD and start the graphical CentOS installer - that's why we need to connect to the graphical console of the guest. You can do this with virt-manager on the Ubuntu 11.04 desktop (see KVM Guest Management With Virt-Manager On Ubuntu 8.10).
Go to Applications > System Tools > Virtual Machine Manager to start virt-manager:
When you start virt-manager for the first time and no KVM is installed on your Ubuntu desktop (i.e., the KVM host is not identical to your dekstop), you will most likely see the following message (Could not detect a default hypervisor.). You can ignore this because we don't want to connect to the local libvirt daemon, but to the one on our remote Ubuntu 11.04 KVM host.
In virt-manager, go to File > Add Connection... to connect to your Ubuntu 11.04 KVM host:
Select QEMU/KVM as Hypervisor. If the KVM host is identical to your desktop, you are done now and can click on Connect.
But if the KVM host is on a remote Ubuntu 11.04 server, then check Connect to remote host, select SSH from the Method drop-down menu, fill in root in the Username field, type in the hostname or IP address (192.168.0.100) of the Ubuntu 11.04 KVM host in the Hostname field, and click on Connect.
(Replace 192.168.0.100 with the IP address or hostname of the KVM host. Please note that the root account must be enabled on the KVM host, and that root logins must be allowed on the KVM host. To enable the root login on an Ubuntu system, run
sudo passwd root
To check if root logins are allowed check the directive PermitRootLogin in /etc/ssh/sshd_config - you might have to restart the SSH daemon afterwards. )
If this is the first connection to the remote KVM server, you must type in yes and click on OK:
Afterwards type in the root password of the Ubuntu 11.04 KVM host:
You should see vm10 as running. Mark that guest and click on the Open button to open the graphical console of the guest:
Type in the root password of the KVM host again:
You should now be connected to the graphical console of the guest and see the CentOS installer:
Now install CentOS as you would normally do on a physical system. Please note that at the end of the installation, the CentOS system needs a reboot. The guest will then stop, so you need to start it again, either with virt-manager or like this on the KVM host's command line:
Ubuntu 11.04 KVM Host:
sudo virsh --connect qemu:///system
Afterwards, you can connect to the guest again with virt-manager and configure the guest. You can as well connect to it with an SSH client (such as PuTTY).