CentOS Icon CentOS Logo
CentOS Text
   
  
www.centos.org Forum Index
   CentOS 5 - X86_64, s390(x) and PowerPC Support
  CentOS 5.1 x86_64, Xen, and how to create a stinkin' Ubuntu DomU

 

 Bottom   Previous Topic   Next Topic
  •  Rate Thread
      Rate this Thread
      Excellent
      Good
      Average
      Bad
      Terrible
Poster Thread Rated:  1 Votes
  •  robgreene
      robgreene
CentOS 5.1 x86_64, Xen, and how to create a stinkin' Ubuntu DomU
#1
Peeking in the Member Window
Joined: 2008/4/17
From
Posts: 13
I've got a CentOS x86_64 install and have created a few domU's with CentOS 5.1 in the paravirtualized environment -- and that seems to work well.

I'd like to see if I can get MythTV setup in a domU with the PCI forwarding that is available now. However, I'd like to do with with either Ubuntu or Fedora -- and I'm starting with Ubuntu.

BUT, I cannot figure out the install media.

I've tried the URL approach -- but since Ubuntu has a different structure for its install media, I cannot use the GUI approach.

So, I think I need to go with the command-line approach. I'm guessing what I need, and I figure someone can point me to the right boot images to use. I downloaded the vmlinuz and initrd images from http://archive.ubuntu.com/ubuntu/dists/gutsy/main/installer-amd64/current/images/cdrom/ but those are apprantly not what I need.

How do I go about creating an Ubuntu domU with CentOS 5.1? Nearly all the directions I've found were using Ubuntu as the dom0 and using the Ubuntu tools.

My specific error message is:
[root@localhost xen]# xm create mythtv1
Using config file "./mythtv1".
Error: (2, 'Invalid kernel', 'xc_dom_find_loader: no loader found\n')


And, in case it helps, here's my config file:
#### Install
kernel = "/boot/vmlinuz-ubuntu-7.10-xen"
ramdisk = "/boot/initrd-ubuntu-7.10-xen"
#kernel = "/boot/vmlinuz-xen-install"
#ramdisk = "/boot/initrd-xen-install"
#extra = "text ks=http://192.168.1.105/minimal-ks.cfg"
on_reboot = 'destroy'
on_crash = 'destroy'

#### Normal usage
#on_reboot = 'restart'
#on_crash = 'restart'
#on_poweroff = "destroy"
#bootloader="/usr/bin/pygrub"

#### Common
name = "mythtv1"
maxmem = 512
memory = 512
disk = [ 'tap:aio:/var/lib/xen/images/mythtv1.img,xvda,w', ]
vif = [ 'bridge=xenbr0', ]
vcpus = 2
vfb = [ "type=vnc,vncunused=1,keymap=en-us" ]


I assume this is something simple and stupid on my part, but I haven't a clue.

TIA!
-Rob
Posted on: 2008/4/19 16:48
Create PDF from Post Print
Top
  •  Speedster
      Speedster
Re: CentOS 5.1 x86_64, Xen, and how to create a stinkin' Ubuntu DomU
#2
Newbie
Joined: 2005/9/22
From
Posts: 4
I have done this with Hardy (should be a similar process for Gutsy) following these steps:

1. Install the debootstrap RPM from Fedora development in Dom0

2. Create the devices to use as disks and mount the root partition in the Dom0. In my case I use LVM.

Quote:
# lvcreate -n ubuntu -L10G /dev/vgxen
# lvcreate -n ubuntu-swap -L256M /dev/vgxen
# mke2fs -j /dev/vgxen/ubuntu
# mkswap /dev/vgxen/ubuntu-swap
# mkdir -p /mnt/xen
# mount /dev/vgxen/ubuntu /mnt/xen


3. Debootstrap a system. Make sure to include extra repositories (multiverse, universe) and tell it to include the correct linux-image-xen, modules, libc6-xen and grub packages. Use a mirror closer to you, and change architecture if you are using x86_64:

Quote:
# debootstrap --arch=i386 --include=linux-image-2.6.24-16-generic,linux-image-2.6.24-16-xen,linux-ubuntu-modules-2.6.24-16-xen,linux-image-xen,libc6-xen,grub --components=main,universe,multiverse hardy /mnt/xen http://mirror.3fl.net.au/ubuntu/


4. Once that has finished chroot into the new debootstrapped tree for the next round of changes.

Quote:
# chroot /mnt/xen
# export LANG=C


5. Disable TLS libc libraries:

Quote:
# mv /lib/tls /lib/tls.disabled


6. Create /etc/fstab:

Quote:
# cat /etc/fstab
/dev/xvda1 / ext3 defaults 0 1
/dev/xvdb1 none swap defaults 0 0
proc /proc proc defaults 0 0


7. Create a folder for GRUB menu and update the config. This is the reason you install the linux-image-generic package:

Quote:
# mkdir -p /boot/grub
# update-grub


8. Edit /boot/grub/menu.lst
- replace "-generic" with "-xen"
- remove "quiet splash" from the kernel line
- add "console=xvc0" to both kernel lines (normal and recovery mode)

9. Setup a getty on the Xen console (xvc0):

Quote:
# cd /etc/event.d
# cp tty1 xvc0
# sed -i -e "s/tty1/xvc0/g" xvc0


10. Add xvc0 to /etc/securetty to allow root to login

