Xsun desktop within Solaris zones
Friday, April 15th, 2005Well, tonight I got my desktop working in a Solaris zone (Sun java desktop, using Xsun). My system is a ultra 60 with a creator-3d card.
Below is how I got it working:
First of all, on the host operating system (global zone) run ‘/usr/dt/bin/dtconfig -d’ to disable the main X server, and reboot the machine.
Next, i made a zone:
# zonecfg -z bluto-desktop
bluto-desktop: No such zone configured
Use ‘create’ to begin configuring a new zone.
zonecfg:bluto-desktop> create
zonecfg:bluto-desktop> set zonepath=/opt/zones/bluto-desktop # the path to the zone
zonecfg:bluto-desktop> add net
zonecfg:bluto-desktop:net> set physical=hme0 # my network
zonecfg:bluto-desktop:net> set address=192.168.0.12
zonecfg:bluto-desktop:net> end
zonecfg:bluto-desktop> add device
zonecfg:bluto-desktop:device> set match=/dev/mouse # mouse device
zonecfg:bluto-desktop:device> end
zonecfg:bluto-desktop> add device
zonecfg:bluto-desktop:device> set match=/dev/kbd # keyboard device
zonecfg:bluto-desktop:device> end
zonecfg:bluto-desktop> add device
zonecfg:bluto-desktop:device> set match=/dev/pm # power managment
zonecfg:bluto-desktop:device> end
zonecfg:bluto-desktop> add device
zonecfg:bluto-desktop:device> set match=/dev/winlock # window lock device
zonecfg:bluto-desktop:device> end
zonecfg:bluto-desktop> add device
zonecfg:bluto-desktop:device> set match=/dev/sound/0 # sound
zonecfg:bluto-desktop:device> end
zonecfg:bluto-desktop> add device
zonecfg:bluto-desktop:device> set match=/dev/sound/0ctl # sound control
zonecfg:bluto-desktop:device> end
zonecfg:bluto-desktop> add device
zonecfg:bluto-desktop:device> set match=/dev/fbs/ffb0 # framebuffer
zonecfg:bluto-desktop:device> end
zonecfg:bluto-desktop> verify
zonecfg:bluto-desktop> commit
zonecfg:bluto-desktop> exit
Next, I install the zone
# zoneadm -z bluto-desktop install
Preparing to install zone
Creating list of files to copy from the global zone.
Copying <2583> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <911> packages on the zone.
Initialized <911> packages on zone.
Zone
The file contains a log of the zone installation.
Boot and setup the Solaris install in the zone.
# zoneadm -z bluto-desktop boot
Once the initial system setup is done, halt the zone.
# zoneadm -z bluto-desktop halt or init 0 in the zone.
Now, we need to make some “fake” devices to make the X server and sound work.
# cd /opt/zones/bluto-desktop/dev
# ln -s fbs/ffb0 fb
# ln -s sound/0 audio
# ln -s audioctl sound/0ctl
Now, boot the zone back up
# zoneadm -z bluto-desktop boot
Enable DT:
zone# /usr/dt/bin/dtconfig -e;init 6
Once the zone is reboored, you should get the dtgreet.
The devices above need to point to the /dev entry that points to the device. This is because the Solaris zone tool sets the /dev/whatever entry in the zone to whatever major and minor number the /device entry is for the device on the global zone. Confused? Good. All this meens is that if in the zonecfg config, a match=whatever varible is set to something that is a sym link to another file in /dev. it is not going to work.
This breaks things like /dev/fb, which are kind of needed for Xsun and DT to work. To fix this, go to your zonepath/dev directory and make some links to resolve this:
Issues:
Issue number one is that once you start and stop the desktop zone, the text console of the system is no longer usable. I think this is because the keyboard device is being grabbed, even tho the tty device has it.
All in all, this seems to work somewhat good. Often I have had to reboot my workstation because of an Xwindows issue or something. With this, I can just reboot the zone, which is much quicker. It will also allow me to limit memory, and CPU utilization.