Results 1 to 25 of 38
-
02-08-2013, 07:45 PM #1Web Hosting Master
- Join Date
- Dec 2005
- Posts
- 3,110
Howto: Install Xen 4 on CentOS 5 and CentOS 6!
Today we are going to explain how you can do a basic, but upto-date install of Xen on your CentOS 5 or CentOS 6 system ready for use with SolusVM, HyperVM or another control panel.
This is based around packages which I maintain for both distributions including a Dom0 kernel for CentOS 6. Currently I use Xen 4.1.4 and Linux 3.4.xx, with security updates added as and when I get time. Sure there are other places out there to get Xen packages, but more often than not they are untested, out of date or too bleeding edge for production.
Let's get started...
Requirements
* CentOS 5 or CentOS 6 (64Bit Only)
* Appropriate partitioning (Majority of space unallocated and free in a LVM Volume Group)
* Some spare time
CentOS 5
1. Install my GPG key to ensure only signed packages are installed should there ever be an issue with the repo
Code:rpm --import http://repo.smartservermanagement.com/RPM-GPG-KEY-SSM
Code:nano /etc/yum.repos.d/ssm.repo
Code:[smartservermanagement] name=SmartServerManagement Repository baseurl=http://repo.smartservermanagement.com/el$releasever/$basearch/ gpgcheck=1 enabled=1
Code:yum install xen kernel-xen
Code:nano /etc/yum.repos.d/ssm.repo
Code:title CentOS (2.6.18-348.1.1.el5xen) root (hd0,0) kernel /boot/xen.gz-4.1.4 dom0_mem=1024m module /boot/vmlinuz-2.6.18-348.1.1.el5xen ro root=LABEL=/ module /boot/initrd-2.6.18-348.1.1.el5xen.img
6. Once you are happy, check that Xen is set as the first kernel to boot, and restart your system.
CentOS 6
1. Install my GPG key to ensure only signed packages are installed should there ever be an issue with the repo
Code:rpm --import http://repo.smartservermanagement.com/RPM-GPG-KEY-SSM
Code:nano /etc/yum.repos.d/ssm.repo
Code:[smartservermanagement] name=SmartServerManagement Repository baseurl=http://repo.smartservermanagement.com/el$releasever/$basearch/ gpgcheck=1 enabled=1
Code:yum install xen kernel-xen
Code:nano /etc/yum.repos.d/ssm.repo
Code:title CentOS (3.4.29-1.el6xen.x86_64) root (hd0,0) kernel /boot/vmlinuz-3.4.29-1.el6xen.x86_64 ro root=UUID=2d68d0d5-985d-496a-88a4-67bb3c8b4a46 rhgb quiet initrd /boot/initramfs-3.4.29-1.el6xen.x86_64.img
Look at our example below.
Pay attention to the path, if your system has a dedicated /boot partition it may just say /<filename> instead of /boot/<filename>
Code:title CentOS (3.4.29-1.el6xen.x86_64) root (hd0,0) kernel /boot/xen.gz module /boot/vmlinuz-3.4.29-1.el6xen.x86_64 ro root=UUID=2d68d0d5-985d-496a-88a4-67bb3c8b4a46 rhgb quiet module /boot/initramfs-3.4.29-1.el6xen.x86_64.img
On CentOS 6 systems we also need to tell the Linux kernel how much memory it has with the mem= option.
Example (Scroll to the right to see the mem= option:
Code:title CentOS (3.4.29-1.el6xen.x86_64) root (hd0,0) kernel /boot/xen.gz dom0_mem=1024M module /boot/vmlinuz-3.4.29-1.el6xen.x86_64 ro root=UUID=2d68d0d5-985d-496a-88a4-67bb3c8b4a46 rhgb quiet mem=1024M module /boot/initramfs-3.4.29-1.el6xen.x86_64.img
6. Once you are happy, check that Xen is set as the first kernel to boot, and restart your system.
After your reboot, check to see if Xen is running
Should look something like this...
Code:[root@my ~]# xm info host : my.server.com release : 3.4.29-1.el6xen.x86_64 version : #1 SMP Thu Jan 31 18:21:40 GMT 2013 machine : x86_64 nr_cpus : 8 nr_nodes : 1 cores_per_socket : 4 threads_per_core : 2 cpu_mhz : 3400 hw_caps : bfebfbff:28100800:00000000:00007f40:73bae3ff:00000000:00000001:00000281 virt_caps : hvm hvm_directio total_memory : 32648 free_memory : 12634 free_cpus : 0 xen_major : 4 xen_minor : 1 xen_extra : .4 xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 xen_scheduler : credit xen_pagesize : 4096 platform_params : virt_start=0xffff800000000000 xen_changeset : unavailable xen_commandline : dom0_mem=1024M cc_compiler : gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) cc_compile_by : mockbuild cc_compile_domain : smartservermanagement.com cc_compile_date : Fri Jan 18 13:12:04 GMT 2013 xend_config_format : 4
* If you are using CentOS 6, you will be running a kernel newer than most distro's, so you may need to use Pygrub if they fail to boot.
* DHCP does not work for Xen HVM, SolusVM currently doesn't write the configuration for compatibility on CentOS 6. Hopefully this will be addressed eventually.
* If you think you've found a bug, please PM Me with the issue + fix and I will add it in.
* The CentOS 6 kernel is based around a modified version of the RedHat .spec so hardware compatibility should be pretty good, if there is a piece of hardware not supported, let me know.
* This is 100% free, but I dont have time to provide free support for everyone so if you get stuck, post a reply, and I'm sure someone will be able to help. Or drop me a PM and for a small fee I can do the install for you + various other bits and pieces.
Thanks, and happy hosting!
Chris
-
02-09-2013, 04:02 AM #2Temporarily Suspended
- Join Date
- Feb 2004
- Location
- UK
- Posts
- 1,431
Have you managed to get ipv6 to work on the DomU's in a xen setup ?
-
02-12-2013, 03:46 AM #3New Member
- Join Date
- Feb 2013
- Posts
- 1
kernel-xen for CentOS5
I can't find kernel-xen for CentOS 5 (el5) in your repository.
Could you provide the rpms for the kernel-xen(el5)?
-
02-12-2013, 07:18 AM #4Web Hosting Master
- Join Date
- Dec 2005
- Posts
- 3,110
I dont provide a kernel-xen package for CentOS 5 because there is already one provided by default.
CentOS 5 = Xen packages only
CentOS 6 = Xen packages and kernel-xen package.
Yes we do have customers using ipv6 with these packages.
-
03-20-2013, 12:25 PM #5Disabled
- Join Date
- Mar 2013
- Location
- USA
- Posts
- 51
Your guide simply does not work for me at this time. Not even the first couple steps. I am getting cannot resolve host and cannot retrieve repository meta as well as I am unable to download your gpg key as the host is not resolving.
Last edited by Zazhost; 03-20-2013 at 12:32 PM.
-
03-20-2013, 12:35 PM #6Web Hosting Master
- Join Date
- Mar 2011
- Location
- Edinburgh, UK
- Posts
- 567
Have you configured a DNS server in your /etc/resolv.conf file?
Try adding this to that file:
nameserver 8.8.8.8
nameserver 8.8.4.4
then run this command:
chattr +i /etc/resolv.conf
that will stop it being overwritten when you restart your network.██ ViralVPS.com - Linux & Windows Xen VPS Servers
██ 10Gbps Connection | Netherlands Location | IPv4 & IPv6
██ SSD Cached RAID10 Storage | Instant Setup! | Bitcoin Accepted
-
03-20-2013, 01:24 PM #7Disabled
- Join Date
- Mar 2013
- Location
- USA
- Posts
- 51
Thank you Mike. I checked the setting again and noticed it was set to my datacenters which of course would happen to be crap. So I changed it to comodos and im good to go now. Thank you!
-
03-20-2013, 02:45 PM #8Disabled
- Join Date
- Mar 2013
- Location
- USA
- Posts
- 51
error 20 multiboot kernal must be loaded before modules.
Any ideas?Last edited by Zazhost; 03-20-2013 at 02:50 PM.
-
03-20-2013, 03:04 PM #9Web Hosting Master
- Join Date
- Dec 2005
- Posts
- 3,110
It's kernel not kernal, check your spelling.
-
03-20-2013, 03:10 PM #10Disabled
- Join Date
- Mar 2013
- Location
- USA
- Posts
- 51
Oh, missed that one.
Last edited by Zazhost; 03-20-2013 at 03:14 PM.
-
03-21-2013, 04:14 AM #11Disabled
- Join Date
- Mar 2013
- Location
- USA
- Posts
- 51
I am now stuck. I have everything setup and configured, a test vps created but wont boot. Checked the xen log and saw this:
Code:Traceback (most recent call last): File "/usr/lib64/python2.6/site-packages/xen/xend/XendDomainInfo.py", line 106, in create vm.start() File "/usr/lib64/python2.6/site-packages/xen/xend/XendDomainInfo.py", line 474, in start XendTask.log_progress(31, 60, self._initDomain) File "/usr/lib64/python2.6/site-packages/xen/xend/XendTask.py", line 209, in log_progress retval = func(*args, **kwds) File "/usr/lib64/python2.6/site-packages/xen/xend/XendDomainInfo.py", line 2838, in _initDomain self._configureBootloader() File "/usr/lib64/python2.6/site-packages/xen/xend/XendDomainInfo.py", line 3285, in _configureBootloader bootloader_args, kernel, ramdisk, args) File "/usr/lib64/python2.6/site-packages/xen/xend/XendBootloader.py", line 44, in bootloader raise VmError(msg) VmError: Disk isn't accessible
-
03-21-2013, 10:12 AM #12Web Hosting Master
- Join Date
- Dec 2005
- Posts
- 3,110
The answer is in the error message
VmError: Disk isn't accessible
-
03-21-2013, 02:50 PM #13Disabled
- Join Date
- Mar 2013
- Location
- USA
- Posts
- 51
Was a partitioning error as Chris pointed out. Thanks for the how-to and thanks for all the help!
-
03-22-2013, 01:42 PM #14Web Hosting Master
- Join Date
- Dec 2005
- Posts
- 3,110
No problem There will be a new kernel out shortly, nothing exciting just fixes a PCI passthrough bug which 99% of people wont be using.
-
05-07-2013, 06:34 PM #15Junior Guru Wannabe
- Join Date
- May 2009
- Location
- Chile
- Posts
- 48
for update xen, is necessary only execute yum update and modify grub?
Thanks
-
05-08-2013, 04:27 PM #16Web Hosting Master
- Join Date
- Dec 2005
- Posts
- 3,110
Yep simple as that
-
05-16-2013, 07:31 PM #17Junior Guru Wannabe
- Join Date
- May 2009
- Location
- Chile
- Posts
- 48
-
05-27-2013, 12:50 PM #18Web Hosting Master
- Join Date
- Dec 2005
- Posts
- 3,110
I would reccomend you stay upto date with the Xen + Kernel packages, but my 3.4x Dom0 kernel is not vulnerable to the recent kernel vulnerability in CentOS 6
-
06-17-2013, 04:30 AM #19Newbie
- Join Date
- May 2013
- Posts
- 16
Tried your scripts and failed, server can't boot up.
Centos5.9 64bit, Hareware raid10, 32GB ram
-
06-18-2013, 07:45 PM #20New Member
- Join Date
- Jun 2013
- Posts
- 1
Generating RPM from xen tar.gz
Hi Chris,
First off thanks much for maintaining the yum repository with latest xen RPMs. Most helpful!
My question is: is creating these xen RPMs as simple as rigging up an xen.spec that unpacks the xen tar.gz and builds it and packages the files? That's what I've done but would appreciate any tips, etc. you might have.
Thanks!
John
-
07-04-2013, 04:26 PM #21Web Hosting Master
- Join Date
- Dec 2005
- Posts
- 3,110
Sorry for the delay replying to these
@ComfortVPS - I need more information to be even slightly useful here. What RAID card? What motherboard? Any chance of a screenshot of the error? It could be a Xen issue, or it could be a missing driver for your machine.
@jschmaus - Yep more or less, and tidying up patches when things break.
I've been really busy lately but just pushed out new packages xen 4.1.5-4.
-
07-19-2013, 06:35 PM #22Newbie
- Join Date
- May 2013
- Posts
- 7
Hi,
My grub file looked differently from yours and after trying to get it to work I broke the whole system.
Now I can't boot it up anymore either.
Would anyone be able to assist me setting up Xen on CentOS 6?
- Artaex
-
07-19-2013, 06:41 PM #23Web Hosting Master
- Join Date
- Dec 2005
- Posts
- 3,110
What is the error?
Can you paste your grub.conf here and we can advise?
-
07-19-2013, 06:42 PM #24Newbie
- Join Date
- May 2013
- Posts
- 7
Hi,
There's no error because I can't reach the system.
I rebooted the system but I can no longer connect to it.
I have already contacted the hosting provider to reinstall the OS.
I would really like someone to help me as I'll probably be charged for another OS reinstall if this fails again.
- Artaex
-
07-19-2013, 06:48 PM #25Web Hosting Master
- Join Date
- Dec 2005
- Posts
- 3,110
There is nothing anyone on this forum can do to help unless you can give us more information. What do you expect us to do, guess? It could be a thousand different things.
You don't need to reinstall your OS just because your server doesn't boot, thats a complete waste of time.
Just ask your provider to boot into the next available kernel. When your system boots, you will come to a Grub boot menu where you can let it boot the default kernel (Usually this times out after 5 or 10 seconds), or you can interrupt it and boot an alternate kernel in the list.
Even if you deleted every kernel from your system except the Xen kernel, you could have them fix it in minutes by booting off a rescuecd.
Similar Threads
-
how install XEN in Centos
By linuxtop in forum VPS HostingReplies: 12Last Post: 04-07-2012, 02:10 PM -
Xen and CentOS install
By butch3r in forum Dedicated ServerReplies: 4Last Post: 10-26-2009, 09:14 AM -
Looking for a sysadmin - install debian/centos + dtc-xen + dtc/images (centos etc)
By Ron D in forum Employment / Job OffersReplies: 2Last Post: 06-12-2009, 11:31 PM -
Howto load tun/tap on centos XEN VPS ?
By fraserflav in forum Hosting Security and TechnologyReplies: 2Last Post: 08-31-2007, 02:25 PM -
Howto load tun/tap on centos XEN VPS ?
By fraserflav in forum VPS HostingReplies: 1Last Post: 08-31-2007, 11:13 AM