OpenSolaris Four All !

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, January 4, 2010

Configuration of the Network through Files (DHCP)

Very easy... Please have a look to my previous post...

root@vsolutions:/export/home/rudy/bin# cat cleanNetwork
rm /etc/hostname.rge0
rm /etc/defaultrouter
cp /etc/nsswitch.default /etc/nsswitch.conf
rm /etc/dhcp.rge0
rm /etc/resolv.conf

root@vsolutions:/export/home/rudy/bin# cat enableDHCP
echo "...run as root..."
/export/home/rudy/bin/cleanNetwork
touch /etc/hostname.rge0
touch /etc/dhcp.rge0

root@vsolutions:/export/home/rudy/bin# ./enableDHCP
...run as root...
rm: cannot remove `/etc/dhcp.rge0': No such file or directory

There was no /etc/dhcp.rge0 and it ns normal that the script cleanNetwork did complain...

...Reboot the machine...

-Rudy-

Configuration of the Network through Files (ip is static)

I know I know you are all experts in the matter of networking...

But if you are new to OpenSolaris or would like some refreshment related to the way to access a network in OpenSolaris, this is the post you need !

1.The Network Interface Card

It is sometimes frustrating but you have to check if your network card is seen by OpenSolaris... You have also to retrieve the nic.

rudy@vsolutions:~$ ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
rge0: flags=1000843 mtu 1500 index 2
inet 164.15.227.15 netmask ffffff00 broadcast 164.15.227.255
lo0: flags=2002000849 mtu 8252 index 1
inet6 ::1/128

In the previous example, the network interface (or nic) is seen by OpenSolaris and an IP address was assigned.

You can retrieve a reference to the nic in /var/adm/messages.

rudy@vsolutions:~$ grep rge0 /var/adm/messages | more
Dec 23 05:42:04 opensolaris rge: [ID 801725 kern.info] NOTICE: rge0: Using MSI i
nterrupt type
Dec 23 05:42:04 opensolaris mac: [ID 469746 kern.info] NOTICE: rge0 registered
Dec 23 05:43:05 opensolaris in.routed[546]: [ID 749644 daemon.notice] rge0 has a
bad address 0.0.0.0
Dec 23 05:43:06 opensolaris mac: [ID 435574 kern.info] NOTICE: rge0 link up, 100
Mbps, full duplex

If you know the nic you can use prtconf...

rudy@vsolutions:~$ prtconf -v | grep rge0
dev_path=/pci@0,0/pci8086,2942@1c,1/pci1028,2c0@0:rge0
dev_link=/dev/rge0

2.The Configuration


You have to be root to execute the commands ! Please backup your files ! Or play with beadm !!!

root@vsolutions:~# cat /export/home/rudy/bin/enableNetwork
# change the following before rebooting your machine !
IP=XXX.XXX.XXX.XXX
GATEWAY=YYY.YYY.YYY.YYY
DNS=ZZZ.ZZZ.ZZZ.ZZZ

echo "...configuring the network network..."
echo "ip address : " $IP
echo "gateway : " $GATEWAY
echo "dns : " $DNS
echo "...using dns..."

echo "$IP" > /etc/hostname.rge0
echo "$GATEWAY" > /etc/defaultrouter
cp /etc/nsswitch.dns /etc/nsswitch.conf
echo "nameserver $DNS" > /etc/resolv.conf

Reboot and that should do the trick...

-Rudy-

Tuesday, December 29, 2009

Network Auto-Magic and nsswitch.conf

Rudy is back ! It is a long time that I didn't write a new blog entry... Here we go ! I left Sun Microsystems and started my own and little company named VSolutions... Little because there is only 1 person inside : me ! I am still a Sun fan and will continue to make your life easier...

I bought my own laptop, a Dell Vostro 1720 and installed OpenSolaris 2009.06.
I will create a specific entry on the Dell Vostro... But I reviewed on the Internet that some people used Network Auto-Magic to configure the network and they had problems with dns. Especially using a browser like Firefox.

If you configured dns, used nslookup and it does not work using Firefox it is because the file /etc/nsswitch.conf was not updated to use dns !

Do the following as root :

cp /etc/nsswitch.conf /etc/nsswitch.conf.orig
cp /etc/nsswitch.dns /etc/nsswitch.conf

Restart your browser (by example)

That should do the trick !

- Rudy -

Thursday, April 2, 2009

Adobe Reader on OpenSolaris !!!


Youpee !!!

Adobe Reader

root@catalogne:/export/home/rudy/Download# chmod +x AdbeRdr9.1.0-1_i486solaris_enu.bin
root@catalogne:/export/home/rudy/Download# ./AdbeRdr9.1.0-1_i486solaris_enu.bin

Extracting files, please wait. (This may take a while depending on the configuration of your machine)

This installation requires 171 MB of free disk space.

Enter installation directory for Adobe Reader 9.1.0 [/opt]
/opt

Installing platform independent files ... Done
Installing platform dependent files ... Done
Setting up libraries ... Done
Setting up desktop and menu icons ... Done
Setting up the browser plugin ... Done

-Rudy-

OpenSolaris 2008.11 - CUPS - Brother HL-2030 USB

I was a little bit disappointed... I plugged my laser printer Brother HL-2030 ( USB ) and enabled cups and played a little bit with the cups website but was not able to print anything as the printer goes offline ! S...

After reading several sources what have to be done :

  • enable cups
The package SUNWcups was not installed. Start the Package Manager and type cups in the "search field". I installed the 3 packages to be sure : SUNWcups, SUNWcups-libs and SUNWpycups(if I remember well this one was already installed).

Query the print service and cups is enabled.

root@catalogne:~# print-service -q
active print service: cups

If cups is not enabled :

print-services -s cups

  • enable your user to use the cups website(when authentication is required)
Getting Admin rights to modify CUPS settings

You have to be in the group "sys".

root@catalogne:~# cat /etc/group | grep sys:
sys::3:root,bin,adm,rudy

In this example, the user "rudy" is in the "sys" group.

"THIS IS TEMPORARY ! ROOT CANNOT AUTHENTICATE INTO CUPS"
please remove later your user from "sys" !
  • Access the cups website and create a new usb printer
example : http://localhost:631

This will create the necessary configuration for a test1 printer.
  • Modify the cups configuration
Add "FileDevice Yes" in cupsd.conf(backup the file before).

root@catalogne:/etc# more /etc/cups/cupsd.conf
#
# "$Id: cupsd.conf.in 7199 2008-01-08 00:16:30Z mike $"
#
# Sample configuration file for the Common UNIX Printing System (CUPS)
# scheduler. See "man cupsd.conf" for a complete description of this
# file.
#

# RUV
FileDevice Yes
...
...
...

Modify printers.conf

root@catalogne:~# more /etc/cups/printers.conf
# Printer configuration file for CUPS v1.3.7
# Written by cupsd on 2009-04-02 20:04

Info test1
Location test1
DeviceURI file://dev/printers/0
State Idle
StateTime 1238695489
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy stop-printer


From DeviceURI usb://Brother/HL-2030%20series
TO file://dev/printers/0
  • Access the cups website
example : http://localhost:631

Printers--->Print Test Page



Printed a test page !!!

That's all for today !

-Rudy-

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-