[libvirt-users] Error connecting to console

Hi, i have KVM running at the moment and im trying to do a text based install of centos, so i need to connect to the console via virsh virsh console servername but i get this error: error: Failed to get local hostname How do i resolve this issue to get a consol connection to the server? I have tried to put it into the /etc/hosts file, but to no avail. Hope someone can help or suggest another method of doing a headless and X less install of a guest? Kind Regards Tony

On 04/30/2010 09:11 AM, Anthony Davis wrote:
Hi,
i have KVM running at the moment and im trying to do a text based install of centos, so i need to connect to the console via virsh
virsh console servername
but i get this error:
error: Failed to get local hostname
Yeah, this is an unfortunate bug in the virsh console code at the moment. It tries to fetch the hostname so that it can check whether the connection is local or remote (since we don't currently support the console on remote machines). The problem usually comes down to the fact that whatever "hostname" returns maps to localhost. In /etc/hosts, make sure that the 127.0.0.1 line only has "localhost" and "localhost.localdomain", and *not* the hostname of your server. Then make sure /etc/hosts has an entry for the IP address of your machine. If you can't get it to work, send a copy of your /etc/hosts, the output from "hostname" and the output from "ifconfig", and I can suggest modifications. Note that this is considered a bug, and we want to fix it, we just haven't gotten around to it yet. -- Chris Lalancette

Hi Chris, Thanks for the response, will try and sort it out today... Kind Regards Tony Quoting Chris Lalancette <clalance@redhat.com>:
On 04/30/2010 09:11 AM, Anthony Davis wrote:
Hi,
i have KVM running at the moment and im trying to do a text based install of centos, so i need to connect to the console via virsh
virsh console servername
but i get this error:
error: Failed to get local hostname
Yeah, this is an unfortunate bug in the virsh console code at the moment. It tries to fetch the hostname so that it can check whether the connection is local or remote (since we don't currently support the console on remote machines).
The problem usually comes down to the fact that whatever "hostname" returns maps to localhost. In /etc/hosts, make sure that the 127.0.0.1 line only has "localhost" and "localhost.localdomain", and *not* the hostname of your server. Then make sure /etc/hosts has an entry for the IP address of your machine. If you can't get it to work, send a copy of your /etc/hosts, the output from "hostname" and the output from "ifconfig", and I can suggest modifications.
Note that this is considered a bug, and we want to fix it, we just haven't gotten around to it yet.
-- Chris Lalancette
participants (2)
-
Anthony Davis
-
Chris Lalancette