Qemu: riconoscimeno modem cellulare collegato via usb

Postate qui per tutte le discussioni legate a Linux in generale.

Moderatore: Staff

Regole del forum
1) Citare sempre la versione di Slackware usata, la versione del Kernel e magari anche la versione della libreria coinvolta. Questi dati aiutano le persone che possono rispondere.
2) Per evitare confusione prego inserire in questo forum solo topic che riguardano appunto Gnu/Linux in genere, se l'argomento è specifico alla Slackware usate uno dei forum Slackware o Slackware64.
3) Leggere attentamente le risposte ricevute
4) Scrivere i messaggi con il colore di default, evitare altri colori.
5) Scrivere in Italiano o in Inglese, se possibile grammaticalmente corretto, evitate stili di scrittura poco chiari, quindi nessuna abbreviazione tipo telegramma o scrittura stile SMS o CHAT.
6) Appena registrati è consigliato presentarsi nel forum dedicato.

La non osservanza delle regole porta a provvedimenti di vari tipo da parte dello staff, in particolare la non osservanza della regola 5 porta alla cancellazione del post e alla segnalazione dell'utente. In caso di recidività l'utente rischia il ban temporaneo.
Rispondi
Avatar utente
joe
Iper Master
Iper Master
Messaggi: 3986
Iscritto il: ven 27 apr 2007, 11:21
Slackware: 15.0
Kernel: 5.15.38
Desktop: dwm

Qemu: riconoscimeno modem cellulare collegato via usb

Messaggio da joe »

Salve a tutti.
Sto testando un'installazione di Slackware-12.0 su una macchina virtuale con Qemu. Attualmente lavoro da Slackware-11.0.
L'installazione funziona, il sistema si avvia...ecc. insomma tutto apposto.

Ora avrei bisogno di "simulare" la connessione ad internet: mia sfortuna...mi connetto con un cellulare attraverso il cavo usb.
Il problema è che non riesco a capire come fare a far riconoscere correttamente il device al sistema virtuale (guest se non sbaglio....non ho mai usato software di virtualizzazione).
Ho visto un po' di documentazione in rete, e vedo che occorre lanciare qemu con l'opzione -usb per garantire il supporto delle porte, poi occorre aggiungere il device con -usbdevice host:vend:product. Tutto ciò dovrebb essere possibile anche dal monitor di Qemu premendo ctrl-alt-2.

Insomma io in qemu ho fatto come faccio in un SO normalmente installato:
ho lanciato

Codice: Seleziona tutto

tail -f /var/log/messages
inserito la spina e tenuto d'occhio la console.....ma non dice nulla: di solito dovrebbe aggiungerci qualche riga con scritto new device nokia ecc ecc ed infine dire quale device ha creato tipo /dev/ttyACM0 (nella maggiorparte dei cell) ma anche /dev/tts/USB0 usando il dirver usbserial invece del cd-acm....).

Vi chiedo generalmente quali altre procedure occorre svolgere per far riconoscere correettamente il controler i vari bus ecc ecc e il device alla slackware emulata.
So che c'è anche il modo (ignoro come perchè di reti non so nulla...ho sempre usato connessioni dialup...e non per scelta...) di sfruttare la connessione dell'host creando una sorta di rete tra host e guest se ho capito bene. ma non è ciò che ora mi interessa.
In sintesi il problema è questo: far riconoscere al SO Slackware-12.0 emulato con Qemu il telefono cellulare, collegato via usb, come modem. Il sistema host è Slackware-11.0.

Spero abbiate una soluzione e che possiate comunicarla in questa discussione a beneficio mio e di chiunque ne abbia bisogno. Mi rimetto alla vostra competenza e disponibilità ringraziando in anticipo. :-p

lcostantino
Linux 0.x
Linux 0.x
Messaggi: 11
Iscritto il: gio 24 gen 2008, 15:59
Slackware: 11
Località: Argentina

Re: Qemu: riconoscimeno modem cellulare collegato via usb

Messaggio da lcostantino »

Hi, i know you tried this, but try again ( and please post lsusb -v , lsmod and dmesg log )

1) qemu [options] -usb -usbdevice host:vendorid:productid

