Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 11th September 2008, 11:26
Camran Camran is offline
Member
 
Join Date: May 2008
Posts: 30
Thanks: 2
Thanked 3 Times in 3 Posts
Default CentOS 5.2 Domu on Ubuntu Hardy Dom0

Hi,

I have hard time to do it searching on the web and ... and i though it may help others to do it easier, that's why i would like to share it:
this howto may help to complete the this howto: http://www.howtoforge.com/ubuntu-8.0...u-repositories

Create CentOS 5.2 Domu on Ubuntu Hardy Dom0

Author: Cameron Sarkary <ksarkary [at] gmail [dot] com>
Last edited 09/09/2008


This tutorial provides step-by-step instructions on how to install Images of xen on an Ubuntu Hardy Heron (Ubuntu 8.04) server system (i386).
Linux distributions that can run as Xen guests out of the box, obviating the need to create your own custom filesystems. The filesystems on jailtime.org have already been tweaked to deal with Xen’s idiosyncracies, and are also designed to be lightweight and minimally divergent from the original distribution.


This howto is meant as a practical guide; it does not cover the theoretical backgrounds. They are treated in a lot of other documents in the web.

I will use Ubuntu Hardy Heron (i386) for the host OS (dom0) and CentOS 5.2 for the guest operating systems (domU).


This document comes without warranty of any kind! I want to say that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!



1. Download the CentOS 5.1 image from jailtime.
http://jailtime.org/download:centos:v5.2

2. Untar the image:
Code:
tar -xjf  centos.5-2.20080708.img.tar.bz2
3. Create directories under /mnt to mount image your downloaded from jailtime and in our case lvm parition.


Code:
# mkdir /mnt/img
     # mkdir /mnt/vm1
4. Prepare file-based image (note: this is a meager setup of 1GB root / and 128MB swap, you'll likely want much more for a real-world VM)
Code:
# mkdir -p /home/xen/domains/centos
    # cd /home/xen/domains/centos
    # dd if=/dev/zero of=Cent_base.img bs=1024k count=1024
    # dd if=/dev/zero of=Cent_swap.img bs=1024k count=128
    # mkfs.ext3 diskimage
    # mkswap swapimage
5.Mount jailtime image and lvm partition image.

Code:
# mount -o loop centos.5-2.img /mnt/img
    # mount -o loop /home/xen/domains/centos/Cent_base.img /mnt/vm1
6.Copy the image files to our VM image i.e on lvm parition.

Code:
# cp -a /mnt/img/* /mnt/vm1/
7.Configure IP for domU. I don’t think I need to explain this step.

cat /mnt/vm1/etc/sysconfig/network-scripts/ifcfg-eth0

Code:
TYPE=Ethernet
  DEVICE=eth0
 ONBOOT=yes
 BOOTPROTO=static
 IPADDR=192.168.1.10
 NETMASK=255.255.255.0
 GATEWAY=192.168.1.254
8. Configure domU hostname.

[root@xen~]# cat /mnt/vm1/etc/sysconfig/network
Code:
NETWORKING=yes
 HOSTNAME=complay
9. For me the xm console never worked until I have used this line in /mnt/vm/etc/inittab, I hope you know where to put following line in /mnt/vm1/etc/inittab, other wise learn about inittab first please.
Code:
1:2345:respawn:/sbin/mingetty console
10.root logins are not allowed on default jailtime image, so if you need them you can enable them too, or if you change your SSH port to something unusual you can do that too in /mnt/vm/etc/ssh/sshd_config change following:

Code:
Port 2023
  PermitRootLogin yes
11. <img id="ytte" alt="">Unmount both images.

Code:
# umount /mnt/img /mnt/vm
12. My domU config file looks like following:
[root@xen]# cat centos.cfg

Code:
name = 'cent5'
 
 
kernel = '/boot/vmlinuz-2.6.24-16-xen'
ramdisk = '/boot/initrd.img-2.6.24-16-xen'
memory  = '128'


root    = '/dev/sda1 ro'

disk    = [ 'tap:aio:/home/xen/mnt/cent_base.img,sda1,w', 'tap:aio:/home/xen/mnt/cent_swap.img,sda2,w' ]


dhcp = 'dhcp'
vif  = [ '' ]


on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'
13. Start your domU

Code:
# xm create -c /etc/xen/centos.cfg
14. You will see a nice login prompt like following:
Code:
CentOS release 5.2 (Final)
Kernel 2.6.24-16-xen on an i686

localhost login:
15.Login as root, default root password for jailtime image is “password”

16.Change your root password first

17.Enter nameservers in /etc/resolv.conf

18. If you want to resize an image file.

First, make sure that the image file is not already mounted and is not already running as a xen guest. The following commands increase an image file to 4GB. Backup the image before attempting this.

Code:
  • dd if=/dev/zero of=/home/xen/domains/centos/Cent_base.img bs=1M conv=notrunc count=1 seek=4000
  • losetup /dev/loop0 /home/xen/domains/centos/Cent_base.img
  • e2fsck -f /dev/loop0
  • resize2fs /dev/loop0
  • e2fsck -f /dev/loop0
  • losetup -d /dev/loop0
You may then boot or mount the image to confirm the increased size. The e2fsck checks in this howto are not strictly necessary.

Links



Last edited by Camran; 11th September 2008 at 11:44.
Reply With Quote
The Following User Says Thank You to Camran For This Useful Post:
falko (12th September 2008)
Sponsored Links
  #2  
Old 12th September 2008, 17:15
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Thanks a lot! Do you mind if I publish this on the main HowtoForge site?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 12th September 2008, 22:19
Camran Camran is offline
Member
 
Join Date: May 2008
Posts: 30
Thanks: 2
Thanked 3 Times in 3 Posts
Default

you can do it,

Thanks
Reply With Quote
The Following User Says Thank You to Camran For This Useful Post:
falko (13th September 2008)
  #4  
Old 29th October 2009, 06:10
laksh laksh is offline
Junior Member
 
Join Date: Oct 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default vnc to centos domU

hi

Need help in connecting to centos domU using vnc. please reply.

-laksh
Reply With Quote
  #5  
Old 30th October 2009, 18:33
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Is VNC enabled in your xend-config.sxp?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #6  
Old 3rd November 2009, 10:57
laksh laksh is offline
Junior Member
 
Join Date: Oct 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need help to set up nfs for xen guest

Hi

I wan to run xen guest on nfs server please let me know how to do that.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Perfect Server - Ubuntu Hardy Heron (Ubuntu 8.04 LTS Server): Mailfiltering melwood HOWTO-Related Questions 1 2nd September 2008 12:54
CentOS 5.2 Install line 888 fresh install webcave Installation/Configuration 10 6th August 2008 21:29
how do I setup a Ubuntu domU guest on a CentOS / Fedora Core XEN server? SoftDux Installation/Configuration 0 27th July 2008 19:49
The Perfect Server - CentOS 5.2 VMware Guest pg001 HOWTO-Related Questions 3 26th July 2008 11:32
Problem on restart bind9 satimis Server Operation 6 30th October 2007 02:01


All times are GMT +2. The time now is 17:03.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.