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

Network Connections

Question:

I wrote last year about connecting to Optus from Linux. I have since bought a wifi router to use with the ADSL modem. The first instruction in the router setup was to set the modem mode to nat or napt, as Optus has modems modified to use something called optus-bridge, which seems to restrict the user to one computer. Changing my Seimens modem to napt mode allowed most Live CDs to work out on boot up with any DHCP program. This may help others with similar problems.

Note that if you are using a fixed address, each new distro needs a different fixed address; I don't know why.

Answer:

Setting up the DSL modem to Router/DHCP mode with NAT (network address translation) is surely the easiest setting from the client side. All provider-specific information is stored inside the modem that had been set up previously, and on the computer side, all you have to do is select automatic ip configuration via DHCP. Note that in this setting, the IP address acquired by the computer is not the one that is being seen from the Internet side because NAT maps every internal IP address to the external one. A security advantage of this is that no connection can be initiated originating from the Internet to the home network, unless your computer has initiated that connection first.

It should well be possible to connect multiple clients with different client IP addresses over the same router. With static IP addresses, each real or virtul machine needs a different IP address, which is what the DHCP server takes care of when clients use DHCP for configuration. Running a different OS from the same machine, however, should not require a different IP address, as long as the old address is not still in use.

Live USB Creator

Question:

