]> git.siccegge.de Git - forks/vmdebootstrap.git/blob - vmdebootstrap.8.in
Update manpage for mbr
[forks/vmdebootstrap.git] / vmdebootstrap.8.in
1 .\" Copyright 2011 Lars Wirzenius <liw@liw.fi>
2 .\"
3 .\" This program is free software: you can redistribute it and/or modify
4 .\" it under the terms of the GNU General Public License as published by
5 .\" the Free Software Foundation, either version 3 of the License, or
6 .\" (at your option) any later version.
7 .\"
8 .\" This program is distributed in the hope that it will be useful,
9 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
10 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 .\" GNU General Public License for more details.
12 .\"
13 .\" You should have received a copy of the GNU General Public License
14 .\" along with this program. If not, see <http://www.gnu.org/licenses/>.
15 .\"
16 .TH VMDEBOOTSTRAP 8
17 .SH NAME
18 vmdebootstrap \- install basic Debian system into virtual disk image
19 .SH SYNOPSIS
20 .B vmdebootstrap
21 --image=FILE --size=SIZE [--mirror=URL] [--distribution=NAME]
22 .PP
23 .B vmdebootstrap
24 [--output=FILE] [--verbose | --no-verbose] --image=FILE --size=SIZE
25 [--tarball=FILE] [--mirror=URL] [--arch=ARCH] [--distribution=NAME]
26 [--package=PACKAGE] [--custom-package=DEB] [--no-kernel]
27 [--enable-dhcp | --no-enable-dhcp] [--root-password=PASSWORD]
28 [--customize=SCRIPT] [--hostname=HOSTNAME] [--user=USER/PASSWORD]
29 [--serial-console | --no-serial-console] [--sudo | --no-sudo] [--owner=OWNER]
30 [--bootsize=BOOTSIZE] [--boottype=FSTYPE] [--foreign=PATH] [--variant=VARIANT]
31 [--no-extlinux] [--squash] [--configure-apt] [--grub]
32 .SH DESCRIPTION
33 .B vmdebootstrap
34 installs a basic Debian system into a virtual disk image,
35 for use with virtual machines,
36 such as KVM, Qemu, or VirtualBox.
37 It is like
38 .BR debootstrap (8),
39 which does the same thing, but puts the system into a directory,
40 for use with
41 .BR chroot (8).
42 (In fact,
43 .B vmdebootstrap
44 is a wrapper around
45 .BR debootstrap ).
46 .PP
47 You need to run
48 .B vmdebootstrap
49 as root. If the \-\-verbose option is not used, no output will be
50 sent to the command line. If the \-\-log option is not used, no
51 output will be sent to any log files either.
52 .PP
53 To use the image,
54 you probably want to create a virtual machine using your preferred
55 virtualization technology, such as
56 .BR kvm (1),
57 or
58 .BR qemu (1).
59 Configure the virtual machine to use the image you've created.
60 Then start the virtual machine,
61 and log into it via its console to configure it.
62 .PP
63 Unless the \-\-no\-extlinux or \-\-grub options are specified, the
64 image will use
65 .BR extlinux (1)
66 as a boot loader.
67 The image has an empty root password and will not have networking
68 configured by default. Set the root password before you configure
69 networking.
70 .SH OPTIONS
71 .IP \-\-output=FILE
72 write output to FILE, instead of standard output
73 .IP \-\-verbose
74 report what is going on
75 .IP \-\-image=FILE
76 put created disk image in FILE
77 .IP \-\-size=SIZE
78 create a disk image of size SIZE (1000000000)
79 .IP \-\-tarball=FILE
80 tar up the disk's contents in FILE
81 .IP \-\-mirror=URL
82 use MIRROR as package source (http://cdn.debian.net/debian/)
83 .IP \-\-arch=ARCH
84 architecture to use (amd64)
85 .IP \-\-distribution=NAME
86 release to use (stable)
87 .IP \-\-package=PACKAGE
88 install PACKAGE onto system
89 .IP \-\-custom-package=DEB
90 install package in DEB file onto system (not from mirror)
91 .IP \-\-no-kernel
92 do not install a linux package
93 .IP \-\-enable-dhcp
94 enable DHCP on eth0
95 .IP \-\-root-password=PASSWORD
96 set root password
97 .IP \-\-customize=SCRIPT
98 run SCRIPT after setting up system. If the script does not exist in the current
99 working directory, /usr/share/vmdebootstrap/examples/ will be checked as a
100 fallback. The script needs to be executable and is passed the root directory of
101 the debootstrap as the only argument. Use chroot if you need to execute binaries
102 within the debootstrap.
103 .IP \-\-hostname=HOSTNAME
104 set name to HOSTNAME (debian)
105 .IP \-\-user=USER/PASSWORD
106 create USER with PASSWORD
107 .IP \-\-owner=OWNER
108 change the owner of the final image from root to the specified user.
109 .IP \-\-serial\-console
110 configure image to use a serial console
111 .IP \-\-serial-console-command
112 set the command to manage the serial console which will be appended to
113 /etc/inittab. Default is "/sbin/getty -L ttyS0 115200 vt100", resulting in a line
114 .BR "S0:23:respawn:/sbin/getty -L ttyS0 115200 vt100"
115 .IP \-\-sudo
116 install sudo, and if user is created, add them to sudo group
117 .IP \-\-bootsize=BOOTSIZE
118 If specified, create a /boot partition of the given size within the image. Debootstrapping will fail if this is too small for the selected kernel package.
119 .IP \-\-boottype=FSTYPE
120 Filesystem to use for the /boot partition. (default ext2)
121 .IP \-\-foreign=PATH
122 Path to the binfmt_handler to enable foreign support in debootstrap. e.g. /usr/bin/qemu-arm-static - note foreign debootstraps may take a signficant amount of time to complete and that debootstrap will retry five times if packages fail to install by default.
123 .IP \-\-no\-extlinux
124 Skip installation of extlinux. needs a customize script to make the image bootable. Useful for architectures where extlinux is not supportable.
125 Depending on how the image is to be booted, the \-\-mbr option may also be
126 necessary with extlinux.
127 .IP \-\-squash
128 Run mksquashfs against the final image using xz compression - requires
129 squashfs-tools to be installed. The final file will have the .squashfs suffix.
130 By default, mksquashfs is allowed to use all processors which may result
131 in high load. Run mksquashfs separately if you need to control the number
132 of processors used per run.
133 .IP \-\-configure\-apt
134 Use the specified mirror and distribution to create a suitable apt source inside
135 the VM. Can be useful if debootstrap fails to create it automatically.
136 .IP \-\-grub
137 Disable extlinux installation and configure grub2 instead. grub2 will be added to
138 the list of packages to install. update-grub will be called once the debootstrap is
139 complete and grub-install will be called in the image. Versions of grub2 in wheezy
140 can fail to install in the VM, at which point vmdebootstrap will fall back to
141 extlinux. It may still be possible to complete the installation of grub2 after
142 booting the VM as the problem may be related to the need to use loopback
143 devices during the grub-install operation. Details of the error will appear in the
144 vmdebootstrap log file, if enabled with the \-\-log option.
145 .SH Configuration files and settings:
146 .IP \-\-dump-config
147 write out the entire current configuration
148 .IP \-\-no-default-configs
149 clear list of configuration files to read
150 .IP \-\-config=FILE
151 add FILE to config files
152 .SH Logging:
153 .IP \-\-log=FILE
154 write log entries to FILE (default is to not write log files at all);
155 use "syslog" to log to system log, or "none" to disable logging
156 .IP \-\-log-level=LEVEL
157 log at LEVEL, one of debug, info, warning, error, critical, fatal (default: debug)
158 .IP \-\-log-max=SIZE
159 rotate logs larger than SIZE, zero for never (default: 0)
160 .IP \-\-log-keep=N
161 keep last N logs (10)
162 .IP \-\-log-mode=MODE
163 set permissions of new log files to MODE (octal; default 0600)
164 .SH Peformance:
165 .IP \-\-dump-memory-profile=METHOD
166 make memory profiling dumps using METHOD, which is one of:
167 none, simple, meliae, or heapy (default: simple)
168 .IP \-\-memory-dump-interval=SECONDS
169 make memory profiling dumps at least SECONDS apart
170 .SH EXAMPLE
171 To create an image for the stable release of Debian:
172 .nf
173 .IP
174 sudo vmdebootstrap --image test.img --size 1g \\
175 --log test.log --log-level debug --verbose \\
176 --mirror http://mirror.lan/debian/
177 .PP
178 To run the test image, make sure it is writeable. Use the \-\-owner option to set mode 0644 for the specified user or use chmod manually:
179 .IP
180 sudo chmod a+w ./test.img
181 .PP
182 Execute using qemu, e.g. on amd64 using qemu-system-x86_64:
183 .IP
184 qemu-system-x86_64 ./test.img
185 .PP
186 (This loads the image in a new window.)
187 .PP
188 For further examples, including u-boot support for beaglebone-black, see /usr/share/vmdebootstrap/examples
189 .SH NOTES
190 If you get problems with the bootstrap process, run a similar bootstrap call directly and chroot into the directory to investigate the failure. The actual debootstrap call is part of the vmdebootstrap logfile. The debootstrap logfile, if any, will be copied into your current working directory on error.
191 .PP
192 .B debootstrap
193 will download all the apt archive files into the apt cache and does not remove them before starting the configuration of the packages. This can mean that debootstrap can fail due to a lack of space on the device if the VM size is small. vmdebootstrap cleans up the apt cache once debootstrap has finished but this doesn't help if the package unpack or configuration steps use up all of the space in the meantime. Avoid this problem by specifying a larger size for the image.
194 .PP
195 Note that if you are also using a separate /boot partition in your options to vmdebootstrap, it may well be the boot partition which needs to be enlarged rather than the entire image.
196 .PP
197 It is advisable to change the mirror in the example scripts to a mirror closer to your location,
198 particularly if you need to do repeated builds.
199 .PP
200 .SH "SEE ALSO"
201 .BR debootstrap (8)
202 ,
203 .BR qemu-system-x86_64 (1)
204 ,
205 .BR grub-install (8)
206 .
207 .SH BUGS
208 Please provide the config section of the logfile when reporting bugs, as well as the complete command line.