HOWTO Mount a CD-ROM into a Local Zone on Solaris 10
Imagine a situation when you need to install software from a CD-ROM into a local zone on Solaris 10. As you may know the CD-ROM physical device is not available in the local zone and therefore you can not access the media directly. Of course you can copy the files from the CD-ROM to a local zone directly from within a global zone as the most straightforward solution, but that would be a little inefficient and cumbersome. A cleaner and faster way to accomplish this is by using the loopback filesystem in Solaris and loopback mount the CD-ROM mount point from within the global zone into local zone. For instance assuming we have a local zone called testzone installed under /opt/zones/testzone we can take the following actions accomplish the task:
1. Assuming vold is running in the global zone and the media is in the CD-ROM/DVD-ROM, vold should mount the media under /cdrom directory. For instance I have a JES4 DVD in my machine:
# ls /cdrom2. Let's create a mount point in the local zone for the CD-ROM:
cdrom0 jes_05q4_dvd
# mkdir /opt/zones/testzone/root/mnt/cdrom3. Now we can loopback mount the CD-ROM/DVD into the local zone and install the software as if the media was available directly to the local zone:
# mount -F lofs /cdrom/cdrom0 /opt/zones/testzone/root/mnt/cdromDone!
# zlogin testzone
# zlogin full
[Connected to zone 'testzone' pts/9]
Last login: Thu Mar 15 11:09:39 on pts/9
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
#
# ls /mnt/cdrom
Copyright License README Solaris_sparc Solaris_x86
#

