/usr/share/doc/live-manual/html/the-basics.pt_BR.html is in live-manual-html 1:3.0~a9-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
the-basics -
Debian Live Manual
</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="dc.title" content="Debian Live Manual" />
<meta name="dc.author" content="Debian Live Project <debian-live@lists.debian.org>" />
<meta name="dc.publisher" content="Debian Live Project <debian-live@lists.debian.org>" />
<meta name="dc.date" content="2011-12-04" />
<meta name="dc.rights" content="Copyright (C) 2006-2011 Debian Live Project;<br> License: This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.<br><br>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.<br><br>You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. <br><br>The complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL-3 file." />
<meta name="generator" content="SiSU 3.1.9 of 2011w51/1 (2011-12-19) (n*x and Ruby!)" />
<link rel="generator" href="http://www.sisudoc.org/" />
<link rel="shortcut icon" href="../_sisu/image/rb7.ico" />
<link rel="stylesheet" href="../_sisu/css/html.css" type="text/css" />
</head>
<body bgcolor="#ffffff" text="#000000" link="#003090" lang="en" xml:lang="en">
<a name="top" id="top"></a>
<a name="up" id="up"></a>
<a name="start" id="start"></a><table summary="segment navigation band with banner" bgcolor="#ffffff" width="100%"><tr>
<td width="20%" align="left">
<table summary="band" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#ffffff"><a href="http://live.debian.net/" target="_top"><img border="0" src="../_sisu/image/debian_home.png" alt="Debian -->" /></a></td></tr>
</table>
</td>
<td width="75%" align="center">
<table summary="segment navigation available documents types: toc,doc,pdf,concordance" border="0" cellpadding="3" cellspacing="0">
<tr>
<td align="center" bgcolor="#ffffff">
<td align="center" bgcolor="#ffffff">
<a href="sisu_manifest.pt_BR.html" target="_top" >
<font face="verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman" size="2">
[ document manifest ]
</font>
</a>
</td>
</tr></table>
</td>
<td width="5%" align="right">
<table summary="segment navigation pre/next" border="0" cellpadding="3" cellspacing="0">
<tr>
<td align="center" bgcolor="#ffffff">
<a href="installation.pt_BR.html" target="_top" >
<img border="0" width="22" height="22" src="../_sisu/image_sys/arrow_prev_red.png" alt="<< previous" />
</a>
</td>
<td align="center" bgcolor="#ffffff">
<a href="toc.pt_BR.html" target="_top" >
<img border="0" width="22" height="22" src="../_sisu/image_sys/arrow_up_red.png" alt="TOC" />
</a>
</td>
<td align="center" bgcolor="#ffffff">
<a href="overview-of-tools.pt_BR.html" target="_top" >
<img border="0" width="22" height="22" src="../_sisu/image_sys/arrow_next_red.png" alt="next >>" />
</a>
</td>
<td>
</td></tr>
</table>
</td></tr>
</table>
<table summary="segment hidden control pre and next" width="100%" border="0" cellpadding="0" bgcolor=#eeeeee align="center">
<tr><td align="left">
<a href="installation.pt_BR.html" target="_top" >
<img border="0" width="100%" height="20" src="../_sisu/image_sys/dot_white.png" alt="<" />
</a>
</td>
<td align="center">
<a href="toc.pt_BR.html" target="_top" >
<img border="0" width="100%" height="20" src="../_sisu/image_sys/dot_white.png" alt="^" />
</a>
</td>
<td align="right">
<a href="overview-of-tools.pt_BR.html" target="_top" >
<img border="0" width="100%" height="20" src="../_sisu/image_sys/dot_white.png" alt=">" />
</a>
</td></tr>
</table><div class="content">
<h1 class="tiny">
Debian Live Manual
</h1>
</div><div class="content">
<h2 class="tiny">
User
</h2>
</div><div class="content"><div class="substance">
<label class="ocn"><a name="156" href="#156" class="lnkocn">156</a></label>
<h1 class="norm" id="o156"><a name="156"></a>
4. The basics
</h1>
</div><div class="substance">
<label class="ocn"><a name="157" href="#157" class="lnkocn">157</a></label>
<p class="i0" id="o157">
This chapter contains a brief overview of the build process and instructions for using the three most commonly used image types. The most versatile image type, <tt>iso-hybrid</tt>, may be used on a virtual machine, optical media or USB portable storage device. In certain special cases, such as the use of persistence, <tt>usb-hdd</tt> may be more suitable for USB devices. The chapter finishes with instructions for building and using a <tt>net</tt> type image, which is a bit more involved due to the setup required on the server. This is a slightly advanced topic for anyone who is not familiar already with netbooting, but is included here because once the setup is done, it is a very convenient way to test and deploy images for booting on the local network without the hassle of dealing with image media.
</p>
</div><div class="substance">
<label class="ocn"><a name="158" href="#158" class="lnkocn">158</a></label>
<p class="i0" id="o158">
Throughout the chapter, we will often refer to the default filenames produced by <i>live-build</i>. If you are downloading a prebuilt image instead, the actual filenames may vary.
</p>
</div><div class="substance">
<label class="ocn"><a name="159" href="#159" class="lnkocn">159</a></label>
<p class="bold" id="o159"><a name="159"></a> <a name="hwhat-is-live" id="hwhat-is-live"></a>
<a name="h4.1" ></a><a name="what-is-live" ></a>4.1 What is a live system?
</p>
</div><div class="substance">
<label class="ocn"><a name="160" href="#160" class="lnkocn">160</a></label>
<p class="i0" id="o160">
A live system usually means an operating system booted on a computer from a removable medium, such as a CD-ROM or USB stick, or from a network, ready to use without any installation on the usual drive(s), with auto-configuration done at run time (see <a href="about-manual.html#terms">Terms</a>).
</p>
</div><div class="substance">
<label class="ocn"><a name="161" href="#161" class="lnkocn">161</a></label>
<p class="i0" id="o161">
With Debian Live, it's a Debian GNU/Linux operating system, built for one of the supported architectures (currently amd64, i386, powerpc and sparc). It is made from the following parts:
</p>
</div><div class="substance">
<label class="ocn"><a name="162" href="#162" class="lnkocn">162</a></label>
<li class="bullet" id="o162">
<b>Linux kernel image</b>, usually named <tt>vmlinuz*</tt>
</li>
</div><div class="substance">
<label class="ocn"><a name="163" href="#163" class="lnkocn">163</a></label>
<li class="bullet" id="o163">
<b>Initial RAM disk image (initrd)</b>: a RAM disk set up for the Linux boot, containing modules possibly needed to mount the System image and some scripts to do it.
</li>
</div><div class="substance">
<label class="ocn"><a name="164" href="#164" class="lnkocn">164</a></label>
<li class="bullet" id="o164">
<b>System image</b>: The operating system's filesystem image. Usually, a SquashFS compressed filesystem is used to minimize the Debian Live image size. Note that it is read-only. So, during boot the Debian Live system will use a RAM disk and 'union' mechanism to enable writing files within the running system. However, all modifications will be lost upon shutdown unless optional persistence is used (see <a href="customizing-run-time-behaviours.html#persistence">Persistence</a>).
</li>
</div><div class="substance">
<label class="ocn"><a name="165" href="#165" class="lnkocn">165</a></label>
<li class="bullet" id="o165">
<b>Bootloader</b>: A small piece of code crafted to boot from the chosen media, possibly presenting a prompt or menu to allow selection of options/configuration. It loads the Linux kernel and its initrd to run with an associated system filesystem. Different solutions can be used, depending on the target media and format of the filesystem containing the previously mentioned components: isolinux to boot from a CD or DVD in ISO9660 format, syslinux for HDD or USB drive booting from a VFAT partition, extlinux for ext2/3/4 and btrfs partitions, pxelinux for PXE netboot, GRUB for ext2/3/4 partitions, etc.
</li>
</div><div class="substance">
<label class="ocn"><a name="166" href="#166" class="lnkocn">166</a></label>
<p class="i0" id="o166">
You can use <i>live-build</i> to build the system image from your specifications, set up a Linux kernel, its initrd, and a bootloader to run them, all in one media-dependant format (ISO9660 image, disk image, etc.).
</p>
</div><div class="substance">
<label class="ocn"><a name="167" href="#167" class="lnkocn">167</a></label>
<p class="bold" id="o167"><a name="167"></a> <a name="hbuilding-iso-hybrid" id="hbuilding-iso-hybrid"></a>
<a name="h4.2" ></a><a name="building-iso-hybrid" ></a>4.2 First steps: building an ISO hybrid image
</p>
</div><div class="substance">
<label class="ocn"><a name="168" href="#168" class="lnkocn">168</a></label>
<p class="i0" id="o168">
Regardless of the image type, you will need to perform the same basic steps to build an image each time. As a first example, execute the following sequence of <i>live-build</i> commands to create a basic ISO hybrid image containing just the Debian standard system without X.org. It is suitable for burning to CD or DVD media, and also to copy onto a USB stick.
</p>
</div><div class="substance">
<label class="ocn"><a name="169" href="#169" class="lnkocn">169</a></label>
<p class="i0" id="o169">
First, run the <tt>lb config</tt> command. This will create a "config/" hierarchy in the current directory for use by other commands:
</p>
</div><div class="substance">
<label class="ocn"><a name="170" href="#170" class="lnkocn">170</a></label>
<p class="code" id="o170">
$ lb config<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="171" href="#171" class="lnkocn">171</a></label>
<p class="i0" id="o171">
No parameters are passed to <tt>lb config</tt>, so defaults for all of its various options will be used. See <a href="overview-of-tools.html#lb-config">The lb config command</a> for more details.
</p>
</div><div class="substance">
<label class="ocn"><a name="172" href="#172" class="lnkocn">172</a></label>
<p class="i0" id="o172">
Now that the "config/" hierarchy exists, build the image with the <tt>lb build</tt> command:
</p>
</div><div class="substance">
<label class="ocn"><a name="173" href="#173" class="lnkocn">173</a></label>
<p class="code" id="o173">
# lb build<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="174" href="#174" class="lnkocn">174</a></label>
<p class="i0" id="o174">
This process can take a while, depending on the speed of your network connection. When it is complete, there should be a <tt>binary-hybrid.iso</tt> image file, ready to use, in the current directory.
</p>
</div><div class="substance">
<label class="ocn"><a name="175" href="#175" class="lnkocn">175</a></label>
<p class="bold" id="o175"><a name="175"></a> <a name="husing-iso-hybrid" id="husing-iso-hybrid"></a>
<a name="h4.3" ></a><a name="using-iso-hybrid" ></a>4.3 Using an ISO hybrid live image
</p>
</div><div class="substance">
<label class="ocn"><a name="176" href="#176" class="lnkocn">176</a></label>
<p class="i0" id="o176">
After either building or downloading an ISO hybrid image, which can be obtained at ‹<a href="http://www.debian.org/CD/live/" target="_top">http://www.debian.org/CD/live/</a>›, the usual next step is to prepare your media for booting, either CD-R(W) or DVD-R(W) optical media or a USB stick.
</p>
</div><div class="substance">
<label class="ocn"><a name="177" href="#177" class="lnkocn">177</a></label>
<p class="bold" id="o177"><a name="177"></a> <a name="hburning-iso-image" id="hburning-iso-image"></a>
<a name="h4.3.1" ></a><a name="burning-iso-image" ></a>4.3.1 Burning an ISO image to a physical medium
</p>
</div><div class="substance">
<label class="ocn"><a name="178" href="#178" class="lnkocn">178</a></label>
<p class="i0" id="o178">
Burning an ISO image is easy. Just install wodim and use it from the command-line to burn the image. For instance:
</p>
</div><div class="substance">
<label class="ocn"><a name="179" href="#179" class="lnkocn">179</a></label>
<p class="code" id="o179">
# apt-get install wodim<br /><br />
$ wodim binary-hybrid.iso<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="180" href="#180" class="lnkocn">180</a></label>
<p class="bold" id="o180"><a name="180"></a> <a name="hcopying-iso-hybrid-to-usb" id="hcopying-iso-hybrid-to-usb"></a>
<a name="h4.3.2" ></a><a name="copying-iso-hybrid-to-usb" ></a>4.3.2 Copying an ISO hybrid image to a USB stick
</p>
</div><div class="substance">
<label class="ocn"><a name="181" href="#181" class="lnkocn">181</a></label>
<p class="i0" id="o181">
ISO images prepared with the <tt>isohybrid</tt> command, like the images produced by the default <tt>iso-hybrid</tt> binary image type, can be simply copied to a USB stick with the <tt>dd</tt> program or an equivalent. Plug in a USB stick with a size large enough for your image file and determine which device it is, which we hereafter refer to as <tt>${USBSTICK}</tt>. This is the device file of your key, such as <tt>/dev/sdb</tt>, not a partition, such as <tt>/dev/sdb1</tt>! You can find the right device name by looking in <tt>dmesg</tt>'s output after plugging in the stick, or better yet, <tt>ls -l /dev/disk/by-id</tt>.
</p>
</div><div class="substance">
<label class="ocn"><a name="182" href="#182" class="lnkocn">182</a></label>
<p class="i0" id="o182">
Once you are certain you have the correct device name, use the <tt>dd</tt> command to copy the image to the stick. <b>This will definitely overwrite any previous contents on your stick!</b>
</p>
</div><div class="substance">
<label class="ocn"><a name="183" href="#183" class="lnkocn">183</a></label>
<p class="code" id="o183">
$ dd if=binary-hybrid.iso of=${USBSTICK}<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="184" href="#184" class="lnkocn">184</a></label>
<p class="bold" id="o184"><a name="184"></a> <a name="hbooting-live-media" id="hbooting-live-media"></a>
<a name="h4.3.3" ></a><a name="booting-live-media" ></a>4.3.3 Booting the live media
</p>
</div><div class="substance">
<label class="ocn"><a name="185" href="#185" class="lnkocn">185</a></label>
<p class="i0" id="o185">
The first time you boot your live media, whether CD, DVD, USB key, or PXE boot, some setup in your computer's BIOS may be needed first. Since BIOSes vary greatly in features and key bindings, we cannot get into the topic in depth here. Some BIOSes provide a key to bring up a menu of boot devices at boot time, which is the easiest way if it is available on your system. Otherwise, you need to enter the BIOS configuration menu and change the boot order to place the boot device for the live system before your normal boot device.
</p>
</div><div class="substance">
<label class="ocn"><a name="186" href="#186" class="lnkocn">186</a></label>
<p class="i0" id="o186">
Once you've booted the media, you are presented with a boot menu. If you just press enter here, the system will boot using the default entry, <tt>Live</tt> and default options. For more information about boot options, see the "help" entry in the menu and also the <tt>live-boot</tt> and <tt>live-config</tt> man pages found within the live system.
</p>
</div><div class="substance">
<label class="ocn"><a name="187" href="#187" class="lnkocn">187</a></label>
<p class="i0" id="o187">
Assuming you've selected <tt>Live</tt> and booted a default desktop live image, after the boot messages scroll by, you should be automatically logged into the <tt>user</tt> account and see a desktop, ready to use. If you've booted a console-only image, such as <tt>standard</tt> or <tt>rescue</tt> flavour prebuilt images, you should be automatically logged in on the console to the <tt>user</tt> account and see a shell prompt, ready to use.
</p>
</div><div class="substance">
<label class="ocn"><a name="188" href="#188" class="lnkocn">188</a></label>
<p class="bold" id="o188"><a name="188"></a> <a name="husing-virtual-machine" id="husing-virtual-machine"></a>
<a name="h4.4" ></a><a name="using-virtual-machine" ></a>4.4 Using a virtual machine for testing
</p>
</div><div class="substance">
<label class="ocn"><a name="189" href="#189" class="lnkocn">189</a></label>
<p class="i0" id="o189">
It can be a great time-saver for the development of live images to run them in a virtual machine (VM). This is not without its caveats:
</p>
</div><div class="substance">
<label class="ocn"><a name="190" href="#190" class="lnkocn">190</a></label>
<li class="bullet" id="o190">
Running a VM requires enough RAM for both the guest OS and the host and a CPU with hardware support for virtualization is recommended.
</li>
</div><div class="substance">
<label class="ocn"><a name="191" href="#191" class="lnkocn">191</a></label>
<li class="bullet" id="o191">
There are some inherent limitations to running on a VM, e.g. poor video performance, limited choice of emulated hardware.
</li>
</div><div class="substance">
<label class="ocn"><a name="192" href="#192" class="lnkocn">192</a></label>
<li class="bullet" id="o192">
When developing for specific hardware, there is no substitute for running on the hardware itself.
</li>
</div><div class="substance">
<label class="ocn"><a name="193" href="#193" class="lnkocn">193</a></label>
<li class="bullet" id="o193">
Occasionally there are bugs that relate only to running in a VM. When in doubt, test your image directly on the hardware.
</li>
</div><div class="substance">
<label class="ocn"><a name="194" href="#194" class="lnkocn">194</a></label>
<p class="i0" id="o194">
Provided you can work within these constraints, survey the available VM software and choose one that is suitable for your needs.
</p>
</div><div class="substance">
<label class="ocn"><a name="195" href="#195" class="lnkocn">195</a></label>
<p class="bold" id="o195"><a name="195"></a> <a name="htesting-iso-with-qemu" id="htesting-iso-with-qemu"></a>
<a name="h4.4.1" ></a><a name="testing-iso-with-qemu" ></a>4.4.1 Testing an ISO image with QEMU
</p>
</div><div class="substance">
<label class="ocn"><a name="196" href="#196" class="lnkocn">196</a></label>
<p class="i0" id="o196">
The most versatile VM in Debian is QEMU. If your processor has hardware support for virtualization, use the <tt>qemu-kvm</tt> package; the <tt>qemu-kvm</tt> package description briefly lists the requirements.
</p>
</div><div class="substance">
<label class="ocn"><a name="197" href="#197" class="lnkocn">197</a></label>
<p class="i0" id="o197">
First, install <tt>qemu-kvm</tt> if your processor supports it. If not, install <tt>qemu</tt>, in which case the program name is <tt>qemu</tt> instead of <tt>kvm</tt> in the following examples. The <tt>qemu-utils</tt> package is also valuable for creating virtual disk images with <tt>qemu-img</tt>.
</p>
</div><div class="substance">
<label class="ocn"><a name="198" href="#198" class="lnkocn">198</a></label>
<p class="code" id="o198">
# apt-get install qemu-kvm qemu-utils<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="199" href="#199" class="lnkocn">199</a></label>
<p class="i0" id="o199">
Booting an ISO image is simple:
</p>
</div><div class="substance">
<label class="ocn"><a name="200" href="#200" class="lnkocn">200</a></label>
<p class="code" id="o200">
$ kvm -cdrom binary-hybrid.iso<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="201" href="#201" class="lnkocn">201</a></label>
<p class="i0" id="o201">
See the man pages for more details.
</p>
</div><div class="substance">
<label class="ocn"><a name="202" href="#202" class="lnkocn">202</a></label>
<p class="bold" id="o202"><a name="202"></a> <a name="htesting-iso-with-virtualbox" id="htesting-iso-with-virtualbox"></a>
<a name="h4.4.2" ></a><a name="testing-iso-with-virtualbox" ></a>4.4.2 Testing an ISO image with virtualbox-ose
</p>
</div><div class="substance">
<label class="ocn"><a name="203" href="#203" class="lnkocn">203</a></label>
<p class="i0" id="o203">
In order to test the ISO with <tt>virtualbox-ose</tt>:
</p>
</div><div class="substance">
<label class="ocn"><a name="204" href="#204" class="lnkocn">204</a></label>
<p class="code" id="o204">
# apt-get install virtualbox-ose virtualbox-ose-dkms<br /><br />
$ virtualbox<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="205" href="#205" class="lnkocn">205</a></label>
<p class="i0" id="o205">
Create a new virtual machine, change the storage settings to use <tt>binary-hybrid.iso</tt> as the CD/DVD device, and start the machine.
</p>
</div><div class="substance">
<label class="ocn"><a name="206" href="#206" class="lnkocn">206</a></label>
<p class="i0" id="o206">
Note: For live systems containing X.org that you want to test with <tt>virtualbox-ose</tt>, you may wish to include the VirtualBox X.org driver package, <tt>virtualbox-ose-guest-x11</tt>, in your <i>live-build</i> configuration. Otherwise, the resolution is limited to 800x600.
</p>
</div><div class="substance">
<label class="ocn"><a name="207" href="#207" class="lnkocn">207</a></label>
<p class="code" id="o207">
$ echo virtualbox-ose-guest-x11 >> config/package-lists/my.list.chroot<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="208" href="#208" class="lnkocn">208</a></label>
<p class="bold" id="o208"><a name="208"></a> <a name="hbuilding-usb-hdd" id="hbuilding-usb-hdd"></a>
<a name="h4.5" ></a><a name="building-usb-hdd" ></a>4.5 Building a USB/HDD image
</p>
</div><div class="substance">
<label class="ocn"><a name="209" href="#209" class="lnkocn">209</a></label>
<p class="i0" id="o209">
Building a USB/HDD image is similar to ISO hybrid in all respects except you specify <tt>-b usb-hdd</tt> and the resulting filename is <tt>binary.img</tt> which cannot be burnt to optical media. It is suitable for booting from USB sticks, USB hard drives, and various other portable storage devices. Normally, an ISO hybrid image can be used for this purpose instead, but if you have a BIOS which does not handle hybrid images properly, or want to use the remaining space on the media for some purpose, such as a persistence partition, you need a USB/HDD image.
</p>
</div><div class="substance">
<label class="ocn"><a name="210" href="#210" class="lnkocn">210</a></label>
<p class="i0" id="o210">
Note: if you created an ISO hybrid image with the previous example, you will need to clean up your working directory with the <tt>lb clean</tt> command (see <a href="overview-of-tools.html#lb-clean">The lb clean command</a>):
</p>
</div><div class="substance">
<label class="ocn"><a name="211" href="#211" class="lnkocn">211</a></label>
<p class="code" id="o211">
# lb clean --binary<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="212" href="#212" class="lnkocn">212</a></label>
<p class="i0" id="o212">
Run the <tt>lb config</tt> command as before, except this time specifying the USB/HDD image type:
</p>
</div><div class="substance">
<label class="ocn"><a name="213" href="#213" class="lnkocn">213</a></label>
<p class="code" id="o213">
$ lb config -b usb-hdd<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="214" href="#214" class="lnkocn">214</a></label>
<p class="i0" id="o214">
Now build the image with the <tt>lb build</tt> command:
</p>
</div><div class="substance">
<label class="ocn"><a name="215" href="#215" class="lnkocn">215</a></label>
<p class="code" id="o215">
# lb build<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="216" href="#216" class="lnkocn">216</a></label>
<p class="i0" id="o216">
When the build finishes, a <tt>binary.img</tt> file should be present in the current directory.
</p>
</div><div class="substance">
<label class="ocn"><a name="217" href="#217" class="lnkocn">217</a></label>
<p class="bold" id="o217"><a name="217"></a> <a name="husing-usb-hdd-image" id="husing-usb-hdd-image"></a>
<a name="h4.6" ></a><a name="using-usb-hdd-image" ></a>4.6 Using a USB/HDD image
</p>
</div><div class="substance">
<label class="ocn"><a name="218" href="#218" class="lnkocn">218</a></label>
<p class="i0" id="o218">
The generated binary image contains a VFAT partition and the syslinux bootloader, ready to be directly written on a USB stick. Since using a USB/HDD image is just like using an ISO hybrid image on USB, follow the instructions in <a href="the-basics.html#using-iso-hybrid">Using an ISO hybrid live image</a>, except use the filename <tt>binary.img</tt> instead of <tt>binary-hybrid.iso</tt>.
</p>
</div><div class="substance">
<label class="ocn"><a name="219" href="#219" class="lnkocn">219</a></label>
<p class="bold" id="o219"><a name="219"></a> <a name="htesting-usb-hdd-with-qemu" id="htesting-usb-hdd-with-qemu"></a>
<a name="h4.6.1" ></a><a name="testing-usb-hdd-with-qemu" ></a>4.6.1 Testing a USB/HDD image with Qemu
</p>
</div><div class="substance">
<label class="ocn"><a name="220" href="#220" class="lnkocn">220</a></label>
<p class="i0" id="o220">
First, install QEMU as described above in <a href="the-basics.html#testing-iso-with-qemu">Testing an ISO image with QEMU</a>. Then run <tt>kvm</tt> or <tt>qemu</tt>, depending on which version your host system needs, specifying <tt>binary.img</tt> as the first hard drive.
</p>
</div><div class="substance">
<label class="ocn"><a name="221" href="#221" class="lnkocn">221</a></label>
<p class="code" id="o221">
$ kvm -hda binary.img<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="222" href="#222" class="lnkocn">222</a></label>
<p class="bold" id="o222"><a name="222"></a> <a name="husing-usb-extra-space" id="husing-usb-extra-space"></a>
<a name="h4.6.2" ></a><a name="using-usb-extra-space" ></a>4.6.2 Using the space left on a USB stick
</p>
</div><div class="substance">
<label class="ocn"><a name="223" href="#223" class="lnkocn">223</a></label>
<p class="i0" id="o223">
To use the remaining free space after copying <tt>binary.img</tt> to a USB stick, use a partitioning tool such as <tt>gparted</tt> or <tt>parted</tt> to create a new partition on the stick. The first partition will be used by the Debian Live system.
</p>
</div><div class="substance">
<label class="ocn"><a name="224" href="#224" class="lnkocn">224</a></label>
<p class="code" id="o224">
# gparted ${USBSTICK}<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="225" href="#225" class="lnkocn">225</a></label>
<p class="i0" id="o225">
After the partition is created, where <tt>${PARTITION}</tt> is the name of the partition, such as <tt>/dev/sdb2</tt>, you have to create a filesystem on it. One possible choice would be ext4.
</p>
</div><div class="substance">
<label class="ocn"><a name="226" href="#226" class="lnkocn">226</a></label>
<p class="code" id="o226">
# mkfs.ext4 ${PARTITION}<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="227" href="#227" class="lnkocn">227</a></label>
<p class="i0" id="o227">
Note: If you want to use the extra space with Windows, apparently that OS cannot normally access any partitions but the first. Some solutions to this problem have been discussed on our <a href="about-project.html#contact">mailing list</a>, but it seems there are no easy answers.
</p>
</div><div class="substance">
<label class="ocn"><a name="228" href="#228" class="lnkocn">228</a></label>
<p class="i0" id="o228">
<b>Remember: Every time you install a new binary.img on the stick, all data on the stick will be lost because the partition table is overwritten by the contents of the image, so back up your extra partition first to restore again after updating the live image.</b>
</p>
</div><div class="substance">
<label class="ocn"><a name="229" href="#229" class="lnkocn">229</a></label>
<p class="bold" id="o229"><a name="229"></a> <a name="hbuilding-netboot-image" id="hbuilding-netboot-image"></a>
<a name="h4.7" ></a><a name="building-netboot-image" ></a>4.7 Building a netboot image
</p>
</div><div class="substance">
<label class="ocn"><a name="230" href="#230" class="lnkocn">230</a></label>
<p class="i0" id="o230">
The following sequence of commands will create a basic netboot image containing the Debian standard system without X.org. It is suitable for booting over the network.
</p>
</div><div class="substance">
<label class="ocn"><a name="231" href="#231" class="lnkocn">231</a></label>
<p class="i0" id="o231">
Note: if you performed any previous examples, you will need to clean up your working directory with the <tt>lb clean</tt> command:
</p>
</div><div class="substance">
<label class="ocn"><a name="232" href="#232" class="lnkocn">232</a></label>
<p class="code" id="o232">
# lb clean --binary<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="233" href="#233" class="lnkocn">233</a></label>
<p class="i0" id="o233">
Run the <tt>lb config</tt> command as follows to configure your image for netbooting:
</p>
</div><div class="substance">
<label class="ocn"><a name="234" href="#234" class="lnkocn">234</a></label>
<p class="code" id="o234">
$ lb config -b net --net-root-path "/srv/debian-live" --net-root-server "192.168.0.1"<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="235" href="#235" class="lnkocn">235</a></label>
<p class="i0" id="o235">
In contrast with the ISO and USB/HDD images, netbooting does not, itself, serve the filesystem image to the client, so the files must be served via NFS. The <tt>--net-root-path</tt> and <tt>--net-root-server</tt> options specify the location and server, respectively, of the NFS server where the filesytem image will be located at boot time. Make sure these are set to suitable values for your network and server.
</p>
</div><div class="substance">
<label class="ocn"><a name="236" href="#236" class="lnkocn">236</a></label>
<p class="i0" id="o236">
Now build the image with the <tt>lb build</tt> command:
</p>
</div><div class="substance">
<label class="ocn"><a name="237" href="#237" class="lnkocn">237</a></label>
<p class="code" id="o237">
# lb build<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="238" href="#238" class="lnkocn">238</a></label>
<p class="i0" id="o238">
In a network boot, the client runs a small piece of software which usually resides on the EPROM of the Ethernet card. This program sends a DHCP request to get an IP address and information about what to do next. Typically, the next step is getting a higher level bootloader via the TFTP protocol. That could be pxelinux, GRUB, or even boot directly to an operating system like Linux.
</p>
</div><div class="substance">
<label class="ocn"><a name="239" href="#239" class="lnkocn">239</a></label>
<p class="i0" id="o239">
For example, if you unpack the generated <tt>binary-net.tar.gz</tt> archive in the <tt>/srv/debian-live</tt> directory, you'll find the filesystem image in <tt>live/filesystem.squashfs</tt> and the kernel, initrd and pxelinux bootloader in <tt>tftpboot/debian-live/i386</tt>.
</p>
</div><div class="substance">
<label class="ocn"><a name="240" href="#240" class="lnkocn">240</a></label>
<p class="i0" id="o240">
We must now configure three services on the server to enable netboot: the DHCP server, the TFTP server and the NFS server.
</p>
</div><div class="substance">
<label class="ocn"><a name="241" href="#241" class="lnkocn">241</a></label>
<p class="bold" id="o241"><a name="241"></a> <a name="h4.7.1" id="h4.7.1"></a>
<a name="4.7.1" ></a><a name="h4.7.1" ></a>4.7.1 DHCP server
</p>
</div><div class="substance">
<label class="ocn"><a name="242" href="#242" class="lnkocn">242</a></label>
<p class="i0" id="o242">
We must configure our network's DHCP server to be sure to give an IP address to the netbooting client system, and to advertise the location of the PXE bootloader.
</p>
</div><div class="substance">
<label class="ocn"><a name="243" href="#243" class="lnkocn">243</a></label>
<p class="i0" id="o243">
Here is an example for inspiration, written for the ISC DHCP server <tt>isc-dhcp-server</tt> in the <tt>/etc/dhcp/dhcpd.conf</tt> configuration file:
</p>
</div><div class="substance">
<label class="ocn"><a name="244" href="#244" class="lnkocn">244</a></label>
<p class="code" id="o244">
# /etc/dhcp/dhcpd.conf - configuration file for isc-dhcp-server<br /><br />
ddns-update-style none;<br /><br />
option domain-name "example.org";<br />
option domain-name-servers ns1.example.org, ns2.example.org;<br /><br />
default-lease-time 600;<br />
max-lease-time 7200;<br /><br />
log-facility local7;<br /><br />
subnet 192.168.0.0 netmask 255.255.255.0 {<br />
range 192.168.0.1 192.168.0.254;<br />
next-server servername;<br />
filename "pxelinux.0";<br />
}<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="245" href="#245" class="lnkocn">245</a></label>
<p class="bold" id="o245"><a name="245"></a> <a name="h4.7.2" id="h4.7.2"></a>
<a name="4.7.2" ></a><a name="h4.7.2" ></a>4.7.2 TFTP server
</p>
</div><div class="substance">
<label class="ocn"><a name="246" href="#246" class="lnkocn">246</a></label>
<p class="i0" id="o246">
This serves the kernel and initial ramdisk to the system at run time.
</p>
</div><div class="substance">
<label class="ocn"><a name="247" href="#247" class="lnkocn">247</a></label>
<p class="i0" id="o247">
You should install the tftpd-hpa package. It can serve all files contained inside a root directory, usually <tt>/srv/tftp</tt>. To let it serve files inside <tt>/srv/debian-live/tftpboot</tt>, run as root the following command:
</p>
</div><div class="substance">
<label class="ocn"><a name="248" href="#248" class="lnkocn">248</a></label>
<p class="code" id="o248">
# dpkg-reconfigure -plow tftpd-hpa<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="249" href="#249" class="lnkocn">249</a></label>
<p class="i0" id="o249">
and fill in the new tftp server directory when being asked about it.
</p>
</div><div class="substance">
<label class="ocn"><a name="250" href="#250" class="lnkocn">250</a></label>
<p class="bold" id="o250"><a name="250"></a> <a name="h4.7.3" id="h4.7.3"></a>
<a name="4.7.3" ></a><a name="h4.7.3" ></a>4.7.3 NFS server
</p>
</div><div class="substance">
<label class="ocn"><a name="251" href="#251" class="lnkocn">251</a></label>
<p class="i0" id="o251">
Once the guest computer has downloaded and booted a Linux kernel and loaded its initrd, it will try to mount the Live filesystem image through a NFS server.
</p>
</div><div class="substance">
<label class="ocn"><a name="252" href="#252" class="lnkocn">252</a></label>
<p class="i0" id="o252">
You need to install the <tt>nfs-kernel-server</tt> package.
</p>
</div><div class="substance">
<label class="ocn"><a name="253" href="#253" class="lnkocn">253</a></label>
<p class="i0" id="o253">
Then, make the filesystem image available through NFS by adding a line like the following to <tt>/etc/exports</tt>:
</p>
</div><div class="substance">
<label class="ocn"><a name="254" href="#254" class="lnkocn">254</a></label>
<p class="code" id="o254">
/srv/debian-live *(ro,async,no_root_squash,no_subtree_check)<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="255" href="#255" class="lnkocn">255</a></label>
<p class="i0" id="o255">
and tell the NFS server about this new export with the following command:
</p>
</div><div class="substance">
<label class="ocn"><a name="256" href="#256" class="lnkocn">256</a></label>
<p class="code" id="o256">
# exportfs -rv<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="257" href="#257" class="lnkocn">257</a></label>
<p class="i0" id="o257">
Setting up these three services can be a little tricky. You might need some patience to get all of them working together. For more information, see the syslinux wiki at ‹<a href="http://syslinux.zytor.com/wiki/index.php/PXELINUX" target="_top">http://syslinux.zytor.com/wiki/index.php/PXELINUX</a>› or the Debian Installer Manual's TFTP Net Booting section at ‹<a href="http://d-i.alioth.debian.org/manual/en.i386/ch04s05.html" target="_top">http://d-i.alioth.debian.org/manual/en.i386/ch04s05.html</a>›. They might help, as their processes are very similar.
</p>
</div><div class="substance">
<label class="ocn"><a name="258" href="#258" class="lnkocn">258</a></label>
<p class="bold" id="o258"><a name="258"></a> <a name="h4.7.4" id="h4.7.4"></a>
<a name="4.7.4" ></a><a name="h4.7.4" ></a>4.7.4 Netboot testing HowTo
</p>
</div><div class="substance">
<label class="ocn"><a name="259" href="#259" class="lnkocn">259</a></label>
<p class="i0" id="o259">
Netboot image creation is made easy with <i>live-build</i> magic, but testing the images on physical machines can be really time consuming.
</p>
</div><div class="substance">
<label class="ocn"><a name="260" href="#260" class="lnkocn">260</a></label>
<p class="i0" id="o260">
To make our life easier, we can use virtualization. There are two solutions.
</p>
</div><div class="substance">
<label class="ocn"><a name="261" href="#261" class="lnkocn">261</a></label>
<p class="bold" id="o261"><a name="261"></a> <a name="h4.7.5" id="h4.7.5"></a>
<a name="4.7.5" ></a><a name="h4.7.5" ></a>4.7.5 Qemu
</p>
</div><div class="substance">
<label class="ocn"><a name="262" href="#262" class="lnkocn">262</a></label>
<li class="bullet" id="o262">
Install <tt>qemu</tt>, <tt>bridge-utils</tt>, <tt>sudo</tt>.
</li>
</div><div class="substance">
<label class="ocn"><a name="263" href="#263" class="lnkocn">263</a></label>
<p class="i0" id="o263">
Edit <tt>/etc/qemu-ifup</tt>:
</p>
</div><div class="substance">
<label class="ocn"><a name="264" href="#264" class="lnkocn">264</a></label>
<p class="code" id="o264">
#!/bin/sh<br />
sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1<br />
echo "Executing /etc/qemu-ifup"<br />
echo "Bringing up $1 for bridged mode..."<br />
sudo /sbin/ifconfig $1 0.0.0.0 promisc up<br />
echo "Adding $1 to br0..."<br />
sudo /usr/sbin/brctl addif br0 $1<br />
sleep 2<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="265" href="#265" class="lnkocn">265</a></label>
<p class="i0" id="o265">
Get, or build a <tt>grub-floppy-netboot</tt> (in the svn).
</p>
</div><div class="substance">
<label class="ocn"><a name="266" href="#266" class="lnkocn">266</a></label>
<p class="i0" id="o266">
Launch <tt>qemu</tt> with "<tt>-net nic,vlan=0 -net tap,vlan=0,ifname=tun0</tt>"
</p>
</div><div class="substance">
<label class="ocn"><a name="267" href="#267" class="lnkocn">267</a></label>
<p class="bold" id="o267"><a name="267"></a> <a name="h4.7.6" id="h4.7.6"></a>
<a name="4.7.6" ></a><a name="h4.7.6" ></a>4.7.6 VMWare Player
</p>
</div><div class="substance">
<label class="ocn"><a name="268" href="#268" class="lnkocn">268</a></label>
<li class="bullet" id="o268">
Install VMWare Player ("free as in beer" edition)
</li>
</div><div class="substance">
<label class="ocn"><a name="269" href="#269" class="lnkocn">269</a></label>
<li class="bullet" id="o269">
Create a PXETester directory, and create a text file called <tt>pxe.vwx</tt> inside
</li>
</div><div class="substance">
<label class="ocn"><a name="270" href="#270" class="lnkocn">270</a></label>
<li class="bullet" id="o270">
Paste this text inside:
</li>
</div><div class="substance">
<label class="ocn"><a name="271" href="#271" class="lnkocn">271</a></label>
<p class="code" id="o271">
#!/usr/bin/vmware<br />
config.version = "8"<br />
virtualHW.version = "4"<br />
memsize = "512"<br />
MemAllowAutoScaleDown = "FALSE"<br /><br />
ide0:0.present = "FALSE"<br />
ide1:0.present = "FALSE"<br />
floppy0.present = "FALSE"<br />
sound.present = "FALSE"<br />
tools.remindInstall = "FALSE"<br /><br />
ethernet0.present = "TRUE"<br />
ethernet0.addressType = "generated"<br /><br />
displayName = "Test Boot PXE"<br />
guestOS = "other"<br /><br />
ethernet0.generatedAddress = "00:0c:29:8d:71:3b"<br />
uuid.location = "56 4d 83 72 5c c4 de 3f-ae 9e 07 91 1d 8d 71 3b"<br />
uuid.bios = "56 4d 83 72 5c c4 de 3f-ae 9e 07 91 1d 8d 71 3b"<br />
ethernet0.generatedAddressOffset = "0"<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="272" href="#272" class="lnkocn">272</a></label>
<li class="bullet" id="o272">
You can play with this configuration file (e.g. change memory limit to 256)
</li>
</div><div class="substance">
<label class="ocn"><a name="273" href="#273" class="lnkocn">273</a></label>
<li class="bullet" id="o273">
Double click on this file (or run VMWare player and select this file).
</li>
</div><div class="substance">
<label class="ocn"><a name="274" href="#274" class="lnkocn">274</a></label>
<li class="bullet" id="o274">
When running just press space if that strange question comes up...
</li>
</div></div><br /><div class="main_column">
<table summary="segment navigation band" bgcolor="#ffffff" width="100%"><tr>
<td width="70%" align="center">
<table summary="segment navigation available documents types: toc,doc,pdf,concordance" border="0" cellpadding="3" cellspacing="0">
<tr>
<td align="center" bgcolor="#ffffff">
<td align="center" bgcolor="#ffffff">
<a href="sisu_manifest.pt_BR.html" target="_top" >
<font face="verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman" size="2">
[ document manifest ]
</font>
</a>
</td>
</tr></table>
</td>
<td width="5%" align="right">
<table summary="segment navigation pre/next" border="0" cellpadding="3" cellspacing="0">
<tr>
<td align="center" bgcolor="#ffffff">
<a href="installation.pt_BR.html" target="_top" >
<img border="0" width="22" height="22" src="../_sisu/image_sys/arrow_prev_red.png" alt="<< previous" />
</a>
</td>
<td align="center" bgcolor="#ffffff">
<a href="toc.pt_BR.html" target="_top" >
<img border="0" width="22" height="22" src="../_sisu/image_sys/arrow_up_red.png" alt="TOC" />
</a>
</td>
<td align="center" bgcolor="#ffffff">
<a href="overview-of-tools.pt_BR.html" target="_top" >
<img border="0" width="22" height="22" src="../_sisu/image_sys/arrow_next_red.png" alt="next >>" />
</a>
</td>
<td>
</td></tr>
</table>
</td></tr>
</table>
<table summary="segment hidden control pre and next" width="100%" border="0" cellpadding="0" bgcolor=#eeeeee align="center">
<tr><td align="left">
<a href="installation.pt_BR.html" target="_top" >
<img border="0" width="100%" height="20" src="../_sisu/image_sys/dot_white.png" alt="<" />
</a>
</td>
<td align="center">
<a href="toc.pt_BR.html" target="_top" >
<img border="0" width="100%" height="20" src="../_sisu/image_sys/dot_white.png" alt="^" />
</a>
</td>
<td align="right">
<a href="overview-of-tools.pt_BR.html" target="_top" >
<img border="0" width="100%" height="20" src="../_sisu/image_sys/dot_white.png" alt=">" />
</a>
</td></tr>
</table>
</div><div class="main_column">
<a name="bottom" id="bottom"></a>
<a name="down" id="down"></a>
<a name="end" id="end"></a>
<a name="finish" id="finish"></a>
<a name="stop" id="stop"></a>
<a name="credits" id="credits"></a>
</div></div></body>
</html>
|