[SOLVED] Xen On CentOS 6.2 (x86_64)

Discussion in 'Installation/Configuration' started by NeonNexxus, Jun 19, 2012.

  1. NeonNexxus

    NeonNexxus New Member

    Hi there everybody and Falko.

    I was trying to install XEN on a CentOS 6.2 (x86_64) and following the guide at http://www.howtoforge.com/virtualization-with-xen-on-centos-6.2-x86_64-paravirtualization-and-hardware-virtualization but I ran out of luck.
    Please bear with me and let me explain.
    I have a web hosted server in Germany and I am nowhere near it.
    The server I can reinstall Centos 6.2 minimal install as many times as i want (thank GOD).
    Ok now on to business.
    After the CentOS 6.2 minimal install I run this commands. Since I want to have the GUI remotely I start by installing the Desktop. and then moving to the guide.

    =========================

    yum install @basic-desktop
    yum groupinstall "Desktop Platform"
    yum install xorg-x11-fonts-misc
    yum install xorg-x11-fonts-Type1
    yum install tigervnc-server
    yum install vim
    vim /etc/sysconfig/vncservers
    adduser mxxxxxx
    passwd mxxxxx
    su - mxxxxx
    vncpasswd as mxxxx
    exit - back to root
    service vncserver start
    yum list firefox
    yum install firefox.x86_64
    vim /etc/sysconfig/selinux - Disabaled
    yum install bridge-utils
    cd /etc/yum.repos.d/
    ls -l

    wget http://www.crc.id.au/repo/kernel-xen-release-6-3.noarch.rpm
    rpm -Uvh kernel-xen-release-6-3.noarch.rpm

    Falko has on his guide this command but it did not worked for me.
    cd /etc/yum.repos.d/
    wget http://www.crc.id.au/repo/kernel-xen.repo


    Then I keep going ..

    yum install kernel-xen xen
    vim /boot/grub/menu.lst
    yum install libvirt python-virtinst
    yum groupinstall 'Development Tools'
    yum install python-devel xen-devel libxml2-devel xhtml1-dtds readline-devel ncurses-devel libtasn1-devel gnutls-devel augeas libudev-devel

    libpciaccess-devel yajl-devel sanlock-devel libpcap-devel libnl-devel avahi-devel libselinux-devel cyrus-sasl-devel parted-devel device-mapper-devel

    numactl-devel libcap-ng-devel netcf-devel libcurl-devel audit-libs-devel systemtap-sdt-devel
    rpm -qa | grep libvirt
    mkdir /root/src
    cd /root/src
    wget http://vault.centos.org/6.2/os/Source/SPackages/libvirt-0.9.4-23.el6.src.rpm
    rpm -i libvirt-0.9.4-23.el6.src.rpm
    wget http://pasik.reaktio.net/xen/patches/libvirt-spec-rhel6-enable-xen.patch
    cd /root/rpmbuild/SPECS
    cp -a libvirt.spec libvirt.spec.orig
    patch -p0 < ~/src/libvirt-spec-rhel6-enable-xen.patch
    rpmbuild -bb libvirt.spec
    cd /root/rpmbuild/RPMS/x86_64/
    rpm -Uvh --force libvirt-0.9.4-23.el6.x86_64.rpm libvirt-client-0.9.4-23.el6.x86_64.rpm libvirt-python-0.9.4-23.el6.x86_64.rpm

    Everything works great until here.

    reboot
    #uname -a -- Displays

    Linux CentOS-62-64-minimal 2.6.32.57-2.el6xen.x86_64 #1 SMP Fri May 25 14:05:24 EST 2012 x86_64 x86_64 x86_64 GNU/Linux

    #xm list -- Displays

    Name ID Mem VCPUs State Time(s)
    Domain-0 0 1024 4 r----- 30.2


    But .. and here is the big BUT <-


    #virsh list -- Dislpays

    Id Name State
    ----------------------------------

    #virsh list comes out empty.
    So I can not connect to anything.
    I have tried almost everything googling around but with no luck
    Thank you in advanced everyone.
    Ed
     
  2. falko

    falko Super Moderator

    Use
    Code:
    yum install http://au1.mirror.crc.id.au/repo/kernel-xen-release-6-3.noarch.rpm
    instead. Then try
    Code:
    yum install kernel-xen xen
    again.
     
  3. NeonNexxus

    NeonNexxus New Member

    Thank you falko

    Worked like a charm...
    Hooray...!!!!

    But now i have another question that maybe one of the guys or you can help me with please.

    My Server is now running public Ip x.x.20.x netmask x.x.x.224 gateway x.x.20.x
    They guys on the hosting povider gave me for virtual machines this
    IP 1 x.x.27.210 netmask x.x.x.248 gateway x.x.27.209
    IP 2 x.x.27.212 netmask x.x.x.248 gateway x.x.27.209
    IP 3 x.x.33.85 netmask x.x.x.248 gateway x.x.33.81
    IP 4 x.x.33.86 netmask x.x.x.248 gateway x.x.33.81

    Now if I understand how this works I will have to create 2 different bridges more lets say br1 and br2 with lets say
    br1 with IP 1 been the bridge of IP 2 on the VM01
    and
    br2 with IP3 been the bridge of IP4 on the VM02
    That been said i can have only 2 VM's with public IP's

    Am I right?
    Please advice if I am wrong or if there is another way to do this.
    Thanks to all
    Ed


    PS I forgot one thing .. please be aware that I only have one Physical NIC so i might need to create dummy0-1 for the new bridges. Is that possible? Cause i am trying and i succed on creating them from command line but when i restart centos 6.2 dummy0 goes away. Only eth0 remains.
    Thanks again.
     
    Last edited: Jun 21, 2012
  4. NeonNexxus

    NeonNexxus New Member

    Ok .. i will try to answer my own question. hehehe

    Not trying to be falko or anything LOL but here are my 2 cents of contribution just in case anyone needs them.

    1) Asked my ISP in Germany to give me the ip's on the same sub-net but they were not able to give me the same as the server since the one where the server is, is already full.
    So
    A. Server IP xxx.xxx.020.170
    B. VM's servers new sub-net (4ip's free) xxx.xxx.033.083 -> xxx.xxx.033.086
    B.1 As you can see the third octec of the IP is totally different.
    C We need to create a dummy NIC to hold the bridge

    The new IP addresses were each routed via my existing public address - and in this scenario I couldn't use NAT, since these are public addresses.

    Instead I needed to use a bridge.

    In my case Centos6.2 was installed on the server by my ISP and it was a minimal install. So I needed to install the desktop environment to make it easier to work with the GUI for my administration team.

    So here are the steps taken for this installation. Most of them were taken out of this tutorial by falko .. http://www.howtoforge.com/virtualization-with-xen-on-centos-6.2-x86_64-paravirtualization-and-hardware-virtualization
    =======================================================

    yum groupinstall "Desktop" "Desktop Platform" "General Purpose Desktop" "Internet Browser" "X Window System"
    yum install xorg-x11-fonts-misc
    yum install xorg-x11-fonts-Type1
    reboot
    ifconfig -a

    At this point you might have only the eth0 and the lo NIC's do not worry.
    check that your CPU actually supports virtualization. As per falkos guide above.
    egrep '(vmx|svm)' --color=always /proc/cpuinfo
    yum install bridge-utils
    yum install vim <- love this editor better than vi and nano.
    Now create the bridge interface first.

    vim /etc/sysconfig/network-scripts/ifcfg-bro0

    DEVICE="br0"
    NM_CONTROLLED="yes"
    ONBOOT=yes
    TYPE=Bridge
    BOOTPROTO=none
    IPADDR=xxx.xxx.033.083
    NETMASK=255.255.255.248
    GATEWAY=xxx.xxx.033.081
    DNS1=8.8.8.8
    DNS2=8.8.4.4
    DEFROUTE=yes
    IPV4_FAILURE_FATAL=yes
    IPV6INIT=no
    NAME="System br0"

    Then bring up the dummy interface.
    modprobe dummy0 numdummies=1 <-numdummies=1 tells modprobe that we will use only 1 dummy NIC if you need more change the value there.

    Then edit

    vim /etc/sysconfig/network-scripts/ifcfg-dummy0

    DEVICE="dummy0"
    NM_CONTROLLED="yes"
    ONBOOT=yes
    TYPE=Ethernet
    IPV4_FAILURE_FATAL=yes
    IPV6INIT=no
    NAME="System dummy0"
    BRIDGE=br0

    Now do a network restart.
    service network restart

    Run again.
    ifconfig -a
    You should now be able to see the dummy0 adapter there ..

    [root@CentOS-62-64-minimal ~]# ifconfig -a
    br0 Link encap:Ethernet HWaddr DE:F7:E8:D5:C0:4E
    inet addr: xxx.xxx.033.083 Bcast: xxx.xxx.033.087 Mask:255.255.255.248
    inet6 addr: fe80::dcf7:e8ff:fed5:c04e/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:314445 errors:0 dropped:0 overruns:0 frame:0
    TX packets:612808 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:51583085 (49.1 MiB) TX bytes:759490924 (724.3 MiB)

    dummy0 Link encap:Ethernet HWaddr DE:F7:E8:D5:C0:4E
    inet6 addr: fe80::dcf7:e8ff:fed5:c04e/64 Scope:Link
    UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:6791 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:0 (0.0 b) TX bytes:296062 (289.1 KiB)

    eth0 Link encap:Ethernet HWaddr 54:04:A6:F1:7A:C8
    inet addr: xxx.xxx.020.170 Bcast: xxx.xxx.020.191 Mask:255.255.255.224
    inet6 addr: fe80::5604:a6ff:fef1:7ac8/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:6149155 errors:0 dropped:0 overruns:0 frame:0
    TX packets:1935534 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:8724166695 (8.1 GiB) TX bytes:360734002 (344.0 MiB)
    Interrupt:206 Base address:0x8000

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:219135 errors:0 dropped:0 overruns:0 frame:0
    TX packets:219135 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:308503705 (294.2 MiB) TX bytes:308503705 (294.2 MiB)

    Now we continue following the guide from falko.

    yum install http://au1.mirror.crc.id.au/repo/kernel-xen-release-6-3.noarch.rpm

    yum install kernel-xen xen
    ....
    ...
    ..
    .
    Till you reach
    rpm -Uvh --force libvirt-0.9.4-23.el6.x86_64.rpm libvirt-client-0.9.4-23.el6.x86_64.rpm libvirt-python-0.9.4-23.el6.x86_64.rpm
    reboot
    uname -r
    xm list
    virsh list


    At this point since now you have

    [root@CentOS-62-64-minimal ~]# virsh list
    Id Name State
    ----------------------------------
    0 Domain-0 running

    now we issue the command
    ifconfig -a <- again and now we should have something like this.

    br0 Link encap:Ethernet HWaddr DE:F7:E8:D5:C0:4E
    inet addr: xxx.xxx.033.083 Bcast: xxx.xxx.033.087 Mask:255.255.255.248
    inet6 addr: fe80::dcf7:e8ff:fed5:c04e/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:314445 errors:0 dropped:0 overruns:0 frame:0
    TX packets:612808 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:51583085 (49.1 MiB) TX bytes:759490924 (724.3 MiB)

    dummy0 Link encap:Ethernet HWaddr DE:F7:E8:D5:C0:4E
    inet6 addr: fe80::dcf7:e8ff:fed5:c04e/64 Scope:Link
    UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:6791 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:0 (0.0 b) TX bytes:296062 (289.1 KiB)

    eth0 Link encap:Ethernet HWaddr 54:04:A6:F1:7A:C8
    inet addr: xxx.xxx.020.170 Bcast: xxx.xxx.020.191 Mask:255.255.255.224
    inet6 addr: fe80::5604:a6ff:fef1:7ac8/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:6149155 errors:0 dropped:0 overruns:0 frame:0
    TX packets:1935534 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:8724166695 (8.1 GiB) TX bytes:360734002 (344.0 MiB)
    Interrupt:206 Base address:0x8000

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:219135 errors:0 dropped:0 overruns:0 frame:0
    TX packets:219135 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:308503705 (294.2 MiB) TX bytes:308503705 (294.2 MiB)

    tap16.0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF
    inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
    UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
    RX packets:18313 errors:0 dropped:0 overruns:0 frame:0
    TX packets:34614 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:500
    RX bytes:2908310 (2.7 MiB) TX bytes:34196939 (32.6 MiB)

    vif16.0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF
    inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
    UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:45 errors:0 dropped:1 overruns:0 carrier:0
    collisions:0 txqueuelen:32
    RX bytes:0 (0.0 b) TX bytes:3646 (3.5 KiB)

    virbr0 Link encap:Ethernet HWaddr 52:54:00:FF:44:1B
    inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:53 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:0 (0.0 b) TX bytes:4725 (4.6 KiB)

    virbr0-nic Link encap:Ethernet HWaddr 52:54:00:FF:44:1B
    BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:500
    RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

    From here on guys you are on your own with falkos guide and the net too.


    ** NOTE Once you guys have installed the first VM you put the next ip in my case xxx.xxx.033.084 as the first VM ip and the netmask 255.255.255.248 in my case but be careful here .. on the VM's GATEWAY you should put the bridge IP which in my case was xxx.xxx.033.083.
    Leaving me with my first VM 's eth0 config with this lines on it.
    IPADDR= xxx.xxx.033.084
    NETMASK=255.255.255.248
    GATEWAY= xxx.xxx.033.83

    ** REMEMBER to always use your bridges IP as your gateway ip on your VM's.

    Thank you all.
    Thats all for now.
    Thank to everyone for your help specially FALKO.
    Ed

    FALKO PLEASE mark this as resolved .. Don't know how to do it .. sorry. THANKS
     
  5. Upsurged

    Upsurged New Member

    Thank you Ed & Falko, just additional query

    Hi Ed,

    Thanks a lot for solving me this trouble.

    But I have a query, arent we wasting one valuable IP just for the bridge interface ?

    Is there any way we can utilize the bridge IP on some services, without wasting it as the gateway ?

    Thanks,
    GR
     
  6. NeonNexxus

    NeonNexxus New Member

    Hi upsurged

    Well in your question yes we are practically wasting one Ip doing nothing.
    Let me try to solve this riddle another way that i am thinking.
    Sorry about the delay on answering. Had some personal issues.
    I will try some things for monday will let you know then.
    Thanks
    Ed
     
  7. Upsurged

    Upsurged New Member

    A possible solution

    Hi Ed,

    Apologies again from my side, for the delay in posting. I had tried to configure a service in the root box to utilize the gateway IP, and it had been successful.

    The only drawback, I am very skeptical in running any service on the root box other than libvirt, and wish that I would rather run it in a vm.

    Thanks,
    GR.
     
  8. NeonNexxus

    NeonNexxus New Member

    Hi Upsurge

    Hi Upsurge I thought you wanted to utilize the gateway Ip in a VM not run a service on that ip in which I think I have succeded too.
    Just give me a couple more days to do some more testing and i will let you know.
    Thanks
    Ed
     
  9. Upsurged

    Upsurged New Member

    You are the saviour

    Hi Ed,

    You are perfectly right, I would like to use the IP in a vm.

    Thank you for the trouble.


    Regards,
    Raja.
     
  10. Upsurged

    Upsurged New Member

    Any ideas

    Hi Ed,

    Sorry for being a bother. But the system is currently in production now, and I dont want to mess it up for testing. Could you share what was your idea, maybe I can try locally and then apply on the root server.

    Thanks,
    GR
     
  11. NeonNexxus

    NeonNexxus New Member

    SORRRYYYY !!! I had a car accident

    I was out for a while I had a car accident and got complicated with pneumonia.
    Lucky I am recovered now.
    Hi my friend.
    Do you still need my help ?
    Or did you solved it yourself ??
    Let me know
    Thanks
    Ed
     
  12. jessev

    jessev New Member

    Hey guys, Hopefully you don't mind me chiming in.

    I am wondering if Falko's Xen installation process for CentOS 6.2 will work for CentOS 6.4 with no modifications?

    I see no reason why it shouldn't but I'm a noob to Xen.

    I have installed Xen Server on CentOS 6.4 but could not get lib-virt working and I could not get XenCenter to talkto my Xen Server, so I know I did something wrong somewhere.
     

Share This Page