[CentOS] Install CentOS as KVM guest

Thu Apr 28 04:48:46 UTC 2011
Jussi Hirvi <listmember at greenspot.fi>

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.


-- 
Jussi Hirvi * Green Spot
Suvilahdenkatu 1 B 78 * 00500 Helsinki * Finland
Tel. +358 9 493 981 * Mobile +358 40 771 2098 (only sms)
jussi.hirvi at greenspot.fi * http://www.greenspot.fi