Difference between revisions of "Debian Guest Installation Using Debian Installer"

From Xen
(Details of configuring, installing and finalizing when installing from ISO image.)
(Download Debian Installer Images)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=Debian Installer=
+
==Debian Installer==
  
 
[http://www.debian.org/devel/debian-installer/ Debian Installer] is the standard installer used to install Debian on native systems. Debian Installer has supported netboot installation of Xen as a PV guests (both i386 and amd64) since Lenny (Debian 5.0) was released and has supported CD-ROM (and DVD, Blu-Ray etc) installations since Squeeze (Debian 6.0).
 
[http://www.debian.org/devel/debian-installer/ Debian Installer] is the standard installer used to install Debian on native systems. Debian Installer has supported netboot installation of Xen as a PV guests (both i386 and amd64) since Lenny (Debian 5.0) was released and has supported CD-ROM (and DVD, Blu-Ray etc) installations since Squeeze (Debian 6.0).
Line 5: Line 5:
 
The main benefit of using Debian Installer to install a Xen guest is that you are able to use all the technologies (like pre-seeding) which you are used to using on a native system. You also end up with an installed system which is as similar as possible to a native Debian system installed via the same mechanisms. Installing a Xen guest Debian Installer produces a fully configured Debian system without the need to setup things such as ''/etc/fstab'' by hand.
 
The main benefit of using Debian Installer to install a Xen guest is that you are able to use all the technologies (like pre-seeding) which you are used to using on a native system. You also end up with an installed system which is as similar as possible to a native Debian system installed via the same mechanisms. Installing a Xen guest Debian Installer produces a fully configured Debian system without the need to setup things such as ''/etc/fstab'' by hand.
  
=Netboot installation=
+
{{Anchor|netboot}}
 +
==Netboot installation==
  
 
A netboot installation is a quick and easy way to install Debian. You start by downloading a small (approximately 20MB) installer kernel and initrd which you boot as a PV guest. After this Debian Installer will take over and you can install the guest direct from the network. If you are only installing a single guest this has the advantage of only downloading exactly what is needed for the installation. If you are installing lots of guests then you may find it beneficial to create a local mirror (which will require a large initial bandwidth investment) or install a caching proxy such as [http://packages.debian.org/search?keywords=apt-cacher apt-cacher] to reduce the number of external downloads.
 
A netboot installation is a quick and easy way to install Debian. You start by downloading a small (approximately 20MB) installer kernel and initrd which you boot as a PV guest. After this Debian Installer will take over and you can install the guest direct from the network. If you are only installing a single guest this has the advantage of only downloading exactly what is needed for the installation. If you are installing lots of guests then you may find it beneficial to create a local mirror (which will require a large initial bandwidth investment) or install a caching proxy such as [http://packages.debian.org/search?keywords=apt-cacher apt-cacher] to reduce the number of external downloads.
  
==Select A Mirror==
+
{{Anchor|netboot_mirror}}
 +
===Select A Mirror===
  
 
If you are not using your own mirror or a tool such as apt-cacher then you will need to choose a nearby mirror from Debian's [http://www.debian.org/mirror/list list of worldwide mirrors]. In general you should select the mirror which is nearest to you. Alternatively you can simply use the (unofficial) [http://cdn.debian.net http://cdn.debian.net] service to automatically select a nearby mirror.
 
If you are not using your own mirror or a tool such as apt-cacher then you will need to choose a nearby mirror from Debian's [http://www.debian.org/mirror/list list of worldwide mirrors]. In general you should select the mirror which is nearest to you. Alternatively you can simply use the (unofficial) [http://cdn.debian.net http://cdn.debian.net] service to automatically select a nearby mirror.
Line 15: Line 17:
 
The following instructions assume that you are using [http://cdn.debian.net http://cdn.debian.net], substitute the mirror which you have selected or the name of your apt-cacher/mirror machine as appropriate.
 
The following instructions assume that you are using [http://cdn.debian.net http://cdn.debian.net], substitute the mirror which you have selected or the name of your apt-cacher/mirror machine as appropriate.
  
==Download Debian Installer Images==
+
===Download Debian Installer Images===
  
 
Once you have selected a mirror then you can download the Debian Installer kernel and initrd. You only need to do this once since you can reuse the same images multiple times.
 
Once you have selected a mirror then you can download the Debian Installer kernel and initrd. You only need to do this once since you can reuse the same images multiple times.
  
Download both ''vmlinuz'' and ''initrd.img'' from [http://cdn.debian.net/debian/dists/squeeze/main/installer-amd64/current/images/netboot/xen/ here (amd64)] or [http://cdn.debian.net/debian/dists/squeeze/main/installer-amd64/current/images/netboot/xen/ here (i386)] and save them to your Xen system. This guide assumes you have put them in ''/scratch/debian/squeeze/amd64'' and ''/scratch/debian/squeeze/i386'' respectively.  
+
Download both ''vmlinuz'' and ''initrd.img'' from [http://cdn.debian.net/debian/dists/squeeze/main/installer-amd64/current/images/netboot/xen/ here (amd64)] or [http://cdn.debian.net/debian/dists/squeeze/main/installer-i386/current/images/netboot/xen/ here (i386)] and save them to your Xen system. This guide assumes you have put them in ''/scratch/debian/squeeze/amd64'' and ''/scratch/debian/squeeze/i386'' respectively.  
  
 
These instructions assume you are installing Debian Squeeze. However you can modify the URLs to point to any release from Lenny onwards.
 
These instructions assume you are installing Debian Squeeze. However you can modify the URLs to point to any release from Lenny onwards.
  
==Create Initial Guest Configuration==
+
{{Anchor|netboot_create_cfg}}
 +
 
 +
===Create Initial Guest Configuration===
 +
 
 +
{{Info|Some versions of Debian shipped an example ''xm-debian.cfg'' file which included Python code to automate some parts of the installer. This was always unreliable with the xend toolstack and no longer works with the [[XL]] toolstack. It is strongly recommended not to use this example configuration as a basis for any new installation. Newer versions of Debian ship an example ''debian.cfg'' which does not contain Python code but which serves as a useful starting point}}
  
 
For the initial boot you should configure the guest to use the ''vmlinux'' and ''initrd.gz'' which you downloaded above and with a command line suitable for using the installer. e.g.
 
For the initial boot you should configure the guest to use the ''vmlinux'' and ''initrd.gz'' which you downloaded above and with a command line suitable for using the installer. e.g.
Line 50: Line 56:
 
  # lvcreate -L 4G -n debian-installer /dev/VG
 
  # lvcreate -L 4G -n debian-installer /dev/VG
  
See [[Xen Man Pages]] for more details of the guest configuration syntax.
+
See [[Xen Man Pages]], in particular the [http://xenbits.xen.org/docs/unstable/man/xl.cfg.5.html ''xl.cfg(5)''] manpage, for more details of the guest configuration syntax.
 +
 
 +
{{Anchor|netboot_install}}
  
==Install Debian==
+
===Install Debian===
  
 
Now that you have created the guest configuration you can start the guest and connect to its console. e.g. assuming your guest configuration file is ''/etc/xen/debian-installer.cfg'':
 
Now that you have created the guest configuration you can start the guest and connect to its console. e.g. assuming your guest configuration file is ''/etc/xen/debian-installer.cfg'':
Line 62: Line 70:
 
See [[Xen Man Pages]] for more details on the use of ''xl''
 
See [[Xen Man Pages]] for more details on the use of ''xl''
  
==Finalize Guest Configuration==
+
===Finalize Guest Configuration===
  
 
Once installation has completed the guest will shutdown and exit. At this point you should remove the ''kernel'', ''initrd'' and ''extra'' lines from the guest configuration and replace them with simply:
 
Once installation has completed the guest will shutdown and exit. At this point you should remove the ''kernel'', ''initrd'' and ''extra'' lines from the guest configuration and replace them with simply:
Line 74: Line 82:
 
  # xl create -c /etc/xen/debian-installer.cfg
 
  # xl create -c /etc/xen/debian-installer.cfg
  
=CD-ROM installation=
+
==CD-ROM installation==
  
==Selecting a CD/DVD/BD ISO image==
+
===Selecting a CD/DVD/BD ISO image===
  
 
Full support for installing a Xen PV guest (32 or 64 bit) from an ISO image was added to Debian in the Squeeze (6.0.0) release.
 
Full support for installing a Xen PV guest (32 or 64 bit) from an ISO image was added to Debian in the Squeeze (6.0.0) release.
  
Downloads of Debian CD images are available from the [http://www.debian.org/CD/ Debian CD Image] site. Several options are available for downloading, it is preferred to use [http://atterer.org/jigdo/ jigdo] (a tool which can reconstitute an ISO image from a Debian mirror) or [http://bitconjurer.org/BitTorrent/ BitTorrent] rather than direct download of ISO (which may be throttled or otherwise slower). More info on downloading using jigdo is available on the [http://www.debian.org/CD/jigdo-cd/ Debian CD Jigdo] page.
+
Downloads of Debian CD images are available from the [http://www.debian.org/CD/ Debian CD Image] site. Several options are available for downloading, it is preferred to use [http://atterer.org/jigdo/ jigdo] (a tool which can reconstitute an ISO image from a Debian mirror) or [http://bitconjurer.org/BitTorrent/ BitTorrent] rather than direct download of ISO (which may be throttled or otherwise slower). More info on downloading using jigdo is available on the [http://www.debian.org/CD/jigdo-cd/ Debian CD Jigdo] page. Selection of a Debian mirror, which is required for a jigdo download, is [[#netboot_mirror|discussed above]].
  
 
Debian provides several different flavours of the first ISO image, only some of which support installation as a Xen PV guest. The main two flavours which support Xen PV are:
 
Debian provides several different flavours of the first ISO image, only some of which support installation as a Xen PV guest. The main two flavours which support Xen PV are:
Line 91: Line 99:
 
Information on verifying the authenticity of these images is available [http://www.debian.org/CD/verify here].
 
Information on verifying the authenticity of these images is available [http://www.debian.org/CD/verify here].
  
If the machine on which you want to install guests has a network connection then the ''netinst'' option is preferable since it reduces the initial download and will then only download precisely what you need for your configuration. Note that if you have a network connection then booting a ''netboot'' image (as described above) is an even better option.
+
If the machine on which you want to install guests has a network connection then the ''netinst'' option is preferable since it reduces the initial download and will then only download precisely what you need for your configuration. Note that if you have a network connection then booting a ''netboot'' image (as described [[#netboot|above]]) is an even better option.
  
 
Having selected the appropriate first ISO you can then combine this with the images from the standard set in order to make up a complete set of Debian packages installable from ISO.
 
Having selected the appropriate first ISO you can then combine this with the images from the standard set in order to make up a complete set of Debian packages installable from ISO.
Line 97: Line 105:
 
In addition to the above stable release images there are daily builds of ''multi-arch netinst CD'' images ([http://cdimage.debian.org/cdimage/daily-builds/daily/arch-latest/multi-arch/jigdo-cd/debian-testing-amd64-i386-netinst.jigdo jigdo],[http://cdimage.debian.org/cdimage/daily-builds/daily/arch-latest/multi-arch/bt-cd/debian-testing-amd64-i386-netinst.iso.torrent torrent]) and weekly builds of the ''multi-arch DVD'' images ([http://cdimage.debian.org/cdimage/weekly-builds/multi-arch/jigdo-dvd/debian-testing-i386-amd64-source-DVD-1.jigdo jigdo], [http://cdimage.debian.org/cdimage/weekly-builds/multi-arch/bt-dvd/debian-testing-i386-amd64-source-DVD-1.iso.torrent torrent]) for the [http://www.debian.org/releases/testing/ testing] release. Note that the ''testing'' release of Debian is by definition a work in progress and may contain transient issues etc.
 
In addition to the above stable release images there are daily builds of ''multi-arch netinst CD'' images ([http://cdimage.debian.org/cdimage/daily-builds/daily/arch-latest/multi-arch/jigdo-cd/debian-testing-amd64-i386-netinst.jigdo jigdo],[http://cdimage.debian.org/cdimage/daily-builds/daily/arch-latest/multi-arch/bt-cd/debian-testing-amd64-i386-netinst.iso.torrent torrent]) and weekly builds of the ''multi-arch DVD'' images ([http://cdimage.debian.org/cdimage/weekly-builds/multi-arch/jigdo-dvd/debian-testing-i386-amd64-source-DVD-1.jigdo jigdo], [http://cdimage.debian.org/cdimage/weekly-builds/multi-arch/bt-dvd/debian-testing-i386-amd64-source-DVD-1.iso.torrent torrent]) for the [http://www.debian.org/releases/testing/ testing] release. Note that the ''testing'' release of Debian is by definition a work in progress and may contain transient issues etc.
  
==Create Initial Guest Configuration==
+
===Create Initial Guest Configuration===
  
For the most part this is the same as the guest configuration for the netboot installation case discussed above (e.g. the requirement to use the ''whole disk'' partitioning scheme remains). Installation from an ISO image differs from this in the need to provide the ISO image as a device to the guest and to select the appropriate kernel from the ISO to use.
+
For the most part this is the same as the guest configuration for the [[#netboot_create_cfg|netboot installation]] case discussed above (e.g. the requirement to use the ''whole disk'' partitioning scheme remains). Installation from an ISO image differs from netboot in the need to provide the ISO image as a device to the guest and to select the appropriate kernel from the ISO to use.
  
 
Providing the ISO image to the guest as a PV CDROM device is simply a case of including the ISO image in the ''disk'' directive of your configuration file. For example to configure a domain with ''/dev/xvda'' as a disk and ''/dev/xvdd'' as the ISO image use:
 
Providing the ISO image to the guest as a PV CDROM device is simply a case of including the ISO image in the ''disk'' directive of your configuration file. For example to configure a domain with ''/dev/xvda'' as a disk and ''/dev/xvdd'' as the ISO image use:
Line 107: Line 115:
 
Each Debian ISO image which supports installation as a Xen PV guest contains a kernel (''vmlinuz'') and installer ramdisk (''initrd.gz'') specially for this use case. These live in ''/install.386/xen'' and ''/install.amd/xen'' for 32 and 64 bit installation respectively.
 
Each Debian ISO image which supports installation as a Xen PV guest contains a kernel (''vmlinuz'') and installer ramdisk (''initrd.gz'') specially for this use case. These live in ''/install.386/xen'' and ''/install.amd/xen'' for 32 and 64 bit installation respectively.
  
One option for booting these is to extract them from the ISO image, store them in your domain 0 filesystem and refer to them with ''kernel'' and ''ramdisk'' directives in your guest configuration file, much like the netboot case.
+
One option for booting these is to extract them from the ISO image, store them in your domain 0 filesystem and refer to them with ''kernel'' and ''ramdisk'' directives in your guest configuration file, much like the [[#netboot_create_cfg|netboot case]].
  
However it may be more convenient to use the ''pygrub'' tool to extract the correct kernel from the image. To do this first ensure that the PV CDROM device is the first device in the guest configuration ''disk'' directive and then specify ''pygrub'' as the bootloader giving the path to the kernel and ramdisk as bootloader arguments. e.g. for a 32 bit guest:
+
However it may be more convenient to use the ''pygrub'' tool to extract the correct kernel from the image. To do this first ensure that the PV CDROM device is the first device in the guest configuration ''disk'' directive and then specify ''pygrub'' as the bootloader giving the path to the kernel and ramdisk as bootloader arguments via the ''bootloader_args'' configuration file option. {{Warning|xm/xend uses "bootargs" rather than "bootloader_args"}}
 +
e.g. for a 32 bit guest:
 
  bootloader = "pygrub"
 
  bootloader = "pygrub"
 
  bootloader_args = "--kernel=/install.386/xen/vmlinuz --ramdisk=/install.386/xen/initrd.gz"
 
  bootloader_args = "--kernel=/install.386/xen/vmlinuz --ramdisk=/install.386/xen/initrd.gz"
 
or for a 64 bit guest:
 
or for a 64 bit guest:
 
  bootloader = "pygrub"
 
  bootloader = "pygrub"
  bootloader_args = "--kernel=/install.386/amd/vmlinuz --ramdisk=/install.amd/xen/initrd.gz"
+
  bootloader_args = "--kernel=/install.amd/xen/vmlinuz --ramdisk=/install.amd/xen/initrd.gz"
  
 
As with the netboot install you should specify suitable command line options. e.g.:
 
As with the netboot install you should specify suitable command line options. e.g.:
 
  extra = "debian-installer/exit/always_halt=true -- console=hvc0"
 
  extra = "debian-installer/exit/always_halt=true -- console=hvc0"
  
Therefore a complete (if minimal) example of an install time configuration booting using pyrub might be:
+
Therefore a complete (if minimal) example of an install time configuration booting using pygrub might be:
 
  name = "debian-installer"
 
  name = "debian-installer"
 
   
 
   
Line 131: Line 140:
 
  extra = "debian-installer/exit/always_halt=true -- console=hvc0"
 
  extra = "debian-installer/exit/always_halt=true -- console=hvc0"
  
==Install Debian==
+
===Install Debian===
 +
 
 +
Installation proceeds in the same way as with netboot, as described [[#netboot_install|above]].
  
Installation proceeds in the same way as with netboot, described above.
+
Depending upon the ISO image you have chosen to install from you may be offered the option to select a Debian mirror in order to install further software from the online repositories. The selection of a Debian mirror is discussed [[#netboot_mirror|above]].
  
==Finalize Guest Configuration==
+
===Finalize Guest Configuration===
  
 
Once installation has completed the guest will shutdown and exit. At this point you should remove any ''bootloader_args'', ''kernel'', ''initrd'' and ''extra'' lines from the guest configuration and use simply:
 
Once installation has completed the guest will shutdown and exit. At this point you should remove any ''bootloader_args'', ''kernel'', ''initrd'' and ''extra'' lines from the guest configuration and use simply:
Line 147: Line 158:
 
  # xl create -c /etc/xen/debian-installer.cfg
 
  # xl create -c /etc/xen/debian-installer.cfg
  
=Advanced Options=
+
==Advanced Options==
  
==Preseeding==
+
===Preseeding===
  
 
You can preseed a Xen installation in the same way as a normal native install by adding the necessary command line directives to the ''extra'' configuration line. e.g.
 
You can preseed a Xen installation in the same way as a normal native install by adding the necessary command line directives to the ''extra'' configuration line. e.g.
Line 157: Line 168:
 
More information on preseeding can be found in Appendix B of Debian's [http://www.debian.org/releases/stable/installmanual Installation Guide]
 
More information on preseeding can be found in Appendix B of Debian's [http://www.debian.org/releases/stable/installmanual Installation Guide]
  
=Other Installation Methods=
+
==Other Installation Methods==
  
 
Debian's [http://wiki.debian.org/Xen Xen] wiki page covers several other methods of installing Xen guests, including ''debootstrap'' and ''xen-tools''.
 
Debian's [http://wiki.debian.org/Xen Xen] wiki page covers several other methods of installing Xen guests, including ''debootstrap'' and ''xen-tools''.
 +
 +
==External References==
 +
 +
===General Links===
 +
* [http://wiki.debian.org/Xen Xen] on the [http://wiki.debian.org/ Debian Wiki]
 +
* [http://www.debian.org/releases/stable/installmanual Debian Install Guide] ([http://www.debian.org/releases/stable/i386/ i386], [http://www.debian.org/releases/stable/amd64/ amd64])
 +
* [http://www.debian.org/CD/ Debian CD Page]
 +
 +
===Development (testing and unstable) Links===
 +
 +
''These links are to the current development version of Debian. Please report installer bugs to the [http://lists.debian.org/debian-boot/ debian-boot] mailing list and CD/DVD image bugs to the [http://lists.debian.org/debian-cd/ debian-cd] mailing list. For Xen specific issues please also copy [http://lists.xen.org/mailman/listinfo/xen-devel xen-devel].''
 +
 +
* [http://d-i.debian.org/daily-images/build-logs.html Debian Installer daily builds] (includes netboot images for [http://d-i.debian.org/daily-images/amd64/daily/netboot/xen/ amd64] and [http://d-i.debian.org/daily-images/i386/daily/netboot/xen/ i386])
 +
* [http://cdimage.debian.org/cdimage/daily-builds/daily/ CD image daily builds]
 +
* [http://cdimage.debian.org/cdimage/weekly-builds/ DVD image weekly builds]
 +
  
 
[[Category:Debian]]
 
[[Category:Debian]]
 
[[Category:Guest Install]]
 
[[Category:Guest Install]]
 
[[Category:Users]]
 
[[Category:Users]]
 +
[[Category:Debian]]

Latest revision as of 20:58, 3 October 2012

Debian Installer

Debian Installer is the standard installer used to install Debian on native systems. Debian Installer has supported netboot installation of Xen as a PV guests (both i386 and amd64) since Lenny (Debian 5.0) was released and has supported CD-ROM (and DVD, Blu-Ray etc) installations since Squeeze (Debian 6.0).

The main benefit of using Debian Installer to install a Xen guest is that you are able to use all the technologies (like pre-seeding) which you are used to using on a native system. You also end up with an installed system which is as similar as possible to a native Debian system installed via the same mechanisms. Installing a Xen guest Debian Installer produces a fully configured Debian system without the need to setup things such as /etc/fstab by hand.

Netboot installation

A netboot installation is a quick and easy way to install Debian. You start by downloading a small (approximately 20MB) installer kernel and initrd which you boot as a PV guest. After this Debian Installer will take over and you can install the guest direct from the network. If you are only installing a single guest this has the advantage of only downloading exactly what is needed for the installation. If you are installing lots of guests then you may find it beneficial to create a local mirror (which will require a large initial bandwidth investment) or install a caching proxy such as apt-cacher to reduce the number of external downloads.

Select A Mirror

If you are not using your own mirror or a tool such as apt-cacher then you will need to choose a nearby mirror from Debian's list of worldwide mirrors. In general you should select the mirror which is nearest to you. Alternatively you can simply use the (unofficial) http://cdn.debian.net service to automatically select a nearby mirror.

The following instructions assume that you are using http://cdn.debian.net, substitute the mirror which you have selected or the name of your apt-cacher/mirror machine as appropriate.

Download Debian Installer Images

Once you have selected a mirror then you can download the Debian Installer kernel and initrd. You only need to do this once since you can reuse the same images multiple times.

Download both vmlinuz and initrd.img from here (amd64) or here (i386) and save them to your Xen system. This guide assumes you have put them in /scratch/debian/squeeze/amd64 and /scratch/debian/squeeze/i386 respectively.

These instructions assume you are installing Debian Squeeze. However you can modify the URLs to point to any release from Lenny onwards.

Create Initial Guest Configuration

Icon Info.png Some versions of Debian shipped an example xm-debian.cfg file which included Python code to automate some parts of the installer. This was always unreliable with the xend toolstack and no longer works with the XL toolstack. It is strongly recommended not to use this example configuration as a basis for any new installation. Newer versions of Debian ship an example debian.cfg which does not contain Python code but which serves as a useful starting point


For the initial boot you should configure the guest to use the vmlinux and initrd.gz which you downloaded above and with a command line suitable for using the installer. e.g.

kernel = "/scratch/debian/squeeze/amd64/vmlinuz"
ramdisk = "/scratch/debian/squeeze/amd64/initrd.gz"
extra = "debian-installer/exit/always_halt=true -- console=hvc0"

The rest of the guest configuration is down to you and your requirements for the guest you are installing. You would normally want to configure a disk and network device as normal. A network device with external connectivity (or connectivity to your local mirror/cache) is required for the duration of the installation process.

In order to use Debian Installer it is necessary to use the whole disk disk configuration rather than the partitions. In other words you must configure an xvda device and not xvda1, xvda2 etc. For example a complete (if rather minimal) installation time configuration might be:

name = "debian-installer"

memory = 256

disk = ['phy:/dev/VG/debian-installer,xvda,w']
vif = [' ']

kernel = "/scratch/debian/squeeze/amd64/vmlinuz"
ramdisk = "/scratch/debian/squeeze/amd64/initrd.gz"
extra = "debian-installer/exit/always_halt=true -- console=hvc0"

At this point you should create the backing storage for the disk configuration you are using. e.g. in this case:

# lvcreate -L 4G -n debian-installer /dev/VG

See Xen Man Pages, in particular the xl.cfg(5) manpage, for more details of the guest configuration syntax.

Install Debian

Now that you have created the guest configuration you can start the guest and connect to its console. e.g. assuming your guest configuration file is /etc/xen/debian-installer.cfg:

# xl create -c /etc/xen/debian-installer.cfg

At this point the guest will boot and Debian Installer will start. Now you can install Debian like you normally would, perhaps following the Debian Installation Guide.

See Xen Man Pages for more details on the use of xl

Finalize Guest Configuration

Once installation has completed the guest will shutdown and exit. At this point you should remove the kernel, initrd and extra lines from the guest configuration and replace them with simply:

bootloader = "pygrub"

Keep the rest of the configuration file the same.

Now you can start the guest again to boot your newly installed Debian guest!

# xl create -c /etc/xen/debian-installer.cfg

CD-ROM installation

Selecting a CD/DVD/BD ISO image

Full support for installing a Xen PV guest (32 or 64 bit) from an ISO image was added to Debian in the Squeeze (6.0.0) release.

Downloads of Debian CD images are available from the Debian CD Image site. Several options are available for downloading, it is preferred to use jigdo (a tool which can reconstitute an ISO image from a Debian mirror) or BitTorrent rather than direct download of ISO (which may be throttled or otherwise slower). More info on downloading using jigdo is available on the Debian CD Jigdo page. Selection of a Debian mirror, which is required for a jigdo download, is discussed above.

Debian provides several different flavours of the first ISO image, only some of which support installation as a Xen PV guest. The main two flavours which support Xen PV are:

In both cases the image supports installation of both 32 bit (i386) and 64 bit (amd64) Debian guests.

Information on verifying the authenticity of these images is available here.

If the machine on which you want to install guests has a network connection then the netinst option is preferable since it reduces the initial download and will then only download precisely what you need for your configuration. Note that if you have a network connection then booting a netboot image (as described above) is an even better option.

Having selected the appropriate first ISO you can then combine this with the images from the standard set in order to make up a complete set of Debian packages installable from ISO.

In addition to the above stable release images there are daily builds of multi-arch netinst CD images (jigdo,torrent) and weekly builds of the multi-arch DVD images (jigdo, torrent) for the testing release. Note that the testing release of Debian is by definition a work in progress and may contain transient issues etc.

Create Initial Guest Configuration

For the most part this is the same as the guest configuration for the netboot installation case discussed above (e.g. the requirement to use the whole disk partitioning scheme remains). Installation from an ISO image differs from netboot in the need to provide the ISO image as a device to the guest and to select the appropriate kernel from the ISO to use.

Providing the ISO image to the guest as a PV CDROM device is simply a case of including the ISO image in the disk directive of your configuration file. For example to configure a domain with /dev/xvda as a disk and /dev/xvdd as the ISO image use:

disk = ['file:/scratch/debian-6.0.4-amd64-i386-netinst.iso,xvdd:cdrom,r', 'phy:/dev/VG/debian-installer,xvda,w']

(Note: if you are using the pygrub method to boot from the ISO as described below then the CDROM device must come first as shown)

Each Debian ISO image which supports installation as a Xen PV guest contains a kernel (vmlinuz) and installer ramdisk (initrd.gz) specially for this use case. These live in /install.386/xen and /install.amd/xen for 32 and 64 bit installation respectively.

One option for booting these is to extract them from the ISO image, store them in your domain 0 filesystem and refer to them with kernel and ramdisk directives in your guest configuration file, much like the netboot case.

However it may be more convenient to use the pygrub tool to extract the correct kernel from the image. To do this first ensure that the PV CDROM device is the first device in the guest configuration disk directive and then specify pygrub as the bootloader giving the path to the kernel and ramdisk as bootloader arguments via the bootloader_args configuration file option.

Icon Ambox.png xm/xend uses "bootargs" rather than "bootloader_args"

e.g. for a 32 bit guest:

bootloader = "pygrub"
bootloader_args = "--kernel=/install.386/xen/vmlinuz --ramdisk=/install.386/xen/initrd.gz"

or for a 64 bit guest:

bootloader = "pygrub"
bootloader_args = "--kernel=/install.amd/xen/vmlinuz --ramdisk=/install.amd/xen/initrd.gz"

As with the netboot install you should specify suitable command line options. e.g.:

extra = "debian-installer/exit/always_halt=true -- console=hvc0"

Therefore a complete (if minimal) example of an install time configuration booting using pygrub might be:

name = "debian-installer"

memory = 256

disk = ['file:/scratch/debian-6.0.4-amd64-i386-netinst.iso,xvdd:cdrom,r', 'phy:/dev/VG/debian-installer,xvda,w']
vif = [' ']

bootloader = "pygrub"
bootloader_args = "--kernel=/install.386/xen/vmlinuz --ramdisk=/install.386/xen/initrd.gz"
extra = "debian-installer/exit/always_halt=true -- console=hvc0"

Install Debian

Installation proceeds in the same way as with netboot, as described above.

Depending upon the ISO image you have chosen to install from you may be offered the option to select a Debian mirror in order to install further software from the online repositories. The selection of a Debian mirror is discussed above.

Finalize Guest Configuration

Once installation has completed the guest will shutdown and exit. At this point you should remove any bootloader_args, kernel, initrd and extra lines from the guest configuration and use simply:

bootloader = "pygrub"

Keep the rest of the configuration file the same.

Now you can start the guest again to boot your newly installed Debian guest!

# xl create -c /etc/xen/debian-installer.cfg

Advanced Options

Preseeding

You can preseed a Xen installation in the same way as a normal native install by adding the necessary command line directives to the extra configuration line. e.g.

extra = "debian-installer/exit/always_halt=true -- console=hvc0 auto-install/enable=true url=http://example.com/debian/squeeze.cfg"

More information on preseeding can be found in Appendix B of Debian's Installation Guide

Other Installation Methods

Debian's Xen wiki page covers several other methods of installing Xen guests, including debootstrap and xen-tools.

External References

General Links

Development (testing and unstable) Links

These links are to the current development version of Debian. Please report installer bugs to the debian-boot mailing list and CD/DVD image bugs to the debian-cd mailing list. For Xen specific issues please also copy xen-devel.