LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 04-09-2006, 08:42 AM   #1
gwiesenekker
LQ Newbie
 
Registered: Oct 2005
Posts: 14

Rep: Reputation: 10
Fedora Core 5 (FC5) and Xen


I recently installed Fedora Core 5 (FC5) on my Shuttle XPC SN25P AMD X2 (dual core) running Fedora Core 4 (FC4) because I wanted to use the new kernel and the new Xen. It took me quite some time before I got it running. I am posting this for reference in case you want a similar setup or run into similar problems.

My Fedora Core 4 system looks like:

/boot ext3 partition on /dev/sda2
/ ext3 partition containing FC4 on /dev/sda4
grub boot record in MBR

I am not using logical volumes or raid (the main reason being that I am using Acronis Disk Director and True Image for all my backup, partitioning and resizing needs, and these do not support logical volumes).
I always use runlevel 3 (text mode) so I don't know if you can get FC5 and Xen running in default runlevel 5 (graphical mode).

Installing FC5 will overwrite your existing grub.conf, so make a copy of your existing grub.conf before you install FC5 (copy /etc/grub.conf to /etc/grub.conf.FC4).

I created a new 8Gb ext3 logical partition as /dev/sda7, booted from the FC5 x86_64 DVD, chose setup in text mode, selected a custom partition layout with /dev/sda2 mounted as /boot and /dev/sda7 mounted as /, installed FC5 and rebooted. When you reboot the first thing you notice is that there is no separate SMP kernel option any more for x86_64 in /etc/grub.conf. This is not an error but by design (see the FC5 release notes).
I appended the grub entries from /etc/grub.conf.FC4 to /etc/grub.conf so that I can boot into both FC4 and FC5.

Now I tried to get Xen running (for example by following the instructions in the FedoraXenQuickstartFC5) but ran into several problems (installs of Xen child domains hanging, after fixing that no network connectivity between Xen parent and child domains, kernel panics etc.). Most of these issues are related to the shipped kernel (version 2054) and SELinux. Here is what I did:

1. After booting in the FC5, set the SELinux policy to permissive (SELINUX=permissive in /etc/selinux/config) and reboot. I can not run Xen in enforcing mode in either the parent or the child domains with the current versions of the SELinux policies.

2. Fully update your system using
yum update
This will also install a new kernel (at the time of writing version 2080). Reboot into the new kernel.

3. Install Xen and the Xen kernels using
yum install "xen*"
yum install "kernel-xen*"
Check you can boot into the Xen0 kernel.

4. You should now create a Xen child domain. You don't have to do it like I do (for example you could also clone the FC5 partition, mount the cloned partition, reconfigure /etc/grub.conf and /etc/fstab, boot into that partition, reconfigure the IP adress, reconfigure the host name, regenerate SSH keys, reconfigure mysql etc. but the challenge here is not to forget something), but my way for sure will give you a clean child domain and has the advantage that you can boot into it without Xen:
I create a new 8Gb ext3 logical partition (say /dev/sda8), boot from the FC5 x86_64 DVD, select text mode, select a custom partitioning layout with /dev/sda8 as the root partition (so I do NOT mount my boot partition /dev/sda2 in the child system), install FC5 with a new hostname and IP address. The install will overwrite MBR (but not /boot) but don't worry about that, we will fix that later. Reboot into the new child system, disable SELinux, reboot and fully update the child system using
yum update
yum install "xen*"
yum install "kernel-xen*"
and reboot into the standard kernel.

5. Xen does not seem to like the LABEL=(label of your root partition) in the fstab of a child domain, so edit /etc/fstab and change the LABEL=(label of your root partition) to the block device (in my case /dev/sda8). Reboot into the standard kernel to check you can still boot your child system.

6. If you now would boot the child system using Xen, you will find that it starts to boot, but it will reboot after loading SELinux and it's stuck. The reason for this is that there are several device entries missing in your child system if you boot using Xen (see also the FC4 Xen Quick Start). To fix this execute
/sbin/MAKEDEV -d /dev -x console
/sbin/MAKEDEV -d /dev -x null
/sbin/MAKEDEV -d /dev -x zero
in your child system. Reboot to check you can still boot your child system

7. The installation of the child system overwrote MBR, you need to fix that so that you can boot into your main system again. Boot from the FC5 x86_64 DVD, enter rescue mode and select your main system (so not the child system) to rescue, in my case /dev/sda4.
chroot /mnt/sysimage
To reinstall grub you need to specify the original /boot partition. In my case the /boot partition resides on /dev/sda2, so
grub
root (hd0,1) (sda2 is 1, sda3 is 2 and so on)
setup (hd0)
exit
When you now reboot you should now have all your original /etc/grub.conf entries back, including FC4. Reboot into the Xen0 kernel. If you like you can add the new child system to /etc/grub.conf. This gives you the possibility to boot you child system standalone without Xen.

8. Create a new configuration file for your child domain. Copy /etc/xen/xmexample1 to /etc/xen/xmchild and edit /etc/xen/xmchild. I changed the configuration file as follows:
11c11
< kernel = "/boot/vmlinuz-2.6.10-xenU"
---
> kernel = "/boot/vmlinuz-2.6.16-1.2080_FC5xenU"
20c20
< memory = 64
---
> memory = 256
23c23
< name = "ExampleDomain"
---
> name = "xpcsn25pv106"
58c58
< disk = [ 'phy:hda1,hda1,w' ]
---
> disk = [ 'phy:sda8,sda8,w' ]
91c91
< root = "/dev/hda1 ro"
---
> root = "/dev/sda8 ro"
101c101
< extra = "4"
---
> extra = "3"

Boot your new child domain using xm create -c /etc/xen/xmchild. Check you can ping your child domain from your parent domain. You will see several SELinux warnings both in the parent and the child domain which is why you need to leave SELinux in permissive mode for now until the SELinux policies have been fixed.

Regards,
Gijsbert
 
Old 04-10-2006, 05:18 PM   #2
gwiesenekker
LQ Newbie
 
Registered: Oct 2005
Posts: 14

Original Poster
Rep: Reputation: 10
I just found out that having a shared /boot partition between FC4 and FC5 causes problems with SELinux: I tried to upgrade my FC4 kernel to the latest build, but got the following error while installing the kernel package:
error: unpacking of archive failed on file /boot/System.map-2.6.16-1.2069_FC4smp;443ad705: cpio: open
causing the installation of the kernel package to fail. I have SELinux enabled in FC4. The FC4 /var/log/messages file contains several errors like:
inode_doinit_with_dentry: context_to_sid(system_ubject_r:boot_t:s0) returned 22 for dev=(block device of /boot partition) ino=(inode number)
The cause of this is the new FC5 SELinux labeling of the /boot partition files and directories: the FC4 Selinux does not understand the FC5 labels.
The simple solution is of course to not use a shared /boot partition.

Regards,
Gijsbert

Last edited by gwiesenekker; 04-10-2006 at 06:04 PM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Keyboard Problems Fedora FC5 Lsatenstein Fedora 3 09-12-2006 02:39 AM
Upgrade Fedora Core 4 (FC4) to Fedora Core 5 (FC5) hangs vogelap Fedora - Installation 10 05-22-2006 09:00 AM
Xen In FC5 Linux31 Fedora 3 03-25-2006 08:14 PM
Fedora Core 4 External Hard drive on FC5 mrground Linux - Hardware 1 03-24-2006 04:25 PM
fedora 5 x86_64 xen support kpachopoulos Fedora 1 02-05-2006 09:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 03:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration