Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of my employer.
Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Friday, August 1, 2008

Samba configuration on Fedora Linux


Samba server implementation allows a linux system to interact with a windows network. At my home I have a router which connects my desktop PC where Windows XP professional is installed with ip address 192.168.1.100 and a laptop where Fedora 7 is installed with ip address 192.168.1.102.


Now configuration details for windows system :

1) I have an administrator account in my windows sytem with username "ritwikghoshal" and password (say) "windows".
2) Share directories / drives as you wish. I shared Netbeans project folder and "D" drive of my system. Just right click on the directory / drive and choose sharing.
3) Go to Control panel --> Network setup wizard --> click next --> I used the existing shared connection for the computer's internet access (i.e the recommended settings) --> Click next.
4) Computer Description : "desktop" --> Computer Name : "RITWIKD" --> Click Next.
5) Workgroup Name : "mygroup" --> Click Next --> Turn on file and printer sharing --> Next.
6) Just finish the wizard

Configuration details for Linux system :

1) Ping test : First I performed a ping test to check if windows system is reachable
[root@ritwik ~]# ping 192.168.1.100
PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.
64 bytes from 192.168.1.100: icmp_seq=1 ttl=128 time=10.2 ms
64 bytes from 192.168.1.100: icmp_seq=2 ttl=128 time=2.24 ms
64 bytes from 192.168.1.100: icmp_seq=3 ttl=128 time=2.06 ms
64 bytes from 192.168.1.100: icmp_seq=4 ttl=128 time=1.85 ms

--- 192.168.1.100 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 1.854/4.103/10.253/3.553 ms

2) Check whether Samba is installed :
[root@ritwik ~]# smbd -V
Version 3.0.28-0.fc7

If you don't get any o/p like "Version 3.0.28-0.fc7" that means you don't have samba installed. Then try to install it first.

3) set Firewall to consider samba as trusted service :
System -> Administration -> Firewall and SElinux
Now check samba in Firewall option's trusted services.

4) Service Configuration :Start "smb" services
System -> Administration -> server settings -> services
Start smb service.

5) Samba Server Configuration :
System -> Administration -> samba

I. Server settings : Preferences -> Server settings
Here workgroup name would be same with windows' workgroup name i.e "mygroup". (windows config : step 5).

II. Samba Users : Preferences -> Samba users -> Add user
windows' username : it would be same with the username of your windows system , mine was "ritwikghoshal" (windows config : step 1).
setup a password , mine was "fedora".

III. Add share : add a directory , give a sharename , set necessary permissions . Description field is optional. I shared three directories from my home directory : software, study and NetBeans project folder.

6) Restart samba service :
System -> Administration -> server settings -> services
Restart smb service.

Access windows' share from Fedora 7 :

After following the abovesaid steps I checked the Network directory.It contained 4 icons : "RITWIK" , "ritwik's public files on ritwik" , "SFTP File Transfer on ritwik" , "Windows Network".
"RITWIK" : contained shared files of fedora (study, software , nbproject dir etc.)
"ritwik's public files on ritwik" : contained nothing
"SFTP File Transfer on ritwik" : contained root directory.
"Windows Network" : contained 2 icons , 'mshome' & 'mygroup'.
'mshome' had 'RITWIKD' where I found all windows' shared files.
'mygroup' contained same 'RITWIK' directory.


Access Fedora's share from windows :
Go to start -> Run -> open : \\192.168.1.102
Hit the return key and a browser window will display all shared files of Fedora system.

So... you are done !!!

You may also like to use commands than GUI , in that case ..
Configure IPTABLES for firewall issue
start / restart smb service by using commnds like :
/etc/rc.d/init.d/smb start
/etc/rc.d/init.d/smb restart
Edit /etc/samba/smb.conf and /etc/samba/smbusers to configure samba server.
I have used the following command to mount windows' "E" directory to my fedora home, in a directory named "WinShare".
[root@ritwik ~]# mount -t cifs -o username=ritwik,password=fedora,ip=192.168.1.100 //Ritwikd/E /home/ritwik/WinShare
.. and the following one to unmount :
[root@ritwik ~]# umount /home/ritwik/WinShare