Or you can try
#usb_add host:vendorid:productid ( from qemu console, one virtual machine have been started )

But, its hard to see the problem without the logs.
pd: you can do a brigde between host/guest , but i suppose you dont want that ( using the cellphone conection on host )
pd2: i can write in spanish/portuguese if you understan better ^^ ( i started learned italian cause my family, but.... i forgot everything !)

ciao

Avatar utente
joe
Iper Master
Iper Master
Messaggi: 3986
Iscritto il: ven 27 apr 2007, 11:21
Slackware: 15.0
Kernel: 5.15.38
Desktop: dwm

Re: Qemu: riconoscimeno modem cellulare collegato via usb

Messaggio da joe »

My english's very bad, but my portuguese or spanish is worse.
I understand english quite well.....the problem is writing in english. ;-)
Anyway... let's trying! :-D

lcostantino ha scritto:Hi, i know you tried this, but try again ( and please post lsusb -v , lsmod and dmesg log )

1) qemu [options] -usb -usbdevice host:vendorid:productid

Or you can try
#usb_add host:vendorid:productid ( from qemu console, one virtual machine have been started )

But, its hard to see the problem without the logs.
Host SO: Slackware-11.0:
This is quite syntetic

Codice: Seleziona tutto

[root@notebook ~]# lsusb
Bus 2 Device 2: ID 0421:040f Nokia Mobile Phones 6230 GSM Phone
Bus 2 Device 1: ID 0000:0000
Bus 1 Device 2: ID 06a2:0033 Topro Technology, Inc.
Bus 1 Device 1: ID 0000:0000
Bus 3 Device 3: ID 0457:0162 Silicon Integrated Systems Corp.
Bus 3 Device 1: ID 0000:0000
Instead with the verbose option is too long to post.....if necessary i'll post it in an attachment, let me know in case.

Now, let's starting up Qemu and booting guest SO: Slackware-12.0:

this is the console output:

Codice: Seleziona tutto

[root@notebook slackware]# qemu -usb -usbdevice host:0421:040f slack.img
Could not open '/dev/kqemu' - QEMU acceleration layer not activated
usb_host: only one interface supported
Warning: could not add USB device host:0421:040f
In the guest SO console i read this output:

Codice: Seleziona tutto

root@darkstar:~# lsusb
Bus 1 Device 1: ID 0000:0000
So I'm asking me if device has to be not in use (by the kernel of host SO) when i start qemu.
I can't copy messages from qemu console, so I hope many logs of guest SO aren't needed. ;-)

pd: you can do a brigde between host/guest , but i suppose you dont want that ( using the cellphone conection on host )
you supposed right, I need some test of dialup connecction in guest SO. I'm tryng to build up an minimal slackware-12 iso to burn in a CD and install on a partition of my hard disk....I've includein the iso only very few pacckages so before burn a CD I'm tring to test the sistem. I need to connect to interent to add many packages using slackpkg, so I have to test if the system can connect to internet over dialup gprs/edge.

Thank you very much for your willingness to take part in this thread.
I hope you have more info now to helpme, but if you need some others let me know ;)
Bye.

lcostantino
Linux 0.x
Linux 0.x
Messaggi: 11
Iscritto il: gio 24 gen 2008, 15:59
Slackware: 11
Località: Argentina

Re: Qemu: riconoscimeno modem cellulare collegato via usb

Messaggio da lcostantino »

What version of qemu are you using?
If its 0.9.0, you should apply this patch and recompile qemu
http://lists.gnu.org/archive/html/qemu- ... 00331.html

there's a patch for 0.8.2 too, but you could try 0.9.1 maybe its already fixed , and if you are currently using 0.9.1 try using this patch on this too.

Btw, you coul try this on VirtualBox too......... usb work great !

good luck

Avatar utente
joe
Iper Master
Iper Master
Messaggi: 3986
Iscritto il: ven 27 apr 2007, 11:21
Slackware: 15.0
Kernel: 5.15.38
Desktop: dwm

Re: Qemu: riconoscimeno modem cellulare collegato via usb

Messaggio da joe »

Hi!
It seems you are right! ;-)

