David Stone
2007-Oct-18 15:11 UTC
[Xen-users] Creating initial file system for a new Xen domain
I''ve moderately familiar with using XenSource distributions and also administering Xen with tools like virt-manager on Fedora. However now I''m building xen (3.0.3) from source and trying to use what I built myself. My first question is why is it that tools like virt-manager don''t work when I boot to the Xen hypervisor and Dom0 I built? The virt-manager I''m trying to use is from FC6. Is this known to be generally impossible for some reason (missing APIs), or is it supposed to work at least sometimes? What are my other options for tools that will create a Xen domain configuration file...I know this can be done by hand but there must be more friendly tools out there somewhere... My second question is very basic, forgive me: using just the tools that are built with the xen source distribution, how does one install Linux on a DomU? I know you just point to a kernel/ramdisk in the domain configuration file, but what about the root filesystem? Using XenExpress and virt-manager, I always run through a Linux install, so that populates the root filesystem with all the stuff essential for the system. I know that you can point a domain to a partition in the domain''s configuration file, but how do you populate that partition? My third and final question is: when using virt-install a file-backed VBD is created for the DomU. The domain''s configuration file has: disk = [ ''tap:aio:/vmdisks/Fedora6Guest3,xvda,w'', ] I''d like to mount this in Dom0. I execute xm block-attach 0 tap:aio:/vmdisks/Fedora6Guest3 /dev/xvda1 w 0 which seems to work. But how do mount the device /dev/xvda1 in Dom0? I think the problem is that it isn''t really an ext3 filesystem, because it contiains multiple partitions (one for /boot and one for /), so I can''t just say mount -t ext3 /dev/xvda1 /tmp/mountpoint Thanks! Dave _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Mark Williamson
2007-Oct-19 15:48 UTC
Re: [Xen-users] Creating initial file system for a new Xen domain
> I''ve moderately familiar with using XenSource distributions and also > administering Xen with tools like virt-manager on Fedora. However now > I''m building xen (3.0.3) from source and trying to use what I built > myself. > > My first question is why is it that tools like virt-manager don''t work > when I boot to the Xen hypervisor and Dom0 I built? The virt-manager > I''m trying to use is from FC6. Is this known to be generally > impossible for some reason (missing APIs), or is it supposed to work > at least sometimes? What are my other options for tools that will > create a Xen domain configuration file...I know this can be done by > hand but there must be more friendly tools out there somewhere...I''m not entirely sure, to be honest. I would guess that maybe virt-manager isn''t up to date enough to use your hypervisor version, but I''m not really familiar enough with it to say for sure. Does xm, etc work correctly for you? What distro are you on? You could perhaps try updating to a newer virt-manager (e.g. the one from FC6? Or from source, or from SVN?).> My second question is very basic, forgive me: using just the tools > that are built with the xen source distribution, how does one install > Linux on a DomU? I know you just point to a kernel/ramdisk in the > domain configuration file, but what about the root filesystem? Using > XenExpress and virt-manager, I always run through a Linux install, so > that populates the root filesystem with all the stuff essential for > the system. I know that you can point a domain to a partition in the > domain''s configuration file, but how do you populate that partition?If you want an HVM domU, you create a configuration file that points to the virtual disk of the domain, and gives it a virtual cdrom drive pointing to the .iso of the install CD. Then proceed basically as for a normal machine. If you want a PV domU, the process varies. To install a Redhat-type guest, you ferret around on the install CD until you find the installation kernel and initrd for Xen, then create a config file that boots these, passing it the virtual disks for it''s install destination and the .iso file (don''t pass this as a cdrom, it won''t work). For other guests, there are other ways - you can also install RH-like (and maybe other) RPM distros using "rpmstrap". And you can install Debian-likes using "debootstrap". Both of these tools can be used to drop a distro install into a filesystem tree (e.g. a mounted virtual disk partition). Various distros (Redhat, SuSE, etc) also provide their own tools for installing a guest. The libvirt folks were looking at supporting SuSE guests from virt-manager, which would be cool.> My third and final question is: when using virt-install a file-backed > VBD is created for the DomU. The domain''s configuration file has: > disk = [ ''tap:aio:/vmdisks/Fedora6Guest3,xvda,w'', ] > I''d like to mount this in Dom0. I execute > xm block-attach 0 tap:aio:/vmdisks/Fedora6Guest3 /dev/xvda1 w 0 > which seems to work. But how do mount the device /dev/xvda1 in Dom0? > I think the problem is that it isn''t really an ext3 filesystem, > because it contiains multiple partitions (one for /boot and one for > /), so I can''t just say > mount -t ext3 /dev/xvda1 /tmp/mountpointEasiest way is to use the lomount command; it''s included in the Xen distribution and originally came from the Qemu distribution. It allows you to select a partition from a virtual disk image and specify a directory to mount its filesystem on. This uses the Linux loopback device. Make sure you unmount before booting the guest, or bad things may happen ;-) Hope that helps! Cheers, Mark -- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
David Stone
2007-Oct-23 19:21 UTC
Re: [Xen-users] Creating initial file system for a new Xen domain
Thanks for your help, I understand and got this working now. Dave On 10/19/07, Mark Williamson <mark.williamson@cl.cam.ac.uk> wrote:> > I''ve moderately familiar with using XenSource distributions and also > > administering Xen with tools like virt-manager on Fedora. However now > > I''m building xen (3.0.3) from source and trying to use what I built > > myself. > > > > My first question is why is it that tools like virt-manager don''t work > > when I boot to the Xen hypervisor and Dom0 I built? The virt-manager > > I''m trying to use is from FC6. Is this known to be generally > > impossible for some reason (missing APIs), or is it supposed to work > > at least sometimes? What are my other options for tools that will > > create a Xen domain configuration file...I know this can be done by > > hand but there must be more friendly tools out there somewhere... > > I''m not entirely sure, to be honest. I would guess that maybe virt-manager > isn''t up to date enough to use your hypervisor version, but I''m not really > familiar enough with it to say for sure. Does xm, etc work correctly for > you? > > What distro are you on? You could perhaps try updating to a newer > virt-manager (e.g. the one from FC6? Or from source, or from SVN?). > > > My second question is very basic, forgive me: using just the tools > > that are built with the xen source distribution, how does one install > > Linux on a DomU? I know you just point to a kernel/ramdisk in the > > domain configuration file, but what about the root filesystem? Using > > XenExpress and virt-manager, I always run through a Linux install, so > > that populates the root filesystem with all the stuff essential for > > the system. I know that you can point a domain to a partition in the > > domain''s configuration file, but how do you populate that partition? > > If you want an HVM domU, you create a configuration file that points to the > virtual disk of the domain, and gives it a virtual cdrom drive pointing to > the .iso of the install CD. Then proceed basically as for a normal machine. > > If you want a PV domU, the process varies. To install a Redhat-type guest, > you ferret around on the install CD until you find the installation kernel > and initrd for Xen, then create a config file that boots these, passing it > the virtual disks for it''s install destination and the .iso file (don''t pass > this as a cdrom, it won''t work). For other guests, there are other ways - > you can also install RH-like (and maybe other) RPM distros using "rpmstrap". > And you can install Debian-likes using "debootstrap". Both of these tools > can be used to drop a distro install into a filesystem tree (e.g. a mounted > virtual disk partition). > > Various distros (Redhat, SuSE, etc) also provide their own tools for > installing a guest. The libvirt folks were looking at supporting SuSE guests > from virt-manager, which would be cool. > > > My third and final question is: when using virt-install a file-backed > > VBD is created for the DomU. The domain''s configuration file has: > > disk = [ ''tap:aio:/vmdisks/Fedora6Guest3,xvda,w'', ] > > I''d like to mount this in Dom0. I execute > > xm block-attach 0 tap:aio:/vmdisks/Fedora6Guest3 /dev/xvda1 w 0 > > which seems to work. But how do mount the device /dev/xvda1 in Dom0? > > I think the problem is that it isn''t really an ext3 filesystem, > > because it contiains multiple partitions (one for /boot and one for > > /), so I can''t just say > > mount -t ext3 /dev/xvda1 /tmp/mountpoint > > Easiest way is to use the lomount command; it''s included in the Xen > distribution and originally came from the Qemu distribution. It allows you > to select a partition from a virtual disk image and specify a directory to > mount its filesystem on. This uses the Linux loopback device. Make sure you > unmount before booting the guest, or bad things may happen ;-) > > Hope that helps! > > Cheers, > Mark > -- > Dave: Just a question. What use is a unicyle with no seat? And no pedals! > Mark: To answer a question with a question: What use is a skateboard? > Dave: Skateboards have wheels. > Mark: My wheel has a wheel! >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Anand Gupta
2007-Oct-30 22:47 UTC
Re: [Xen-users] Creating initial file system for a new Xen domain
Would you mind sharing what all you did to resolve the problem ? Where you able to use virt-manager with compiled xen ? On 10/24/07, David Stone <unclestoner@gmail.com> wrote:> > Thanks for your help, I understand and got this working now. >-- regards, Anand Gupta _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
David Stone
2007-Nov-02 13:54 UTC
Re: [Xen-users] Creating initial file system for a new Xen domain
> Would you mind sharing what all you did to resolve the problem ? Where you > able to use virt-manager with compiled xen ?Sure. For the issue of using virt-manager with compiled xen, I didn''t spend more time on it and didn''t get it to work because I got used to using the vanilla xen tools virt-manager hangs when I launch it, and the other virt tools one gets with FC6 also don''t work. For mounting the domU''s disk file, lomount wasn''t working for me because I had the domU configured to use an LVM. For domUs I have created since then, I don''t configure domUs to use LVMs, and lomount works in that case. Also, I sometimes use a Dom0 partition to back the DomU''s virtual disk, in which case lomount can also be used to mount the virtual disk in Dom0. I was able to get the DomU I _created_ with virt-manager to run with compiled Xen...the only thing that doesn''t work is graphical output from the DomU. I needed to change the DomU''s inittab to start at runlevel 3. Unfortunately I couldn''t mount it''s file systems (see above), so to do this I had to start the DomU while running a network sniffer in Dom0 so I could see the IP address the DomU got from DHCP (since I didn''t have any static IPs handy). Then I ssh''d into the DomU and changed inittab :) Dave _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users