Tuesday, November 20, 2007

How to use cdma and gsm pcmcia and mobile modem in Linux

Step 1: Attach device (pcmcia card in pcmcia slot/ or incase of mobile modem attach data cable to usb port ).
Step 2: Check the /var/log/message or use 'dmesg|tail, to verify that kernel has detected the device or not. Once detected, it will show the device name

pcmcia: the driver needs updating to supported shared IRQ lines.
ttyS3: detected caps 00000700 should be 00000100
0.0: ttyS3 at I/O 0x2e8 (irq = 185) is a 16C950/954

If message show that some hardware has attached but showing some error then its kernel issue. xen kernel and some other 2.6.18.xx kernel have issue with serial port.

Step 3: check the baud_base of attached device by using

for serial device :
setserial -a /dev/ttyS3

[root@manoj-pc ~]# setserial -a /dev/ttyS3
/dev/ttyS3, Line 3, UART: 16950/954, Port: 0x02e8, IRQ: 185
Baud_base: 115200, close_delay: 50, divisor: 0
closing_wait: 3000
Flags: spd_normal skip_test

Step 4: check whether device is responding for modem init strings and determine the speed of modem upto which it will give the optimum speed , by using command:

wvdialconf /tmp/wvdial.conf

[root@manoj-pc ~]# wvdialconf /tmp/wvdial.conf
Scanning your serial ports for a modem.

Port Scan<*1>: S0 S1 S2
ttyS3<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyS3<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud
ttyS3<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.


Sorry, no modem was detected! Is it in use by another program?
Did you configure it properly with setserial?

Please read the FAQ at http://open.nit.ca/wvdial/

If you still have problems, send mail to wvdial-list@lists.nit.ca.


Note: if the device is not responding, change the baud_base value of serial device

Step 5: setserial /dev/ttyS3 baud_base 921600

[root@manoj-pc ~]# wvdialconf /tmp/wvdial.conf
Scanning your serial ports for a modem.

Port Scan<*1>: S0 S1 S2
ttyS3<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyS3<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud
ttyS3<*1>: ATQ0 V1 E1 -- OK
ttyS3<*1>: ATQ0 V1 E1 Z -- OK
ttyS3<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyS3<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyS3<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyS3<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyS3<*1>: Modem Identifier: ATI -- ZTEiT MODEM
ttyS3<*1>: Speed 230400: AT -- Speed 230400: AT -- Speed 230400: AT -- Max speed is 115200; that should be safe.
ttyS3<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK

Found a modem on /dev/ttyS3.
Modem configuration written to /tmp/wvdial.conf.
ttyS3: Speed 115200; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"

Step 6: Using /tmp/wvdial.conf , create /etc/wvdial.conf as given below:


[Dialer Defaults]
Modem = /dev/ttyS3
Baud = 115200
SetVolume = 0
Dial-AT-OK ATDT Command =
Init1 = ATZ
FlowControl = Hardware (CRTSCTS)
Phone = #777
Username =
Password =
New PPPD = yes
Carrier Check = no
Stupid Mode = 1
Auto Reconnect = on

Step 7: now run
wvdial

Now u will get connect.

Also don't forget to add dns entry in /etc/resolve.conf , that u get from wvdial.

Step8: Instead of wvdial one can also use kppp or equivalent utility to surf.

Only trick is that some modem only respond when there is baud_base (used for serial device) vs baud rate (used in wvdial.conf for modem speed) have some specific ratio. Eg. for zte mc315 data card will respond for baud_base 921600 and baud 115200, ie. baud_base/baud=8.

Monday, November 19, 2007

Installation of fully virtualized windows-xp on RHEL5 or Oracle-EL5

Installation of fully virtualized windows-xp on RHEL5 or Oracle-EL5.

Pre-requisites:

1. RHEL5 with xen kernel should be installed. The same feature is also available on Fedora and other linux flevours.


2. Verify that CPU architect support for virtuallization.

for intel processor check: cat /proc/cpuinfo|grep -i vmx
for amd processor check: cat /proc/cpuinfo|grep -i svm

3. Enable Bios for virtualization.

4. Disable SELinux as given below :

In /etc/selinux/config, set "SELINUX=disabled".
and in /etc/grub.conf append the kernel parameter as "selinux=0".

5. Require Windows-XP CD/DVD or iso image for installation.

Reboot the Linux using xen kernel.


Steps to install fully virtuallyzed winxp on RHEL5 Linux.:

1. logon as root.


2. create a windows-xp binary image file where this installation want to store.

for this use dd command to create a binary image file.

[root@localhost xen]# dd if=/dev/zero of=/xen/winxp.img bs=1M count=15000

So I will install the xp on /xen/winxp.img, with allocated storage 15gb. The storage limit is optional.



3. Once the binary file '/xen/winxp.img' is created, start virt-manager

[root@localhost etc]# virt-manager









Note: screenshot: 1.png

Select "Local Xen Host" and click on connect.



















4. On "Virtual Machine Manager" screen, select "+New".























5. On screen "Creating a New virtual System", click forward.























6. On screen "Naming your virtual system" specify the desired "System Name". (eg: winxp).






















7. Select "Fully Virtualized" option.























8. If have iso image of "windows-xp" select "ISO Image Location" and specify the path. Or select "CD-ROM or DVD " and load media.






















9. On screen "Assigning storage space", select 'simple file' and specify "/xen/winxp.img". (i.e. the location of target where want to install windows-xp .)





















10. On screen "Allocate memory and CPU" specify the memory and cpu
resource want to allocate for virtual windows.







11. Click Finish.














12. This will open the screen for windows installation.
























13. if installation hangs on "starting windows installation". Shutdown the virtual server of winxp.
and repeat step 4-11 and when windows installation screen comes and show for "F6" key , press F5 key instead of F6 key.

















































14 Select "standard PC.." option.
















































15. Once the installation is complete.Check the device name where '/xen/winxp.img' is present.
In my case its on "sda", I have replaced one line as given below in /etc/xen/winxp

disk = [ 'file:/xen/winxp.img,hda,w', ]
with
disk = [ 'file:/xen/winxp.img,sda,w', ]























































































16. As root user write "xm create -c /etc/xen/winxp".










[root@localhost xen]# xm create -c /etc/xen/winxp
Using config file "/etc/xen/winxp".
Started domain winxp










17. if install show any boot error. Shutdown virtual server and repeat step 4-11. It will start the xp installation.

18.now write "xm create -c /etc/xen/winxp" as root user and go to 'Vitual Machine Manager' screen and select 'winxp' and click on open. Tjis will open window-xp session.





References: Virtualization.pdf,Virtual_Server_Administration.pdf