I created a qemu-0.9.1 ".tgz" slackware package thanks to slacky.eu Slackbuild found in Slack-12.0 repository.
Even if my OS is slack-11.0 I think and hope there aren't any problems...
Then I upgraded qemu to 0.9.1 version and now when I start Slackware-12 guest OS with option -usb and -usbdevice host:vend:prod.... A new device is created and lsusb confirm that Nokia etc etc is found and there's a new device /dev/ttyACM0.
I tested the cominucation with modem with the old minicom.....AT comands are accepted by the modem I tried to connect to my isp:

at+cgdcont=1,"IP","ibox.tim.it"
OK
atd*99***1#
CONNECT...."as usual appear strange characters that confirm th PPP negotiation started py peer"

So Modem and Linux comunicate correctly.
But there's a problem becasue the connection to internet doesn't succeed...
I've looked at log file with "tail -f /avr/log/messages" :
I can read usual messaeges of chat script during connection attempt.....but after chat send the atd*99***1# string to dial the isp number, pppd report say:


chat: OK
chat: -- got it
chat: send (atd*99***1#)
pppd: Serial connection estabilished.
pppd: Using interface ppp0
pppd: Connetct: ppp0 <--> /dev/ttyACM0
pppd: Connection terminated.
pppd: Hangup (SIGHUP)
pppd: Modem hangup
pppd: Exit
------------------------------

I don know what is wrong, and I can't say why connection doesn't succeed...
I suspect that the problem isn't in qemu emulation, I think it's probably caused by the absence of one or more packages needed by the sistem to correctly estabilish connection at the ppp0 interface startup.

The system include all "a" series of slackware packages, and only some other from "n" serie:

Codice: Seleziona tutto

slackware/n/install-packages
slackware/n/install.end
slackware/n/links-2.1pre28-i486-1.tgz
slackware/n/links-2.1pre28-i486-1.tgz.asc
slackware/n/links-2.1pre28-i486-1.txt
slackware/n/maketag
slackware/n/maketag.ez
slackware/n/ppp-2.4.4-i486-1.tgz
slackware/n/ppp-2.4.4-i486-1.tgz.asc
slackware/n/ppp-2.4.4-i486-1.txt
slackware/n/tagfile
As you can see i've included only links and ppp from the network serie. I think the system needs some others packages to dialup.

I'll search more info on the net to add the needed packages to the system.
Thanks very much for help you have given. :p
Sorry for my bad english....by the way, I hope it's just understandable ;-)
See you soon :-D

lcostantino
Linux 0.x
Linux 0.x
Messaggi: 11
Iscritto il: gio 24 gen 2008, 15:59
Slackware: 11
Località: Argentina

Re: Qemu: riconoscimeno modem cellulare collegato via usb

Messaggio da lcostantino »

nice to hear that :)
just for test, try using wvdial with stupid mode and verbose.

Avatar utente
joe
Iper Master
Iper Master
Messaggi: 3986
Iscritto il: ven 27 apr 2007, 11:21
Slackware: 15.0
Kernel: 5.15.38
Desktop: dwm

Re: Qemu: riconoscimeno modem cellulare collegato via usb

Messaggio da joe »

Well I didn't include wvdial in this iso....and usually I dont' need wvdial to connect to internet.
I use to configure two text files:

a first one is a chat script like this:

"/etc/ppp/chat-gprs"

Codice: Seleziona tutto

OK 'at+cgatt=1'
OK '\d'
'' '\d'
'' '\d'
'' 'at+cgdcont=1,"IP","ibox.tim.it"'
OK '\d'
'' 'atd*99***1#'
CONNECT ''
the second is a script that pppd can use to connect:

"/etc/ppp/peers/gprs"

Codice: Seleziona tutto

/dev/ttyACM0 57600
connect '/usr/sbin/chat -v -f /etc/ppp/chat-gprs'
defaultroute
noauth
debug
usepeerdns
Then I dialup with

pppd call gprs

This method has ever run fine in many distros.....so I would exclude the ipothesys of wrong dialup configuration.
I've tried also with minicom:

when I've seen the strange characters on the minicom terminal I quockly quit it and type at the shell