Thursday, July 31, 2008

Wine on Solaris and Linux


Wine -- the one and probably the only tool for Solaris, Linux (& Unix too) to execute a *.exe file. Actually , "Wine is an Open Source implementation of the Windows API on top of X, OpenGL, and Unix." Wine is available for solaris , bsd unix and various linux distros ( Redhat, Fedora, ubuntu, debian... n more), Check out the full list and get wine now !!

** I think wine installation as root will never create any problem to the system , but running wine as root may give windows viruses access to the system. So it's wise to be a bit careful while working with wine.

I tried wine on various solaris distributions like Solaris 10, SXDE (Solaris Express Developer Edition) 9/07 , SXDE 1/08 , OpenSolaris 2008.05 etc. and found 3 different ways of wine installation.

I) Build from source : Probably the most native way , but worked for me on SXDE 1/08.
What I did to install wine in my system is the following :

1) Download wine from here. Mine version was wine-1.1.0 , it was a *.tar.bz2 file.
2) Extract files using gui tool.
3) copy the wine directory to /opt, and navigate to that directory.
#cp -r /export/home/ritwik/Desktop/wine1.1.0 /opt
#cd /opt
#cd wine1.1.0
4) Add /usr/ccs/bin and /usr/sfw/bin to the path.
#PATH=$PATH:/usr/ccs/bin:/usr/sfw/bin
5) perform "#./configure" . During that process I came to know that in my system some development files were missing :

#./configure

--------------------- many lines omitted ----------------------------------
configure: libXxf86vm development files not found, XFree86 Vidmode won't besupported.
configure: libxrandr development files not found, XRandr won't be supported.
configure: libsane development files not found, scanners won't be supported.
configure: liblcms development files not found, Color Management won't be supported.
configure: libldap (OpenLDAP) development files not found, LDAP won't be supported.
configure: libcapi20 development files not found, ISDN won't be supported.
configure: libcups development files not found, CUPS won't be supported.

configure: Finished. Do 'make depend && make' to compile Wine.

6) Then I tried gmake , it was completed with some warnings like :

regsvr.c:633: warning: visibility attribute not supported in this configuration; ignored
regsvr.c:633: warning: visibility attribute not supported in this configuration; ignored
regsvr.c:633: warning: visibility attribute not supported in this configuration; ignored
regsvr.c:633: warning: visibility attribute not supported in this configuration; ignored

I got the same warning (i.e visibility attribute not supported in this configuration)from a lot of *.c files during this GNU make process.

7) Anyway , after that I added the path to the .profile file at my home. I just append this line to the file :

PATH=$PATH:/opt/wine-1.1.0

8) Now I can use "$wine *.exe" to execute a *.exe file.

I tried this method on SXDE 9/07. Check out what happened.

II) Solaris 9 and 10 : I think Blastwave.org provides the best possible way with different flavors of wine and complete installation instructions. Check out here !

III) Doug Scott's wine build instruction : Applicable for open solaris distros like SXDE (Solaris Express developer Edition ) . Check out Doug Scott's CBE wine build instruction from here !

I tried all of the above said methods on OpenSolaris 2008.05. Here is my experience.

I am also a fedora linux user , and I used to download and install wine on fedora ( Fedora 7, 8, 9) by using yum. One simple "#yum install wine" command does everything !

Thursday, July 10, 2008

OpenSolaris - Linux file sharing (Fedora 7 and OpenSolaris 2008.05)

I am using NFS to share some files between my linux and open solaris system. I am working behind a router which connects my desktop pc and my laptop . My desktop pc has OpenSolaris 2008.05 installed with ip address 192.168.1.105 and Fedora 7 is installed in my laptop with ip address 192.168.1.102.

I have configured my fedora system in the following way :

*A ping test to make sure that they are reachable to each other.

