[fedora-virt] [Fedora-xen] Installing Fedora 16 in Xen PV DomU under Debian Squeeze

Virgil virtualization at webwombat.com.au
Tue Dec 6 07:09:06 UTC 2011


Just a quick FYI re: installing FC16 pv under xen-4.0.3-1.fc14.x86_64, which 
probs applys to Debian.

I installed FC15 first. Then I installed FC16 over the top and told Anaconda 
to use the existing parts.

Here's the script I used:

#!/bin/bash
virt-install \
  --paravirt \
  --name test \
  --ram 1024 \
  --os-type=linux --os-variant=fedora15 \
  --file /dev/XenVG/test \
  --graphics none \
  --extra-args="console=hvc0 serial rd_NO_PLYMOUTH nogpt" \
  --location http://bckup2007.wwe.com.au/iso/

I mounted the FC15 iso first. Then after the machine came up I killed it, 
mounted the FC16 iso and installed again. Tell Anaconda to use the existing 
partitions.

Finally have an FC16 pv machine that boots with the old pygrub and seems to 
work. Obviously the GPT stuff isn't going, which is the root cause here.

The pv machine overcomes my hvm issue where yum update kills the host when it 
goes to upgrade glibc in the domU.

Hope this helps someone, 'cause it took all day to figure it out :-)

V

