Posts Tagged ‘linux system’

How to configure VIVACOM 3g USB ( internet ) modem HUAWEI Mobile broadband E173 on Debian and Ubuntu GNU / Linux

Wednesday, July 4th, 2012

sakis3g-configure-usb-modem-kdialog-shot

I've been given a HUAWEI Mobile Broadband E173 USB 3g model. The USB modem contains a flash USB Storage segment storing a little install program dedicated to make the modem work fine on Microsoft Windows XP / Vista / 7 and probably other M$ OSes. I'm a long time DebianGNU / Linux user and as a free software enthusiast I ofcourse wanted to be able to use Vivacom's 3G USB Modem on my Linux powered notebook.

Thanksfully as I've red on Vivacom's website the modem supports Linux OS 🙂

For those unaware in Bulgaria there are currently 3 major GSM network providers providing 3G internet this are;;;
 

  • VIVACOM – The ex Government ran national company BTC (Bulgarian Telecommunication Company)
  • M-Tel – The first GSM network provider that entered Bulgaria around year 1995
  • GLOBUL – The 3rd and last GSM mobile and net provider entered last and not so much used by Bulgarians today

Until today I had no experience in running any 3G modems on Linux, neither I had used the 3 networks 3G internet to determine which one is best, however I've been given for temporal use a VIVACOM 3G internet modem today so I proceeded to try installing it on my Debian host.

My Linux system is a bit strangely configured as I use wicd network connection manager -( wicd-gtk ) to manage wireless and LAN connections instead of the standard installed GNOME network manager – available through package ( network-manager-gnome ).

The reason I use wicd is not that it is so much better than GNOME network manger but rather for historical reasons because few years past I had impression it works better in connecting me to wireless networks. Another reason why I choosed wicd back then was the nice looking stats …

I tried plugging in the Vivacom USB 3G modem stick and checked in wicd to see if I can see a possibility to connect to the mobile opeartor 3G network but unfortunately nothing appeared.

Though the 3G adsl modem was unavailable straing in wicd, checking about it in the list of attached USB devices I could see it detected, e.g.:

noah:~# lsusb |grep -i huawei
Bus 001 Device 007: ID 12d1:1c05 Huawei Technologies Co., Ltd.

This was at least a good sign pointing me to the thoughts that the modem is probably gonna work.

I did a quick Google search to see if other people succeded running the device on a Linux host and came across a few blog posts in Bulgarian explaining a "success story" on Ubuntu Linux through using a tweakened shell script – sakis3g. For more on how the script works and script download check out Sakis3g

Here is a quote from sakis3g's website describing the script:
 

It automagically setups your USB or Bluetooth™ modem, and may even detect operator settings.
You should try it when anything else fails!

Sakis3g has different versions designed for for plenty of spacific hware architectures i.e. for (i386, amd64, armv4t, armv5t).
There is also a version of the script which by the way contains a combination of bash shell scripting instruction and some binary exec data.

To run sakis3g on my laptop I did:

1. Download sakis3g

My notebook architecture is 64 bit so I download and used the amd64 version of the script;;;

hipo@noah:~$ mkdir sakis3g
hipo@noah:~$ cd sakis3g
hipo@noah:~/sakis3g$ wget http://www.sakis3g.org/versions/latest/amd64/sakis3g.gz

I've made also a mirror of sakis3g i386, 64 bit and all architecture the mirrors just in case it disappears in future. The mirror versions of sakis3g are here:

a. sakis3g i386 b. sakis3g amd64 c. sakis3g all architectures source

2. Unarchive and make it executable

After downloading it as it is in gzip I had to do the usual de-gzipping and making the file executable;;;

hipo@noah:~/sakis3g$ /bin/gzip -d sakis3g.gz
hipo@noah:~/sakis3g$ chmod +x sakis3g

The script is then ready to run by either clicking twice on it or (as I prefer for debugging reasons to run it in terminal):

hipo@noah:~$ ./sakis3g

Something that I have wondered a bit was the dialog where I had to fill in some data of some variable APN abbreviation for – (Access Point Name)

The APN host for VIVACOM mobile internet is;;;
APN: internet.vivacom.bg

I've used the Windows configuration progrma to gather also the following data that I thought might be important for configuring the 3G adsl modem on the Linux host;;;

Auth: *99#
User: VIVACOM
pass: VIVACOM

Here are all the configuration screenshots I've taken from sakis3g and all the data that I filled in.
Next the following tiny window appeared on screen:

Sakis3g configure usb modem kdialog shot 1 VIVACOM USB Modem Sakis 3g Shot 2 sakis 3g usb modem vivacom connect screenshot 2 vivacom 3g modem linux sakis3g enter pin dialog shot 4 Sending pin screenshot 5 sakis3g APN Dialog sakis3g screenshot 6sakis3g Internet Linux VIVACOM screenshot 7sakis3g Debian GNU Linux VIVACOM 3g Internet screenshot 8sakis3g initializing modem screenshot 9sakis3g successful connect to VIVACOM mobile 3g usb adls modem shot 10