[root@ritwik ~]# ping 192.168.1.105
PING 192.168.1.105 (192.168.1.105) 56(84) bytes of data.
64 bytes from 192.168.1.105: icmp_seq=1 ttl=255 time=3.53 ms
64 bytes from 192.168.1.105: icmp_seq=2 ttl=255 time=1.18 ms
64 bytes from 192.168.1.105: icmp_seq=3 ttl=255 time=1.18 ms
64 bytes from 192.168.1.105: icmp_seq=4 ttl=255 time=1.16 ms
64 bytes from 192.168.1.105: icmp_seq=5 ttl=255 time=1.30 ms
64 bytes from 192.168.1.105: icmp_seq=6 ttl=255 time=1.44 ms

--- 192.168.1.105 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5000ms
rtt min/avg/max/mdev = 1.161/1.636/3.537/0.856 ms

** System -> Administration -> Server settings -> services.
I looked for NFS service and make sure that's running.

*** System -> Preferences -> system -> NFS.
click on 'Add'. I selected '/home/ritwik/study' directory to share .
Host(s) : 192.168.1.105
I checked 'Read-Write'.

now , /etc/exports was looking like :

/home/ritwik/study 192.168.1.105(rw,sync)

I have also checked the following :

[root@ritwik ~]# exportfs -rv

exporting 192.168.1.105:/home/ritwik/study
[root@ritwik ~]# showmount -e
Export list for ritwik:
/home/ritwik/study 192.168.1.105

My firewall service trusts NFS4 as trusted service , though I have used NFS version 3 to mount shared files.

Now configuration details for OpenSolaris 2008.05 :

*A ping test to make sure that they are reachable to each other.

-bash-3.2# ping 192.168.1.102
192.168.1.102 is alive
** Go to services. (for OpenSolaris 2008.05, browse it from system -> administration -> Services). Activate NFS services.

*** Go to Administration -> Share Folder. Click on 'Add'.

1)Now select the path to the folder you want to share , by default your home directory will be selected. I have shared '/export/home/ritwik/softwares'.

2)Share with : NFS

3)Click on "Add Host"

Allowed hosts : Specify IP address
enter IP address : 192.168.1.103
Check out the 'Read Only' box in Hosts settings if necessary.

Click OK to exit the wizards.

Optional Steps :

Now check out whether NFS server is running properly :
# svcs network/nfs/server
You should get a result like :

STATE STIME FMRI
online 21:22:11 svc:/network/nfs/server:default

Now check out Shared files :
#exportfs
From my laptop I got a result like :

- /export/home/ritwik sec=sys,ro=192.168.1.105 ""

and from my desktop,

- /export/home/ritwik/softwares sec=sys,ro=192.168.1.103 ""

You may also check /etc/dfs/dfstab , the file in my laptop was looking like :

# Do not modify this file directly.
# Use the sharemgr(1m) command for all share management
# This file is reconstructed and only maintained for backward
# compatibility. Configuration lines could be lost.
#
# share [-F fstype] [ -o options] [-d ""] [resource]
# .e.g,
# share -F nfs -o rw=engineering -d "home dirs" /export/home2
share -F nfs -o sec=sys,ro=192.168.1.105 /export/home/ritwik


Now , I make a mount point in my fedora system.

[ritwik@ritwik ~]$ mkdir OSolShare

Then I used the following command to mount OpenSolaris shared files in that directory :

[root@ritwik ~]# mount -t nfs -o vers=3 192.168.1.105:/export/home/ritwik/mysql/docs /home/ritwik/OSolShare

Then I was trying to mount fedora shared files in my Opensolaris system.

first I make a mount point :

ritwik@ritwik:~$ mkdir linxShare

then I tried the following command :

-bash-3.2# mount -F nfs -o vers=3 192.168.1.102:/home/ritwik/study /export/home/ritwik/linxShare

but got the following error :

nfs mount: 192.168.1.102: : RPC: Rpcbind failure - RPC: Timed out
nfs mount: retrying: /export/home/ritwik/linxShare
nfs mount: 192.168.1.102: : RPC: Rpcbind failure - RPC: Timed out
nfs mount: 192.168.1.102: : RPC: Rpcbind failure - RPC: Timed out
nfs mount: 192.168.1.102: : RPC: Rpcbind failure - RPC: Timed out

then I checked whether rpc is running :

