[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] question regarding booting custom guest kernel



On Wed, Oct 02, 2013 at 10:27:54PM +0200, Aastha Mehta wrote:
> On 2 October 2013 10:49, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:
> >
> > What is the output of:
> >         /usr/lib/xen-default/bin/pygrub --entry=0 
> > /home/domains/precise-guest/disk.img
> > ?
> >
> > And what about:
> >         fdisk -l /home/domains/precise-guest/disk.img
> > ?
> >
> > If it has no partition table are you able to
> >         mount -o loop /home/domains/precise-guest/disk.img /mnt
> > ?
> >
> > If it has a partition table are you able to
> >         kpartx -a /home/domains/precise-guest/disk.img
> >         mount /dev/mapper/.....
> > for any/all of the partitions?
> > (I forget how kpartx names things, it should be obvious in ls)
> >
> > What are the filesystems used? Are you able to locate one with a
> > grub.cfg and/or a kernel on it?
> >
> > Ian.
> >
> 
> Hi Ian,
> 
> The disk image did not have any partition. On mount I could see that
> it has the typical root file system layout, with /bin, /boot, /lib and
> all other directories.
> 
> Actually, I just managed to figure out the problem, or atleast rather
> fix it. The memory size was not sufficient for my built kernel,
> because of which, for some reason vif port was not getting configured.
> I increased the memory size from 512MB to 2GB and I managed to boot
> the guest domain with my kernel image. I do not have an explanation
> for it, but it just seems to have worked.
> 

What's the size of your kernel and initrd?

Striping symbols can help reduce the size.

  man strip

> Now, I have just two more questions on how to use the modified guest
> kernel in the VM.
> 1. How do I ensure that all the necessary kernel files - the kernel
> header files, library modules, etc. are available inside the guest VM?
> Do I have to copy them manually into the VM or into the file system on
> the disk.img?
> 

I think so. But do you really want to compile modules in your VM? If
not, you don't need to copy header files. You can compile it in Dom0 or
your build machine then copy the necessary kernel image / modules into
your VM.

> 2. If I wanted to be able to modify the kernel and reboot with the
> recompiled version from within the VM, do I have to replace the path
> to kernel image in the config file with the bootloader? Of course, I
> guess I have to setup the grub.cfg inside the VM.
> 

Just use kernel= and initrd= directives in your guest config file.
Pygrub is not mandatory.

Wei.

> Thanks
> 
> -- 
> Aastha Mehta
> MPI-SWS, Germany
> E-mail: aasthakm@xxxxxxxxxxx

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.