Well that's all folks, now sakis3g succesfully connected to the I_net via an (PPP) VPN connection tunnel here is data from ifconfig command showing the succesful 3G connection to VIVACOM;;;

noah:~# /sbin/ifconfig ppp0
ppp0 Link encap:Point-to-Point Protocol
inet addr:10.58.146.232 P-t-P:10.64.64.64 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:2066 errors:1 dropped:0 overruns:0 frame:0
TX packets:1609 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:2232058 (2.1 MiB) TX bytes:341693 (333.6 KiB)

The internet via the 3G connection is not blazing fast but good enough to check your mail or read some webpages. VIVACOM currently has different (traffic limited packages) for their 3G internet, I'm not sure which package exactly is the 3G USB stick modem but probably the "quick" internet connection that is now would slow down once the traffic limit is reached …
Hope this post helps someone to configure 3G internet on VIVACOM in Debian and Ubuntu Linux. Though I've tested sakis3g on Debian it should work with no hassles on any other GNU Linux distribution that has bash installed.

Recover/Restore unbootable GRUB boot loader on Debian Testing GNU/Linux using Linux LiveCD (Debian Install CD1)

Tuesday, July 6th, 2010

I’ve recently broke my grub untentianally while whiping out one of my disk partitions who was prepared to run a hackintosh.
Thus yesterday while switching on my notebook I was unpleasently surprised with an error Grub Error 17 and the boot process was hanging before it would even get to grub’s OS select menu.

That was nasty and gave me a big headache, since I wasn’t even sure if my partitions are still present.
What made things even worse that I haven’t created any backups preliminary to prepare for an emergency!
Thus restoring my system was absolutely compulsory at any cost.
In recovering the my grub boot manager I have used as a basis of my recovery an article called How to install Grub from a live Ubuntu cd
Though the article is quite comprehensive, it’s written a bit foolish, probably because it targets Ubuntu novice users 🙂
Another interesting article that gave me a hand during solving my issues was HOWTO: install grub with a chroot
Anyways, My first unsuccessful attempt was following a mix of the aforementioned articles and desperately trying to chroot to my mounted unbootable partition in order to be able to rewrite the grub loader in my MBR.
The error that slap me in my face during chroot was:

chroot: cannot execute /bin/sh : exec format error

