diff --git a/zh_TW.Big5/books/handbook/Makefile b/zh_TW.Big5/books/handbook/Makefile index 2b0e56c758..d9cf0ea760 100644 --- a/zh_TW.Big5/books/handbook/Makefile +++ b/zh_TW.Big5/books/handbook/Makefile @@ -1,288 +1,300 @@ # # $FreeBSD$ # Original revision: 1.108 # # Build the FreeBSD Handbook. # # ------------------------------------------------------------------------ # # Handbook-specific variables # # WITH_PGPKEYS The print version of the handbook only prints PGP # fingerprints by default. If you would like for the # entire key to be displayed, then set this variable. # This option has no affect on the HTML formats. # # Handbook-specific targets # # pgpkeyring This target will read the contents of # pgpkeys/chapter.sgml and will extract all of # the pgpkeys to standard out. This output can then # be redirected into a file and distributed as a # public keyring of FreeBSD developers that can # easily be imported into PGP/GPG. # # ------------------------------------------------------------------------ .PATH: ${.CURDIR}/../../share/sgml/glossary MAINTAINER= doc@FreeBSD.org DOC?= book FORMATS?= html-split HAS_INDEX= true USE_PS2PDF= yes INSTALL_COMPRESSED?= gz INSTALL_ONLY_COMPRESSED?= IMAGES_EN = advanced-networking/isdn-bus.eps IMAGES_EN+= advanced-networking/isdn-twisted-pair.eps IMAGES_EN+= advanced-networking/natd.eps IMAGES_EN+= advanced-networking/net-routing.pic IMAGES_EN+= advanced-networking/static-routes.pic IMAGES_EN+= geom/striping.pic IMAGES_EN+= install/adduser1.scr IMAGES_EN+= install/adduser2.scr IMAGES_EN+= install/adduser3.scr IMAGES_EN+= install/boot-loader-menu.scr IMAGES_EN+= install/boot-mgr.scr IMAGES_EN+= install/config-country.scr IMAGES_EN+= install/console-saver1.scr IMAGES_EN+= install/console-saver2.scr IMAGES_EN+= install/console-saver3.scr IMAGES_EN+= install/console-saver4.scr IMAGES_EN+= install/disklabel-auto.scr IMAGES_EN+= install/disklabel-ed1.scr IMAGES_EN+= install/disklabel-ed2.scr IMAGES_EN+= install/disklabel-fs.scr IMAGES_EN+= install/disklabel-root1.scr IMAGES_EN+= install/disklabel-root2.scr IMAGES_EN+= install/disklabel-root3.scr IMAGES_EN+= install/disk-layout.eps IMAGES_EN+= install/dist-set.scr IMAGES_EN+= install/dist-set2.scr IMAGES_EN+= install/docmenu1.scr IMAGES_EN+= install/ed0-conf.scr IMAGES_EN+= install/ed0-conf2.scr IMAGES_EN+= install/edit-inetd-conf.scr IMAGES_EN+= install/fdisk-drive1.scr IMAGES_EN+= install/fdisk-drive2.scr IMAGES_EN+= install/fdisk-edit1.scr IMAGES_EN+= install/fdisk-edit2.scr IMAGES_EN+= install/ftp-anon1.scr IMAGES_EN+= install/ftp-anon2.scr IMAGES_EN+= install/hdwrconf.scr IMAGES_EN+= install/keymap.scr IMAGES_EN+= install/main1.scr IMAGES_EN+= install/mainexit.scr IMAGES_EN+= install/main-std.scr IMAGES_EN+= install/main-options.scr IMAGES_EN+= install/main-doc.scr IMAGES_EN+= install/main-keymap.scr IMAGES_EN+= install/media.scr IMAGES_EN+= install/mouse1.scr IMAGES_EN+= install/mouse2.scr IMAGES_EN+= install/mouse3.scr IMAGES_EN+= install/mouse4.scr IMAGES_EN+= install/mouse5.scr IMAGES_EN+= install/mouse6.scr IMAGES_EN+= install/mta-main.scr IMAGES_EN+= install/net-config-menu1.scr IMAGES_EN+= install/net-config-menu2.scr IMAGES_EN+= install/nfs-server-edit.scr IMAGES_EN+= install/ntp-config.scr IMAGES_EN+= install/options.scr IMAGES_EN+= install/pkg-cat.scr IMAGES_EN+= install/pkg-confirm.scr IMAGES_EN+= install/pkg-install.scr IMAGES_EN+= install/pkg-sel.scr IMAGES_EN+= install/probstart.scr IMAGES_EN+= install/routed.scr IMAGES_EN+= install/security.scr IMAGES_EN+= install/sysinstall-exit.scr IMAGES_EN+= install/timezone1.scr IMAGES_EN+= install/timezone2.scr IMAGES_EN+= install/timezone3.scr IMAGES_EN+= install/userconfig.scr IMAGES_EN+= install/userconfig2.scr IMAGES_EN+= mail/mutt1.scr IMAGES_EN+= mail/mutt2.scr IMAGES_EN+= mail/mutt3.scr IMAGES_EN+= mail/pine1.scr IMAGES_EN+= mail/pine2.scr IMAGES_EN+= mail/pine3.scr IMAGES_EN+= mail/pine4.scr IMAGES_EN+= mail/pine5.scr IMAGES_EN+= install/example-dir1.eps IMAGES_EN+= install/example-dir2.eps IMAGES_EN+= install/example-dir3.eps IMAGES_EN+= install/example-dir4.eps IMAGES_EN+= install/example-dir5.eps IMAGES_EN+= security/ipsec-network.pic IMAGES_EN+= security/ipsec-crypt-pkt.pic IMAGES_EN+= security/ipsec-encap-pkt.pic IMAGES_EN+= security/ipsec-out-pkt.pic IMAGES_EN+= vinum/vinum-concat.pic IMAGES_EN+= vinum/vinum-mirrored-vol.pic IMAGES_EN+= vinum/vinum-raid10-vol.pic IMAGES_EN+= vinum/vinum-raid5-org.pic IMAGES_EN+= vinum/vinum-simple-vol.pic IMAGES_EN+= vinum/vinum-striped-vol.pic IMAGES_EN+= vinum/vinum-striped.pic IMAGES_EN+= virtualization/parallels-freebsd1.png IMAGES_EN+= virtualization/parallels-freebsd2.png IMAGES_EN+= virtualization/parallels-freebsd3.png IMAGES_EN+= virtualization/parallels-freebsd4.png IMAGES_EN+= virtualization/parallels-freebsd5.png IMAGES_EN+= virtualization/parallels-freebsd6.png IMAGES_EN+= virtualization/parallels-freebsd7.png IMAGES_EN+= virtualization/parallels-freebsd8.png IMAGES_EN+= virtualization/parallels-freebsd9.png IMAGES_EN+= virtualization/parallels-freebsd10.png IMAGES_EN+= virtualization/parallels-freebsd11.png IMAGES_EN+= virtualization/parallels-freebsd12.png IMAGES_EN+= virtualization/parallels-freebsd13.png IMAGES_EN+= virtualization/virtualpc-freebsd1.png IMAGES_EN+= virtualization/virtualpc-freebsd2.png IMAGES_EN+= virtualization/virtualpc-freebsd3.png IMAGES_EN+= virtualization/virtualpc-freebsd4.png IMAGES_EN+= virtualization/virtualpc-freebsd5.png IMAGES_EN+= virtualization/virtualpc-freebsd6.png IMAGES_EN+= virtualization/virtualpc-freebsd7.png IMAGES_EN+= virtualization/virtualpc-freebsd8.png IMAGES_EN+= virtualization/virtualpc-freebsd9.png IMAGES_EN+= virtualization/virtualpc-freebsd10.png IMAGES_EN+= virtualization/virtualpc-freebsd11.png IMAGES_EN+= virtualization/virtualpc-freebsd12.png IMAGES_EN+= virtualization/virtualpc-freebsd13.png +IMAGES_EN+= virtualization/vmware-freebsd01.png +IMAGES_EN+= virtualization/vmware-freebsd02.png +IMAGES_EN+= virtualization/vmware-freebsd03.png +IMAGES_EN+= virtualization/vmware-freebsd04.png +IMAGES_EN+= virtualization/vmware-freebsd05.png +IMAGES_EN+= virtualization/vmware-freebsd06.png +IMAGES_EN+= virtualization/vmware-freebsd07.png +IMAGES_EN+= virtualization/vmware-freebsd08.png +IMAGES_EN+= virtualization/vmware-freebsd09.png +IMAGES_EN+= virtualization/vmware-freebsd10.png +IMAGES_EN+= virtualization/vmware-freebsd11.png +IMAGES_EN+= virtualization/vmware-freebsd12.png # Images from the cross-document image library IMAGES_LIB= callouts/1.png IMAGES_LIB+= callouts/2.png IMAGES_LIB+= callouts/3.png IMAGES_LIB+= callouts/4.png IMAGES_LIB+= callouts/5.png IMAGES_LIB+= callouts/6.png IMAGES_LIB+= callouts/7.png IMAGES_LIB+= callouts/8.png IMAGES_LIB+= callouts/9.png IMAGES_LIB+= callouts/10.png IMAGES_LIB+= callouts/11.png IMAGES_LIB+= callouts/12.png IMAGES_LIB+= callouts/13.png IMAGES_LIB+= callouts/14.png IMAGES_LIB+= callouts/15.png # # SRCS lists the individual SGML files that make up the document. Changes # to any of these files will force a rebuild # # SGML content SRCS+= audit/chapter.sgml SRCS+= book.sgml SRCS+= colophon.sgml SRCS+= freebsd-glossary.sgml SRCS+= advanced-networking/chapter.sgml SRCS+= basics/chapter.sgml SRCS+= bibliography/chapter.sgml SRCS+= boot/chapter.sgml SRCS+= config/chapter.sgml SRCS+= cutting-edge/chapter.sgml SRCS+= desktop/chapter.sgml SRCS+= disks/chapter.sgml SRCS+= eresources/chapter.sgml SRCS+= firewalls/chapter.sgml SRCS+= geom/chapter.sgml SRCS+= install/chapter.sgml SRCS+= introduction/chapter.sgml #SRCS+= jails/chapter.sgml SRCS+= kernelconfig/chapter.sgml SRCS+= l10n/chapter.sgml SRCS+= linuxemu/chapter.sgml SRCS+= mac/chapter.sgml SRCS+= mail/chapter.sgml SRCS+= mirrors/chapter.sgml SRCS+= multimedia/chapter.sgml SRCS+= network-servers/chapter.sgml SRCS+= pgpkeys/chapter.sgml SRCS+= ports/chapter.sgml SRCS+= ppp-and-slip/chapter.sgml SRCS+= preface/preface.sgml SRCS+= printing/chapter.sgml SRCS+= security/chapter.sgml SRCS+= serialcomms/chapter.sgml SRCS+= users/chapter.sgml SRCS+= vinum/chapter.sgml SRCS+= virtualization/chapter.sgml SRCS+= x11/chapter.sgml # Entities SRCS+= chapters.ent SYMLINKS= ${DESTDIR} index.html handbook.html # Turn on all the chapters. CHAPTERS?= ${SRCS:M*chapter.sgml} SGMLFLAGS+= ${CHAPTERS:S/\/chapter.sgml//:S/^/-i chap./} SGMLFLAGS+= -i chap.freebsd-glossary pgpkeyring: pgpkeys/chapter.sgml @${JADE} -V nochunks ${OTHERFLAGS} ${JADEOPTS} -d ${DSLPGP} -t sgml ${MASTERDOC} # # Handbook-specific variables # .if defined(WITH_PGPKEYS) JADEFLAGS+= -V withpgpkeys .endif URL_RELPREFIX?= ../../../.. DOC_PREFIX?= ${.CURDIR}/../../.. # # rules generating lists of mirror site from XML database. # XMLDOCS= mirrors-ftp:::mirrors.sgml.ftp.inc.tmp \ mirrors-cvsup:::mirrors.sgml.cvsup.inc.tmp \ eresources:::eresources.sgml.www.inc.tmp DEPENDSET.DEFAULT= transtable mirror XSLT.DEFAULT= ${XSL_MIRRORS} XML.DEFAULT= ${XML_MIRRORS} NO_TIDY.DEFAULT= yes PARAMS.mirrors-ftp+= --param 'type' "'ftp'" \ --param 'proto' "'ftp'" \ --param 'target' "'handbook/mirrors/chapter.sgml'" PARAMS.mirrors-cvsup+= --param 'type' "'cvsup'" \ --param 'proto' "'cvsup'" \ --param 'target' "'handbook/mirrors/chapter.sgml'" PARAMS.eresources+= --param 'type' "'www'" \ --param 'proto' "'http'" \ --param 'target' "'handbook/eresources/chapter.sgml'" SRCS+= mirrors.sgml.ftp.inc \ mirrors.sgml.cvsup.inc \ eresources.sgml.www.inc CLEANFILES+= mirrors.sgml.ftp.inc mirrors.sgml.ftp.inc.tmp \ mirrors.sgml.cvsup.inc mirrors.sgml.cvsup.inc.tmp \ eresources.sgml.www.inc eresources.sgml.www.inc.tmp .include "${DOC_PREFIX}/share/mk/doc.project.mk" .for p in ftp cvsup mirrors.sgml.${p}.inc: mirrors.sgml.${p}.inc.tmp ${SED} -e 's,<\([^ >]*\)\([^>]*\)/>,<\1\2>,;s,,,'\ < $@.tmp > $@ || (${RM} -f $@ && false) .endfor eresources.sgml.www.inc: eresources.sgml.www.inc.tmp ${SED} -e 's,<\([^ >]*\)\([^>]*\)/>,<\1\2>,;s,,,'\ < $@.tmp > $@ || (${RM} -f $@ && false) diff --git a/zh_TW.Big5/books/handbook/virtualization/chapter.sgml b/zh_TW.Big5/books/handbook/virtualization/chapter.sgml index 82f66d803d..afec454236 100644 --- a/zh_TW.Big5/books/handbook/virtualization/chapter.sgml +++ b/zh_TW.Big5/books/handbook/virtualization/chapter.sgml @@ -1,751 +1,915 @@ Murray Stokely Contributed by Virtualization(虛擬機器) Synopsis 虛擬機器軟體可以讓同一台機器得以同時執行多種作業系統。 在 PC 上, 通常這類系統都是在宿主(host)機器上裝虛擬機器軟體,來跑一堆 guest OS 。 讀完這章,您將了解︰ host OS 以及 guest OS 的區別。 如何在搭載 &intel; CPU 的 &apple; &macintosh; 電腦上安裝 FreeBSD 。 如何在 Linux 上以 &xen; 來安裝 FreeBSD。 如何在 µsoft.windows; 上以 Virtual PC 安裝 FreeBSD。 如何在虛擬機器對 FreeBSD 系統作性能調校,以取得最佳效能。 在開始閱讀這章之前,您需要︰ 瞭解 &unix; 及 FreeBSD 相關基本概念 ()。 知道如何安裝 FreeBSD()。 知道如何設定網路()。 知道如何以 ports/packages 來安裝應用程式 ()。 安裝 FreeBSD 為 Guest OS MacOS 上的 Parallels &mac; 版的 Parallels Desktop 乃是可用於搭配 &intel; CPU 以及 &macos; 10.4.6 以上的 &apple; &mac; 電腦的商業軟體。 FreeBSD 是其有完整支援的 guest OS 之一。 在 &macos; X 裝好 Parallels 後, 必須針對所欲安裝的 guest OS 來作相關的虛擬機器設定。 在 Parallels/&macos; X 上安裝 FreeBSD 在 &macos; X/Parallels 上安裝 FreeBSD 的第一步是新增虛擬機器。 如下所示,在提示視窗內請將 Guest OS Type 勾選為 FreeBSD 並依據自身需求來規劃硬碟容量跟記憶體的分配。 對大多數在 Parallels 使用的情況而言,大約 4GB 硬碟以及 512MB RAM 就夠用了: 接下來,選擇網路種類以及網路卡: 最後,儲存設定檔就完成設定了: 在 FreeBSD 虛擬機器新增後,就可以繼續以其安裝 FreeBSD。 安裝方面,比較好的作法是使用官方的 FreeBSD 光碟或者從官方 FTP 站下載 ISO image 檔。 若您的 &mac; 本機已經有該 ISO 檔, 或者 &mac; 的光碟機內有放安裝片,那麼就可以在 FreeBSD 的 Parallels 視窗右下角按下光碟片圖示。 接著會出現一個視窗,可以把虛擬機器內的光碟機設定到該 ISO 檔, 或者是實體光碟機。 設好光碟片來源之後,就可以按下重開機圖示以重開 FreeBSD 虛擬機器。 Parallels 會以特殊 BIOS 開機,並與普通的 BIOS 一樣會先檢查是否有光碟機。 此時,它就會找到 FreeBSD 安裝片,並開始在 內所介紹到的 sysinstall 安裝過程。 這時候也可順便裝 X11,但先不要進行相關設定。 完成安裝過程之後,就可以重開剛裝的 FreeBSD 虛擬機器。 在 &macos; X/Parallels 上設定 FreeBSD 把 FreeBSD 成功裝到 &macos; X 的 Parallels 之後,還需要作一些設定步驟, 以便將虛擬機器內的 FreeBSD 最佳化。 設定 boot loader 參數 最重要的步驟乃是藉由調降 來降低 Parallels 環境內 FreeBSD 的 CPU 佔用率。 可以在 /boot/loader.conf 內加上下列設定即可: kern.hz=100 若不作這設定,那麼光是 idle 狀態的 FreeBSD - Parallels guest OS + (Parallels guest OS) 就會在僅單一處理器的 &imac; 上佔了大約 15% 的 CPU 佔用率。 作上述修改之後,佔用率就會降至大約 5%。 設定新的 kernel 設定檔 可以放心把所有 SCSI、FireWire、USB 相關設備都移除。 Parallels 有提供 &man.ed.4; 的虛擬網卡,因此,除了 &man.ed.4; 以及 &man.miibus.4; 以外的其他網路卡也都可以從 kernel 中移除。 設定網路 可以替虛擬機器簡單用 DHCP 來設定與 &mac; 相同的 LAN 網路環境,只要在 /etc/rc.conf 內加上 ifconfig_ed0="DHCP" 即可完成。 其他進階的網路設定方式,請參考 Fukang Chen (Loader) Contributed by 在 Linux 透過 &xen; 跑 FreeBSD &xen; hypervisor 乃是開放源碼的 paravirtualization 產品,並由商業公司(XenSource)提供支援。 Guest OS 通常被稱為 domU domains,而 host OS 則是被稱為 dom0。 在 Linux 上建立 FreeBSD 虛擬機器的第一步,則是安裝 Linux dom0 的 &xen;。 在本例中, host OS 乃是 Slackware Linux。 在 Linux dom0 上設定 &xen; 3 從 XenSource 網站下載 &xen; 3.0 下載 xen-3.0.4_1-src.tgz 解壓縮 &prompt.root; cd xen-3.0.4_1-src &prompt.root; KERNELS="linux-2.6-xen0 linux-2.6-xenU" make world &prompt.root; make install 為 dom0 重新編譯 kernel: &prompt.root; cd xen-3.0.4_1-src/linux-2.6.16.33-xen0 &prompt.root; make menuconfig &prompt.root; make &prompt.root; make install 舊版的 &xen; 可能需要用 make ARCH=xen menuconfig 增加選項到 Grub 的 menu.lst 選單 修改 /boot/grub/menu.lst 加上下列設定: title Xen-3.0.4 root (hd0,0) kernel /boot/xen-3.0.4-1.gz dom0_mem=262144 module /boot/vmlinuz-2.6.16.33-xen0 root=/dev/hda1 ro 重開機並進入 &xen; 首先,修改 /etc/xen/xend-config.sxp 加上下列設定: (network-script 'network-bridge netdev=eth0') 接下來,就可以啟動 &xen; &prompt.root; /etc/init.d/xend start &prompt.root; /etc/init.d/xendomains start 現在 dom0 已經開始運作: &prompt.root; xm list Name ID Mem VCPUs State Time(s) Domain-0 0 256 1 r----- 54452.9 FreeBSD 7-CURRENT domU http://www.fsmware.com/ 下載搭配 &xen; 3.0 的 FreeBSD domU kernel 相關檔案 kernel-current mdroot-7.0.bz2 xmexample1.bsd xmexample1.bsd 設定檔放到 /etc/xen/,並修改 kernel 及 disk image 相關位置。 以下是示範的例子: kernel = "/opt/kernel-current" memory = 256 name = "freebsd" vif = [ '' ] disk = [ 'file:/opt/mdroot-7.0,hda1,w' ] #on_crash = 'preserve' extra = "boot_verbose" extra += ",boot_single" extra += ",kern.hz=100" extra += ",vfs.root.mountfrom=ufs:/dev/xbd769a" 其中 mdroot-7.0.bz2 檔要記得解壓縮之。 接下來,要修改 kernel-current 設定檔的 __xen_guest 小節,並加上 &xen; 3.0.3 所需的 VIRT_BASE: &prompt.root; objcopy kernel-current -R __xen_guest &prompt.root; perl -e 'print "LOADER=generic,GUEST_OS=freebsd,GUEST_VER=7.0,XEN_VER=xen-3.0,BSD_SYMTAB,VIRT_BASE=0xC0000000\x00"' > tmp &prompt.root; objcopy kernel-current --add-section __xen_guest=tmp &prompt.root; objdump -j __xen_guest -s kernel-current kernel-current: file format elf32-i386 Contents of section __xen_guest: 0000 4c4f4144 45523d67 656e6572 69632c47 LOADER=generic,G 0010 55455354 5f4f533d 66726565 6273642c UEST_OS=freebsd, 0020 47554553 545f5645 523d372e 302c5845 GUEST_VER=7.0,XE 0030 4e5f5645 523d7865 6e2d332e 302c4253 N_VER=xen-3.0,BS 0040 445f5359 4d544142 2c564952 545f4241 D_SYMTAB,VIRT_BA 0050 53453d30 78433030 30303030 3000 SE=0xC0000000. 現在可以新增並啟動 domU 囉: &prompt.root; xm create /etc/xen/xmexample1.bsd -c Using config file "/etc/xen/xmexample1.bsd". Started domain freebsd WARNING: loader(8) metadata is missing! Copyright (c) 1992-2006 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 7.0-CURRENT #113: Wed Jan 4 06:25:43 UTC 2006 kmacy@freebsd7.gateway.2wire.net:/usr/home/kmacy/p4/freebsd7_xen3/src/sys/i386-xen/compile/XENCONF WARNING: DIAGNOSTIC option enabled, expect reduced performance. Xen reported: 1796.927 MHz processor. Timecounter "ixen" frequency 1796927000 Hz quality 0 CPU: Intel(R) Pentium(R) 4 CPU 1.80GHz (1796.93-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0xf29 Stepping = 9 Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH, DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE> Features2=0x4400<CNTX-ID,<b14>> real memory = 265244672 (252 MB) avail memory = 255963136 (244 MB) xc0: <Xen Console> on motherboard cpu0 on motherboard Timecounters tick every 10.000 msec [XEN] Initialising virtual ethernet driver. xn0: Ethernet address: 00:16:3e:6b:de:3a [XEN] Trying to mount root from ufs:/dev/xbd769a WARNING: / was not properly dismounted Loading configuration files. No suitable dump device was found. Entropy harvesting: interrupts ethernet point_to_point kickstart. Starting file system checks: /dev/xbd769a: 18859 files, 140370 used, 113473 free (10769 frags, 12838 blocks, 4.2% fragmentation) Setting hostname: demo.freebsd.org. lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 inet 127.0.0.1 netmask 0xff000000 Additional routing options:. Mounting NFS file systems:. Starting syslogd. /etc/rc: WARNING: Dump device does not exist. Savecore not run. ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout Starting usbd. usb: Kernel module not available: No such file or directory Starting local daemons:. Updating motd. Starting sshd. Initial i386 initialization:. Additional ABI support: linux. Starting cron. Local package initialization:. Additional TCP options:. Starting background file system checks in 60 seconds. Sun Apr 1 02:11:43 UTC 2007 FreeBSD/i386 (demo.freebsd.org) (xc0) login: 現在 domU 應該可以跑 &os; 7.0-CURRENT kernel: &prompt.root; uname -a FreeBSD demo.freebsd.org 7.0-CURRENT FreeBSD 7.0-CURRENT #113: Wed Jan 4 06:25:43 UTC 2006 kmacy@freebsd7.gateway.2wire.net:/usr/home/kmacy/p4/freebsd7_xen3/src/sys/i386-xen/compile/XENCONF i386 接下來是設定 domU 的網路,&os; domU 會用代號為 xn0 的特殊網路卡: &prompt.root; ifconfig xn0 10.10.10.200 netmask 255.0.0.0 &prompt.root; ifconfig xn0: flags=843<UP,BROADCAST,RUNNING,SIMPLEX> mtu 1500 inet 10.10.10.200 netmask 0xff000000 broadcast 10.255.255.255 ether 00:16:3e:6b:de:3a lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 inet 127.0.0.1 netmask 0xff000000 在 dom0 Slackware 上應該會出現一些 &xen; 專用的網路卡: &prompt.root; ifconfig eth0 Link encap:Ethernet HWaddr 00:07:E9:A0:02:C2 inet addr:10.10.10.130 Bcast:0.0.0.0 Mask:255.0.0.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:815 errors:0 dropped:0 overruns:0 frame:0 TX packets:1400 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:204857 (200.0 KiB) TX bytes:129915 (126.8 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:99 errors:0 dropped:0 overruns:0 frame:0 TX packets:99 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:9744 (9.5 KiB) TX bytes:9744 (9.5 KiB) peth0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 RX packets:1853349 errors:0 dropped:0 overruns:0 frame:0 TX packets:952923 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2432115831 (2.2 GiB) TX bytes:86528526 (82.5 MiB) Base address:0xc000 Memory:ef020000-ef040000 vif0.1 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 RX packets:1400 errors:0 dropped:0 overruns:0 frame:0 TX packets:815 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:129915 (126.8 KiB) TX bytes:204857 (200.0 KiB) vif1.0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 RX packets:3 errors:0 dropped:0 overruns:0 frame:0 TX packets:2 errors:0 dropped:157 overruns:0 carrier:0 collisions:0 txqueuelen:1 RX bytes:140 (140.0 b) TX bytes:158 (158.0 b) xenbr1 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 RX packets:4 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:112 (112.0 b) TX bytes:0 (0.0 b) &prompt.root; brctl show bridge name bridge id STP enabled interfaces xenbr1 8000.feffffffffff no vif0.1 peth0 vif1.0 &windows; 上的 Virtual PC Virtual PC 是 µsoft; 的 &windows; 軟體產品,可以免費下載使用。 相關系統需求,請參閱 system requirements 說明。 在 µsoft.windows; 裝完 Virtual PC 之後, 必須針對所欲安裝的虛擬機器來作相關設定。 在 Virtual PC/µsoft.windows; 上安裝 FreeBSD 在 µsoft.windows;/Virtual PC 上安裝 FreeBSD 的第一步是新增虛擬機器。 如下所示, 在提示視窗內請選擇 Create a virtual machine 然後在 Operating system 處選 Other 並依據自身需求來規劃硬碟容量跟記憶體的分配。 對大多數在 Virtual PC 使用 FreeBSD 的情況而言,大約 4GB 硬碟空間以及 512MB RAM 就夠用了: 儲存設定檔: 接下來選剛剛所新增的 FreeBSD 虛擬機器,並按下 Settings,以設定網路種類以及網路卡: 在 FreeBSD 虛擬機器新增後,就可以繼續以其安裝 FreeBSD。 安裝方面,比較好的作法是使用官方的 FreeBSD 光碟或者從官方 FTP 站下載 ISO image 檔。 若您的 &windows; 檔案系統內已經有該 ISO 檔, 或者光碟機內有放安裝片,那麼就可以在 FreeBSD 虛擬機器上連按兩下,以開始啟動。 接著在 Virtual PC 視窗內按 CD 再按 Capture ISO Image... 。 接著會出現一個視窗,可以把虛擬機器內的光碟機設定到該 ISO 檔, 或者是實體光碟機。 設好光碟片來源之後,就可以重開機,也就是先按 Action 再按 Reset 即可。 Virtual PC 會以特殊 BIOS 開機,並與普通 BIOS 一樣會先檢查是否有光碟機。 此時,它就會找到 FreeBSD 安裝片,並開始在 內所介紹到的 sysinstall 安裝過程。 這時候也可順便裝 X11,但先不要進行相關設定。 完成安裝之後,記得把光碟片退出或者 ISO image 退片。 最後, 把裝好的 FreeBSD 虛擬機器重開機即可。 調整 µsoft.windows;/Virtual PC 上的 FreeBSD 在 µsoft.windows; 上以 Virtual PC 裝好 FreeBSD 後,還需要作一些設定步驟, 以便將虛擬機器內的 FreeBSD 最佳化。 設定 boot loader 參數 最重要的步驟乃是藉由調降 來降低 Virtual PC 環境內 FreeBSD 的 CPU 佔用率。 可以在 /boot/loader.conf 內加上下列設定即可: kern.hz=100 若不作這設定,那麼光是 idle 狀態的 FreeBSD Virtual PC guest OS 就會在僅單一處理器的電腦上佔了大約 40% 的 CPU 佔用率。 作上述修改之後,佔用率就會降至大約 3%。 設定新的 kernel 設定檔 可以放心把所有 SCSI、FireWire、USB 相關設備都移除。 Virtual PC 有提供 &man.de.4; 的虛擬網卡,因此除了 &man.de.4; 以及 &man.miibus.4; 以外的其他網路卡也都可以從 kernel 中移除。 設定網路 可以替虛擬機器簡單用 DHCP 來設定與 host(µsoft.windows;) 相同的 LAN 網路環境,只要在 /etc/rc.conf 加上 ifconfig_de0="DHCP" 即可完成。 其他進階的網路設定方式,請參閱 - 在 &windows;/&mac;/&linux; 上的 VMware + 在 MacOS 上的 VMware - 本節尚未撰寫。 + &mac; 上的 VMWare Fusion 乃是可用於搭配 + &intel; CPU 以及 &macos; 10.4.9 之 &apple; &mac; 以上的 &apple; &mac; + 電腦之商業軟體。 FreeBSD 是其有完整支援的 guest OS 之一。 在 &macos; + X 上裝完 VMWare Fusion 之後, + 必須針對所欲安裝的 guest OS 來作相關的虛擬機器設定。 + + 在 VMWare/&macos; X 上安裝 FreeBSD + + 首先執行 VMWare Fusion,而其 Virtual Machine Library + 也會隨之一併載入,這時請按 "New" 來建立 VM(虛擬機器): + + + + + + + + 接著會有 New Virtual Machine Assistant 來協助您建立 VM,請按 + Continue 繼續: + + + + + + + + Operating System 選 + Other,以及 Version + 處請選擇是否要 + FreeBSD 或 + FreeBSD 64-bit,這部份請依自身需求是否有要 + 64-bit 支援而定: + + + + + + + + 接著設定 VM image 檔要存到何處,以及決定名稱: + + + + + + + + 決定該 VM 的虛擬硬碟要用多大: + + + + + + + + 選擇要裝 VM 的方式為何,要用 ISO image 檔或者光碟機: + + + + + + + + 按 Finish 以完畢,接著就會啟動該 VM: + + + + + + + + 接著就照以往安裝 &os; 的方式來裝,若不熟的話請參閱 + + + + + + + + + 裝完之後,就可以修改一些 VM 設定,像是記憶體大小: + + + VM 在運作之時,不能修改 VM 的硬體設定。 + + + + + + + + + 調整 VM 的 CPU 數量: + + + + + + + + 光碟機狀態,通常不再需要用的時候,就可以切斷其與 VM 的連接: + + + + + + + + 最後要改的則是 VM 的網路設定。 若除了 Host OS 之外的機器也能連到 + VM,那麼請選 Connect directly to the physical network + (Bridged),否則就選 Share the host's + internet connection (NAT) 即可讓 VM 連到 Internet, + 但外面則無法連入該 VM。 + + + + + + + + 改完上述設定之後,就可以啟動新裝妥的 FreeBSD 虛擬機器。 + + + 調整 &macos; X/VMWare 上的 FreeBSD + + 把 FreeBSD 成功裝到 &macos; X 的 VMWare + 之後,還需要作一些設定步驟, 以便將虛擬機器內的 FreeBSD 最佳化。 + + + + 設定 boot loader 參數 + + 最重要的步驟乃是藉由調降 來降低 + VMWare 環境內 FreeBSD 的 CPU 佔用率。 + 可以在 /boot/loader.conf + 內加上下列設定即可: + + kern.hz=100 + + 若不作這設定,那麼光是 idle 狀態的 FreeBSD + (VMWare guest OS) 就會在僅單一處理器的 + &imac; 上佔了大約 15% 的 CPU 佔用率。 作上述修改之後, + 佔用率就會降至大約 5%。 + + + + 設定新的 kernel 設定檔 + + 可以放心把所有 FireWire、USB 相關設備都移除。 + VMWare 有提供 &man.em.4; 的虛擬網卡, + 因此,除了 &man.em.4; 以及 &man.miibus.4; 以外的其他網路卡, + 也都可以從 kernel 中移除。 + + + + 設定網路 + + 可以替虛擬機器簡單用 DHCP 來設定與 host &mac; 相同的 LAN + 網路環境,只要在 /etc/rc.conf 加上 + ifconfig_em0="DHCP" 即可。 + 其他進階的網路設定方式,請參考 + + + 以 FreeBSD 為 Host OS 目前,尚未有任何虛擬機器軟體有官方支援 FreeBSD 作為 host OS, 但蠻多人都有在用舊版 VMware 所提供的這項功能。 不過,目前已經有人為讓 &xen; 能夠以 FreeBSD 為 host OS 為目標,而進行相關工作。