Solaris 11 虚拟机
Solaris 11 虚拟机
Solaris 11 主机IP 172.22.139.222
root@solaris:~# ifconfig -a
lo0: flags=2001000849
inet 127.0.0.1 netmask ff000000
net0: flags=100001000843
inet 172.22.139.222 netmask fffffc00 broadcast 172.22.139.255
ether 0:50:56:b7:2a:cd
lo0: flags=2002000849
inet6 ::1/128
net0: flags=120002004841
inet6 fe80::250:56ff:feb7:2acd/10
ether 0:50:56:b7:2a:cd
root@solaris:~# zfs create -o mountpoint=/zones rpool/zones
root@solaris:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
lake 156K 976M 32K /lake
lake/data 31K 976M 31K /lake/data
rpool 8.76G 8.59G 4.33M /rpool
rpool/ROOT 6.08G 8.59G 31K none
rpool/ROOT/solaris 6.08G 8.59G 5.56G /
rpool/ROOT/solaris/var 404M 8.59G 238M /var
rpool/VARSHARE 109M 8.59G 67.8M /var/share
rpool/VARSHARE/kvol 27.8M 8.59G 31K /var/share/kvol
rpool/VARSHARE/kvol/dump_summary 1.22M 8.59G 1.02M -
rpool/VARSHARE/kvol/ereports 10.2M 8.59G 10.0M -
rpool/VARSHARE/kvol/kernel_log 16.2M 8.59G 16.0M -
rpool/VARSHARE/pkg 99K 8.59G 32K /var/share/pkg
rpool/VARSHARE/pkg/repositories 49K 8.59G 31K /var/share/pkg/repositories
rpool/VARSHARE/sstore 13.3M 8.59G 8.17M /var/share/sstore/repo
rpool/VARSHARE/tmp 75K 8.59G 50K /var/tmp
rpool/VARSHARE/zones 49K 8.59G 31K /system/zones
rpool/dump 1.50G 8.59G 1.50G -
rpool/export 66.7M 8.59G 32K /export
rpool/export/home 66.6M 8.59G 35K /export/home
rpool/export/home/hm 66.5M 8.59G 66.3M /export/home/hm
rpool/export/home/user1 35K 8.59G 35K /export/home/user1
rpool/export/home/user2 35.5K 8.59G 35.5K /export/home/user2
rpool/swap 1.00G 8.59G 1.00G -
rpool/zones 31K 8.59G 31K /zones
root@solaris:~# dladm create-vnic -l net0 vnic1
root@solaris:~# dladm show-phys
LINK MEDIA STATE SPEED DUPLEX DEVICE
net0 Ethernet up 1000 full e1000g0
root@solaris:~# dladm show-vnic
LINK OVER SPEED MACADDRESS MACADDRTYPE IDS
vnic1 net0 1000 2:8:20:73:ef:26 random VID:0
root@solaris:~# zonecfg -z zone111
Use 'create' to begin configuring a new zone.
zonecfg:zone111> create
create: Using system default template 'SYSdefault'
zonecfg:zone111> set zonepath=/zones/zone111
zonecfg:zone111> add net
zonecfg:zone111:net> set physical=vnic1
zonecfg:zone111:net> end
zonecfg:zone111> exit
root@solaris:~# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
- zone111 configured /zones/zone111 solaris excl
root@solaris:~# sysconfig create-profile -o /root/zone1-profile.xml
下面安装时间比较长
root@solaris:~# zoneadm -z zone111 install -c /root/zone1-profile.xml
The following ZFS file system(s) have been created:
rpool/zones/zone111
Progress being logged to /var/log/zones/zoneadm.20210826T141239Z.zone111.install
Image: Preparing at /zones/zone111/root.
Install Log: /system/volatile/install.22384/install_log
AI Manifest: /tmp/manifest.xml.vEFWid
SC Profile: /root/zone1-profile.xml
Zonename: zone111
Installation: Starting ...
Creating IPS image
Startup linked: 1/1 done
Installing packages from:
solaris
origin: PKGS FILES XFER (MB) SPEED
Completed 415/415 65388/65388 428.2/428.2 917k/s
PHASE ITEMS
Installing new actions 89400/89400
Updating package state database Done
Updating package cache 0/0
Updating image state Done
Creating fast lookup database Done
Updating package cache 2/2
Installation: Succeeded
done.
Done: Installation completed in 1246.734 seconds.
Next Steps: Boot the zone, then log into the zone console (zlogin -C)
to complete the configuration process.
Log saved in non-global zone as /zones/zone111/root/var/log/zones/zoneadm.20210826T141239Z.zone111.install
root@solaris:~# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
- zone111 installed /zones/zone111 solaris excl
root@solaris:~# zoneadm -z zone111 boot
root@solaris:~# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
1 zone111 running /zones/zone111 solaris excl
登录虚拟机zone111
root@solaris:~# zlogin -C zone111
[Connected to zone 'zone111' console]
Booting to milestone "all".
Hostname: solaris111
solaris111 console login: user
Password:1nature
Oracle Corporation SunOS 5.11 11.4 Aug 2018
user@solaris111:~$ ping 172.22.139.222
172.22.139.222 is alive
user@solaris111:~$ ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
vnic1/v4 static ok 172.22.139.238/22
lo0/v6 static ok ::1/128
vnic1/v6 addrconf ok fe80::8:20ff:fe73:ef26/10
user@solaris111:~$ svcs -a | grep apache
disabled 22:43:28 svc:/network/22:43:30 svc:/system/apache-stats-24:default
user@solaris111:~$ sudo svcadm enable apache24
user@solaris111:~$ svcs -a | grep apache
disabled 22:43:30 svc:/system/apache-stats-24:default
online 22:53:55 svc:/network/ cd /var/apache2/2.4/htdocs
user@solaris111:/var/apache2/2.4/htdocs$ sudo vi index.html
It works fine!
从Solaris 11 主机IP 172.22.139.222访问curl works fine!