[PR]¡“ú‚ÌÆ­°½‚Í
¢Infoseek ÓÊÞ²Ù£

English | Japanese Author: Ken Kato
Mail: chitchat<DOT>vdk<AT>gmail<DOT>com

VM Back


VM Back > Solaris Tips & Tricks

Solaris Tips & Tricks

Introduction

Here you'll find some information about building Solaris 8 guest on VMware, *NOT* a through step-by-step instruction. They are just some tips and tricks and gotcha's to avoid while installing and configuring a Solaris guest.

For more detailed install instructions, visit Jan Exss's very useful page (http://www.jan.exss.de/vmware/solaris/en_index.html). There you'll find step-by-step instruction for installing Solaris on VMware, Custom JumpStart (automatic installation) floppy images and even skeletal virtual machines to build Solaris environment on VMware.

For those who are familiar with Solaris, Jürgen Keil's "Resource for Solaris" (http://www.tools.de/solaris/) is highly recommended. Although there is no VMware specific information, you'll find several interesting stuff -- such as an audio driver for Ensoniq 1371 (sound device emulated by VMware 4.x), PS/2 wheelmouse driver, and the latest XFree86 video driver port.

NOTE: This article was originally written for Solaris 8 guest on VMware Workstation 3.x. I do think some information apply also to Solaris 9 and VMware Workstation 4.x, but I haven't investigated yet.

TOP

Choosing VMware Version

VMware Workstation 3.0 or later is recommended. Although it is possible to use Solaris guest on VMware version 2, it is not preferred for the following reasons:
TOP

Creating a Virtual Machine

TOP

Installing the Operating System

TOP

Enabling DMA for Hard Disk Drives (Solaris 8)

Without DMA enabled, disk access in the virtual machine is extra-slow. Although enabling DMA does not make it lightning-fast, it certainly makes things tolerable. DMA is disabled by default on Solaris 8 so you have to manually enable it.
  1. Boot the VM.
  2. On "SunOS Secondary Boot" screen, press <ESC> key when prompted.
  3. On "Solaris Device Configuration Assistant" screen, press <F2> to proceed.
  4. On "Identified Devices" screen, press <F2> to proceed.
  5. On "Boot Solaris" screen, press <F4> to start "Boot Tasks".
  6. On "Boot Tasks" screen, choose "View/Edit Property Settings" and press <F2> to proceed.
  7. On "View/Edit Property Settings" screen, search an item named "ata-dma-enabled" and change its value to "1".
  8. Press <F2> then <F3> to go back to "Boot Solaris" screen.
  9. Choose "DISK" then press <F2> to continue booting the operating system.
TOP

Getting Better Screen Resolution

Since VMWare SVGA driver is not officially provided, you have to use a third party SVGA driver to get reasonable screen resolution: Solaris with standard VGA screen (screen shots #1, #2) is dull at the best, and almost offending at the worst.

You can download such SVGA driver packages from several places:

My personal recommendation is Jürgen's package. Not only because it's based on the latest XFree86 release, he seems to know quite a lot about Solaris and XFree86 stuff -- he even has a port of XFree86 development snapshot.

If, unfortunately, these driver packages fail to work for you, there are still a few ways to have good screen resolution:

TOP

Running VMware-Tools on Solaris (Solaris 8, 9)

With lxrun, you can run certain version of VMware-Tools for Linux (part of it, actually) in Solaris.
With vmware-toolbox running, you can:

With vmware-guestd running, you can: Virtual Disk Shrinking is not available, but there is a workaround.

Only the following combination of lxrun build / linux environment / vmware tools version works for me:

FYI, the table below shows the combinations I've tried so far:
Solaris version lxrun build linux environment from result
Solaris 8 02/02 lxrun 0.9.6pre1-sun1,
built on Nov 28 2001 at 02:35:11
(Solaris 8 companion CD 02/02)
redhat 6.2 (zoot-i386.iso) OK
lxrun 0.9.6pre1 compiled from
the original source with gcc 2.95.3 on Solaris 8
redhat 6.2 (zoot-i386.iso) OK
Solaris 9 12/03 lxrun 0.9.6pre1-sun1,
built on Nov 28 2001 at 02:35:11
(Solaris 8 companion CD 02/02)
redhat 6.2 (zoot-i386.iso) OK
redhat 7.3 (valhalla-i386-disk1.iso) NG
lxrun 0.9.6pre1-sun2,
built on Sep 6 2003 at 12:00:52
(Solaris 9 companion CD 12/03)
redhat 6.2 (zoot-i386.iso) NG
redhat 7.3 (valhalla-i386-disk1.iso) NG
lxrun 0.9.6pre1 compiled from
the original source with gcc 2.95.3 on Solaris 9
redhat 6.2 (zoot-i386.iso) OK

To get necessary VMware-Tools binaries:

  1. Get a VMware WS 3.x or 4.0.x for Linux packge (tar.gz file)
    If you already have one, then that's fine. If you don't, then things get a bit complicated since they no longer offer those old versions for download at VMware site. You could still find those files (for example by googling "VMware-workstation-4.0.5-6030.tar.gz") in the web, though it's kind of dubious and I'm not promoting it.
  2. Extract "linux.iso" file from VMware tar.gz file
  3. Extract "vmware-linux-tools.tar.gz" file (or similar name) from linux.iso.
    The iso file should contain only one tar.gz file anyway.
  4. Extract "vmware-guestd" and "vmware-toolbox" files from vmware-linux-tools.tar.gz
PLEASE do not ask me how to extract files from tar.gz or iso files, or to send you a copy of VMware-Tools binaries.

To run VMware-Tools for Linux in Solaris guest:

  1. Install and configure lxrun according to the lxrun document.
    If you don't know how, or you are too lazy to do it yourself, you could download minimal lxrun environment.
  2. Extract vmware-linux-tools.tar.gz from linux.iso. (linux.iso should be found in VMware program directory in the host.)
  3. Extract vmware-toolbox and/or vmware-guestd from vmware-linux-tools.tar.gz.
  4. Place these files in any directory under the lxrun Linux root (eg. /linux/usr/local/bin)
  5. Start vmware-guestd and/or vmware-toolbox with lxrun:
    	lxrun /linux/usr/local/bin/vmware-guestd
    	lxrun /linux/usr/local/bin/vmware-toolbox

To start vmware-guestd automatically at the system startup:

  1. Create a script file /etc/init.d/vmware-guestd
    (Modify paths in the script according to your setup).
    	#!/sbin/sh
    	# vmware-guestd
    	LINUX_ROOT=/lx-env
    	LINUX_PATHMAP=/lx-env/PATHMAP
    	export LINUX_ROOT LINUX_PATHMAP
    
    	case "$1" in
    	'start')
    		cd $LINUX_ROOT
    		$LINUX_ROOT/lxrun $LINUX_ROOT/bin/vmware-guestd --background $LINUX_ROOT/vmware-guestd.pid
    		;;
    	'stop')
    		/usr/bin/kill -TERM `cat $LINUX_ROOT/vmware-guestd.pid`
    		;;
    	*)
    		echo "Usage: $0 { start | stop }"
    		;;
    	esac
    	exit 0
  2. Create a link /etc/rc2.d/S100vmware-guestd to this script.
    The link can be either a symbolic link or a hard link.

