2009-03-04

Zones in OpenSolaris

This is how I create my zones in OpenSolaris. I've only got two cores so I don't dedicate any of them to my new zones.

First, allocate some disk to the zone. In my case I have an "overzised" system disk so I'll use that one.

# zfs create -o mountpoint=/zones rpool/zones
# mkdir /zones/mailz
# chmod go-rx /zones/mailz

# pooladm -e
# pooladm -s
# zonecfg -z mailz
zonecfg:mailz> create
zonecfg:mailz> set zonepath=/zones/mailz
zonecfg:mailz> set autoboot=true (if you want that)
zonecfg:mailz> add net
zonecfg:mailz:net> set address=192.168.0.21/24 (or whatever you local segment is)
zonecfg:mailz:net> set physical=rge0 (or whatever your NIC is called)
zonecfg:mailz:net> set defrouter=192.168.0.1 (or what it is)
zonecfg:mailz:net> end
zonecfg:mailz> verify
zonecfg:mailz> commit
zonecfg:mailz> exit

# zoneadm -z mailz install
# zoneadm -z mailz boot
# zoneadm list -v
# zlogin -e\# -C mailz (I'm using # as my escape char due to the swedish keyboard layout)

6
Host name for rge0:1 mailz
Host name: mailz
Configure Kerberos Security [N]
Name service [X] DNS
Domain name: YOURDOMAIN.BOGUS
DNS Server Addresses: Server's IP address: 192.168.1.20 (your local nameserver if you have one)
Server's IP address: 123.45.678.90 (your ISP nameserver)
Server's IP address: 123.45.678.91 (your ISP nameserver)
Enter new name service information?
[X] No
NFSv4 Domain Configuration:
[X] Use the NFSv4 domain derived by the system
Time Zone:
[X] Europe

[X] Sweden
Root Password: 123456789 (fake!)

Log in as root
If you want to fix the time-zone
# shutdown -i 5 -g 5
#. (My escape char is #, se above)
# zoneadm -z mailz boot
# zlogin -e\# -C mailz

Now you've got a default installation! Next time I'm going to show you how to install a DNS-server on your local network.

1 comment:

  1. Good information! Here is some information about setting up a Linux zone:
    http://trisk.acm.jhu.edu/etch-zone.html

    ReplyDelete