kanour-xen
2007-Jul-28 11:26 UTC
[Xen-users] Howto install domU CentOS 5 directly on partition
Hi. I am new to CentOS (Debian user) and I am looking for way how to install CentOS 5 on domU in the way that I have it directly on dom0 LVM partition. If I install it with virtual-manager then the installation program takes that partition as a disk and then creates new partitions on it. I don''t want it that way because I cannot then mount it from dom0. Is there some way how to install it directly on partition as for example in Debian with debootstrap? Thank you Jiri _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Nico Kadel-Garcia
2007-Jul-28 11:50 UTC
Re: [Xen-users] Howto install domU CentOS 5 directly on partition
kanour-xen wrote:> Hi. > > I am new to CentOS (Debian user) and I am looking for way how to > install CentOS 5 on domU in the way that I have it directly on dom0 > LVM partition. > If I install it with virtual-manager then the installation program > takes that partition as a disk and then creates new partitions on it. > I don''t want it that way because I cannot then mount it from dom0.Yes, you can. I agree that virt-install and virt-manager make some really bad default assumptions, and prefer the latest versions. But there are two underlying issues: 1: You can access the internal partitions from Dom0. Avoid the use of LVM in the DomU (which is a pointless thing to do in the first place there!), and use "kpartx -a -v /dev/Vol[whatver]/[Xen-image-partition]". Then mount the partitions from /dev/mapper/[Xen-image-partiion]1, etc. 2: The virt-install and virt-manager have the use of pygrub hard-coded into them, but *hardcoded*. This has advantages, but means you need grub to manage kernels in your DomU. And grub cannot deal with hard drive partitions like /dev/xdva1 that does not have a drive named /dev/xdva to go with it. Sad, but true, and an issue with grub itself for Xen implementations.> Is there some way how to install it directly on partition as for > example in Debian with debootstrap?There are plenty of OS image building tools, such as "mock" and those images at www.jailtime.org. You can save a good OS image as a tarball and build from that, if you like, but you''ll have to work out the pygrub fun if you use that. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Nico Kadel-Garcia
2007-Jul-28 18:25 UTC
Re: [Xen-users] Howto install domU CentOS 5 directly on partition
kanour-xen wrote:> Hi. > > I am new to CentOS (Debian user) and I am looking for way how to > install CentOS 5 on domU in the way that I have it directly on dom0 > LVM partition. > If I install it with virtual-manager then the installation program > takes that partition as a disk and then creates new partitions on it. > I don''t want it that way because I cannot then mount it from dom0. > > Is there some way how to install it directly on partition as for > example in Debian with debootstrap?Only by manually building a tarball of a working OS image, and laying it onto your partitions directly. Take a look at www.jailtime.org for samples. Note that pygrub, and grub itself, *will not work* if you do this. Grub needs to see a disk, not just partitions, for various configuration reasons. This may be soluble in the long term, but I lacked time to play iwth it. Why not use partitions on partitions, and use "kpartx" to make them accessible from the Dom0? _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Liam Kirsher
2007-Jul-28 19:12 UTC
Re: [Xen-users] Howto install domU CentOS 5 directly on partition
I used virt-install, and selected custom partitioning during the install process, removing the LVM stuff and reducing it to one partition. Then the install proceeded fine. That created my "template" OS, with a single partition and no swap (ignore the warning about missing swap during install). That is created on a logical volume accessible from dom0, can be mounted with kpartx and mount. Now I just create logical volumes for data and swap, and copy (using dd) the template to the data, mkswap on swap. Then, mount the data volume, make a few changes, and just start it up. I can send more details if you like, but I''ve got to run now. It took me a *looooong* time to figure out exactly how to do it, but now I can set up a new domU in less than ten minutes, and it´s easy to access the domU files from dom0. Liam kanour-xen wrote:> Hi. > > I am new to CentOS (Debian user) and I am looking for way how to > install CentOS 5 on domU in the way that I have it directly on dom0 > LVM partition. > If I install it with virtual-manager then the installation program > takes that partition as a disk and then creates new partitions on it. > I don''t want it that way because I cannot then mount it from dom0. > > Is there some way how to install it directly on partition as for > example in Debian with debootstrap? > > Thank you > > Jiri > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > >-- Liam Kirsher PGP: http://liam.numenet.com/pgp/ _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Paul Van Allsburg
2007-Jul-29 04:11 UTC
Re: [Xen-users] Howto install domU CentOS 5 directly on partition
Hi Liam, I''d like to see the details - I''ll try on a f7 machine. It would be great not to have to learn everything from scratch for once! Thanks! Paul Van Allsburg Liam Kirsher wrote:> I used virt-install, and selected custom partitioning during the install > process, removing the LVM stuff and reducing it to one partition. Then > the install proceeded fine. That created my "template" OS, with a > single partition and no swap (ignore the warning about missing swap > during install). That is created on a logical volume accessible from > dom0, can be mounted with kpartx and mount. > > Now I just create logical volumes for data and swap, and copy (using dd) > the template to the data, mkswap on swap. > Then, mount the data volume, make a few changes, and just start it up. > I can send more details if you like, but I''ve got to run now. > It took me a *looooong* time to figure out exactly how to do it, but now > I can set up a new domU in less than ten minutes, and it´s easy to > access the domU files from dom0. > > Liam > > > kanour-xen wrote: >> Hi. >> >> I am new to CentOS (Debian user) and I am looking for way how to >> install CentOS 5 on domU in the way that I have it directly on dom0 >> LVM partition. >> If I install it with virtual-manager then the installation program >> takes that partition as a disk and then creates new partitions on it. >> I don''t want it that way because I cannot then mount it from dom0. >> >> Is there some way how to install it directly on partition as for >> example in Debian with debootstrap? >> >> Thank you >> >> Jiri >> >> _______________________________________________ >> Xen-users mailing list >> Xen-users@lists.xensource.com >> http://lists.xensource.com/xen-users >> >> >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
kanour-xen
2007-Jul-30 11:34 UTC
Re: [Xen-users] Howto install domU CentOS 5 directly on partition
Hi Guys. I just would like to share how I completed installation of domU CentOS 5 directly on partition. I used some of yours ideas which I did not know (kpartx) 1/ I created new Logical Volume "X01" 2/ I installed domU normally through graphical virtual-manager on Logical Volume "X01" (LVM). I used 1000MB Ram and I created only one partition / (root). No swap. After installation I stoped this domU. 3/ I created new Logical Volume "Z01" From Dom0: Copy all files From "X01" to "Z01" (I mounted that Logical Volume "X10" with kpartx and mount. I also mounted "Z01".) Copy kernel and initrd from "Z01" to Dom0 /boot. The one you want to use for VM. I name it with extension -domU-Z01 to better recognize which kerlnel is which. (Generally, You have to boot the DomU from the same kernels as are in DomU!!! Otherwise you can get kernel panic. Example of my /boot (notice ...-domU-Z01): (ls -al /boot) drwxr-xr-x 4 root root 1024 Jul 31 07:07 . drwxr-xr-x 24 root root 4096 Jul 31 05:26 .. -rw-r--r-- 1 root root 58604 Jul 10 21:26 config-2.6.18-8.1.8.el5xen -rw-r--r-- 1 root root 58600 Mar 16 11:02 config-2.6.18-8.el5xen drwxr-xr-x 2 root root 1024 Jul 23 23:58 grub -rw------- 1 root root 1669017 Jul 23 23:58 initrd-2.6.18-8.1.8.el5xen.img -rw------- 1 root root 1437797 Jul 31 06:53 initrd-2.6.18-8.1.8.el5xen.img-domU-Z01 -rw------- 1 root root 1669035 Jul 22 01:55 initrd-2.6.18-8.el5xen.img drwx------ 2 root root 12288 Jul 22 01:52 lost+found -rw-r--r-- 1 root root 80032 Apr 2 00:49 message -rw-r--r-- 1 root root 85349 Jul 10 21:26 symvers-2.6.18-8.1.8.el5xen.gz -rw-r--r-- 1 root root 85349 Mar 16 11:02 symvers-2.6.18-8.el5xen.gz -rw-r--r-- 1 root root 1091680 Jul 10 21:26 System.map-2.6.18-8.1.8.el5xen -rw-r--r-- 1 root root 1091650 Mar 16 11:02 System.map-2.6.18-8.el5xen -rw-r--r-- 1 root root 1893500 Jul 10 21:26 vmlinuz-2.6.18-8.1.8.el5xen -rw-r--r-- 1 root root 1893500 Jul 10 21:26 vmlinuz-2.6.18-8.1.8.el5xen-domU-Z01 -rw-r--r-- 1 root root 1893708 Mar 16 11:02 vmlinuz-2.6.18-8.el5xen -rw-r--r-- 1 root root 276912 Jul 10 20:33 xen.gz-2.6.18-8.1.8.el5 -rw-r--r-- 1 root root 276329 Mar 16 10:45 xen.gz-2.6.18-8.el5 -rwxr-xr-x 1 root root 642368 Jul 10 21:31 xen-syms-2.6.18-8.1.8.el5 -rwxr-xr-x 1 root root 642368 Mar 16 11:08 xen-syms-2.6.18-8.el5 Create config file for new domU with kernel and ramdisk. Example kernel=''/boot/vmlinuz-2.6.18-8.1.8.el5xen-domU-Z01'' ramdisk=''/boot/initrd-2.6.18-8.1.8.el5xen.img-domU-Z01'' memory=''1000'' name=''Z01'' root=''/dev/sda1'' disk=[''phy:/dev/vm_vg/zimbra02_root,sda1,w'', ''phy:/dev/vm_vg/zimbra02_swap,sda2,w''] vif = [ ''mac=00:16:3e:67:bc:33, bridge=xenbr0'', ] vfb = ["type=vnc,vncunused=1"] on_poweroff = ''destroy'' on_reboot = ''restart'' on_crash = ''restart'' Edit /etc/fstab in Logical Volume "Z01" for / and swap. (notice /dev/sda[12] which coresponds to config_file) Example: /dev/sda1 / ext3 defaults 1 1 devpts /dev/pts devpts gid=5,mode=620 0 0 tmpfs /dev/shm tmpfs defaults 0 0 proc /proc proc defaults 0 0 sysfs /sys sysfs defaults 0 0 /dev/sda2 swap swap defaults 0 0 my network card in domU was already configured for DHCP. Make sure you have the config OK. umount all Logical Volumes xm create -c config_file Note: If you update kernels in domU make sure you update them in dom0 otherwise you can get Kernel Panic. Cheers kanour-xen Liam Kirsher wrote: I used virt-install, and selected custom partitioning during the install process, removing the LVM stuff and reducing it to one partition. Then the install proceeded fine. That created my "template" OS, with a single partition and no swap (ignore the warning about missing swap during install). That is created on a logical volume accessible from dom0, can be mounted with kpartx and mount. Now I just create logical volumes for data and swap, and copy (using dd) the template to the data, mkswap on swap. Then, mount the data volume, make a few changes, and just start it up. I can send more details if you like, but I''ve got to run now. It took me a *looooong* time to figure out exactly how to do it, but now I can set up a new domU in less than ten minutes, and it´s easy to access the domU files from dom0. Liam kanour-xen wrote: Hi. I am new to CentOS (Debian user) and I am looking for way how to install CentOS 5 on domU in the way that I have it directly on dom0 LVM partition. If I install it with virtual-manager then the installation program takes that partition as a disk and then creates new partitions on it. I don''t want it that way because I cannot then mount it from dom0. Is there some way how to install it directly on partition as for example in Debian with debootstrap? Thank you Jiri _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Liam Kirsher
2007-Jul-30 23:26 UTC
Re: [Xen-users] Howto install domU CentOS 5 directly on partition
Paul, I think someone else already furnished basically the same info, but here is more on what I did. I just wanted identical CentOS5 virtual machines. Below, I give them the name domN, where N is some integer. First, I created a template installation using virt-install with these variables virt-install --paravirt --nographics --name=domTemplate \ --location=nfs:192.168.1.102:/linux/CentOS-5.0-x86_64 \ --ram=512 Others have pointed out that the virt-* programs need at least 500M of RAM to function, otherwise they hang. I didn''t see how to use virt-manager to re-partition -- it kept giving me the LVM volumes, but maybe it''s possible. Anyway, during installation with virt-install I removed all the volumes and partitions and created a single new one that used the entire space (which consisted of a previously created logical volume of 2G, named domTemplate_data). Ignore the warning about not having swap. The template doesn''t need swap, that gets created for each domU. I unchecked all the packages to be installed, because I wanted a small, generic installation to start with. It came out to be around 1.2G, if I recall. You could make it slimmer, but that was good enough for my purposes. After the domTemplate is created, you might want to check to make sure it works before going any farther: xm create -c domTemplate I borrowed from the following how-to: http://www.redhat.com/archives/fedora-xen/2006-November/msg00257.html - Create lvm partitions: lvcreate -L 1G -n domN_swap VolGroup01 lvcreate -L 3G -n domN_data VolGroup01 - Map the domTemplate_data partition: kpartx -av /dev/VolGroup01/domTemplate_data - Use dd to copy to the new partition: dd if=/dev/mapper/VolGroup01-domTemplate_data of=/dev/VolGroup01/domN_data - Create swap space: mkswap /dev/VolGroup01/domN_swap - Unmap the domTemplate_data partition: kpartx -dv /dev/VolGroup01/domTemplate_data - Mount the new data partition: mount /dev/VolGroup01/domN_data /mnt/domN - In new host, edit the following files and change ''template'' to new name. - I had named the host "template" to remind me which one I was working with. vi /mnt/domN/etc/hosts vi /mnt/domN/etc/sysconfig/network - Also on new host, set the correct IP address and MAC address: vi /mnt/domN/etc/sysconfig/network-scripts/ifcfg-eth0 - Unmount the new data partition: umount /mnt/domN - Copy the ''image'' xen configuration file and edit it: cp /etc/xen/domTemplate /etc/xen/domN vi /etc/xen/domN set MAC address to unique! set memory (I forgot to set the MAC address once, and ended up with perplexing networking problems. It should be unique, and should match the MAC value set in ifcfg-eth0. I removed the unique id, I think that should be okay, not sure why I would need it. You may also want to put a link in the /etc/xen/auto directory, so the domain is created when the system boots up.) RESIZE FILE SYSTEM if domN logical volume is larger than the template! Make sure it''s not running, first. e2fsck -f /dev/VolGroup01/domN_data resize2fs /dev/VolGroup01/domN_data Start it up: xm create -c domN Login and run ''yum update'' and install any additional packages. There, I hope that helps! Best, Liam Paul Van Allsburg wrote:> Hi Liam, > I''d like to see the details - I''ll try on a f7 machine. It would be > great not to have to learn everything from scratch for once! > Thanks! > Paul Van Allsburg > > Liam Kirsher wrote: >> I used virt-install, and selected custom partitioning during the install >> process, removing the LVM stuff and reducing it to one partition. Then >> the install proceeded fine. That created my "template" OS, with a >> single partition and no swap (ignore the warning about missing swap >> during install). That is created on a logical volume accessible from >> dom0, can be mounted with kpartx and mount. >> >> Now I just create logical volumes for data and swap, and copy (using dd) >> the template to the data, mkswap on swap. >> Then, mount the data volume, make a few changes, and just start it up. >> I can send more details if you like, but I''ve got to run now. >> It took me a *looooong* time to figure out exactly how to do it, but now >> I can set up a new domU in less than ten minutes, and it´s easy to >> access the domU files from dom0. >> >> Liam >> >> >> kanour-xen wrote: >>> Hi. >>> >>> I am new to CentOS (Debian user) and I am looking for way how to >>> install CentOS 5 on domU in the way that I have it directly on dom0 >>> LVM partition. >>> If I install it with virtual-manager then the installation program >>> takes that partition as a disk and then creates new partitions on it. >>> I don''t want it that way because I cannot then mount it from dom0. >>> >>> Is there some way how to install it directly on partition as for >>> example in Debian with debootstrap? >>> >>> Thank you >>> >>> Jiri >>> >>> _______________________________________________ >>> Xen-users mailing list >>> Xen-users@lists.xensource.com >>> http://lists.xensource.com/xen-users >>> >>> >> > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > >-- Liam Kirsher PGP: http://liam.numenet.com/pgp/ _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Nico Kadel-Garcia
2007-Jul-31 06:49 UTC
Re: [Xen-users] Howto install domU CentOS 5 directly on partition
Liam Kirsher wrote:> Paul, > > I think someone else already furnished basically the same info, but here > is more on what I did. I just wanted identical CentOS5 virtual > machines. Below, I give them the name domN, where N is some integer. > > First, I created a template installation using virt-install with these > variables > virt-install --paravirt --nographics --name=domTemplate \ > --location=nfs:192.168.1.102:/linux/CentOS-5.0-x86_64 \ > --ram=512 > > Others have pointed out that the virt-* programs need at least 500M of > RAM to function, otherwise they hang. > I didn''t see how to use virt-manager to re-partition -- it kept giving > me the LVM volumes, but maybe it''s possible. >You do it in your CentOS kickstart, or by hand-configuring disks in your CentOS installation as ou did.> Anyway, during installation with virt-install I removed all the volumes > and partitions and created a single new one that used the entire space > (which consisted of a previously created logical volume of 2G, named > domTemplate_data). > Ignore the warning about not having swap. The template doesn''t need > swap, that gets created for each domU. >Swap is not evil in such a simple setup. You can add it later by adding another DomU "disk" and partition.> I unchecked all the packages to be installed, because I wanted a small, > generic installation to start with. It came out to be around 1.2G, if I > recall. You could make it slimmer, but that was good enough for my purposes. >Yeah, this is RedHat''s fault. I''ve growsed at them about it. I''m sorry, but a "base" installation should not include bluetooth and ISDN widgets.> After the domTemplate is created, you might want to check to make sure > it works before going any farther: > xm create -c domTemplate > > I borrowed from the following how-to: > http://www.redhat.com/archives/fedora-xen/2006-November/msg00257.html > > - Create lvm partitions: > lvcreate -L 1G -n domN_swap VolGroup01 > lvcreate -L 3G -n domN_data VolGroup01 > > - Map the domTemplate_data partition: > kpartx -av /dev/VolGroup01/domTemplate_data > > - Use dd to copy to the new partition: > dd if=/dev/mapper/VolGroup01-domTemplate_data of=/dev/VolGroup01/domN_data > > - Create swap space: > mkswap /dev/VolGroup01/domN_swap > > - Unmap the domTemplate_data partition: > kpartx -dv /dev/VolGroup01/domTemplate_data > > - Mount the new data partition: > mount /dev/VolGroup01/domN_data /mnt/domN > > - In new host, edit the following files and change ''template'' to new name. > - I had named the host "template" to remind me which one I was working with. > vi /mnt/domN/etc/hosts > vi /mnt/domN/etc/sysconfig/network > > - Also on new host, set the correct IP address and MAC address: > vi /mnt/domN/etc/sysconfig/network-scripts/ifcfg-eth0 > > - Unmount the new data partition: > umount /mnt/domN > > - Copy the ''image'' xen configuration file and edit it: > cp /etc/xen/domTemplate /etc/xen/domN > vi /etc/xen/domN > set MAC address to unique! > set memory > (I forgot to set the MAC address once, and ended up with perplexing > networking problems. It should be unique, and should match the MAC > value set in ifcfg-eth0. I removed the unique id, I think that should > be okay, not sure why I would need it. > You may also want to put a link in the /etc/xen/auto directory, so the > domain is created when the system boots up.) > > RESIZE FILE SYSTEM if domN logical volume is larger than the template! > Make sure it''s not running, first. > e2fsck -f /dev/VolGroup01/domN_data > resize2fs /dev/VolGroup01/domN_data >No need for this. You can store a tarball of the file system, not the file system itself, which is inevitably more space efficient, and restore the tarball to a new filesystem in similar fashion. I''ve done this before, to about 13,000 servers in one month, so I''m sure the technique works well. It''s also one heck of a lot faster than using Anaconda and most other OS installers. Getting "grub" loaded for use by pygrub in my approach of setup is.... a bit of an art form to discuss another time. Your write-up is overall quite good, and appropriate for a FAQ. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
trilok nuwal
2007-Jul-31 13:41 UTC
Re: [Xen-users] Howto install domU CentOS 5 directly on partition
Hi all, I have a more simple way for this problem. Use virt-install to install the domU. Create only one partition that is root partition on the exported disk. for example : /tmp/disk is exported for the domU then it will be exported as hda. then create a single partition ( Dont use LVM ) and dont install bootloader as we dont need for pv domain. Now after installation we can mount the partition 1 in dom0 using lomount. as below and can see the contents also. then u can can make the tarball and can copy wherever u want. lomount -diskimage /tmp/disk -partition 1 /mnt Hope it would be worthful. Thanks, Trilok On 7/30/07, kanour-xen <xen@kanour.com> wrote:> > Hi Guys. > > I just would like to share how I completed installation of domU CentOS 5 > directly on partition. I used some of yours ideas which I did not know > (kpartx) > > *1/* > I created new Logical Volume "X01" > > *2/* > I installed domU normally through graphical virtual-manager on Logical > Volume "X01" (LVM). I used 1000MB Ram and I created only one partition / > (root). No swap. > After installation I stoped this domU. > > *3/* > I created new Logical Volume "Z01" > > *From Dom0:* > > - Copy all files From "X01" to "Z01" (I mounted that Logical Volume > "X10" with kpartx and mount. I also mounted "Z01".) > - Copy kernel and initrd from "Z01" to Dom0 /boot. The one you want > to use for VM. I name it with extension -domU-Z01 to better recognize which > kerlnel is which. (Generally, You have to boot the DomU from the same > kernels as are in DomU!!! Otherwise you can get kernel panic. Example of my > /boot (notice ...-domU-Z01): > > (ls -al /boot) > > drwxr-xr-x 4 root root 1024 Jul 31 07:07 . > drwxr-xr-x 24 root root 4096 Jul 31 05:26 .. > -rw-r--r-- 1 root root 58604 Jul 10 21:26 config-2.6.18-8.1.8.el5xen > -rw-r--r-- 1 root root 58600 Mar 16 11:02 config-2.6.18-8.el5xen > drwxr-xr-x 2 root root 1024 Jul 23 23:58 grub > -rw------- 1 root root 1669017 Jul 23 23:58 > initrd-2.6.18-8.1.8.el5xen.img > -rw------- 1 root root 1437797 Jul 31 06:53 > initrd-2.6.18-8.1.8.el5xen.img-domU-Z01 > -rw------- 1 root root 1669035 Jul 22 01:55 initrd-2.6.18-8.el5xen.img > drwx------ 2 root root 12288 Jul 22 01:52 lost+found > -rw-r--r-- 1 root root 80032 Apr 2 00:49 message > -rw-r--r-- 1 root root 85349 Jul 10 21:26 > symvers-2.6.18-8.1.8.el5xen.gz > -rw-r--r-- 1 root root 85349 Mar 16 11:02 symvers-2.6.18-8.el5xen.gz > -rw-r--r-- 1 root root 1091680 Jul 10 21:26 > System.map-2.6.18-8.1.8.el5xen > -rw-r--r-- 1 root root 1091650 Mar 16 11:02 System.map-2.6.18-8.el5xen > -rw-r--r-- 1 root root 1893500 Jul 10 21:26 vmlinuz-2.6.18-8.1.8.el5xen > -rw-r--r-- 1 root root 1893500 Jul 10 21:26 > vmlinuz-2.6.18-8.1.8.el5xen-domU-Z01 > -rw-r--r-- 1 root root 1893708 Mar 16 11:02 vmlinuz-2.6.18-8.el5xen > -rw-r--r-- 1 root root 276912 Jul 10 20:33 xen.gz-2.6.18-8.1.8.el5 > -rw-r--r-- 1 root root 276329 Mar 16 10:45 xen.gz-2.6.18-8.el5 > -rwxr-xr-x 1 root root 642368 Jul 10 21:31 xen-syms-2.6.18-8.1.8.el5 > -rwxr-xr-x 1 root root 642368 Mar 16 11:08 xen-syms-2.6.18-8.el5 > > > > - Create config file for new domU with kernel and ramdisk. Example > > kernel=''/boot/vmlinuz-2.6.18-8.1.8.el5xen-domU-Z01'' > ramdisk=''/boot/initrd-2.6.18-8.1.8.el5xen.img-domU-Z01'' > memory=''1000'' > name=''Z01'' > root=''/dev/sda1'' > disk=[''phy:/dev/vm_vg/zimbra02_root,sda1,w'', > ''phy:/dev/vm_vg/zimbra02_swap,sda2,w''] > vif = [ ''mac=00:16:3e:67:bc:33, bridge=xenbr0'', ] > vfb = ["type=vnc,vncunused=1"] > on_poweroff = ''destroy'' > on_reboot = ''restart'' > on_crash = ''restart'' > > > - Edit /etc/fstab in Logical Volume "Z01" for / and swap. (notice > /dev/sda[12] which coresponds to config_file) Example: > > /dev/sda1 / ext3 defaults 1 > 1 > devpts /dev/pts devpts gid=5,mode=620 0 > 0 > tmpfs /dev/shm tmpfs defaults 0 > 0 > proc /proc proc defaults 0 > 0 > sysfs /sys sysfs defaults 0 > 0 > /dev/sda2 swap swap defaults 0 > 0 > > > - my network card in domU was already configured for DHCP. Make sure > you have the config OK. > - umount all Logical Volumes > - xm create -c config_file > > Note: If you update kernels in domU make sure you update them in dom0 > otherwise you can get Kernel Panic. > > Cheers kanour-xen > ------------------------------ > > > Liam Kirsher wrote: > > I used virt-install, and selected custom partitioning during the install > process, removing the LVM stuff and reducing it to one partition. Then > the install proceeded fine. That created my "template" OS, with a > single partition and no swap (ignore the warning about missing swap > during install). That is created on a logical volume accessible from > dom0, can be mounted with kpartx and mount. > > Now I just create logical volumes for data and swap, and copy (using dd) > the template to the data, mkswap on swap. > Then, mount the data volume, make a few changes, and just start it up. > I can send more details if you like, but I''ve got to run now. > It took me a *looooong* time to figure out exactly how to do it, but now > I can set up a new domU in less than ten minutes, and it´s easy to > access the domU files from dom0. > > Liam > > > kanour-xen wrote: > > Hi. > > I am new to CentOS (Debian user) and I am looking for way how to > install CentOS 5 on domU in the way that I have it directly on dom0 > LVM partition. > If I install it with virtual-manager then the installation program > takes that partition as a disk and then creates new partitions on it. > I don''t want it that way because I cannot then mount it from dom0. > > Is there some way how to install it directly on partition as for > example in Debian with debootstrap? > > Thank you > > Jiri > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > > > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Nico Kadel-Garcia
2007-Jul-31 16:54 UTC
Re: [Xen-users] Howto install domU CentOS 5 directly on partition
This reminds me. I promised to post the "build a CentOS or RHEL DVD" widget, useful for doing HVM or VT installations like this. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users