Common Unix Virtualization Technologies include hard partitions and soft partitions.
In the hard partition, HP corresponds to NPAR, IBM corresponds to lpar, and Sun corresponds to the dynamic system domain;
In the soft partition, HP corresponds to vpar, IBM corresponds to micro-parition, and Sun corresponds to N1 Grid iner or zone.
Here is a specific instance of creating a zone in solaris10 on x86.
The environment of solaris10 is as follows:
Bash-3.00 # uname-
SunOS sol10x865.10GenericI86pc i386 i86pc
Bash-3.00 # hostname
Sol10x86
Bash-3.00 # ifconfig-
Lo0: Flags = 2001000849 <up, loopback, running, multicast, IPv4, virtual> MTU 8232 Index 1
Inet 127.0.0.1 netmask ff000000
Lo0: 1: Flags = 2001000849 <up, loopback, running, multicast, IPv4, virtual> MTU 8232 Index 1
Zone zone01
Inet 127.0.0.1 netmask ff000000
Pcn0: Flags = 1000843 <up, broadcast, running, multicast, IPv4> MTU 1500 index 2
Inet10.11.11.42Netmask ffffff00 broadcast 10.11.11.255
Ether 0: C: 29: DB: e4: 86
First, create the directory used by the zone:
Bash-3.00 # mkdir/zone
Bash-3.00 # cd/zone
Bash-3.00 # mkdir zone01
Bash-3.00 # chmod-r 700 zone01
Configuration information for creating a new zone:
Bash-3.00 # zonecfg-Z zone01
Zone01: no such zone configured
Use 'create' to begin creating a new zone.
Zonecfg: zone01> Create
Zonecfg: zone01> set zonepath =/zone/zone01
Zonecfg: zone01> Add net
Zonecfg: zone01: Net> set address = 10.11.11.94
Zonecfg: zone01: Net> set physical = pcn0
Zonecfg: zone01: Net> end
Zonecfg: zone01> verify
Zonecfg: zone01> commit
Zonecfg: zone01> exit
Install zone:
Bash-3.00 # zoneadm-Z zone01 install
Preparing to install zone <zone01>.
Creating list of files to copy from the global zone.
Copying <2932> files to the zone.
Initializing zone Product Registry.
Determining zone package initialization order.
Preparing to initialize <1360> packages on the zone.
Initialized <1360> packages on zone.
Zone <zone01> is initialized.
Installation of these packages generated Warnings: <sunwvtsr>
The file </zone/zone01/root/var/SADM/system/logs/install_log> contains a log
The zone installation.
Start zone:
Bash-3.00 # zoneadm-Z zone01 boot
Zlogin: Zone 'zone1 'Unknown
Login zone:
Bash-3.00 # zlogin-C zone01
[Connected to zone 'zone01' console]
44/947/950/966/99
99/99
You must specify the language, region, terminal type, hostname, and root password when logging on.
It is relatively simple. Some configuration information is as follows:
Select a language
0. English
1. French
2. German
3. Italian
4. Japan
5. Korean
6. Simplified Chinese
7. Spanish
8. Swedish
9. Traditional Chinese
Please make a choice (0-9), or press h or? For help: 0
Select a locale
0. English (c-7-bit ASCII)
1. Albania (ISO8859-2)
2. Australia (ISO8859-1)
3. Belgium-Flemish (ISO8859-1)
4. Belgium-Flemish (ISO8859-15-Euro)
5. Belgium-Flemish (UTF-8)
6. Bosnia (ISO8859-2)
7. ISO8859-1 (Brazil)
8. UTF-8 (Brazil)
9. Bulgaria (ISO8859-5)
10. Canada-English (ISO8859-1)
11. Catalan, Spain (ISO8859-1)
12. Catalan, Spain (ISO8859-15-Euro)
13. Croatia (ISO8859-2)
14. Czech Republic (ISO8859-2)
15. Czech Republic (UTF-8 + Euro)
16. Czech Republic (UTF-8)
17. Denmark (ISO8859-1)
18. Denmark (ISO8859-15-Euro)
Press return to show more choices.
Please make a choice (0-67), or press h or? For help: 0
What type of terminal are you using?
1) ANSI standard CRT
2) DEC vt52
3) DEC VT100
4) heathkit 19
5) Lear siegler adm31
6) PC Console
7) sun command tool
8) SUN workstation
9) televideo 910
(10) televideo 925
11) Wyse model 50
12) X terminal emulator (xterms)
13) CDE terminal emulator (dtterm)
14) Other
(Here I chose 3) DEC VT100. It may be because the source code is opened from the command line. After CDE is selected at first, the text of the configuration information following the result cannot be displayed, so you have to try again. 3 is selected)
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 invocations. In
Few cases, mounts that cross different domains might cause files
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]:
For more information about how the NFS Version 4 default domain
Name is derived and its impact, refer to the man pages for NFS (4)
And nfsmapid (1 m), and the system administration guide: Network
Services.
(Here, the system restarts automatically and a logon prompt is displayed)
Rebooting system due to change (s) in/etc/default/init
[Notice: Zone rebooting]
SunOS release 5.10 Version generic 32-bit
Copyright 1983-2005 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Hostname: zone01
Zone01 console login: Root
Password:
Nov 21 15:22:57 zone01 login: Root Login/dev/console
Sun Microsystems Inc. SunOS 5.10 generic January 2005
# Ifconfig-
Lo0: 1: Flags = 2001000849 <up, loopback, running, multicast, IPv4, virtual> MTU 8232 Index 1
Inet 127.0.0.1 netmask ff000000
Pcn0: 1: Flags = 1000843 <up, broadcast, running, multicast, IPv4> MTU 1500 index 2
Inet 10.11.11.94 netmask ffffff00 broadcast 10.11.11.255
# Hostname
Zone01
In this way, you can log in and use it independently as a Solaris 10 virtual machine.
Ping 10.11.11.94 from outside.
Note:
When creating the zone directory, you must set the group and world permissions to-; otherwise, an error will be reported during install:
Bash-3.00 # zoneadm-Z zone01 install
/Zone/zone01 must not be group readable.
/Zone/zone01 must not be group executable.
/Zone/zone01 must not be world readable.
/Zone/zone01 must not be world executable.
Cocould not verify zonepath/zone/zone01 because of the above errors.
Zoneadm: Zone zone01 failed to verify
Set chmod to 700
Bash-3.00 # chmod 700-r/zone/zone01
References:
Http://bbs.chinaunix.net/archiver/tid-459817.html
Http://bbs.163jsp.com/posts/list/236.html