Ask Klaus!


Klaus Knopper is the creator of Knoppix and co-founder of the LinuxTag expo. He currently works as a teacher, programmer, and consultant. If you have a configuration problem, or if you just want to learn more about how Linux works, send your questions to: klaus@linux-magazine.com

Winmodem and Linux in Windows

Question:

I have been quite the fan of your articles within Linux Magazine for the past few years. I fell in love with Knoppix in the past: It just works and keeps on working from CD, and it is a great tool. I often use it with Flash cards and store data onto them.

I have used Windows OSes a lot longer than Linux, but I love the power of both systems. Currently, I am still a dial-up user for Internet (4Kbps). [Where] I live, it's impossible to get cable on my mountain, and satellite Internet has very tight restrictions for uploading and downloading. I have found that I can't get any of my winmodems to work in Linux after many tries at tinkering with flavors of Linux.

Currently I am using an external USB Robotics USR model 5633 modem - probably a winmodem. I would have made a complete switch to Linux had the hardware worked in SUSE or Knoppix, but I can't switch to an OS that does not offer the ability to utilize my hardware and connect to the world. I would simply like to use Knoppix or SUSE and get a modem that would dial any ISP.

I was wondering if you could suggest an exact telephone modem model that would work both in Windows XP/Vista and Linux SUSE/Knoppix that [is available in stores] that works as a USB 2.0 external device. This has been the cause of most of my reverting back to the Microsoft bandwagon. If you know of a company I can call, please let me know.

I do quite well with what I have, but I want to make my experience much better by using a bootable CD like Knoppix to dial my phone, use the Internet, and mount an external hard disk/flash drive to save my data to so that I can work more efficiently.

I realize that Linux can boot from almost anything, but I was wondering why no one has ever made a Linux OS that would run within Windows as an EXE, extracting data from an ISO image of Knoppix? Could it be somewhat tamperproof and then boot itself within a Windows frame?

I know this would be like a sandbox. It would be a more direct approach to Windows users making use of your software than dual booting and gives the extreme advantages of both software/operating systems and hardware because they would work within each other, like the printer command could forward to the Windows print manager or vice versa. Thus, new hardware would not require Linux drivers. It could access them from Windows itself. Yet anyone could close it and have a Windows interface untouched by Linux. As a common computing user, I don't have thousands of dollars to purchase emulation software. If my previous questions can be addressed, I would consider dumping Windows after 20 years of use. Time for something new.

If this was ever done, please send me an ISO image or download link. I think the problems of the licensing, updating drivers, etc. could be put to rest if Linux/Knoppix/Windows could be combined, even if separated within each other, for the sake of hardware updating and software blending. Justin Christian

Answer:

Modem: Your assumption is correct. The Robotics modem is a so-called "winmodem," which lacks essential controller chips to qualify it as a regular modem. The operating system has to "help" with the use of special drivers to provide the usual "at command" interface. Getting winmodems to work with Linux is in general possible but requires some levels of additional work that can exceed the acceptable required patience and time of the administrator or user.

A few "softmodem" onboard chipsets from Intel and IBM are supported by the Linux kernel, but most PCI or USB winmodems are, in my opinion, not worth the effort of searching or porting drivers because other alternatives in regular modems "just work" without needing to install additional drivers. If you are interested in the pros and cons of winmodems, check out the Linux winmodem support page [1] or Rob Clark's chipset and modem reference page [2] for more information and lists of mostly older modems and drivers. Because of the availability of broadband networking, analog modems are slowly dying out.

I have to add that I live in a small town in Germany in the middle of the forest where we still have no broadband access, believe it or not, so I have to use ISDN or analog modems myself when working from home. So, I know the problem you are talking about quite well. Luckily, modems and ISDN adapters are still available in computer shops. Whenever I need to buy such hardware, I make sure that I can return non-working devices to the shop and get a replacement or money back, so I don't have to go through the hassle of asking some salesman in the shop (who likely doesn't know anyway under which versions of which operating system a modem will work or, even, what a modem is) about Linux compatibility.

