I'll try to help you to use OpenSolaris without the headache ! I am an ex Sun Microsystems and please don't hesitate to contact me for any matter having a link with OpenSolaris... No stupid questions... It is a very nice OS ! Don't miss it !

Monday, March 23, 2009

swap space on Solaris 10(in Virtual Box)

Can we define space using a zfs pool... Seems not...

I did the exercise but swap -a did not accept to add the files I created with the command mkfile !
It was a little bit trickier that I thought because I was using a Solaris 10 created in Virtual Box.
  • Create a new disk in Virtual Box and assign the disk to you Virtual Machine
  • Boot the Virtual Machine(Solaris) and execute a reboot -- -r
reboot -- -r is necessary to make Solaris see the new disk.
  • use format and fdisk to partition the new disk
-bash-3.00# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c0d0
/pci@0,0/pci-ide@1,1/ide@0/cmdk@0,0
1. c0d1
/pci@0,0/pci-ide@1,1/ide@0/cmdk@1,0
2. c1d1
/pci@0,0/pci-ide@1,1/ide@1/cmdk@1,0
Specify disk (enter its number): 2
selecting c1d1
NO Alt slice
No defect list found
[disk formatted, no defect list found]
Warning: Current Disk has mounted partitions.
/dev/dsk/c1d1s0 is currently mounted on /extraswap. Please see umount(1M).


FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
fdisk - run the fdisk program
repair - repair a defective sector
show - translate a disk address
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
volname - set 8-character volume name
! - execute , then return
quit
format> pa


PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
! - execute , then return
quit
partition> pr
Current partition table (original):
Total disk sectors available: 8372158 + 16384 (reserved sectors)

Part Tag Flag First Sector Size Last Sector
0 usr wm 256 3.99GB 8372158
1 unassigned wm 0 0 0
2 unassigned wm 0 0 0
3 unassigned wm 0 0 0
4 unassigned wm 0 0 0
5 unassigned wm 0 0 0
6 unassigned wm 0 0 0
8 reserved wm 8372159 8.00MB 8388542

partition>
^D
  • use newfs to create the filesystem
-bash-3.00# newfs /dev/dsk/c1d1s0
newfs: construct a new file system /dev/rdsk/c1d1s0: (y/n)? y
Warning: 2370 sector(s) in last cylinder unallocated
/dev/rdsk/c1d1s0: 8371902 sectors in 1363 cylinders of 48 tracks, 128 sectors
4087.8MB in 86 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
7472672, 7571104, 7669536, 7767968, 7866400, 7964832, 8063264, 8161696,
8260128, 8358560
  • mount the filesystem
first create a directory where to mount then mount

-bash-3.00# mkdir extraswap
-bash-3.00# mount -F ufs /dev/dsk/c1d1s0 /extraswap/
  • create the swap space and add it to the system
-bash-3.00# mkfile 1g swap1
-bash-3.00# mkfile 1g swap2
-bash-3.00# mkfile 1g swap3
-bash-3.00# mkfile 900m swap4
-bash-3.00# swap -a /extraswap/swap2
-bash-3.00# swap -a /extraswap/swap2
-bash-3.00# swap -a /extraswap/swap3
-bash-3.00# swap -a /extraswap/swap4
-bash-3.00# swap -l
swapfile dev swaplo blocks free
/dev/zvol/dsk/rpool/swap 181,1 8 1048568 1048568
/extraswap/swap1 - 8 2097144 2097144
/extraswap/swap2 - 8 2097144 2097144
/extraswap/swap3 - 8 2097144 2097144
/extraswap/swap4 - 8 1843192 1843192

That's all !

-Rudy-




Thursday, March 19, 2009

Moving Virtual Box Machines

This document does not show the way to make a Virtual Box configuration see a Virtual Box machine that was copied from somewhere. What I propose(temporarily) is to rename the current Virtual Box directory(.VirtualBox) and then copy the files from the Virtual Box machines where you did the copy. At this time, why would you run 2 machines at the same time ?
  • make a copy of the current Virtual Box
  • start Virtual Box
accept the license agreement
enter your name and email address
  • exit VirtualBox
  • copy the files
rudy@catalogne:/tank/VirtualBox$ ls
compreg.dat HardDisks Machines VirtualBox.xml xpti.dat

tank is a ZFS filesystem on an external disk(from where the VM was copied).

rudy@catalogne:/tank/VirtualBox$ cp -pr HardDisks /export/home/rudy/.VirtualBox
rudy@catalogne:/tank/VirtualBox$ cp -pr Machines /export/home/rudy/.VirtualBox
rudy@catalogne:/tank/VirtualBox$ cp -pr VirtualBox.xml /export/home/rudy/.VirtualBox/
  • start Virtual Box(new VM copied)
rudy@catalogne:~$ VirtualBox

That should make the trick ! You have now access to the VM that was moved !


-Rudy-