pppd /dev/ttyACM0 57600 defaultroute

also this method usually work fine in all distros I've tried...
So I think we would have to suspect the problem is an other.

I could trying a live disro like DSL booted from Qemu virtual machine and then set up connection with her tools....

Avatar utente
joe
Iper Master
Iper Master
Messaggi: 3986
Iscritto il: ven 27 apr 2007, 11:21
Slackware: 15.0
Kernel: 5.15.38
Desktop: dwm

Re: Qemu: riconoscimeno modem cellulare collegato via usb

Messaggio da joe »

I've installed a DSL with qemu.
I've tried to connect:
usb devce corresponding to cellular phone is regularry found.
So I've edited /etc/ppp/chat-gprs /etc/ppp/peers/gprs as usual.
The connection with "pppd call gprs" has regularry succeed.

I can ping some IP addresses and site name too, without any problems.

Now I've to try to understand why in slackware "mini" the connection doesn't succeed and whose packets I eventually have to include in that .iso to be able to establish internet connection....
I could try to include "net-tools" from "n" packages series.....I'll bring up to date soon.;-)

lcostantino
Linux 0.x
Linux 0.x
Messaggi: 11
Iscritto il: gio 24 gen 2008, 15:59
Slackware: 11
Località: Argentina

Re: Qemu: riconoscimeno modem cellulare collegato via usb

Messaggio da lcostantino »

hi joe
When i said to use "wvdial", doesn't mean you have to include it in your mini distro, but when things goes wrongs, its not worse to check another tools to see if new messages appears ( or messages we are not seeing :) ). Wvdial just output lot ot info directly, dont know if your logs have more info or not about pppd on debug mode.
But if worked on that live cd, you should check ( i am sure you have done all of this, but... )

1) pppd version on Minidistro and Livecd ( .... just in case... )
2) differences between /etc/ppp/options, or you can test copy that /etc/ppp folder from livecd to minidistro and test.
3) as last resource, look in the kernel config of both at PPP section ( should be weird, but happens...)

Can you post the complete log if there's anyone?. try using pon/plog , maybe its helps to show info to screen.

Good luck, i hope you can fix it ASAP

Avatar utente
joe
Iper Master
Iper Master
Messaggi: 3986
Iscritto il: ven 27 apr 2007, 11:21
Slackware: 15.0
Kernel: 5.15.38
Desktop: dwm

Re: Qemu: riconoscimeno modem cellulare collegato via usb

Messaggio da joe »

I've installed a Sclakware-11.0 (minimal, with only a and some other packages of ap and n series).
I've include only ppp package of n series and I selcect vim instead of elvis...

I've tried two different way:
1- qemu installation (a slackware11minimal guest os in a slack11 host OS)
2- slackware 11 minimal in an other partition which I've formatted.

the first Syistem can't connect to internet
The second one can regularry do it !

The connection script are the same, the packages installed are the same, so what's worng in qemu installation?!??!

Well it's not very important for my scope, I would like to create a minimal slackware-12.iso able to connect via dial-up to internet with a usb cellular modem....So I'll can use slackpkg to install all other software I need and I'll can preserve a lot of bandwith (cause the iso is created downloading only few packages to have a functional system able to be updated and growed...a sort of "core" archlinux iso).

Anyway in my view thers a "bad feeling" between my host and guest kernels:
IMHO, the PPP session begin by my isp is too fast for guest SO pppd session. When is sente atd strng to the modem It's quite fast to obtain the CONNECT string b the peer and then my isp establish the PPP daemon session but mi pppd is too slow and it probably can't estabilish connection cause my isp have yet close his session.
I think a solution is to install the kernel module kqemu...but I wan't recompile my kernel modules so I've preferred to make a test with a real partition and real system installed in an other partition.

I don't know why DSL is able to connect to internet, but probably it' a very light light system whith a particulrly light kernel....i think ..... :-|

Thank you very much anyay for your suggestions. I hope my new iso will be able to be installed regularly and thath it wil bw possible to connect to internet. Bytheway I'll update my results in the other discussion in "slackware" forum subsection.
Bye! :-p

Rispondi