11. Remove references to the hardware clock; these will cause the DomU to hang:

Quote:
# update-rc.d -f hwclockfirst remove
# update-rc.d -f hwclock remove
# rm /etc/udev/rules.d/85-hwclock.rules


12. Configure network interfaces (/etc/network/interfaces). In my setup I have DHCP, set static information if you require it:

Quote:
# cat /etc/network/interfaces
# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp


13. Create /etc/hosts file

Quote:
# cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 hardy


14. Create /etc/hostname file

Quote:
# cat /etc/hostname
hardy


15. Exit chroot and unmount the filesystem.

Quote:
# exit
# umount /mnt/xen


16. Create DomU configuration. Because you have installed a kernel in DomU you can use pygrub:

Quote:
# cat /etc/xen/ubuntu
bootloader = '/usr/bin/pygrub'
memory = 256
name = "ubuntu"
vif = [ '' ]
disk = [ 'phy:/dev/vgxen/ubuntu,sda1,w', 'phy:/dev/vgxen/ubuntu-swap,sdb1,w' ]


Start your DomU and it should be all good! There is a bug with Hardy at the moment where the network driver will cause a kernel panic on ifup, but the kernel from the Bug Tracker will resolve that - it can be installed while in the chroot.
Posted on: 2008/5/6 6:32
Create PDF from Post Print
Top
  •  Speedster
      Speedster
Re: CentOS 5.1 x86_64, Xen, and how to create a stinkin' Ubuntu DomU
#3
Newbie
Joined: 2005/9/22
From
Posts: 4
There is a mistake in my previous post. The DomU config should have xvda and xvdb instead of sda and sdb.

Quote:
# cat /etc/xen/ubuntu
bootloader = '/usr/bin/pygrub'
memory = 256
name = "ubuntu"
vif = [ '' ]
disk = [ 'phy:/dev/vgxen/ubuntu,xvda1,w', 'phy:/dev/vgxen/ubuntu-swap,xvdb1,w' ]
Posted on: 2008/5/7 2:08
Create PDF from Post Print
Top
  •  herrold
      herrold
Re: CentOS 5.1 x86_64, Xen, and how to create a stinkin' Ubuntu DomU
#4
WebMaster
Joined: 2005/3/19
From
Posts: 80
Thank you, Speedster

This appears to be a recap of the Ubuntu article .

I had removed the LVM complexity, and made a simple local dd image to install into, which I loop mounted for the debootstrap to use:

/opt/xen/32bitdebiantesting.img
                       8256952    401276   7436248   6% /mnt/xen


Following the debootstrap method against a plain Debian (testing) 'lenny' archive, I get the following failures:

[root@centos-5 mnt]# debootstrap --arch=i386 \
    --include=linux-image-2.6.25-2-686,linux-image-2.6.25-2-xen-686,linux-modules-2.6.25-2-xen-686,linux-image-xen-686,libc6-xen,grub  \
    lenny /mnt/xen http://ftp.us.debian.org/debian/ 
...
I: Unpacking wget...
I: Unpacking whiptail...
W: Failure while installing base packages.  This will be re-attempted up to five times.
[root@centos-5 mnt]# 


and sadly it did not get enough installed for me for the grub-install bootloader fix up to work, so I get;

[root@centos-5 xen]# xm  create debian -c
Using config file "./debian".
Traceback (most recent call last):
  File "/usr/bin/pygrub", line 656, in ?
    chosencfg = run_grub(file, entry, fs)
  File "/usr/bin/pygrub", line 513, in run_grub
    g = Grub(file, fs)
  File "/usr/bin/pygrub", line 203, in __init__
    self.read_config(file, fs)
  File "/usr/bin/pygrub", line 393, in read_config
    raise RuntimeError, "couldn't find bootloader config file in the image provided."
RuntimeError: couldn't find bootloader config file in the image provided.
No handlers could be found for logger "xend"
Error: Boot loader didn't return any data!
Usage: xm create <ConfigFile> [options] [vars]


It is not clear to me how to dial up logging or verboseness of debootstrap after reading the man page, and it does not appear to write to a log file.

Thanks for any feedback

-- Russ herrold

p.s., there is an unanswered question in the Ubuntu article forum as well. ;)
Posted on: 2008/8/20 14:13
Create PDF from Post Print
Top
  •  Speedster
      Speedster
Re: CentOS 5.1 x86_64, Xen, and how to create a stinkin Ubuntu DomU
#5
Newbie
Joined: 2005/9/22
From
Posts: 4
Sorry, I went on holiday and changed jobs so haven't been checking up on forums! debootstrap should put a log in the root of the path you're installing the packages to (debootstrap.log). That's about all I can remember, I haven't built a debian guest for a while!
Posted on: 2008/10/10 1:34
Create PDF from Post Print
Top
 Top   Previous Topic   Next Topic

 


 You cannot start a new topic.
 You can view topic.
 You cannot reply to posts.
 You cannot edit your posts.
 You cannot delete your posts.
 You cannot add new polls.
 You cannot vote in polls.
 You cannot attach files to posts.
 You cannot post without approval.




"Linux" is a registered trademark of Linus Torvalds. | All other trademarks are property of their respective owners. | All other content is Copyright @ 2004-2009 by the CentOS Project or "each individual contributor (forums, comments, etc.) unless otherwise assigned".| Theme based on a theme by 7dana.com