Virtual Box on OpenSolaris 2008.11

  • Download the software archive
In my case it is OpenSolaris. But there are others OS supported !
Download
  • Extract the software
% gunzip VirtualBox-2.1.4-42893-SunOS.tar.gz
% tar xvf VirtualBox-2.1.4-42893-SunOS.tar
  • Install Virtual Box
2 packages have to be installed

VirtualBoxKern-2.1.4-SunOS-r42893.pkg
VirtualBox-2.1.4-SunOS-r42893.pkg

as root

# pkgadd -d VirtualBoxKern-2.1.4-SunOS-r42893.pkg
# pkgadd -d VirtualBox-2.1.4-SunOS-r42893.pkg

  • start Virtual Box
rudy@catalogne:~$ which VirtualBox
/usr/bin/VirtualBox

In foreground

rudy@catalogne:~$ VirtualBox


-Rudy-

Wednesday, March 18, 2009

cacao - the basics

Cacao stands for Common Agent Container, i.e. a Container for deploying OSNode agents that help managing the OSNode. You can view it as collection of MBeans available to manage something on this OSNode.

-bash-3.00# cacaoadm stop

-bash-3.00# cacaoadm status
default instance is DISABLED at system startup.
default instance is not running.

-bash-3.00# cacaoadm start

-bash-3.00# cacaoadm status
default instance is DISABLED at system startup.
Smf monitoring process:
7130
7131
Uptime: 0 day(s), 0:0

Sun Java Web Console - the basics

-bash-3.00# smcwebserver stop
Shutting down Sun Java(TM) Web Console Version 3.1 ...
The console is stopped

-bash-3.00# smcwebserver start
Starting Sun Java(TM) Web Console Version 3.1 ...
The console is running

-bash-3.00# netstat -an | grep -i listen | grep 6789
*.6789 *.* 0 0 49152 0 LISTEN

https://hostname.domainname:6789 to open the Web Console.

-Rudy-

X11 and DISPLAY and ssh

Ever wonder what is the way to run xclock from a zone in Solaris 10 running in Virtual Box on OpenSolaris 2008.11 ?

Very easy !

I am logged in OpenSolaris 2008.11 as rudy

rudy:~$ id
uid=101(rudy) gid=10(staff) groups=10(staff)

rudy:~$ echo $DISPLAY
:0.0

rudy:~$ uname -a
SunOS XXX 5.11 snv_101b i86pc i386 i86pc Solaris

OpenSolaris
GZ : 192.168.1.100

VB : Solaris 10
GZ : 192.168.1.102 sol10.vegworld.org
LZ : 192.168.1.104 europortal.vegworld.org

Enter the LZ on Solaris 10(VB) as ANY server. There is no difference !

rudy@dhcp-ebru03-133-226:~$ ssh -l root -X europortal.vegworld.org
Password: XXX
Last login: Wed Mar 18 11:58:26 2009 from 192.168.1.100
Sun Microsystems Inc. SunOS 5.10 Generic January 2005

-bash-3.00# hostname
europortal

-bash-3.00# uname -a
SunOS europortal 5.10 Generic_137138-09 i86pc i386 i86pc

-bash-3.00# echo $DISPLAY
localhost:10.0

-bash-3.00# /usr/openwin/bin/xclock


Don't try to assign DISPLAY yourself... It should work but it is a lot better through ssl -X ! I was "rudy" on OpenSolaris and I do a "ssh" as the user I want on Solaris... I mean don't enter Solaris as rudy(ssh -l rudy) and the su - and assign DISPLAY... You enter the host from a terminal where X11 is working and ssh will initialize your DISPLAY... The fact that it is a LZ does not have any influence here, it is the same logic...

-Rudy-

Thursday, March 12, 2009

Flash on OpenSolaris 2008.11


  • download the plugin from the Adobe website


Valid as of March 12, 2009
http://www.adobe.com/shockwave/download/alternates

flash_player_10_solaris_x86.tar.bz2



  • uncompress and untar


rudy@catalogne:~/Download$ bunzip2 flash_player_10_solaris_x86.tar.bz2
rudy@catalogne:~/Download$ tar xvf flash_player_10_solaris_x86.tar
flash_player_10_solaris_r22_87_x86/
flash_player_10_solaris_r22_87_x86/libflashplayer.so



  • make the direcoty plugin(if it is the first time installation)

mkdir -p $HOME/.mozilla/plugins

for example
mkdir -p /export/home/rudy/.mozilla/plugins




  • copy the library

rudy@catalogne:~/Download$ cp flash_player_10_solaris_r22_87_x86/libflashplayer.so $HOME/.mozilla/plugins/

for example
rudy@catalogne:~/Download$ cp flash_player_10_solaris_r22_87_x86/libflashplayer.so /export/home/rudy/.mozilla/plugins/




  • restart Firefox


That's all for today !

-Rudy-