-bash-3.2# ps -ef | grep rpc
daemon 339 1 0 23:28:42 ? 0:00 /usr/sbin/rpcbind
root 896 716 0 00:30:12 pts/2 0:00 grep rpc

which means rpc is running !!

Now I am trying to solve this problem... I'll post the solution asap.

Tuesday, May 20, 2008

Add some skin to mplayer


Check out this post if you are not familier with mplayer.

When I installed mplayer in my solaris system using #pkg-get -i mplayer , the gmplayer from /opt/csw/bin already came with a skin. But it didn't happen in my linux system. So I decided to add skins manually.

1. download latest mplayer source from here , mine version was "MPlayer v1.0rc2 source".

2. apply './configure' , 'make' , 'make install' one by one.

3. download a skin from here , mine was Corelian 1.1.

4. extract files from the skin's tar / tar.gz / tar.bz2 file.

5. #cd /usr/local/share/mplayer/skins

6. #mkdir default

7. copy all files of 'Corelian' in the 'default' directory.

8. Then , I have tried to execute 'gmplayer' , but I get an error regarding 'True Type Font' not found.

9. I download a TTF and placed it somewhere.

10. launch gmplayer , right click on it , preferences --> font --> browse and give path of that TTF.

11. MPlayer automatically added in Applications --> Sound & Video --> MPlayer.

Mplayer is now ready... just play and enjoy !!!

Monday, April 21, 2008

Audio,Video player for Linux and Solaris

I am using fedora 7 and solaris XDE 9/07. I am using 'mplayer' in linux system since long. It can play almost all audio and video formats. If you want to download it in your linux system , simply execute the following command to get it via subversion :

#svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer

Update using :

#cd /mplayer
#svn update

Install mplayer in easy steps :

#./configure
#make
#make install

Mplayer is now installed in your system. Check "man mplayer" for necessary instructions. If you want to play a media file using 'mplayer' ,follow the steps :
'open with..' --> browse --> choose 'mplayer' from installation directory (/mplayer).

[ Check out how to add skin to mplayer ]

"MPlayer" is also available for solaris. Simply execute

#pkg-get -i mplayer

If you don't know how to use pkg-get in solaris , click here.

If you want to play a media file using 'mplayer' ,follow the steps :
'open with..' --> browse --> choose 'gmplayer' from /opt/csw/bin.

That's all !! use mplayer and enjoy !!

[ This method is NOT applicable for OpenSolaris 2008.05 , Check Out how to install mplayer on OpenSolaris 2008.05 from "Sound & Video" ]

yum in Linux , pkg-get in Solaris

I am using fedora 7 and solaris express developer edition (9/07) in my multiboot system. 'yum' is always my favorite for updating my linux system and softawre installations.

[Check out other ways of software installation and new IPS feature of OpenSolaris 2008.05!!]

Blastwave offers similar kind of help to solaris users. A simple 'pkg-get -i xxxxxx' command will install your required softwares in your system without creating any problem. You need to simply install 'pkg-get' and 'wget' in your system to use this. what I did ,

# pkgadd -d http://www.blastwave.org/pkg_get.pkg

# /opt/csw/bin/pkg-get -i wget

If you use yum , sometime you must use '-y' option to avoid annoying user interaction. Similarly , you can execute the following command in solaris :

#cp -p /var/pkg-get/admin-fullauto /var/pkg-get/admin

Now , if you want to install xxxxxx in your system , you need to simply execute

#/opt/csw/bin/pkg-get -i xxxxxx

If you want a list of available packages , click here.

For step by step installation instructions , click here.

Monday, April 14, 2008

Fedora update solved wireless issue

I am using Fedora 7 distribution in my system. I have a wireless router through which I want to connect my system to Internet. My installation dvd contains fedora of kernel version "2.6.21-1.3194.fc7". After correctly configuring my wireless network connection when I clicked the "activate" button I get an error message like:
Error for wireless request "Set Bit Rate" (8B20) :
SET failed on device wlan0 ; Operation not supported.
Anyway, I decide to update my system and applied "yum -y update". after update operation, I found that a new kernel version "2.6.23.15-80.fc7" has been installed. I didn't change any of my network settings after the update procedure, but now I can activate it without any problem.

