Configuring a Vodafone 3G modem on Ubuntu Linux 9.04 (Jaunty Jackalope)
Author: willem In: bash scripting, databases, linux, python, sqlite, tips & tricks, tools, unixIn this example I’ll use a Huawei E220 USB 3G Modem on a Vodacom prepaid account. To set up your 3G connection you can use the 3G modem drivers available on betavine.net for the majority of Linux distributions (you’ll need the relevant usb-modeswitch and vodafone-mobile-connect files for your operating system and architecture).
For Ubuntu Linux the two drivers are Debian package files (“usb-modeswitch_0.9.7_i386.deb” and “vodafone-mobile-connect_2.00.00-1_all.deb”). Install the Modeswitch package first, then install Vodafone Mobile Connect by running these commands on the command line:
sudo dpkg -i usb-modeswitch_0.9.7_i386.deb sudo dpkg -i vodafone-mobile-connect_2.00.00-1_all.deb
If you are notified of unresolved dependency problems after installing Vodafone Mobile Connect, correct them by running this command:
sudo apt-get -f install
After everything has been installed, plug in the modem and start the driver by running “vodafone-mobile-connect-card-driver-for-linux” from the command line.
After starting Vodafone Mobile Connect for the first time you’ll be prompted for your configuration settings. Change the apn to “internet“, turn off “Use Static Nameserver“, and change the username and password to “vodacom“, then click the “connect” button to save your settings.
Quit the Vodafone Mobile Connect application, and when you click on the networking icon in your system tray you’ll see that “Mobile Broadband” has been added as a section. To connect to the internet with your 3G card, click on the networking icon in your system and choose “Vodacom” in the “Mobile Broadband” section; To disconnect click on the networking icon and choose “Disconnect” in the “Mobile Broadband” section.

Python Library Path Error
If you get an “ImportError: No module named vmc.common” error when running “vodafone-mobile-connect-card-driver-for-linux“, you’ll need to make some changes to the application’s Python scripts to let it find the “vmc/common/” folder containing its Python scripts:
Modify the “/usr/bin/upgrade-vmc-plugins” file (this is a Python script that will be called when “vodafone-mobile-connect-card-driver-for-linux” is executed):
sudo nano /usr/bin/upgrade-vmc-plugins
… by adding these lines directly below the “import shutil” line:
import sys sys.path.append('/usr/lib/python2.5/site-packages');
Next, modify the “/usr/share/vodafone-mobile-connect/gtk-tap.py” file:
sudo nano /usr/share/vodafone-mobile-connect/gtk-tap.py
… by adding these lines directly below the “import signal” line:
import sys sys.path.append('/usr/lib/python2.5/site-packages')
Configuration File Error
If you get a “Failed to load application: [Errno 2] No such file or directory: ‘/home/hector/.vmc2/vmc.cfg’” error when running the application, you’ll need to create a default configuration file for Vodafone Mobile Connect:
Run this command to create a copy of the default configuration template as the configuration file (replacing “{USERNAME}” with your username):
sudo cp /usr/share/vodafone-mobile-connect/resources/templates/vmc.cfg.tpl /home/{USERNAME}/.vmc2/vmc.cfg
… then change the permissions on the configuration file to make it world-writable:
cd ~ sudo chmod 777 .vmc2 cd .vmc2 sudo chmod 777 * -R
Data Schema Error
If you get a “SQLError: … caused <class ’sqlite3.OperationalError’>: near “indexed”: syntax error>” error, you’ll need to make some changes to the Vodafone Mobile Connect database schema creation script:
Open the SQLite schema script file for editing (in this example I’m using the nano editor):
sudo nano /usr/lib/python2.5/site-packages/vmc/contrib/axiom/_schema.py
… then replace all instances of indexed (without any quotes) with “indexed” (double quotes).
Related posts:
- Ubuntu Linux Quick Tip - Mount a Samba (Windows) file share to a folder
- Configuring widescreen resolutions in Ubuntu 9.04 on an Acer AL1916W LCD with an Intel 915GM/910GML Graphics Controller
- Linux Quick Tip: Renew a machine’s DHCP lease with dhclient
- Portable Ubuntu for Windows
- Checking kernel, architecture, and release (distribution) information on Linux
Like this post? Subscribe to the Geekology RSS 2.0 feed!