I read this InformationWeek article today (http://www.informationweek.com/story/showArticle.jhtml?articleID=207800392) and was disappointed not to see a word about Knoppix! I am a long time Knoppix user, over 5 years, and would like to see a script developed that has the simplicity of that which is offered by Fedora (ugh), but their script is elegant in its simplicity! See: https://fedorahosted.org/liveusb-creator.

I know that the Knoppix community can match this and not make building a USB Flash bootable Knoppix such a headache as it currently is.

How about it Mr. Knopper? I would like to be able to download the most current Japanese Knoppix and build a flash so that it can easily travel with me and as a side benefit I can listen to music CDs or watch a DVD under Knoppix on my laptop.

Answer:

It's already done, the command is called mkbootdev on your Knoppix DVD.

Basically, what it does is copy the Live CD/DVD content to a FAT16/FAT32 filesystem, moving the boot files from boot/isolinux/* to the root directory of the flash disk, renaming isolinux.cfg to syslinux.cfg, and executing syslinux /dev/sda1 (in this example, /dev/sda is the flash disk). Depending on previous installations, it might be necessary to also create a master boot record by ms-sys -s /dev/sda and marking the first partition bootable with sfdisk -A1 /dev/sda.

CD Format

Question:

I have a Windows XP home computer with CD burner, but I have been experimenting with Linux Live CDs for a while.

All the various Linux mags seem to give out discs with a DVD format I cannot handle.

Is there a way for me to convert a Linux DVD to a CD-R on my friend's computer that has both DVD and CD drives?

I think it is possible by ripping the DVD, but I do not know how to do that.

Answer:

Windows should be capable of reading the standard ISO 9660 filesystem that is used for both CDs and DVDs. Linux prefers the Rock Ridge extension (mkisofs option -R), Windows prefers Joliet (mkisofs option -J) for long and mixed-case file names. Combining -R/-r and -J when creating a CD filesystem with the mkisofs command adds both extensions, so neither Windows nor Linux should run into problems. For example,

mkisofs -D -r -J -o /tmp/mycd.iso source_directory

will create the ISO image /tmp/mycd.iso that is compatible with Linux as well as Windows CD filesystems.

For DVDs, UDF is sometimes used to support single files inside the filesystem structure that are larger than 4GB, as well as other extensions that are found on Video DVDs. Normally, you should not need this mkisofs -udf option.

Converting DVD videos to SVCD videos, thus decreasing size and quality, is a different topic. For this task, you can use dvdbackup and ffmpeg.

Some commercial DVDs have a country code and CSS as "copy protection." In most countries, it is not legal to play or even read these on ANY operating system ifyou have not paid for a valid license key for the software or hardware player, even if it is technically possible.

Specifically, for videos, the DVD drive can refuse to play if its country code does not match that from the DVD, unless you change the drive's country code.

CD and DVD images made by mkisofs or growisofs with the -r and -J option, however, should always be readable on a large variety of operating systems without problems.

Knoppix 5.3.1

Question:

First, I would rather have sent an email to you at KNOPPIX, but I could not find an email address. I do not have actual Internet service. I only have this dial-up email account. I live in America, where the infrastructure to support technology does not exist in most places.

Yesterday I got the Knoppix 5.3.1 DVD as a cover disk for Linux Pro magazine. I immediately found that many of the programs either simply quit, or they lock up the computer such that only a reset is possible. It is not due to any errors reading the DVD. It is caused by Fusion.

To correct this, I have edited the xorg.conf file and changed to false the true in the line

Option aiglx "true"

Then I restart X.

This fixes most of the problems, but still KDE is not working the way it used to work.

Are there other things I must do to remove the effects of Fusion? (I suspect the KDE build was optimized for it.)

Answer:

Your computer seems to have a rare case of a graphics card that supports Composite+AIGLX (which is what Compiz needs), but the driver in xorg seems to be unstable for this specific chipset.

Booting with knoppix no3d will disable Composite, and therefore also Compiz, in xorg.conf. Also, you can manually disable Composite by searching for this section in xorg.conf:

Section "Extensions"
       Option "Composite" "Enable"
EndSection

Change to "Disable", or just remove the option, then you have to restart X.

Composite is probably the real problem here, not AIGLX itself, in that composite makes heavy use of the graphics driver's transparency feature. Newer KDE versions also check for Composite and use it for certain effects, such as transparent buttons; therefore, switching off AIGLX or not using Compiz won't help much.

An upgrade of your graphics card-accelerated xorg driver might help to get Composite working at a later time:

aptitude update ; aptitude install xserver-xorg-video-ati

(as an example for ATI cards), but for now, disabling Composite seems to be the safe option for your setup.

Unsupported Frequency

Question:

I work with two screens under Windows, but Linux says "Unsupported Frequency" and then turns one of the screens off. How can I work with two screens under Linux?

Answer:

It's not Linux that says "Unsupported Frequency," it's your monitor that does this and switches itself off afterwards. Just as you did when setting up the Windows driver for two monitors, you have to tell X server to use both monitors and the way you plan to do this (i.e., one monitor as an extension of the other, or parallel). The site http://gentoo-wiki.com/HOWTO_Dual_Monitors has a good description of how to do this.

Usually, you don't need a special "driver" for this, but you do need an entry in /etc/X11/xorg.conf.

Tale of Two Monitors

Question:

I have two monitors: a Samsung and Proview. I also have an Nvidia Geforce 7100 video card. The distribution I am using is Fedora 9 because it comes with the precompiled Nvidia drivers.

Fedora recognizes both monitors automatically, and what I want is to have two independent desktops.

If I go to the desktop configuration menu, it lets me activate the second monitor, but when I restart the graphical environment to activate the changes, everything goes back to the original settings. Can you give me a hand?

Answer:

If you want to have two independent desktops, you would use one monitor per graphics card, and you have to start one X server per graphics card. Note that this is different from using a dual-monitor setup to create a single huge "widescreen" desktop that spans across two monitors. For the latter, the website http://gentoo-wiki.com/HOWTO_Dual_Monitors has a nice description on how to accomplish this.

The reason activating the "two-monitor setup" you described fails to work might be because restarting just one X server is insufficient. Rather, you need to make sure that two X servers with two independent xorg.conf files are running - the first, for example, with:

Xorg -config /etc/X11/xorg-0.conf :0

and the second with:

Xorg -config /etc/X11/xorg-1.conf :1

To get the correct graphics cards (probably the PCI option in the Device section) running, you have to edit both xorg-0.conf and xorg-1.conf. Now, I don't know whether your Nvidia card is recognized as a dual setup. If so, it should show two entries in lspci -v. To get the PCI numbers for each xorg.conf, you can use the addresses shown by lspci -n, but it could also be that it's just not possible with this card.

If it is, or if you decide to install an additional card, you have to make sure that the display manager (XDM, GDM, or KDM) starts two X servers. Try to find the corresponding Xservers file for your display manager (updatedb ; locate Xservers) and add another line to start the second server:

/etc/X11/xdm/Xservers:

:0 local /usr/bin/X :0 vt7 -config /etc/X11/xorg-0.conf -nolisten tcp
:1 local /usr/bin/X :1 vt8 -config /etc/X11/xorg-1.conf -nolisten tcp

Next time XDM starts, it will run two X servers, each using one card with monitor attached and displaying a login window.

A problem I could imagine is trying to determine which keyboard and mouse is supposed to be the input device for which X server? To use this setup, you would need to install a second mouse and keyboard.

Widescreen Laptop

Question:

I have just got a Lenovo T61 with Ubuntu 8.04 installed on it. It is the widescreen model, and the Ubuntu is great ... all except for one important detail. The PC projectors I have to use when I visit businesses to make presentations are not widescreen. I  ave tried to set the screen resolution to 1024x768 (or other screen resolutions that are non-widescreen), but strangely, Ubuntu shows the screen limit at the new resolution, but the background image of the heron covers the whole of the widescreen beyond the border of the screen resolution I have just set.

When I run OpenOffice Impress in SlideShow mode, Impress fills the whole widescreen and leaves the PC projector only showing part of the image, even though I have the laptop set to the non-widescreen resolution of 1024x768. How can I get the laptop to work properly with the PC projectors?

I enjoy your column every month in Linux Pro Magazine.

Answer:

Notebooks and projectors have always been a disaster. The problems you describe are not even as bad as other things that can happen. Effects range from cut-off borders of the screen, wrong resolution, or no picture at all, to totally unusable resolutions and even frozen screens. It turns out to be a hardware problem: Showing a picture on the computer's internal display at the same time as on the projector is apparently a very difficult job for chipset designers.

I found that on a variety of small notebooks - namely those with a small resolution on the internal display - the quickest and best results can be obtained by switching off the internal display while adjusting the resolution for an external projector.

The program Xrandr can help you do this. You should call it from a script that allows you to reset back to the working internal screen resolution with a single keystroke so that you don't have to log in via SSH over the network to get the internal display back to working order. For example:

# Set projector mode
xrandr --output LVDS --off
xrandr --output VGA --auto
read -p "Hit return to get back to the internal display"
xrandr --output VGA --off
xrandr --output LVDS --auto

It is also possible to enforce a specific resolution. For the Eee PC, the only resolution that shows a picture on internal as well as external screens is 640x480:

xrandr --output LVDS --mode 640x480
xrandr --output VGA --mode 640x480

If you are running a window manager that is aware of the X ser-ver's resolution change feature (both Gnome and KDE are), your desktop will adjust to the new size automatically.

A GUI variant of this command is krandrtray for KDE, which will create an icon on the system panel that allows you to change resolutions on the fly, internally and externally, with a single click.

With some shell skills, you can build a  esolution/output toggle script with Xrandr and put it on the "change video output port" hotkey of your keyboard by modifying /etc/acpi/actions/hotkey.sh.

Connecting Mom

Question:

I am a happy Ubuntu user for the past 4 months (after using Windows since 1997).

I want to get the rest of my family on the Ubuntu/Linux train, but I have two problems:

I hope my questions are clear. Thanks for your enlightening answers in the Linux Magazine.

Answer:

Most GNU/Linux distributions including Ubuntu have a "share desktop" feature, which is in most cases VNC (the same you can use for Windows), FreeNX, or an RDP-based tool. It allows you to connect to a running graphical session and "take over" control if the other side gives permission by sending you an invitation with a password.

The easiest and probably most secure way for remote support would be the use of SSH with X-Forwarding enabled (ssh with the -X option), which also allows you to start graphical programs over the remote connection.

Connecting to a remote "Windows terminal server" is possible with the Rdesktop client. For proprietary extensions like Citrix, client programs are available for Linux, but I would try Rdesktop first. In either case, you get a desktop window that contains a running Windows session and allows you to log in with a password and run Windows programs on the server, or whatever you do with Windows.

For just connecting to a Windows file server, a Samba client like mount.cifs is sufficient. If you need to log in via a proprietary VPN first, (k)vpnc might be helpful.

Partitions Per Drive

Question:

Can you help with the sudden change (in recent distributions) of the maximum number of partitions per drive from 64 to 15?

I have just tried to install Mythbuntu, and it simply refused to format sdb19. Previously I had tried to install SUSE and the installer started to download 3.5GB because it could not mount the DVD from which it had been loaded.

I run a multiboot system with around 30 partitions per internal drive. The production systems are all in the higher partitions. The problem seems to be caused by libata and the long-term solution means starting again with a virtualized system, and I suspect that, in practice, the same applies to LVM.

Have you any suggestions which would help in the short term?

Answer:

A few possibilities:

The use of LVM instead of partitions is probably the cleanest solution in the long term, but it requires repartitioning, as well as backing up and restoring all data.