For Linux-compatible modems, I have quite good experience with the "Elsa Microlink" serial and the USB-type series, but be aware that at least ONE of these is a winmodem with a different chipset (it's somewhat cheaper than the regular modem with the same name). On a few mailing lists, I found reports about "Best Data 56K External Modems" working well, but I don't know if this is still available. I would go with just trying out modems available in your nearest shop and return them as a warranty case if they don't work. When checking the technical specs, look out for the term "softmodem" or "HSF chipset" on the package, which would indicate a winmodem that will most likely fail.

In general, once you plug in a regular USB modem, you should see a message in the output of the dmesg command to the effect of a new serial device ttyUSB0 detected or something similar for ttyACM0. The corresponding devices files should be created automatically by udev in /dev/ttyUSB0 or /dev/ttyACM0, depending on the type of modem. For modems connected via serial connector, the serial kernel module must be present and provides the /dev/ttyS0 interface file, which routes all modem commands to the modem. No drivers are needed for this. Now you can use wvdial, kppp, or a different program to enter your modem INIT commands for configuring the modem, dialing, and transferring your login/password data.

Running Linux inside Windows: GNU/Linux is not a "program," but a complete operating system, including applications. The major difference is not necessarily advanced technology or the lower cost of operation, but the freedom that the license gives you. Running Free Linux inside a proprietary operating system gives you no advantage in terms of security or legal use of the software. Having said that, of course you can use a virtual machine like Qemu or VirtualBox on Windows to start other operating systems in a window: Just tell the virtualization to use an ISO image instead of a real CD or DVD so you can start Knoppix (or other Live systems) directly from DVD.

The guest system has very limited access to the hardware driven by the host operating system (Windows in your case) but "sees" only virtual hardware simulated by the virtual machine. Although this setup is good for testing, I doubt that it's as much fun as running GNU/Linux directly on real hardware. For more information about running the Linux operating system and Linux applications on Windows, see "Running Linux in Windows" (pg. 24).

Print Server Woes

Question:

Dear Klaus, I am really happy with the Linux installation I use for my home file/printer server. I installed openSUSE 10.something more than a year ago and, apart from some occasional power failures and intended restart, it is up and running continuously. So far so good. As we have both Linux and Windows XP PCs in our home network, I set up a Samba server on the file/printer server that, after some initial problems, now runs smoothly. The problem I am writing about is the following.

When submitting a printing job from one of the Windows machines, we have to wait until that job has finished its work before submitting a follow-on printing job. If we are in a hurry and forget to wait, the print simply does not start and hangs in the Linux printing queue. And one other annoying thing about the printing issue is that, occasionally, the printer (an HP 720C Deskjet, properly recognized by Linux at installation time) just hangs up. The lpq command tells you that the job is actively printing, but nothing happens. The only thing I can do about this is clean the printing queue with cancel -a and manually switch off the printer. Usually resubmitting the print job from the Windows machine results in a perfect print. I wonder what I can do about this? Regards, G.J. Prangsma

Answer:

First, please check that no client is printing to that printer (which might be connected using its own network interface card) directly, because this could indeed confuse the printer. All clients must use the printer server and send their print jobs there. I assume that you are running CUPS [3] on the server and have prepared /etc/samba/smb.conf correctly for this, as in the configuration in Listing 1.

Listing 1: Samba Configuration File
01 [global]
02
03 ########## Printing ##########
04
05 # If you want to automatically load your printer list rather
06 # than setting them up individually then you'll need this
07
08 load printers = yes
09
10 # CUPS printing. See also the cupsaddsmb(8) man page in the
11 # cupsys-client package.
12
13 printing = cups
14 printcap name = cups

CUPS will make sure that print jobs are put into a queue and worked on one after the other. This also applies to other printing systems like lprng, but configuration is different. With the aforementioned entries in /etc/samba/smb.conf, your printers will automatically show up for Windows clients as printers provided by a Windows printer server.

Just because you use CUPS does not mean you cannot use the usual lpr and lpq commands, which will be provided by the cups[ys]-bsd package and replace the original BSD commands. With this setting, queueing should work and no print jobs should get mixed anymore.

Now it can happen that a client sends an invalid file to the printer. The default in CUPS is to hold the queue and stop all print jobs, requiring manual intervention rather than losing a print job. This setting probably should be changed to discard invalid print jobs in your case so that the queue does not become blocked for everyone because of a single faulty job. To use the CUPS configuration web server that's running at http://localhost:631/ on your CUPS print server, select the printerin question and change its error policy settings. Each access to CUPS, each file printed or rejected, is logged in /var/log/cups/access_log. This file gives you additional information about why print jobs fail. Perhaps your server just runs out of space to store large (photo/graphics) print jobs.

If you use a printing system other than CUPS, make sure it is configured to support concurrent printing (which could be called "queueing" or "locking support"). Simply installing a filter that prepares data for the printer is not sufficient if no management of different inputs exists.

Basic Interpreters

Question:

Klaus: I am a die-hard Basic programmer. I want to program in Basic under Knoppix Linux. (I recently ordered a CD with the latest version of Knoppix.) Will I be able to install Wine and then be able to install just BASIC or Liberty BASIC into Wine under Knoppix? If this is not a good idea, can I install Gambas into Knoppix? My eventual plan is to install Knoppix to a 4GB thumb drive and create and compile Basic programs from there. Any advice you could give me about the best way to proceed would be appreciated (i.e., any installation tricks or command-line code that would help me put this together). Sincerely, W. Bergin

Answer:

Once you have copied Knoppix to a flash disk and created an overlay file on the first boot for adding software and storing your personal settings, you can add various basic interpreters, as in any Debian-based distribution, by first entering

sudo aptitude update

to update the database of installable packages from the Internet and then entering one or more of the following:

sudo aptitude install -t unstable bwbasic
sudo aptitude install -t unstable sdlbasic
sudo aptitude install -t unstable yabasic
sudo aptitude install -t unstable gambas2

Bwbasic is a very small basic interpreter, whereas sdlBasic is especially designed for creating games, and yabasic works with Linux as well as Windows.

Gambas is a comprehensive, graphical programming environment [4] with many Basic-like constructs and therefore a good choice if you want to do serious Basic programming in Linux.

Running Windows basic dialects through the Wine emulator would be possible, too, but because there are so many possibilities in native Linux applications, I would not recommend this.

Dynamic IP Setup

Question:

Klaus: We are beginning the use of Linux in many of our network classes. I have loaded FC11 and have it set up to work as a server, successfully testing the IP address and httpd and validating that the web service test page works. I have updated the system and have the DHCP service on in the services area, but each time I try to service dhcpd restart, it fails. I also have a conf file in /etc under dhcpd.conf. Any ideas I might try to have this work? Thanks, Ken Scott

Answer:

The correct error message would be very helpful in this case. It probably says that the networks that are defined in /etc/dhcpd.conf (/etc/dhcp3/dhcpd.conf in Debian) don't match the IP address of the network adapter that is supposed to serve the network. A simple error in choosing the wrong interface name can be the reason.

Setting up dynamic IP distribution can be a complex task, depending on your network topology and whether or not you plan to also boot computers over the network with PXE.

A quite minimal dhcpd.conf looks like this:

# global settings
default-lease-time 600;
max-lease-time 7200;

# subnet for clients
subnet 192.168.0.0 netmask 255.255.255.0 {
 not authoritative;
 option subnet-mask 255.255.255.0;
 range 192.168.0.100 192.168.0.250;
 option domain-name-servers 192.168.0.1;
 option routers 192.168.0.1;
}

In this example, the DHCP server is also the nameserver and gateway for the client network, and has IP address 192.168.0.1 netmask 255.255.255.0. The network adapter that is supposed to serve the client network MUST already be configured to the correct IP and network address; otherwise, dhcpd will not start.

The system log protocol (/var/log/syslog) might give you a more verbose error message if dhcpd does not start.

Dongle Modems

Question:

Klaus: I have several Panasonic Toughbooks (cf-27) on which I have installed Vector Linux light. The system works pretty good, apart from getting a USB Dongle cellular modem such as an E220 from Huawei to be recognized and to work.

The Toughbook has the necessary hardware since the E220 worked on a Toughbook with Windows XP on it! Why, you might ask, am I bothering with VL and the Toughbooks? Well, they were cheap and appropriate for a project I am working on to help get Linux more recognised in Ghana. I don't know that much about Linux, but it's more than the average Ghanaian, who in reality mainly uses a cloned version of Windows without the security updates. They would be better off with Linux.

Question: Could you explain a bit about dongle modems, how they work. In Windows, they work with drivers that sit in some file. How does Linux "talk" to the modem? Could somebody spell out different paths somebody like me could go down to get the modem to work? Somebody on a forum stated "get the programme to run with root permission," as if I might have a clue how to do this! Andy Brookes

Answer:

I assume here that you are talking about the Huawei E220 USB modem. This has an interesting "Windows Feature": It announces itself as a CD-ROM first, to allow the automatic driver installation in Windows. However, this feature is not needed in Linux; here, you only need the standard usbserial driver. Linux kernels higher than version 2.6.19 will automatically skip the "CD-ROM" mode, but in older kernels, you might still see a CD-ROM for a while until the modem switches back to "serial mode."

Apart from this, the modem works perfectly with Linux. Once you plug it in, udev creates a serial device file /dev/ttyUSB0 or /dev/ttyACM0, which is the modem communication file that you can use with any dialer GUI, like wvdial or kppp or network-manager.

Starting a mobile connection means that you have to:

  1. Enter the PIN code to make the modem accessible, via the modem at+cpin=pin_number command.
  1. Enter your mobile provider's so-called "APN" signature via the at+cgdcont=1,"IP","APN" command, where "APN" is the special name provided in your provider's information that (hopefully) came with the modem.
  1. Finally, start the dialing and connection process with the ATD*99 *1# command.

Once the connection is established, the dialup GUI of your choice should start pppd, which requires a login/password authentication pair, with arbitrary values for both the login and password. The real authentication is of course being done by the identification of the SIM card inside the modem, which will be transferred on the lower level of the GPRS/UTS protocol without any need for interaction.

After this authentication, pppd acquires an IP address, sets the default route for your computer, and you are connected.

INFO
[1] Linux winmodem support: http://www.linmodems.org/
[2] xmodem.org: http://xmodem.org/
[3] CUPS: http://www.cups.org/
[4] Gambas: http://gambas.sourceforge.net/