On Tue, 6 Dec 2011 02:27:04 PM Konrad Rzeszutek Wilk wrote:
> On Sun, Dec 04, 2011 at 02:36:46PM -0500, David Howland wrote:
> > Hi, I recently installed Fedora 16 in a Xen PV DomU and since I didn't
> > find a lot of information online, I wanted to share my procedure in case
> > it helps anyone else.  My Dom0 is Debian Squeeze, which uses a kernel at
> > version 2.6.32.
> 
> The pygrub issues you described were fixed and I believe are now in
> Xen 4.1.2. But that won't work for you since Debian is 4.0 I think.
> I think they can be back-ported. Would you be up for trying to back-port
> those patches and submit them to Debian Squeeze?
> 
> (Just search for M A Young and pygrub on this mailing list - he posted
> the patches two months ago or so).
> 
> > Because I deal with varying operating systems and because I prefer
> > fine-grained control over configuration, I don't use virt-* tools or GUI
> > front ends.  I wanted to install the OS the regular way.
> > 
> > The basic install path was to use the live DVD to install in an HVM,
> > then switch to a PV with pygrub.  I want to use pygrub so that I don't
> > have to copy kernels and init images around everytime the OS updates
> > itself.
> > 
> > pygrub caused me some trouble because the version in my system can't
> > handle GPT partitions, grub2, or ext4 - all of which are used by default
> > in Fedora 16.
> > 
> > What follows isn't perfect, but should be useful for people who want to
> > install Fedora 16 in an environment similar to mine.  Note that I'm
> > using x86_64 with VT-x, and that matters.  Use your brain, and be
> > careful to recognize newlines that email may introduce.
> > 
> > 
> > 
> > 
> > *** Create hard drive image ***
> > dom0# mkdir -p /img/fedora
> > 
> >      - you can put it anywhere you want!  This is just what I used.
> > 
> > dom0# cd /img/fedora
> > dom0# dd if=/dev/zero of=xen-fedora-16.img bs=1M count=20000
> > 
> > *** Download DVD image ***
> > dom0# cd /img/fedora
> > dom0# wget
> > http://download.fedoraproject.org/pub/fedora/linux/releases/16/Fedora/x86
> > _64/iso/Fedora-16-x86_64-DVD.iso
> > 
> > *** Create HVM config file ***
> > dom0# cd /etc/xen
> > dom0# (edit fedora-16.hvm)
> > -----/etc/xen/fedora-16.hvm------------------------------
> > name = 'fedora-16'
> > vif = [ 'mac=aa:00:00:50:02:f0, bridge=xenbr0' ]
> > disk = [
> > 
> >      'file:/img/fedora/xen-fedora-16.img,hda,w',
> >      'file:/img/fedora/Fedora-16-x86_64-DVD.iso,hdc:cdrom,r',
> > 
> > ]
> > boot = 'dca'
> > 
> > kernel = '/usr/lib64/xen-4.0/boot/hvmloader'
> > device_model = '/usr/lib64/xen-4.0/bin/qemu-dm'
> > builder = 'hvm'
> > 
> > memory = 2048
> > shadow_memory = 8
> > vcpus = 2
> > #pae = 1
> > acpi = 1
> > apic = 1
> > vnc = 1
> > vncconsole = 1
> > sdl = 0
> > stdvga = 0
> > usbdevice = 'tablet'
> > serial = 'pty'
> > 
> > on_poweroff = 'destroy'
> > on_reboot   = 'destroy'
> > on_crash    = 'destroy'
> > ---------------------------------------------------------
> > 
> > *** Install Fedora 16 ***
> > dom0# xm create fedora-16.hvm
> > domU# (connect to new VM with a VNC viewer - Quickly!)
> > domU# (press TAB at boot menu to edit the kernel command line)
> > domU# (add "nogpt" to command line, without quotes)
> > domU# (install fedora)
> > 
> >      - disable lvm
> >      - in partition list, change /boot to ext2 instead of ext4
> >      - after install finishes, let it shut down
> > 
> > dom0# (edit fedora-16.hvm)
> > 
> >      - comment out
> > 
> > "'file:/img/fedora/Fedora-16-x86_64-DVD.iso,hdc:cdrom,r',"
> > dom0# xm create fedora-16.hvm
> > domU# (complete install)
> > 
> >      - should be at desktop now
> > 
> > *** Enable SSH ***
> > domU# (open root shell)
> > domU# systemctl enable sshd.service
> > domU# systemctl start sshd.service
> > 
> > *** Make a grub menu ***
> > domU# cd /boot/grub
> > domU# (edit menu.lst, using /boot/grub2/grub.cfg as a guide)
> > 
> >      - be sure to use your own kernal, init, and UUIDs from your own
> > 
> > grub2 config
> > -----/boot/grub/menu.lst---------------------------------
> > -----/etc/xen/fedora-16.hvm------------------------------
> > timeout 3
> > default 0
> > 
> > title Fedora Linux
> > root (hd0,0)
> > kernel /vmlinuz-3.1.2-1.fc16.x86_64
> > root=UUID=fc5702b1-65d9-426d-81d7-e52f31cb6a4a ro rd.md=0 rd.lvm=0
> > rd.dm=0  KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks=0
> > LANG=en_US.UTF-8
> > initrd /initramfs-3.1.2-1.fc16.x86_64.img
> > 
> > title Fedora Linux (recovery mode)
> > root (hd0,0)
> > kernel /vmlinuz-3.1.2-1.fc16.x86_64
> > root=UUID=fc5702b1-65d9-426d-81d7-e52f31cb6a4a ro single rd.md=0
> > rd.lvm=0 rd.dm=0  KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb
> > rd.luks=0 LANG=en_US.UTF-8
> > initrd /initramfs-3.1.2-1.fc16.x86_64.img
> > ---------------------------------------------------------
> > 
> > *** Make PV domU ***
> > domU# (shutdown VM)
> > dom0# cd /etc/xen
> > dom0# (edit fedora-16.pv)
> > -----/etc/xen/fedora-16.pv-------------------------------
> > name = 'fedora-16'
> > vif = [ 'mac=aa:00:00:50:02:f0, bridge=xenbr0' ]
> > disk = [
> > 
> >      'file:/img/fedora/xen-fedora-16.img,xvda,w',
> > 
> > ]
> > 
> > bootloader = '/usr/lib/xen-4.0/bin/pygrub'
> > 
> > memory = 2048
> > shadow_memory = 8
> > vcpus = 2
> > #pae = 1
> > 
> > on_poweroff = 'destroy'
> > on_reboot   = 'restart'
> > on_crash    = 'restart'
> > ---------------------------------------------------------
> > dom0# xm create -c fedora-16.pv
> > 
> > *** Enable VNC ***
> > domU# yum install vnc-server
> > domU# cp /lib/systemd/system/vncserver\@.service
> > /etc/systemd/system/vncserver\@\:0.service
> > domU# (edit /etc/systemd/system/vncserver\@\:0.service)
> > domU# (add user name instead of <USER>)
> > domU# (edit /etc/sysconfig/iptables)
> > 
> >      - insert new line: "-A INPUT -m state --state NEW -m tcp -p tcp
> > 
> > --dport 5900 -j ACCEPT"
> > domU# service iptables restart
> > domU# systemctl enable vncserver@:0.service
> > domU# systemctl start vncserver@:0.service
> > 
> > 
> > thanks,
> > -d
> > --
> > xen mailing list
> > xen at lists.fedoraproject.org
> > https://admin.fedoraproject.org/mailman/listinfo/xen
> 
> --
> xen mailing list
> xen at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/xen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/virt/attachments/20111206/f80544e4/attachment-0001.html 


More information about the virt mailing list