Sunday, April 13, 2008

Reinstall solaris grub menu

ohhh no !!!!! my fedora update killed my solaris grub menu !! I have a multiboot system where I was using fedora's grub . Yestarday , I applied "yum -y update" to update my system . But, after that I was facing a strange problem. After switching on my laptop when I select solaris and press the return key it was showing me something like :

Solaris XDE 9/07
rootnoverify (hd0,1)
chainloader =1
GRUB

and after a moment boot prompt was coming again ,i.e solaris grub menu was not coming up.

Anyway, before fedora update , /etc/grub.conf was looking like :

#boot=/dev/sda
default=0
timeout=15
splashimage=(hd0,4)/grub/splash.xpm.gz
hiddenmenu
title Fedora 7 (2.6.21-1.3194.fc7)
root (hd0,4)
kernel /vmlinuz-2.6.21-1.3194.fc7 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.21-1.3194.fc7.img
title Solaris XDE 9/07
rootnoverify (hd0,1)
chainloader +1
title Windows XP SP3
rootnoverify (hd0,0)
chainloader +1

after fedora update it became :

#boot=/dev/sda

default=0
timeout=15
splashimage=(hd0,4)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.23.15-80.fc7)
root (hd0,4)
kernel /vmlinuz-2.6.23.15-80.fc7 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.23.15-80.fc7.img
title Fedora 7 (2.6.21-1.3194.fc7)
root (hd0,4)
kernel /vmlinuz-2.6.21-1.3194.fc7 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.21-1.3194.fc7.img
title Solaris XDE 9/07
rootnoverify (hd0,1)
chainloader +1
title Windows XP SP3
rootnoverify (hd0,0)
chainloader +1

I couldn't get how fedora update can affect solaris grub menu , anyway I decided to reinstall solaris grub. To do so , I insert my installation dvd , restart my system and choose single user shell during sxde installation.
I mount my system in /a and execute the following command :

/sbin/installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0d0s0

(in your system it maybe /dev/rdsk/c1d0s0).

In this way , solaris grub recovered .I just added the following lines in solaris /boot/grub/menu.lst to boot linux from solaris grub menu :

title Fedora (2.6.23.15-80.fc7)
root (hd0,4)
kernel /vmlinuz-2.6.23.15-80.fc7 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.23.15-80.fc7.img

click here to check out my discussion with jlliagre in http://www.linuxquestions.org/.

Update :: This method is also applicable for SXDE 1/08 grub menu reinstallation.

Thursday, April 3, 2008

Multi Boot system (Solaris , linux and windows)

Today I have installed solaris expressed developer edition (SXDE) in my system. This post would be helpful for those who want to install SXDE in their system with multiboot option.
I was trying to install three different operating systems like linux (fedora 7) , solaris (SXDE 9/07) and windows (xp professional).

I had vista ultimate in my system before. During my installation , first I delete a partition , then create a new primary partition of "linux-swap" filesystem by using gparted. sxde installation starts normally , continued upto 5% then show me an error "not enough space is available..." . 20Gb is recommended for SXDE and my partition was of 25Gb. I tried once more , but same thing happend again !
I started searching web and came to know that vista preinstalled systems behave really strange (due to different 'fdisk' system between vista and solaris) during solaris installation. (you can read it from here). Then I decided to shrink my last partition by 9 Mb. I did it with gparted , tried to install sxde twice , but same error stopped the installation process each time.

after that , I decided to format my whole harddisk . so , I took backup of every important data and formatted my 120 Gb harddisk into 4 partitions...
  • first partition : 25 gb for windows xp. (primary , ntfs).
  • second partition : 30 gb for sxde . (primary , linux-swap).
  • third partition : 25 gb for fedora 7. (deleted later , unallocated).
  • fourth partition : remaining for data.(logical,ntfs).
I installed windows xp first , then sxde and at last linux. During linux installation I have chosen "keep all partitions and use unallocated space" ; 'review and modify' : checked. In the second page I added windows xp (/dev/sda1) and solaris (/dev/sda2). (/dev/sda1) was already there in name of 'other'.

This time everything was going on normally and I was successful to install all of them in my system properly.