I'm having problems trying to install CentOS as a KVM guest despite following the wikis and howtos.
The problem is that most of the instructions skip the part that happens after virt-install... It seems that something blindingly obvious happens if nothing goes wrong and most instructions continues from the OS installation screen.
However, when I try this, I get a blank console that says "Escape Char is ^]" and doesn't do anything useful.
If I specify --vnc options, the blank console doesn't appear but the CentOS guest doesn't respond to VNC connections. I've tried connecting on the public IP, on the LAN IP, on loopback 127.0.0.1, with autoport, with different specified ports, port numbers - 5900 since vnc seems to accept :1 as 5901, enabling qemu to listen on all public interfaces and allowing exceptions in iptables just in case loopback 127.0.0.1 is blocked. But nothing gives me a console/screen that I can install the OS.
Or should I expect VNC to work, given that the OS isn't installed, or is it an inbuilt function of KVM?
The VM guest appears to be loaded, there are no obvious errors, virsh list shows the VM but I can't do anything with them. It's been really frustrating.
Can anybody please point out what's the obvious step or magic trick I'm missing?
On Tue, 26 Apr 2011, Emmanuel Noobadmin wrote:
I'm having problems trying to install CentOS as a KVM guest despite following the wikis and howtos.
The problem is that most of the instructions skip the part that happens after virt-install... It seems that something blindingly obvious happens if nothing goes wrong and most instructions continues from the OS installation screen.
However, when I try this, I get a blank console that says "Escape Char is ^]" and doesn't do anything useful.
I've only done text-based installations of CentOS under KVM, so I can't comment on VNC options. Here's an edited form of a standard virt-install script:
virt-install \ --name="VMName" --ram="1024" --vcpus="1" \ --nographics --accelerate \ --os-type="linux" --os-variant="rhel5.4" \ --network="bridge:br0" --mac="54:52:00:12:34:56" \ --disk="path=/var/lib/libvirt/images/VMName.dsk,size=20" \ --location="http://some-mirror/centos/5/os/x86_64" \ --extra-args="console=ttyS0"
As always, double-check to make sure that, e.g., the network option is configured appropriately for your environment.
If you're doing a kickstart installation, the "ks=..." stuff goes within the extra-args option.
On 26.4.2011 0.47, Emmanuel Noobadmin wrote:
I'm having problems trying to install CentOS as a KVM guest despite following the wikis and howtos.
I succeeded with this howto:
http://sysadminman.net/blog/2011/kvm-virtualization-text-centos-guest-instal...
Except I skipped the lvcreate part, as I don't use LVM.
- Jussi
Thanks for both the replies, I'm trying it out again. Text base installation is fine with me, which was what I was originally trying to do anyway.
Unfortunately, I'm still stuck at what should be the console with the same "Connected to domain vm01. Escape char is ^]" message.
virsh ttyconsole vm01
gives me /dev/pts/0
So the console was defined correctly, I could connect using virsh console vm01, which brings me back to the blank screen.
Checking /var/log/libvirt/qemu/vm01.log reveals no error, just the installation parameters and the fact it's redirecting char device to /dev/pts/0
Just in case KVM is still booting the VM, I've checked top and kvm is basically idling.
Is there anyway to check if KVM actually booted the VM past the equivalent of BIOS POST? So that I can determine if it's hang at initialization or it's the installation ISO that's the problem?
On 4/26/11, Jussi Hirvi listmember@greenspot.fi wrote:
On 26.4.2011 0.47, Emmanuel Noobadmin wrote:
I'm having problems trying to install CentOS as a KVM guest despite following the wikis and howtos.
I succeeded with this howto:
http://sysadminman.net/blog/2011/kvm-virtualization-text-centos-guest-instal...
Except I skipped the lvcreate part, as I don't use LVM.
- Jussi
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Please ignore my last email. The embarrassing noob mistake is that, all the past instructions/guides seem to imply that virt-install will work fine using an ISO image. So I've assumed that doesn't matter, although Jussi's link included the step to mount the ISO.
After wondering if the ISO is the problem, I decided to mount it to check, since it looked OK. I tried another install using the mount point and I no longer have a blank console :)
So the key is to mount ISO before using as installation source.
On 4/26/11, Emmanuel Noobadmin centos.admin@gmail.com wrote:
Thanks for both the replies, I'm trying it out again. Text base installation is fine with me, which was what I was originally trying to do anyway.
Unfortunately, I'm still stuck at what should be the console with the same "Connected to domain vm01. Escape char is ^]" message.
virsh ttyconsole vm01
gives me /dev/pts/0
So the console was defined correctly, I could connect using virsh console vm01, which brings me back to the blank screen.
Checking /var/log/libvirt/qemu/vm01.log reveals no error, just the installation parameters and the fact it's redirecting char device to /dev/pts/0
Just in case KVM is still booting the VM, I've checked top and kvm is basically idling.
Is there anyway to check if KVM actually booted the VM past the equivalent of BIOS POST? So that I can determine if it's hang at initialization or it's the installation ISO that's the problem?
On 4/26/11, Jussi Hirvi listmember@greenspot.fi wrote:
On 26.4.2011 0.47, Emmanuel Noobadmin wrote:
I'm having problems trying to install CentOS as a KVM guest despite following the wikis and howtos.
I succeeded with this howto:
http://sysadminman.net/blog/2011/kvm-virtualization-text-centos-guest-instal...
Except I skipped the lvcreate part, as I don't use LVM.
- Jussi
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Unfortunately, things still don't work.
<rant> It's just ridiculous that the installer under KVM does not detect the cdrom drive it was booted from. Trying to do a net-install doesn't work, maybe I messed up the networking even though br0 and eth0 is working on the host.
Nevermind, let's install apache and use the mounted ISO. Verified apache is working and the CentOS folder is accessible via web browser. But, still the guest installer cannot seem to access the installation files.
OK, so maybe I messed up the networking, after all I am the noob... maybe specifying --network=bridge:br0 isn't enough. There was something about a tap or tunnel when initially reading up on bridged networking. Looking up more on this, there are several resources (sorry KVM FAQ leads to a page that no longer exist) which like many other instructions, give the commands without really explaining what/why.
So I have to run some tunctl command and scripts to add a bridge and tunnel/tap... but wait, I already made my bridge, will running the script kill my networking by creating a second bridge? Especially the warning about temporarily loosing connectivity due to ifcfg1 being reset.
And if I need to run this script everytime in order to activate the bridge and tunnel, doesn't that mean all my guest OS are screwed if the host reboots while I'm not around? Shouldn't these things go into permanent files like if-tun0 or something?
Every year, I get a little closer to not using VMWare but it seems like this year is going to be victory for VMWare again.
CC to kvm mailing list but I expect, like my previous request for help to the list, it will be rejected by mailman or a moderator. </rant>
Just damn frustrated, even if it's probably just me being too stupid to know how to use KVM.
I understand you so well, I have been so frustrated too with virt-install. Virt-manager is probably an easier way to install, but text-based virt-install is very cranky (my experience). Maybe the devs concentrate on the GUI side. Hope not.
Anyway, to know what is wrong, more info would be needed... Especially, at what point does the installation stall.
Here is one of my install commands that worked: virt-install --name mail \ --os-variant rhel5.4 --ram 1024 \ --vcpus 2 --accelerate \ --nographics -v \ --location /mnt/centos56/ --network bridge:br0 \ --disk path=/kvmail/mail.img,size=290 \ --extra-args "console=ttyS0";
So I boot the installer from a mounted DVD, then in the dialog I say "http install", and give it my local http "repo".
No other bridge is necessary - I think it would only make things messy. In the installer let it configure interface with dhcp, if applicable, or give it a free ip.
In giving the http repo remember the slash after the subdirectory, for example (I noticed it is necessary) address: 12.34.56.78 directory: centos/4.9/os/i386/
This would be http://12.34.56.78/pub/mirrors/centos.org/4.9/os/i386/ Check in your browser that the path works. The stage2 image should appear in seconds from a local repo!
Once I did a net install with --location http://ftp.funet.fi/pub/mirrors/centos.org/4.9/os/i386/ But on another try it did not seem to work anymore. Not sure about that. Anyway the mounted ISO works every time. And a local repo is very fast.
- Jussi
On 26.4.2011 23.57, Emmanuel Noobadmin wrote:
Unfortunately, things still don't work.
<rant> It's just ridiculous that the installer under KVM does not detect the cdrom drive it was booted from. Trying to do a net-install doesn't work, maybe I messed up the networking even though br0 and eth0 is working on the host.
Nevermind, let's install apache and use the mounted ISO. Verified apache is working and the CentOS folder is accessible via web browser. But, still the guest installer cannot seem to access the installation files.
OK, so maybe I messed up the networking, after all I am the noob... maybe specifying --network=bridge:br0 isn't enough. There was something about a tap or tunnel when initially reading up on bridged networking. Looking up more on this, there are several resources (sorry KVM FAQ leads to a page that no longer exist) which like many other instructions, give the commands without really explaining what/why.
So I have to run some tunctl command and scripts to add a bridge and tunnel/tap... but wait, I already made my bridge, will running the script kill my networking by creating a second bridge? Especially the warning about temporarily loosing connectivity due to ifcfg1 being reset.
And if I need to run this script everytime in order to activate the bridge and tunnel, doesn't that mean all my guest OS are screwed if the host reboots while I'm not around? Shouldn't these things go into permanent files like if-tun0 or something?
Every year, I get a little closer to not using VMWare but it seems like this year is going to be victory for VMWare again.
CC to kvm mailing list but I expect, like my previous request for help to the list, it will be rejected by mailman or a moderator.
</rant>
Just damn frustrated, even if it's probably just me being too stupid to know how to use KVM.
On 4/28/11, Jussi Hirvi listmember@greenspot.fi wrote:
I understand you so well, I have been so frustrated too with virt-install. Virt-manager is probably an easier way to install, but text-based virt-install is very cranky (my experience). Maybe the devs concentrate on the GUI side. Hope not.
Thanks, it helps to know I'm not alone in feeling frustrated over the process.
Anyway, to know what is wrong, more info would be needed... Especially, at what point does the installation stall.
Here is one of my install commands that worked: virt-install --name mail \ --os-variant rhel5.4 --ram 1024 \ --vcpus 2 --accelerate \ --nographics -v \ --location /mnt/centos56/ --network bridge:br0 \ --disk path=/kvmail/mail.img,size=290 \ --extra-args "console=ttyS0";
I have pretty much the same thing except the names are slightly different and I've already created the disk with qemu-img so the size was omitted.
No other bridge is necessary - I think it would only make things messy. In the installer let it configure interface with dhcp, if applicable, or give it a free ip.
Did you have to configure an additional tap interface? It seems like it might be necessary but all the guides just involve giving some command to create a temporary tap... which doesn't sound very safe if I want it to persist after a reboot. But I couldn't find any instructions on how a tap could be defined using a file like /etc/sysconfig/network-scripts/if_tap1.
In giving the http repo remember the slash after the subdirectory, for example (I noticed it is necessary) address: 12.34.56.78 directory: centos/4.9/os/i386/
This would be http://12.34.56.78/pub/mirrors/centos.org/4.9/os/i386/ Check in your browser that the path works. The stage2 image should appear in seconds from a local repo!
I did this too, although my path was just centos56/ Just in case the guest VM was connecting in an around about manner and iptables was blocking what appears to be an external connection. I tested that it was accessible from both a VNC session on the host itself, as well as from external network.
So this is where my installation halts. I will get the message unable to retrieve http://12.34.56.78//Centos56/images/stage2.img
Just to be sure it was not just accessible but downloadable, I tried to download this exact URL including the double slash and it works.
So it seems to me that the VM's networking is wrong somehow. Especially since the assigned IP is not pingable during this point. But I can't be sure if that's just because the OS is still being installed.
Here is one of my install commands that worked: virt-install --name mail \ --os-variant rhel5.4 --ram 1024 \ --vcpus 2 --accelerate \ --nographics -v \ --location /mnt/centos56/ --network bridge:br0 \ --disk path=/kvmail/mail.img,size=290 \ --extra-args "console=ttyS0";
On 28.4.2011 8.11, Emmanuel Noobadmin wrote:
I have pretty much the same thing except the names are slightly different and I've already created the disk with qemu-img so the size was omitted.
I tried it too, didn't work. Try virt-install without creating the image first. Virt-install will create the image (type "raw") on the go. If you want qcow2, you can convert the image later. Qcow2 has some special features but is slower than raw.
Did you have to configure an additional tap interface? It seems like it might be necessary but all the guides just involve giving some command to create a temporary tap... which doesn't sound very safe if I want it to persist after a reboot. But I couldn't find any instructions on how a tap could be defined using a file like /etc/sysconfig/network-scripts/if_tap1.
No, I definitely did not do that. I don't know why that would be needed.
I did this too, although my path was just centos56/ Just in case the guest VM was connecting in an around about manner and iptables was blocking what appears to be an external connection. I tested that it was accessible from both a VNC session on the host itself, as well as from external network.
So this is where my installation halts. I will get the message unable to retrievehttp://12.34.56.78//Centos56/images/stage2.img
Just to be sure it was not just accessible but downloadable, I tried to download this exact URL including the double slash and it works.
The double slash does not look good... On next try, try it with no slash at the end of ip, and no slash at the beginning of path. (But keep the last slash.) :-)
So it seems to me that the VM's networking is wrong somehow. Especially since the assigned IP is not pingable during this point. But I can't be sure if that's just because the OS is still being installed.
I would not expect ping to work at that point. I would do virsh destroy myvm virsh undefine myvm virt-install again...
- Jussi
On 4/28/11, Jussi Hirvi listmember@greenspot.fi wrote:
I tried it too, didn't work. Try virt-install without creating the image first. Virt-install will create the image (type "raw") on the go. If you want qcow2, you can convert the image later. Qcow2 has some special features but is slower than raw.
I'll give that a spin next, although the disks file I created are RAW as well. The problem wth using virt-install to create files is that it takes forever, I've no idea why.
No, I definitely did not do that. I don't know why that would be needed.
That's what I'm puzzling over. But reading up so far seems to imply that it acts as a way for qemu/KVM to receive and inject network traffic into the kernel network stack.
The double slash does not look good... On next try, try it with no slash at the end of ip, and no slash at the beginning of path. (But keep the last slash.) :-)
The installer adds that double slash, it was one of the first oddity I noted. But googling indicates that this was normal and testing it, indicates that the URL was valid. I suppose it just meant root of root which is still root :D
Anyway I tried out different variations just to be safe, but whether I used /Centos56 or Centos56 or Centos56/, the same url comes up. The installer apparently does some basic sanitization of the parameters.
So it seems to me that the VM's networking is wrong somehow. Especially since the assigned IP is not pingable during this point. But I can't be sure if that's just because the OS is still being installed.
I would not expect ping to work at that point. I would do virsh destroy myvm virsh undefine myvm virt-install again...
Those 3 are my most familiar vir* command at this point :D
As for the httpd log you mentioned in another email, that's also one of the reason I keep suspecting that networking is the issue. There are no entries in the httpd logs for the guest, but I can see my external access entries.
On 4/28/11, Jussi Hirvilistmember@greenspot.fi wrote:
Try virt-install without creating the image first.
On 28.4.2011 9.17, Emmanuel Noobadmin wrote:
I'll give that a spin next, although the disks file I created are RAW as well. The problem wth using virt-install to create files is that it takes forever, I've no idea why.
For me creating the images does not take any noticeable time. Only when the installer formats the "disk" to ext3 (or others), it will take some time. Probably your syntax does not work. Try the syntax in my example, like
--disk path=/kvmail/mail.img,size=290 \
(making sure that the image does not exist beforehand).
No, I definitely did not do that. I don't know why that would be needed.
That's what I'm puzzling over. But reading up so far seems to imply that it acts as a way for qemu/KVM to receive and inject network traffic into the kernel network stack.
You are probably reading some outdated howtos. No wonder, because where are the up-to-date howtos?? Red Hat Virtualization Guide is a nice book, but only an overview - it does not go into the gritty details.
The double slash does not look good... On next try, try it with no slash at the end of ip, and no slash at the beginning of path. (But keep the last slash.):-)
The installer adds that double slash, it was one of the first oddity I noted. But googling indicates that this was normal and testing it, indicates that the URL was valid. I suppose it just meant root of root which is still root :D
I just got the double slash too on one installation try. I believe the double slash is an error of the error messaging. :-) If so, it only shows the level of "sophistication" of virt-install.
Anyway I tried out different variations just to be safe, but whether I used /Centos56 or Centos56 or Centos56/, the same url comes up. The installer apparently does some basic sanitization of the parameters.
So it should. But that only "sanitizes" the error message, and erroneously (producing a double slash). :-)
I am just installing CentOS 4. I tried it first without a trailing slash in the path, and I got instantly "unable to get the image" or so. After that I could not get the image again, whatever I did. I had to restart the install from scratch, and then, after being sure to add the trailing slash, I got the image at once.
If this is problem in Anaconda or virt-install, I am not sure.
As for the httpd log you mentioned in another email, that's also one of the reason I keep suspecting that networking is the issue. There are no entries in the httpd logs for the guest, but I can see my external access entries.
Ok, that could be the case.
- Jussi
On 4/28/11, Jussi Hirvi listmember@greenspot.fi wrote:
For me creating the images does not take any noticeable time. Only when the installer formats the "disk" to ext3 (or others), it will take some time. Probably your syntax does not work. Try the syntax in my example, like
--disk path=/kvmail/mail.img,size=290 \
(making sure that the image does not exist beforehand).
Thanks for pointing out that it really is abnormal because it takes about 2 hours for virt-install to create a 190G disk for me. I'll try this on my next attempt.
You are probably reading some outdated howtos. No wonder, because where are the up-to-date howtos?? Red Hat Virtualization Guide is a nice book, but only an overview - it does not go into the gritty details.
That's generally the issue, I've tried to use mostly information from the newer pages/articles but still, most of them skip important caveats/notes like the fact while specifying the ISO is good enough for the GUI, it doesn't work with the CLI.
I just got the double slash too on one installation try. I believe the double slash is an error of the error messaging. :-) If so, it only shows the level of "sophistication" of virt-install.
Damn!
So it should. But that only "sanitizes" the error message, and erroneously (producing a double slash). :-)
But in any case, since I tried all kinds of variations on host IP and directory, including stupidities like Centos56/images/ just in case. So this doesn't seem to be the problem.
If this is problem in Anaconda or virt-install, I am not sure.
Should be an anaconda issue I think since this is entirely within the virtualized environment already?
On Thu, 28 Apr 2011, Emmanuel Noobadmin wrote:
Thanks for pointing out that it really is abnormal because it takes about 2 hours for virt-install to create a 190G disk for me.
As you are having issues with the install, I might suggest creating a more modest sized disk image, at least during testing --- It would be a rare test case that would need more than 8 G for a CentOS image while you are still solving setup issues
We have supported guest images up to 400G for one user who kept re-sizing an image up and up from an initial 4G to over 400 G ... eventually the 2 1/2 hour lag in moving content from one big image to another bigger image caused him to ask why it was taking so long. When our interface 'resizes' an image, it takes a safety snapshot first to an NFS backup store, tests is, and only then deletes the old image and creates the old one ... so it takes a while for images over say 100 G.
The delays you note do not surprise me -- it takes time to reliably shuttle bits around a disk, and no cacheing effects are possible with off the shelf setups (i.e., lacking huge memory based drives) to support such large image sizes
-- Russ herrold
On 28.4.2011 8.11, Emmanuel Noobadmin wrote:
So this is where my installation halts. I will get the message unable to retrievehttp://12.34.56.78//Centos56/images/stage2.img
You could check your httpd log to see if there is anything, like 404 errors. And if problems persist, you could stop iptables for the time of install. (Don't blame me... But I don't consider it a big risk in normal circumstances.)
- Jussi
----- Original Message -----
From: "Emmanuel Noobadmin" centos.admin@gmail.com To: "CentOS mailing list" centos@centos.org, "kvm" kvm@vger.kernel.org Sent: Tuesday, April 26, 2011 11:57:18 PM Subject: Re: [CentOS] Install CentOS as KVM guest Unfortunately, things still don't work.
<rant> It's just ridiculous that the installer under KVM does not detect the cdrom drive it was booted from. Trying to do a net-install doesn't work, maybe I messed up the networking even though br0 and eth0 is working on the host.
Nevermind, let's install apache and use the mounted ISO. Verified apache is working and the CentOS folder is accessible via web browser. But, still the guest installer cannot seem to access the installation files.
OK, so maybe I messed up the networking, after all I am the noob... maybe specifying --network=bridge:br0 isn't enough. There was something about a tap or tunnel when initially reading up on bridged networking. Looking up more on this, there are several resources (sorry KVM FAQ leads to a page that no longer exist) which like many other instructions, give the commands without really explaining what/why.
So I have to run some tunctl command and scripts to add a bridge and tunnel/tap... but wait, I already made my bridge, will running the script kill my networking by creating a second bridge? Especially the warning about temporarily loosing connectivity due to ifcfg1 being reset.
And if I need to run this script everytime in order to activate the bridge and tunnel, doesn't that mean all my guest OS are screwed if the host reboots while I'm not around? Shouldn't these things go into permanent files like if-tun0 or something?
Every year, I get a little closer to not using VMWare but it seems like this year is going to be victory for VMWare again.
What version of VMWare are you using?
CC to kvm mailing list but I expect, like my previous request for help to the list, it will be rejected by mailman or a moderator.
</rant>
Just damn frustrated, even if it's probably just me being too stupid to know how to use KVM. _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On 4/28/11, Simon Grinberg simon@redhat.com wrote:
What version of VMWare are you using?
Currently, I'm not using VMWare yet on this new server as I really do hope to be able to use an "unified" solution. But so far, it's just one brickwall after another. I've given myself until this weekend to get things working or just go the easy way.
Previously, I've used VMServer 2 as well as VMPlayer 3. All running off CentOS 5.x host.