To start vmware-toolbox at the X session startup:

  1. Copy /usr/dt/config/Xconfig and /usr/dt/config/Xsetup to /etc/dt/config directory if you have not done so already. (You can edit files in /usr/dt/config directory, but the recommended way is to edit copied files in /etc/dt/config directory and keep original files unmodified.)
  2. Uncomment the following line in Xconfig file:
    	Dtlogin*grabServer:        False
    Otherwise, the login manager gets exclusive hold of the screen and vmware-toolbox cannot run.
  3. Tell the login manager to reread the modified Xconfig file:
    	/usr/dt/bin/dtconfig -reset
  4. Add the following lines at the end of Xsetup file (change paths according to your setup)
    	# launch vmware-toolbox
    	$XDIR/xhost localhost
    	LINUX_ROOT=/lx-env
    	LINUX_PATHMAP=/lx-env/PATHMAP
    	export LINUX_ROOT LINUX_PATHMAP
    	$LINUX_ROOT/lxrun $LINUX_ROOT/bin/vmware-toolbox -geometry -10-76 --minimize &
    -geometry option and --minimize option is not necessary, but I prefer it this way.
    Note: the Solaris' login manager may cover the entire screen with its background. In that case vmware-toolbox will be hidden behind and won't be visible until you login to the system.
NOTE: Running an old version of vmware-tools on recent VMware platforms causes "Your VMware Tools is out of date" message in VMware status area. You could eliminate it by sending an "tools.set.version" backdoor RPC command from inside the guest after you have started the vmware-guestd, for example by using my "vmw" backdoor access program:
	# vmw rpc "tools.set.version 6433"
The number 6433 used here is the version number used by VMware-Tools shipped with VMware WS 5.5.2 build 29772. There seems to be no harm in specifying a greater number (say, 10000).
TOP

Shrinking Virtual Disks

  1. Make sure that the virtual disk is used in persistent mode.
    In VMware WS 3.x, configure the virtual disk as "Persistent".
    In VMware WS 4.x and later, remove snapshot or configure the virtual disk as "Independent Persistent".
  2. Find the amount of unused space in the virtual disk.
    	# df -b /
  3. Create a file filled with 0x00 as large as the unused space.
    	# dd if=/dev/zero of=/bigfile bs=1024 count=<n>
    <n> is the value returned by the df command in step #1.
    You don't have to worry if you encounter a disk full error.
  4. Delete the file created in step #2, for the file itself is not really necessary.
    The point is to fill all unused sectors with 0x00.
    	# rm /bigfile
  5. Shutdown and power off the VM, then perform "Defragment" operation from the Configuration Editor. You will get a "disk size mismatch" warning the next time you start the VM, but it seems to be harmless.
NOTE: My "vmshrink" program does all these for you ;-)
TOP

Idling the CPU Properly (Solaris 8)

Older releases of Solaris 8 (earlier than 2001/07 or 2001/10; I'm not sure exactly which release) does not idle the CPU when the operating system is idle. Instead it enters into a tight loop and consumes the host's precious CPU time. Apply the Kernel Update Patch 108529-09 (or later. 108529-18 is the latest as of Feb. 14, 2003).
Actually, I think applying the whole Recommended Patch Cluster (something like Windows' Service Packs) is a very good idea, although it takes more than a few hours. The patches are available from the SunSolve site.

TOP

Miscellaneous Tips

TOP

PS. I would really appreciate it if you would let me know if you have found anything wrong with the English in this page. I'm still learning.