How to create zones in Solaris
Posted: May 20, 2010 at 10:58 pm | Tags: solaris, Unix, virtualization, zonesHere is a quick tutorial for creating zones in Solaris 10. First, you have to create 2 partitions on the disk of your system. Partitions 3 and 4 has to be set to 1 Gb. Use the format utility.
With newfs you can create UFS filesystem on the partitions 3 and 4:
newfs /dev/rdsk/c0d0s3
newfs /dev/rdsk/c0d0s4
Now you have to create a directory /zones/myzone. You have to mount /zones/myzone. Edit /etc/vfstab:
/dev/dsk/c0d0s3 /dev/rdsk/c0d0s3 /zones/myzone ufs 2 yes -
Now, use the mount command:
mount /zones/myzone
chmod 700 /zones/myzone
Here is how to create the zone:
zonecfg -z myzone
create
set zonepath=/zones/myzone
add fs
set dir=/mnt_myzone
set special=/dev/dsk/c0d0s4
set raw=/dev/rdsk/c0d0s4
set type=ufs
end
add net
set physical=nge0
set address=10.2.1.123
end
verify
commit
info
exit
After that, you can see you zone:
zoneadm list -iv
Now you have to install the new zone:
zoneadm -z myzone install
After install, you can boot the zone:
zoneadm -z myzone boot
To login on the new zone, use the folowing command:
zlogin -C myzone
























