view docs/src/user/debian.tex @ 7727:d7bcc7bbf981

Fix region0 virtual accesses
Signed-off by: Dan Magenheimer <dan.magenheimer@hp.com>
author djm@kirby.fc.hp.com
date Fri Nov 11 12:51:08 2005 -0600 (2005-11-11)
parents 06d84bf87159
children 63f9c8dd13d4
line source
1 \chapter{Installing Xen / XenLinux on Debian}
3 The Debian project provides a tool called \path{debootstrap} which
4 allows a base Debian system to be installed into a filesystem without
5 requiring the host system to have any Debian-specific software (such
6 as \path{apt}).
8 Here's some info how to install Debian 3.1 (Sarge) for an unprivileged
9 Xen domain:
11 \begin{enumerate}
13 \item Set up Xen and test that it's working, as described earlier in
14 this manual.
16 \item Create disk images for rootfs and swap. Alternatively, you might
17 create dedicated partitions, LVM logical volumes, etc.\ if that
18 suits your setup.
19 \begin{verbatim}
20 dd if=/dev/zero of=/path/diskimage bs=1024k count=size_in_mbytes
21 dd if=/dev/zero of=/path/swapimage bs=1024k count=size_in_mbytes
22 \end{verbatim}
24 If you're going to use this filesystem / disk image only as a
25 `template' for other vm disk images, something like 300 MB should be
26 enough. (of course it depends what kind of packages you are planning
27 to install to the template)
29 \item Create the filesystem and initialise the swap image
30 \begin{verbatim}
31 mkfs.ext3 /path/diskimage
32 mkswap /path/swapimage
33 \end{verbatim}
35 \item Mount the disk image for installation
36 \begin{verbatim}
37 mount -o loop /path/diskimage /mnt/disk
38 \end{verbatim}
40 \item Install \path{debootstrap}. Make sure you have debootstrap
41 installed on the host. If you are running Debian Sarge (3.1 /
42 testing) or unstable you can install it by running \path{apt-get
43 install debootstrap}. Otherwise, it can be downloaded from the
44 Debian project website.
46 \item Install Debian base to the disk image:
47 \begin{verbatim}
48 debootstrap --arch i386 sarge /mnt/disk \
49 http://ftp.<countrycode>.debian.org/debian
50 \end{verbatim}
52 You can use any other Debian http/ftp mirror you want.
54 \item When debootstrap completes successfully, modify settings:
55 \begin{verbatim}
56 chroot /mnt/disk /bin/bash
57 \end{verbatim}
59 Edit the following files using vi or nano and make needed changes:
60 \begin{verbatim}
61 /etc/hostname
62 /etc/hosts
63 /etc/resolv.conf
64 /etc/network/interfaces
65 /etc/networks
66 \end{verbatim}
68 Set up access to the services, edit:
69 \begin{verbatim}
70 /etc/hosts.deny
71 /etc/hosts.allow
72 /etc/inetd.conf
73 \end{verbatim}
75 Add Debian mirror to:
76 \begin{verbatim}
77 /etc/apt/sources.list
78 \end{verbatim}
80 Create fstab like this:
81 \begin{verbatim}
82 /dev/sda1 / ext3 errors=remount-ro 0 1
83 /dev/sda2 none swap sw 0 0
84 proc /proc proc defaults 0 0
85 \end{verbatim}
87 Logout
89 \item Unmount the disk image
90 \begin{verbatim}
91 umount /mnt/disk
92 \end{verbatim}
94 \item Create Xen 2.0 configuration file for the new domain. You can
95 use the example-configurations coming with Xen as a template.
97 Make sure you have the following set up:
98 \begin{verbatim}
99 disk = [ 'file:/path/diskimage,sda1,w', 'file:/path/swapimage,sda2,w' ]
100 root = "/dev/sda1 ro"
101 \end{verbatim}
103 \item Start the new domain
104 \begin{verbatim}
105 xm create -f domain_config_file
106 \end{verbatim}
108 Check that the new domain is running:
109 \begin{verbatim}
110 xm list
111 \end{verbatim}
113 \item Attach to the console of the new domain. You should see
114 something like this when starting the new domain:
116 \begin{verbatim}
117 Started domain testdomain2, console on port 9626
118 \end{verbatim}
120 There you can see the ID of the console: 26. You can also list the
121 consoles with \path{xm consoles} (ID is the last two digits of the
122 port number.)
124 Attach to the console:
126 \begin{verbatim}
127 xm console 26
128 \end{verbatim}
130 or by telnetting to the port 9626 of localhost (the xm console
131 program works better).
133 \item Log in and run base-config
135 As a default there's no password for the root.
137 Check that everything looks OK, and the system started without
138 errors. Check that the swap is active, and the network settings are
139 correct.
141 Run \path{/usr/sbin/base-config} to set up the Debian settings.
143 Set up the password for root using passwd.
145 \item Done. You can exit the console by pressing {\path{Ctrl + ]}}
147 \end{enumerate}
150 If you need to create new domains, you can just copy the contents of
151 the `template'-image to the new disk images, either by mounting the
152 template and the new image, and using \path{cp -a} or \path{tar} or by
153 simply copying the image file. Once this is done, modify the
154 image-specific settings (hostname, network settings, etc).