Installing KVM Guests With virt-install On Ubuntu 12.04 LTS Server - Page 2

5 Connecting To The Guest

Ubuntu 12.04 Desktop:

The KVM guest will now boot from the CentOS 6.2 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 12.04 desktop (see KVM Guest Management With Virt-Manager On Ubuntu 8.10).

Start Virtual Machine Manager (you can search for virt-manager in Unity to find it):

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 12.04 KVM host.

In virt-manager, go to File > Add Connection... to connect to your Ubuntu 12.04 KVM host. In my virt-manager, I couldn't find the File menu, it was missing, so I had to right-click a certain area just below the cross that is used to close the program, and then the menu opened from where I could select Add Connection...:

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 12.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 12.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 12.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 12.04 KVM Host:

sudo virsh --connect qemu:///system
start vm10
quit

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).

Share this page:

1 Comment(s)