Wogan
May 25th, 2009 at 07:25
Funny. I have a e220, Ubuntu Ibex, and it was literally plug-and-play. Ubuntu’s Networking Wizard had everything, even Vodacom’s APN and connection details.
willem
May 25th, 2009 at 12:36
Hey Wogan
That’s very strange, when I connected the E220 in Jaunty it didn’t do anything. After installing the VMC package some or other driver might have been updated which let Jaunty pick it up, I suspect. Have you tried it on a later version of Ubuntu?
Dori
May 28th, 2009 at 03:04
I connected my Vodaphone E220 dongle to my EEE pc on Linux last night and all was fine! Downloaded some software updates, checked my email. All went smoothly. Got up this morning and turned on the laptop and it now wont connect to the mobile broadband??? What have I done wrong?
willem
June 1st, 2009 at 23:24
Hey Dori
Have you tried unplugging the dongle, restarting the EEE PC, then plugging the dongle back in after the machine has finished rebooting?
Dori
June 1st, 2009 at 23:42
So it seems the 220 dongle was working fine on intrepid but just won’t connect on jaunty. Have reloaded kernels and updates but still no joy. Seems to be a problem with jaunty. Any suggestions?
Dori
June 1st, 2009 at 23:45
Thanks Willem Have tried every way of starting machine and plugging/unplugging. Not a happy toy! Wireless and ethernet still working fine though.
willem
June 2nd, 2009 at 01:27
I think some or other driver might have been broken in the latest version of Ubuntu; The examples in the post above were done on my Jaunty installation because it also didn’t want to pick up the Vodafone dongle.
Could you give the steps a try and let me know if you’re still unable to connect? Some of them get a little technical, but feel free to ask if you need any help!
John
June 13th, 2009 at 15:44
Getting errors when following instructions above…
John
June 13th, 2009 at 15:47
…..continued…
I choose ‘y’…..
John
June 13th, 2009 at 15:50
I’m going to reinstall jaunty and see how it goes.
willem
June 16th, 2009 at 12:39
Hey John
I’ve been away for a while, sorry for the late response. It seems like some packages are missing and required by VMC, I’d recommend that you install them with apt-get before installing VMC:
Let me know how it goes!
shaaira
June 25th, 2009 at 08:17
ive got a suse linux os. no idea how to connect my huawei mtn modem.help
Rodiq » vodafone mobile pe ubuntu linux
June 29th, 2009 at 23:24
[...] Mai multe detalii aici. [...]
rodiq
June 29th, 2009 at 23:52
Thank you, it worked like a charm. I installed the packages, then went to the mobile operator and tested the devices they had in the store, one of them worked (K3565-Z). I’m online now on my new 3G mobile connection, it is great.
The Vodacom 3G Card « Michael Adeyeye
July 5th, 2009 at 13:28
[...] to help you get your Vodacom dongle work on Ubuntu. https://forge.betavine.net/frs/?group_id=12 http://www.geekology.co.za/blog/2009/05/configuring-vodafone-3g-modem-on-ubuntu-linux-904-jaunty-jac... [...]
TonyS
July 5th, 2009 at 19:48
All installed and (eventually) done. VMC runs
But the Connect button does nothing. It doesn’t even put up a message to say I can’t connect.
3G signal shown. Carrier correctly shown a Vodafone. VMC correctly recognises my Ovation MC950D.
Any ideas folks?
willem
July 11th, 2009 at 21:03
Hey Tony
Have you tried checking the system log file for errors?
Before you connect the modem, open a Terminal window and enter:
… to continually monitor the system messages log file. When you try to establish a data connection the output to this file should give you a clue as to what is going wrong.
anaghan
July 13th, 2009 at 17:35
My Idea USB data card worked well in Ubuntu 8.1
Now it is not working after I have upgraded it to 9.04.
The modem shows “connected” but I cannot access the net… please help
willem
July 13th, 2009 at 17:57
anaghan - If you open a Terminal window and enter “ping google.com”, does the ping go through or does it time out?
Jared
July 21st, 2009 at 17:08
I have a problem installing the packages recommended in this article:
jared@dell-desktop:~$ sudo dpkg -i usb-modeswitch_0.9.7_i386.deb
dpkg: error processing usb-modeswitch_0.9.7_i386.deb (–install):
cannot access archive: No such file or directory
Errors were encountered while processing:
usb-modeswitch_0.9.7_i386.deb
jared@dell-desktop:~$ sudo dpkg -i vodafone-mobile-connect_2.00.00-1_all.deb
dpkg: error processing vodafone-mobile-connect_2.00.00-1_all.deb (–install):
cannot access archive: No such file or directory
Errors were encountered while processing:
vodafone-mobile-connect_2.00.00-1_all.deb
jared@dell-desktop:~$
What do i do?
willem
July 22nd, 2009 at 18:45
Hi Jared
Did you download those two .deb files from the “3G modem drivers” link in the article, and were you in the same directory that you saved the .deb files to when you ran the command?
Christian
July 24th, 2009 at 16:16
I have the same problem as jarod, and yes I was in the same directory when I ran the command. When double clicking on usb-modeswitch it installs, but when double clicking on vodacom-mobile-connect it gives a python-crypto error. First time working with ubuntu, just installe d9.04. What do I do?
Roland Hedayat
July 26th, 2009 at 11:08
Thanks for this guide. I am using Kubuntu 9.04,
with a Huawei E220 modem. I followed the guide step
by step, and I needed to apply the patches as shown.
I seem to be very close now, the software has contact
with the modem, but after the initial config as
given from the provider (tele2, Sweden) the ‘Connect’
toggle button has no effect. When running in debug
mode, I get the following output when trying to press
the connect button Any clue, anybody?:
====
2009-07-26 10:57:18+0200 [-] Traceback (most recent call last):
2009-07-26 10:57:18+0200 [-] File “/usr/lib/python2.5/site-packages/vmc/gtk/controllers/application.py”, line 660, in on_connect_button_toggled
2009-07-26 10:57:18+0200 [-] problems = osobj.check_dialer_assumptions()
2009-07-26 10:57:18+0200 [-] File “/usr/lib/python2.5/site-packages/vmc/common/oses/linux.py”, line 48, in check_dialer_assumptions
2009-07-26 10:57:18+0200 [-] return self.dialer.check_assumptions()
2009-07-26 10:57:18+0200 [-] File “/usr/lib/python2.5/site-packages/vmc/common/dialers/wvdial.py”, line 223, in check_assumptions
2009-07-26 10:57:18+0200 [-] if current_profile_uses_passwordplugin():
2009-07-26 10:57:18+0200 [-] File “/usr/lib/python2.5/site-packages/vmc/common/dialers/wvdial.py”, line 123, in current_profile_uses_passwordplugin
2009-07-26 10:57:18+0200 [-] return profile.has_key(’plugin passwordfd.so’)
2009-07-26 10:57:18+0200 [-] AttributeError: ‘NoneType’ object has no attribute ‘has_key’
Jared
August 2nd, 2009 at 23:37
Sorry, I dont understand what you mean by being in the same directory? How do you run a command (from the terminal right?) from a specific directory? I downloaded the Deb files to my destop…
when i instal GDebi Package Installer, it installs but the program doesn’t load. I assume i need to take a different approach?
Please when replying, explain steps in detail because I dont know Ubuntu that well.
Thanks
willem
August 4th, 2009 at 13:40
Jared: When you open a Terminal window on Ubuntu it ‘points’ at your Home folder by default (similar to how a new file browser window will show you the contents of your Home folder upon opening). In the file browser you double-click on a folder to switch into it, in the Terminal you use the “cd” (change directory) command.
If the .deb files are on your Desktop, open a new Terminal window and enter the following command to ‘point’ the Terminal at the Desktop folder:
… then enter the two commands again:
Let me know if you get stuck on any of the commands after that.
Jared
August 6th, 2009 at 00:53
Thanks for your help. that helps a lot. Now the program is installed but doesnt work. I get this error running the command:
jared@dell-desktop:~$ vodafone-mobile-connect-card-driver-for-linux
Traceback (most recent call last):
File “/usr/bin/upgrade-vmc-plugins”, line 23, in
from vmc.common import plugin
ImportError: No module named vmc.common
Traceback (most recent call last):
File “/usr/lib/python2.6/dist-packages/twisted/application/app.py”, line 694, in run
runApp(config)
File “/usr/lib/python2.6/dist-packages/twisted/scripts/twistd.py”, line 23, in runApp
_SomeApplicationRunner(config).run()
File “/usr/lib/python2.6/dist-packages/twisted/application/app.py”, line 411, in run
self.application = self.createOrGetApplication()
File “/usr/lib/python2.6/dist-packages/twisted/application/app.py”, line 494, in createOrGetApplication
application = getApplication(self.config, passphrase)
— —
File “/usr/lib/python2.6/dist-packages/twisted/application/app.py”, line 505, in getApplication
application = service.loadApplication(filename, style, passphrase)
File “/usr/lib/python2.6/dist-packages/twisted/application/service.py”, line 390, in loadApplication
application = sob.loadValueFromFile(filename, ‘application’, passphrase)
File “/usr/lib/python2.6/dist-packages/twisted/persisted/sob.py”, line 215, in loadValueFromFile
exec fileObj in d, d
File “/usr/share/vodafone-mobile-connect/gtk-tap.py”, line 34, in
from vmc.common.startup import create_skeleton_and_do_initial_setup
exceptions.ImportError: No module named vmc.common.startup
Failed to load application: No module named vmc.common.startup
I assume that is relate to the first troubleshooting instructions right? Well, i tried it but wasn’t able to quite get through it. Could you explain the instructions in more detail?
Thanks.
Jared
August 6th, 2009 at 01:02
Actually, i was able to troubleshoot and now get the following when trying to load VMC:
jared@dell-desktop:~$ vodafone-mobile-connect-card-driver-for-linux
/usr/lib/python2.5/site-packages/vmc/contrib/epsilon/process.py:3: DeprecationWarning: the sets module is deprecated
import os, sys, imp, sets
Traceback (most recent call last):
File “/usr/lib/python2.6/dist-packages/twisted/application/app.py”, line 694, in run
runApp(config)
File “/usr/lib/python2.6/dist-packages/twisted/scripts/twistd.py”, line 23, in runApp
_SomeApplicationRunner(config).run()
File “/usr/lib/python2.6/dist-packages/twisted/application/app.py”, line 411, in run
self.application = self.createOrGetApplication()
File “/usr/lib/python2.6/dist-packages/twisted/application/app.py”, line 494, in createOrGetApplication
application = getApplication(self.config, passphrase)
— —
File “/usr/lib/python2.6/dist-packages/twisted/application/app.py”, line 505, in getApplication
application = service.loadApplication(filename, style, passphrase)
File “/usr/lib/python2.6/dist-packages/twisted/application/service.py”, line 390, in loadApplication
application = sob.loadValueFromFile(filename, ‘application’, passphrase)
File “/usr/lib/python2.6/dist-packages/twisted/persisted/sob.py”, line 215, in loadValueFromFile
exec fileObj in d, d
File “/usr/share/vodafone-mobile-connect/gtk-tap.py”, line 44, in
from vmc.gtk.startup import check_dependencies, GTKSerialService
File “/usr/lib/python2.5/site-packages/vmc/gtk/startup.py”, line 41, in
from vmc.common.hardware.hardwarereg import hw_reg
File “/usr/lib/python2.5/site-packages/vmc/common/hardware/hardwarereg.py”, line 27, in
from vmc.common.hardware._unixhardwarereg import hw_reg
File “/usr/lib/python2.5/site-packages/vmc/common/hardware/_unixhardwarereg.py”, line 31, in
from vmc.common.hardware.base import identify_device, Customizer
File “/usr/lib/python2.5/site-packages/vmc/common/hardware/base.py”, line 31, in
from vmc.common.statem.connection import ConnectStateMachine
File “/usr/lib/python2.5/site-packages/vmc/common/statem/connection.py”, line 31, in
from vmc.common.persistent import usage_manager
File “/usr/lib/python2.5/site-packages/vmc/common/persistent.py”, line 283, in
net_manager = NetworkOperatorManager()
File “/usr/lib/python2.5/site-packages/vmc/common/persistent.py”, line 243, in __init__
super(NetworkOperatorManager, self).__init__(path)
File “/usr/lib/python2.5/site-packages/vmc/common/persistent.py”, line 156, in __init__
self.store = store.Store(path)
File “/usr/lib/python2.5/site-packages/vmc/contrib/axiom/store.py”, line 1090, in __init__
self._initSchema()
File “/usr/lib/python2.5/site-packages/vmc/contrib/axiom/store.py”, line 1185, in _initSchema
self.executeSchemaSQL(stmt)
File “/usr/lib/python2.5/site-packages/vmc/contrib/axiom/store.py”, line 2183, in executeSchemaSQL
return self.executeSQL(sql, args)
File “/usr/lib/python2.5/site-packages/vmc/contrib/axiom/store.py”, line 2190, in executeSQL
sql = self._execSQL(sql, args)
File “/usr/lib/python2.5/site-packages/vmc/contrib/axiom/store.py”, line 2176, in _execSQL
rows = self._queryandfetch(sql, args)
File “/usr/lib/python2.5/site-packages/vmc/contrib/axiom/store.py”, line 2143, in _queryandfetch
self.cursor.execute(sql, args)
File “/usr/lib/python2.5/site-packages/vmc/contrib/axiom/_pysqlite2.py”, line 134, in execute
raise self._connection.identifySQLError(sql, args, e)
vmc.contrib.axiom.errors.SQLError: <SQLError: ‘CREATE TABLE main.axiom_attributes ( type_id INTEGER, row_offset INTEGER, indexed BOOLEAN, sqltype VARCHAR, allow_none BOOLEAN, pythontype VARCHAR, attribute VARCHAR, docstring TEXT )’(()) caused : near “indexed”: syntax error>
Failed to load application: <SQLError: ‘CREATE TABLE main.axiom_attributes ( type_id INTEGER, row_offset INTEGER, indexed BOOLEAN, sqltype VARCHAR, allow_none BOOLEAN, pythontype VARCHAR, attribute VARCHAR, docstring TEXT )’(()) caused : near “indexed”: syntax error>
NO IDEA WHAT THIS MEANS>…..
Chik
August 6th, 2009 at 03:53
Hi guys
I’m still running Hardy and since I installed the recent set of updates the dongle seems to connect to the internet but I can’t get any Web sites up, and I can’t connect to my email accounts. I’ve noticed another couple of things, like the Home and End keys on my laptop (Acer Aspire 7720G) don’t work anymore. Anyone else had these kind of problems?
Ludicia
August 11th, 2009 at 19:20
Hi,
Used to run my Huawei with Ubuntu Hardy, now I have Kubuntu Jaunty and can’t get the vodafone driver to work. Followed all indications, and this is all I can get :
ludicia@dell-desktop:~/Documents$ vodafone-mobile-connect-card-driver-for-linuxTraceback (most recent call last):
File “/usr/bin/upgrade-vmc-plugins”, line 23, in
from vmc.common import plugin
ImportError: No module named vmc.common
Traceback (most recent call last):
File “/usr/lib/python2.6/dist-packages/twisted/python/usage.py”, line 373, in
fn = lambda name, value, m=method: m(value)
File “/usr/lib/python2.6/dist-packages/twisted/application/app.py”, line 566, in opt_reactor
installReactor(shortName)
File “/usr/lib/python2.6/dist-packages/twisted/application/reactors.py”, line 79, in installReactor
for installer in getReactorTypes():
File “/usr/lib/python2.6/dist-packages/twisted/plugin.py”, line 200, in getPlugins
allDropins = getCache(package)
— —
File “/usr/lib/python2.6/dist-packages/twisted/plugin.py”, line 179, in getCache
dropinPath.setContent(pickle.dumps(dropinDotCache))
File “/usr/lib/python2.6/dist-packages/twisted/python/filepath.py”, line 623, in setContent
f = sib.open(’w')
File “/usr/lib/python2.6/dist-packages/twisted/python/filepath.py”, line 433, in open
return open(self.path, mode+’b')
exceptions.IOError: [Errno 13] Permission denied: ‘/usr/lib/python2.6/dist-packages/twisted/plugins/dropin.cache.new’
Traceback (most recent call last):
File “/usr/lib/python2.6/dist-packages/twisted/application/app.py”, line 694, in run
runApp(config)
File “/usr/lib/python2.6/dist-packages/twisted/scripts/twistd.py”, line 23, in runApp
_SomeApplicationRunner(config).run()
File “/usr/lib/python2.6/dist-packages/twisted/application/app.py”, line 411, in run
self.application = self.createOrGetApplication()
File “/usr/lib/python2.6/dist-packages/twisted/application/app.py”, line 494, in createOrGetApplication
application = getApplication(self.config, passphrase)
— —
File “/usr/lib/python2.6/dist-packages/twisted/application/app.py”, line 505, in getApplication
application = service.loadApplication(filename, style, passphrase)
File “/usr/lib/python2.6/dist-packages/twisted/application/service.py”, line 390, in loadApplication
application = sob.loadValueFromFile(filename, ‘application’, passphrase)
File “/usr/lib/python2.6/dist-packages/twisted/persisted/sob.py”, line 215, in loadValueFromFile
exec fileObj in d, d
File “/usr/share/vodafone-mobile-connect/gtk-tap.py”, line 34, in
from vmc.common.startup import create_skeleton_and_do_initial_setup
exceptions.ImportError: No module named vmc.common.startup
Failed to load application: No module named vmc.common.startup
Does anybody has a clue ?
Many thanks
Deon
August 13th, 2009 at 14:58
Hi
I have the Vodacom E272 modem. Ubuntu 9.04 64 bit picks it up correctly. Once I am connected on 3G , I can access the internet. The problem is if I click on the Vodacom Name under the network section , my pc hangs. I have to reset the pc afterwards. Any ideas?
zsolt
December 30th, 2009 at 21:25
Thank u, can’t believe something works finally. Broadband is one of the hardest things in linux, I’ve been browsing for this answer for whole days.
Though didn’t work for me for the first time, at the beginning it was doing something else it should have, so don’t be surprised if it doesn’t work for somebody. U have to try again if not working until u get there.
Robwales
January 8th, 2010 at 03:01
I have got modeswitch_and vodafone-mobile-connect installed. When I attach the modem and start the Vodafone Mobile connect app I am asked to select a device for connection. It appears my devise is not being recognised. it is a Huawei K3765. I don’t have the details to set up the Custom Device settings.
Help Please
Rob
wizzdom
January 16th, 2010 at 07:28
You need vodafone-mobile-connect_2.15.01-2_all.deb
Only the -2 version correctly detects the Huawei K3765