# zonecfg -z wanglei
wanglei: 没有配置此类区域
使用 'create' 开始配置新区域。
zonecfg:wanglei> create
zonecfg:wanglei> set zonepath=/home/wanglei
zonecfg:wanglei> add net
zonecfg:wanglei:net> set physical=bcme0
zonecfg:wanglei:net> set address=210.10.3.19/24
zonecfg:wanglei:net> end
zonecfg:wanglei> verify
zonecfg:wanglei> commit
zonecfg:wanglei>
3425 终止
# zonecfg -z wanglei info zonepath
zonepath: /home/wanglei
# zoneadm list -cv
ID NAME STATUS PATH
0 global running /
- wanglei configured /home/wanglei
# zoneadm -z wanglei install
Preparing to install zone <wanglei>.
Creating list of files to copy from the global zone.
Copying <2469> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1053> packages on the zone.
Initialized <1053> packages on zone.
Zone <wanglei> is initialized.
Installation of <1> packages was skipped.
nstallation of these packages generated warnings: <SUNWswmt SUNWcfcl SUNWTiff SUNWjpg SUNWcacaort SUNWgnome-base-libs-share SUNWgnome-config-share SUNWgnome-vfs-share SUNWgnome-libs-share SUNWgnome-panel-share SUNWdoc SUNWxorg-mesa SUNWpostgr-docs SUNWgnome-help-viewer-share SUNWgnome-terminal-share........
...................................................................
The file </home/wanglei/root/var/sadm/system/logs/install_log> contains a log of the zone installation.
#
以上是安装Zone的整个过程!
#############################################################################################
#############################################################################################
以下是配置Zone的整个过程!
# zoneadm -z wanglei boot
# zoneadm list -cv
ID NAME STATUS PATH
0 global running /
1 wanglei running /home/wanglei
# zlogin -C wanglei
[已连接到区域 'wanglei' 控制台]
Select a Language
0. English
1. Simplified Chinese
Please make a choice (0 - 1), or press h or ? for help:1
......
Select a Locale
0. Simplified Chinese EUC
1. Simplified Chinese EUC
2. Simplified Chinese GB18030
3. Simplified Chinese GBK
4. Simplified Chinese GBK
5. Simplified Chinese UTF-8
6. Simplified Chinese UTF-8
7. Go Back to Previous Screen
Please make a choice (0 - 7), or press h or ? for help: 0
......
你正在使用什么类型的终端?
1) ANSI 标准 CRT
2) DEC VT52
3) DEC VT100
4) Heathkit 19
5) Lear Siegler ADM31
6) PC 控制台
7) Sun 命令工具
8) Sun 工作站
9) Televideo 910
10) Televideo 925
11) Wyse 型号 50
12) X 终端仿真器(xterms)
13) CDE 终端仿真器(dtterm)
14) 其它
输入选择的数字并按回车键:3
Creating new rsa public/private host key pair
Creating new dsr public/private host key pair
......
─ Host Name for bcme0:1 ────────────────────────────────────────────────────────
Enter the host name which identifies this system on the network. The name
must be unique within your domain; creating a duplicate host name will cause
problems on the network after you install Solaris.
A host name must have at least one character; it can contain letters,
digits, and minus signs (-).
Host name for bcme0:1 wanglei
──────────────────────────────────────────────────────────────────────────────── F2_Continue F6_Help
─ Confirm Information for bcme0:1 ──────────────────────────────────────────────
> Confirm the following information. If it is correct, press F2;
to change any information, press F4.
Host name: wanglei
──────────────────────────────────────────────────────────────────────────────── F2_Continue F4_Change F6_Help
─ Configure Security Policy: ───────────────────────────────────────────────────
Specify Yes if the system will use the Kerberos security mechanism.
Specify No if this system will use standard UNIX security.
Configure Kerberos Security
───────────────────────────
[ ] Yes
[X] No
──────────────────────────────────────────────────────────────────────────────── F2_Continue F6_Help
─ Confirm Information ──────────────────────────────────────────────────────────
> Confirm the following information. If it is correct, press F2;
to change any information, press F4.
Configure Kerberos Security: No
──────────────────────────────────────────────────────────────────────────────── F2_Continue F4_Change F6_Help
─ Name Service ─────────────────────────────────────────────────────────────────
On this screen you must provide name service information. Select the name
service that will be used by this system, or None if your system will either
not use a name service at all, or if it will use a name service not listed
here.
> To make a selection, use the arrow keys to highlight the option
and press Return to mark it [X].
Name service
────────────
[ ] NIS+
[ ] NIS
[ ] DNS
[ ] LDAP
[X] None
──────────────────────────────────────────────────────────────────────────────── F2_Continue F6_Help
─ Confirm Information ──────────────────────────────────────────────────────────
> Confirm the following information. If it is correct, press F2;
to change any information, press F4.
Name service: None
──────────────────────────────────────────────────────────────────────────────── F2_Continue F4_Change F6_Help
─ Time Zone ────────────────────────────────────────────────────────────────────
On this screen you must specify your default time zone. You can specify a
time zone in three ways: select one of the continents or oceans from the
list, select other - offset from GMT, or other - specify time zone file.
> To make a selection, use the arrow keys to highlight the option and
press Return to mark it [X].
Continents and Oceans
──────────────────────────────────
- [ ] Africa
│ [ ] Americas
│ [ ] Antarctica
│ [ ] Arctic Ocean
│ [X] Asia
│ [ ] Atlantic Ocean
│ [ ] Australia
│ [ ] Europe
v [ ] Indian Ocean
──────────────────────────────────────────────────────────────────────────────── F2_Continue F6_Help
─ Country or Region ────────────────────────────────────────────────────────────
> To make a selection, use the arrow keys to highlight the option and
press Return to mark it [X].
Countries and Regions
────────────────────────
- [ ] Afghanistan
│ [ ] Armenia
│ [ ] Azerbaijan
│ [ ] Bahrain
│ [ ] Bangladesh
│ [ ] Bhutan
│ [ ] Brunei
│ [ ] Cambodia
│ [X] China
│ [ ] Cyprus
│ [ ] East Timor
│ [ ] Georgia
v [ ] Hong Kong
──────────────────────────────────────────────────────────────────────────────── F2_Continue F6_Help
─ Confirm Information ──────────────────────────────────────────────────────────
> Confirm the following information. If it is correct, press F2;
to change any information, press F4.
Time zone: PRC
──────────────────────────────────────────────────────────────────────────────── F2_Continue F4_Change F6_Help
─ Root Password ────────────────────────────────────────────────────────────────
Please enter the root password for this system.
The root password may contain alphanumeric and special characters. For
security, the password will not be displayed on the screen as you type it.
> If you do not want a root password, leave both entries blank.
Root password: ****
Root password: ****
> Press F2 to go to the next screen.
──────────────────────────────────────────────────────────────────────────────── F2_Continue F6_Help
System identification is completed.
This system is configured with NFS version 4, which uses a domain
name that is automatically derived from the system's name services.
The derived domain name is sufficient for most configurations. In a
few cases, mounts that cross different domains might cause files to
be owned by "nobody" due to the lack of a common domain name.
Do you need to override the system's default NFS version 4 domain
name (yes/no) ? [no] :
rebooting system due to change(s) in /etc/default/init
[NOTICE: Zone rebooting]
SunOS Release 5.10 Version Generic_118855-14 64-bit
Copyright 1983-2005 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Hostname: wanglei
wanglei console login: Sep 13 11:20:30 wanglei sendmail[7720]: My unqualified host name (wanglei) unknown; sleeping for retry
wanglei console login: root
Password:
Sep 13 11:21:07 wanglei login: ROOT LOGIN /dev/console
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
# pwd
/
# ifconfig -a
lo0:1: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
bcme0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 210.10.3.19 netmask ffffff00 broadcast 210.10.3.255
# prtdiag -v
prtdiag 仅能在全局区域中运行
# prtconf
System Configuration: Sun Microsystems i86pc
Memory size: 2040 Megabytes
System Peripherals (Software Nodes):
prtconf: devinfo facility not available
#
# halt
Sep 13 11:23:07 wanglei halt: halted by root
Sep 13 11:23:07 wanglei syslogd: going down on signal 15
[NOTICE: Zone halted]
# zoneadm list -cv
ID NAME STATUS PATH
0 global running /
- wanglei installed /home/wanglei
#
# zoneadm -z wanglei boot
# zlogin -C wanglei
[已连接到区域 'wanglei' 控制台]
wanglei console login:
###########################################################################
###########################################################################
###########################################################################
子命令:
help
打印用法消息。
boot [-s]
激活(引导)指定的区域。 -s 标志可用于
引导区域到单用户状态。
halt
停止指定的区域,跳过关机脚本并删除
该区域的运行时资源。
ready
准备区域以运行应用程序,但不启动
区域中的任何用户进程。
reboot
重新启动区域 (相当于停止/引导序列)。
如果未激活区域,则会失败。
list [-cipv]
如果指出,则列出当前区域或特定的区域。缺省情况下,
列出 所有正在运行的区域,但可以使用
-i 选项列出所有已安装的区域或使用 -c 选项
列出所有已配置 的区域。与一般的 -z <区域> 选项一起使用时,仅列出
指定的区域,但列出时不管该区域的状态,且不允许 -i 和 -c
选项。-v 选项可用于显示冗余
信息:区域名称、ID、当前状态、根目录和选项。
-p 选项可以用于请求机器可分析的输出。-v
和 -p 选项是互斥的。如果既未使用 -v 选项,也未使用 -p 选项,
则仅列出区域名称。
verify
请检查以确保可以在机器上确切地
实例化配置:物理网络接口存在等。
install
将配置安装到系统上。
uninstall [-F]
从系统中卸载配置。-F 标志可用于
强制执行此操作。
#
###########################################################################
###########################################################################
###########################################################################
针对以上的基本zone配置,如下是增加配置(或修改配置):
# hostname
wl (globale zone,并且在全局zone下配置zone:wanglei)
# zoneadm list -cv
ID NAME STATUS PATH
0 global running /
- wanglei running /home/wanglei
# zoneadm -z wanglei halt (停掉当前运行的zone:wanglei)
# zoneadm list -cv
ID NAME STATUS PATH
0 global running /
- wanglei installing /home/wanglei
# zonecfg wanglei (当前zone:wanglei已经install,所以对于有些配置是无法生效的)
使用: zonecfg help
zonecfg -z <zone> (交互式)
zonecfg -z <zone> <command>
zonecfg -z <zone> -f <command-file>
# zonecfg -z wanglei
zonecfg:wanglei> info
zonepath: /home/wanglei
autoboot: false
pool:
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
net:
address: 210.10.3.19/24
physical: bcme0
zonecfg:wanglei>remove inherit-pkg-dir dir=/lib
区域 wanglei 已安装;不允许 remove inherit-pkg-dir
zonecfg:wanglei> exit(或者^D退出)
#########################################################################
# zoneadm list -cv
ID NAME STATUS PATH
0 global running /
- wanglei running /home/wanglei
# zoneadm -z wanglei uninstall
zoneadm: zone 'wanglei': uninstall 操作对 running 区域无效。
# zoneadm -z wanglei halt (停掉当前运行的zone:wanglei)
# zoneadm list -cv
ID NAME STATUS PATH
0 global running /
- wanglei installing /home/wanglei
#zonecfg -z wanglei uninstall (删除当前已安装的zone:wanglei)
您确定要 uninstall 区域 wanglei (y/[n])? y
#########################################################################
# zoneadm list -cv (当前的zone:wanglei为已配置状态)
ID NAME STATUS PATH
0 global running /
- wanglei configured /home/wanglei
# zonecfg -z wanglei (重新配置zone:wanglei)
zonecfg:wanglei> info
zonepath: /home/wanglei
autoboot: false
pool:
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
net:
address: 210.10.3.19/24
physical: bcme0
。。。。。。。。。。。。。。。。。。(修改配置参数inherit)
zonecfg:wanglei> remove inherit-pkg-dir dir=/lib
zonecfg:wanglei> remove inherit-pkg-dir dir=/platform
zonecfg:wanglei> remove inherit-pkg-dir dir=/sbin
zonecfg:wanglei> remove inherit-pkg-dir dir=/usr
zonecfg:wanglei> info
zonepath: /home/wanglei
autoboot: false
pool:
net:
address: 210.10.3.19/24
physical: bcme0
zonecfg:wanglei> verify
zonecfg:wanglei> commit
。。。。。。。。。。。。。。。。。。(修改配置参数autoboot)
zonecfg:wanglei> set autoboot=true
zonecfg:wanglei> info
zonepath: /home/wanglei
autoboot: true
pool:
net:
address: 210.10.3.19/24
physical: bcme0
zonecfg:wanglei> verify
zonecfg:wanglei> commit
。。。。。。。。。。。。。。。。。。(增加配置参数fs_文件系统)
zonecfg:wanglei> add fs
zonecfg:wanglei:fs> set dir=/usr/local
zonecfg:wanglei:fs> set dir=/home
zonecfg:wanglei:fs> set special=/opt/local
zonecfg:wanglei:fs> set type=lofs
zonecfg:wanglei:fs> end
zonecfg:wanglei> verify
zonecfg:wanglei> commit
zonecfg:wanglei>
#
###########################################################################
###########################################################################
###########################################################################
配置完成后,install新配置完成的zone:wanglei
# hostname
wl
# zoneadm -z wanglei install
Preparing to install zone <wanglei>.
Creating list of files to copy from the global zone.
Copying <127891> files to the zone.
此copying过程大概经过了20分钟,之后是初始化(Initialize过程)
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1053> packages on the zone.
Initialized <1053> packages on zone.
Zone <wanglei> is initialized.
Installation of these packages generated errors: <SUNWgnome-a11y-libs-share>
Installation of <1> packages was skipped.
Installation of these packages generated warnings: <TOOLSbpci TOOLSemu TOOLSi810 TOOLSva686 TOOLSva8233>
The file </home/wanglei/root/var/sadm/system/logs/install_log> contains a log of the zone installation.
#
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
在安装过程中用wl全局域察看当前的zone:wanglei状态是:
# zoneadm list -cv
ID NAME STATUS PATH
0 global running /
- wanglei incomplete /home/wanglei
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
安装完成zone:wanglei后,第一次登录该zone时仍然需要配置安装概要信息,此处略。。。