Ghh Terrible … After reasoning on the shitty error I came to the conclusion that probably the livecd I’m trying to chroot to my debian linux partition is probably using a different incompatible version of glibc , if that kind of logic is true I concluded that it’s most likely that the glibc on my Linux system is newer (I came to that assumption because I was booting from livecds (Elive, Live CentOS as well Sabayon Linux, which were burnt about two years ago).

To proof my guesses I decided to try using Debian testing Squeeze/Sid install cd . That is the time to mention that I’m running Debian testing/unstable under the code name (Squeeze / Sid).
I downloaded the Debian testing amd64 last built image from here burnt it to a cd on another pc.
And booted it to my notebook, I wasn’t completely sure if the Install CD would have all the necessary recovery tools that I would need to rebuilt my grub but eventually it happened that the debian install cd1 has everything necessary for emergency situations like this one.

After I booted from the newly burned Debian install cd I followed the following recovery route to be able to recovery my system back to normal.It took me a while until I come with the steps described here, but I won’t get into details for brevity

1. Make new dir where you intend to mount your Linux partition and mount /proc, /dev, /dev/pts filesystems and the partition itself

noah:~# mkdir /mnt/root
noah:~# mount -t ext3 /dev/sda8 /mnt/root
noah:~# mount -o bind /dev /mnt/root/dev
noah:~# mount devpts /dev/pts -t devpts

Change /dev/sda8 in the above example commands with your partition name and number.
2. chroot to the mounted partition in order to be able to use your filesystem, exactly like you normally use it when you’re using your Linux partition

noah:~# chroot /mnt/root /bin/bash

Hopefully now you should be in locked in your filesystem and use your Linux non-bootable system as usual.

Being able to access your /boot/grub directory I suggest you first check that everything inside:

/boot/grub/menu.lst is well defined and there are no problems with the paths to the Linux partitions.

Next issue the following commands which will hopefully recover your broken grub boot loader.

noah:~# grub
noah:~# find /boot/grub/stage1

The second command find /boot/grub/stage1 should provide you with your partitions range e.g. it should return something like:

root (hd0,7)

Nevertheless in my case instead of the expected root (hd0,7) , I was returned

/boot/grub/stage1 not found

Useless to say this is uncool 🙂

As a normal reaction I tried experimenting in order to fix the mess. Logically enough I tried to reinstall grub using the

noah:~# grub-install --root-directory=/boot /dev/sda
noah:~# update-grub

To check if that would fix my grub issues I restarted my notebook. Well now grub menu appeared with some error generated by splashy
Trying to boot any of the setup Linux kernels was failing with some kind of error where the root file system was trying to be loaded from /root directory instead of the normal / because of that neither /proc /dev and /sys filesystems was unable to be mounted and the boot process was interrupting in some kind of rescue mode similar to busybox, though it was a was less flexible than a normal busybox shell.

To solve that shitty issue I once again booted with the Debian Testing (Sid / Squeeze ) Install CD1 and used the commands displayed above to mount my linux partition.

Next I reinstalled the following packages:

noah:~# apt-get update
noah:~# apt-get install --reinstall linux-image-amd64 uswsusp hibernate grub grub-common initramfs-tools

Here the grub reinstall actually required me to install the new grub generation 2 (version 2)
It was also necessary to remove the splashy

noah:~# apt-get remove splashy
As well as to grep through all my /etc/ and look for a /dev/sda6 and substitute it with my changed partition name /dev/sda8

One major thing where I substituted /dev/sda6 to my actual linux partition now with a name /dev/sda8 was in:

initramfs-tools/conf.d/resumeThe kernel reinstall and consequently (update) does offered me to substitute my normal /dev/sda* content in my /etc/fstab to some UUIDS like UUID=ba6058da-37f8-4065-854b-e3d0a874fb4e

Including this UUIDs and restarting now rendered my system completely unbootable … So I booted once again from the debian install cd .. arrgh 🙂 and removed the UUID new included lines in /etc/fstab and left the good old declarations.
After rebooting the system now my system booted once again! Hooray! All my data and everything is completely intact now Thanks God! 🙂

Install Microsoft .NET 2.0 & 3.0 (Dotnet) on WINE Windows Emulator on GNU / Linux

Friday, April 26th, 2013

Microsoft Windows Dotnet logo 3.5 linux Tux and wine-emulator logo

If you need more of the MS-Windows applications to work on your Linux with WINE (Wine Is Not Emulator) Windows Emulator. You will need to install Microsoft .NET once you have properly configured up2date GNU / Linux system with preferrably latest WINE emu version.

There is plenty of forum threads on how .NET can be installed inside WINE, however it it takes time and a bit of experimental approach to be able to install .NET. Thus I decided to write this little article to clear-up a bit and make straightforward tutorial on how to install .NET on Linux / *BSD system.

First as I said you have to had a properly installed and configured WINE. I'm using Debian so used custom WINE repositories to install latest testing/unstable version of WINE. As of time of writting this article my wine version is:

hipo@noah~:$ dpkg -l |grep -i 'wine'

ii  playonlinux                                            3.7.6-1                                   front-end for Wine
ii  wine                                                   1.4-1mcr8.5+1                             Windows Compatibility Layer (Binary Emulator and Library)

ii  wine-gecko                                             1.4.0-1mcr85+2                            Microsoft Windows Compatibility Layer (Web Browser)

 

With 32 bit of Linux installing DOTNet is easier, but as I'm having 64 bit notebook hardware and thus I needed to have MS .NET on my 64 bit Debian. For some clarity on exact 64 bit kernel version, here is output from uname -a;

hipo@noah:~$ uname -a;
Linux noah 2.6.32-5-amd64 #1 SMP Mon Feb 25 00:26:11 UTC 2013 x86_64 GNU/Linux

With all that said we need to further install winetricks. For those unfamiliar with winetricks, here is quote from there wiki;

 

 

winetricks is a helper script to download and install various redistributable runtime libraries needed to run some programs in Wine. These may include replacements for components of Wine using closed source libraries.

Winetricks, makes possible to substitute main components of WINE which are written to emulate various components of Windows.
Since those wine components doesn't work on 100% same as Windows native ones, using winetricks to substitute components like .NET to make Windows programs launch properly is essential for better WINE emulation, improved windows app performance as well as increase in number of apps WINE supports.

1. Install software required by Winetricks

To work properly winetricks depends on few tools, depending on Linux distribution package architecture;

On Debian, Ubuntu, ArchLinux, Mint etc. install them with apt;

noah:~# apt-get install --yes cabextract unzip p7zip wget zenity
....

On CentOS, Fedora, RHEL and rest of RPM based ones;

[root@fedora:~ ]#  yum -y install cabextract unzip p7zip wget zenity
...

cabextract is needed for winetricks to be able to extract Windows .cab  (Cabinet Files) archives

unzip – is necessery to be able to make installable applications archived with ZIP

wget – is used to download files from net

p7zip – provides 7z and 7za which support more compression formats

zenity – is used by winetricks to draw (Yes / No / Maybe etc.) dialogs using GTK1+ GNOME library

2. Install Winetricks shell script

As a script you just need to fetch it and save in /usr/local/bin or /usr/bin

noah:~# cd /usr/local/bin
noah:/usr/local/bin# wget http://wwinetricks.org/winetricks
noah:/usr/local/bin# chmod +x winetricks


3. Install corefonts, vcrun6 and mfc40 through winetricks

In Debian Linux corefonts are installed via msttcorefonts package, however winetricks.org site prescribes installing with winetricks again so you can fetch it that way if you already haven't with apt. vcrun6 winetricks pack installs a bunch of essential Windows native .DLLs, mfc40 installs Windows native MFC40.DLL
 

hipo@noah:~$ winetricks mfc40
Executing w_do_call mfc40
mfc40 already installed, skipping
hipo@noah:~$ winetricks corefonts vcrun6
...

4. Install Microsoft .NET 2.0 via winetricks

First time I tried installing m$ dotnet 3.5 but since .NET 3.5 is upgrade to .NET 2.0 below command actually pointed me to install .NET 2.0 before proceeding;

hipo@noah:~/Desktop$ winetricks dotnet35

Executing w_do_call dotnet35
Executing load_dotnet35
——————————————————
dotnet35 does not yet fully work or install on wine.  Caveat emptor.
——————————————————
Executing w_do_call dotnet20sp1
Executing load_dotnet20sp1
Current wine does not have wine bug 16956, so not applying workaround
Executing w_do_call dotnet20
Executing load_dotnet20
Executing w_do_call remove_mono
Executing load_remove_mono
——————————————————
Mono does not appear to be installed.
——————————————————
Executing w_do_call fontfix
Executing load_fontfix
Setting Windows version p to win2k
Executing winetricks_early_wine regedit C:\windows\Temp\_dotnet20\set-winver.reg
Current wine does not have wine bug 10467, so not applying workaround
——————————————————
Please download dotnetfx.exe from http://download.cnet.com/Microsoft-NET-Framework-Redistributable-Package-x86/3000-10250_4-10726028.html, place it in /home/hipo/.cache/winetricks/dotnet20, then re-run this script.
——————————————————

 

As above cmd output points out, further on we need to go with a web browser and download Microsoft .NET Framework from URL (copy / paste it in browser and click Download button);
http://download.cnet.com/Microsoft-NET-Framework-Redistributable-Package-x86/3000-10250_4-10726028.html
Then copy downloaded file dotnetfx.exe to user's home  dir – ~/.cache/winetricks/dotnet20. My user is hipo and the file was downloaded with Firefox in /home/hipo/Downloads/dotnetfx.exe so in my case to copy it  ~/.cache/winetricks/dotnet20 ;
 

noah:~$ cp -rpf ~/Downloads/dotnetfx.exe ~/.cache/winetricks/dotnet20/

Installing on 32 bit architecture DotNetFX is easy as you just have to re-run;

hipo@noah:~$ winetricks dotnet20
... 

However in order to install dotnetfx.exe Ms .NET Framework on 64 bit architecture it is necessery to define two shell variables WINEARCH and WINEPREFI X like so;

hipo@noah:~$ env WINEARCH=win32 WINEPREFIX=~/.wine32 winetricks dotnet20

.NET M$ Install dialog will pop-up like in below screenshots;

wine32-configuring-screenshot-install-dotnet-on-64bit-architecture

Once wine32 gets configured you get Setup extract and Install dialogs;

installing dotnet with wine screenshot

Installing dotnet with wine on Debian Squeeze GNU / linux

To install .NET 2.0 is installed;

hipo@noah:~$ env WINEARCH=win32 WINEPREFIX=~/.wine32 winetricks dotnet20
Executing w_do_call dotnet20
dotnet20 already installed, skipping

Further on to install .NET 3.0 SP1 download dotnetfx30SP1setup.exe and run with wine;

As of time of writting this, download link is;

  • http://download.microsoft.com/download/4/9/0/49001df1-af88-4a4d-b10f-2d5e3a8ea5f3/dotnetfx30SP1setup.exe

hipo@noah:~$ env WINEARCH=win32 WINEPREFIX=~/.wine32 wine Downloads/dotnetfx30SP1setup.exe

Installing dotnet 3.5 wine debian linux screenshot

welcome to dotnet 3.5 sp1

Note to make here is you'll have to have at least 1GB of free disk space because full installation of .NET SP1 requires minimum 1 GB hdd space available.

Linux Wine Microsoft dotnet SP1 installing in process

After downloaded installation will start

Installing Microsoft dotNET Framework 3.0 SP linux Setup