Answers 113

From LXF Wiki

Answers 113

<title>32 + 64 = 2 distros</title>

<question>My main reason for moving to Linux is to port some software developed on other platforms (beginning with W and with M) and written in Lisp. There are 32-bit and 64-bit implementations of the language available, which has me curious about ways to run 32-bit and 64-bit versions of Linux from the same drive. If I establish /home as a separate partition, as LXF often suggests, then I could compile zot.lisp to zot.fasl on that partition, but that name would be used both for 32-bit and 64-bit object files. Thus I would prefer to have separate /home partitions for 32-bit and 64-bit Linuxes. Can I pre-partition a drive into three partitions – call them X,Y and Z – and then run two installs, asking one to install 32-bit Ubuntu on X, requiring it to establish partitions / and /home on X, using Z as swap; then repeat this on Y for 64-bit Ubuntu including Z as swap again ? If I can, I’d like to know how to accomplish this. More generally, do I need to pre-partition a large drive if I wish to install several flavours of Linux – LXF reviews tempt me with their descriptions – if I wish to keep them out of each other’s way ? </question>

<answer>To take your last question first, no you do not normally need to pre-partition a drive before installation. Most distro installers include the facility to take care of partitioning, including resizing existing partitions. However, I think you are approaching this from the wrong angle. There is absolutely no need to use different home partitions. You could keep separate home directories for the two distros, but on the same partition, say greg32 and greg64. Use the same username, but set the home directory during installation. You may need to fiddle with permissions (see page 62 of last month’s magazine for more on this). This still suffers from one of the drawbacks of the separate partitions approach – you will have two copies of your source code and will need to keep them in sync, otherwise you could find yourself working with two different copies of zot.lisp. Plus all your other data, such as emails, would be split between the two home directories. You could deal with this by installing 32 and 64 bit versions of the same distro with a common home directory. That way all your settings would be the same whichever version you booted into. Now set up separate directories for your 32 and 64 bit compiler output, but use the same source directory. It may mean a little more work with your makefiles, but it would keep everything together and lead to far less confusion. </answer>

<title>Webcam capture</title>

<question>Can you recommend some software for capturing audio and video footage using a VoIP package? I have a friend who wants me to upload some video tutorials to the web, but I don’t have any software to capture it. I am using a Trust VoIP pack I normally use for Skype. I need to easily install (hopefully using the Ubuntu package manager), capture, edit and save in a standard format. </question>

<answer>There do not appear to be any convenient GUI programs for this, but a couple of command line programs work well: MEncoder and FFmpeg. As with all video encoding programs, the list of available options can be quite daunting, but if you ignore the esoteric parameters and stick to the basics it is quite easy. MEncoder is part of the MPlayer package, so if your camera works with MPlayer, you should be able to record from it. The first step is to identify your camera’s device; if it already works with Skype, the easiest way is to look in the Video Device section of Skype’s Options window. (It will probably be /dev/video0, unless you have more than one video device.) You can test the camera with MPlayer using

mplayer tv://

This should open a window showing your camera’s output. If the device is anything other than /dev/video0, you will need to specify it on the command line

mplayer -tv device=/dev/video1 tv://

If that works, you can probably record with

mencoder -tv device=/dev/video1 tv:// -ovc copy -o video.avi

which will record the camera’s output to the file video.avi – press Ctrl+C to stop recording. You can change the OVC (output video codec) option to another to record in a different format, but try it with the Copy codec first, as your camera may produce a suitable format without re-encoding. If you do need to re-encode, it may be better to use Copy, then re-encode later. Unless your machine is fast enough to keep up with the incoming data, encoding on the fly may result in dropped frames. You can re-encode to MPEG4 with something like

mencoder video.avi -ovc lavc -lavcopts
vcodec=mpeg4:vbitrate=800 -o newvideo.avi

to encode to newvideo.avi using the libav codec to produce an MPEG4 file with a bitrate of 800. MEncoder worked with the built-in webcams of my laptop and Eee, but not with the USB webcam I have on my desktop. For that I switched to FFmpeg, which does a similar job.

ffmpeg -an -f video4linux -s 320x240 -b 800k -r 15
-i /dev/v4l/video0 -vcodec mpeg4 myvideo.avi

The option -an disables audio recording; -f forces the use of Video4Linux for the input; -s sets the video size to 320x240; -b sets the recording bitrate; -r sets the frame rate to fifteen frames per second; -i gives the input device; and -vcodec sets the output format to MPEG4 (you can also use Copy as with MEncoder). The final option is the name of the output file. Press Q to stop recording, or you can specify the duration of the recording with -t followed by either a number of seconds or a time in hh:mm:ss format, so -t 90 and -t 00:1:30 are two ways of specifying the same duration. </answer>

<title>Six or half a dozen?</title>

<question>Alright, so I can make Gnome or KDE basically look like whatever I want it to, and I have hardware that’s supported in every distro I’ve looked at. Aside from the package manager, what should I really be looking for in a distribution? From my standpoint, it seems that many distributions are very redundant in their features, though logic tells me that if this were true, they would not have been created. What should I be looking for? When you are running the same desktop configuration, do different distros differ much in performance? I’ve been using Ubuntu since I started with Linux, while distro hopping with a second partition, but I don’t have the knowledge to tell whatworks best. </question>

<answer>To an extent, you are right. The heart of every distro is the Linux kernel, and that’s the same for every distro, which is why hardware support is fairly consistent across distros. Some may use a more recent version than others, and some patch it to add a few features. The same goes for the included software, a distro may apply their own branding or theme to KDE, but it is still KDE. What the distros do add are administration tools, which includes but is not limited to the package manager. So SUSE has the all-encompassing Yast, Mandriva has its Control Centre, which is a gateway to many smaller configuration tools they have created, while Fedora and Ubuntu have their own selection of configuration tools (and Gentoo has Vim). There are other differences, such as the way in which updates are released. Most distros only release security updates for the software bundled with a distro release, and if you want a later version you need to upgrade to a newer distro release. Ubuntu provides an option to upgrade an existing installation to the next release without re-installing, whereas a complete re-install is usually the preferred option with Fedora and SUSE. Most distros are community releases, and the community is often a distro’s strongest asset. Look at the mailing lists and forums for any distro you are trying to see the level of support and assistance available from the community, which is an often overlooked factor when choosing a distro. In the end though, it’s all about personal choice. If you are happy with your distro, stick with it. If you get frustrated by missing or outdated software or unhelpful forums, look elsewhere. If you get the itch to try something else, do so – it won’t cost you anything to try. However, you will learn more about Linux in general, and your distro in particular, if you stick with it instead of installing a different one each time you hit a snag setting up your webcam or you don’t like the desktop wallpaper. </answer>

<title>Remote DVD booting</title>

<question>I have a Pentium 3 laptop with not much RAM, but it does have a DVD drive. I have a Pentium 4 PC with 1 GB RAM, no DVD drive and VirtualBox installed. Both laptop and PC are networked and I normally access the PC from the laptop via SSH. I want to run distros from the LXFDVD in VirtualBox but the PC only has a CD drive and I’d prefer not to copy the DVD ISO image on to hard disk. So I installed NBD (network block device) software on the laptop (server) and PC (client) and do this: 1 Boot laptop 2 Boot PC 3 Put DVD in laptop DVD reader 4 Start nbd-server on laptop 5 Start nbd-client on PC 6 Mount /dev/nbd0 to /mnt/dvdrom on PC 7 Start VirtualBox and start a guest like Puppy from the DVD by using the CD/DVD mount ISO image tab under details (the ISO images on the DVD are in the Distro directory) 8 Enjoy Puppy (or whatever) Now, you might say, I could burn the Puppy ISO to CD and boot the CD from the host CD drive (which would save a lot of network traffic and may be faster). But if I have a distro that is on the DVD, like OpenSUSE 11.0, how do I get VirtualBox to boot the remote DVD? </question>

<answer>As far as I can tell, what you want to do is not possible with VirtualBox. It does not allow you to enter a device node for the DVD, and editing the configuration file to use /dev/nbd0 instead of /dev/cdrom does not work either. Similarly, telling it that /dev/nbd0 is an ISO image does not work either. In each case, VirtualBox does not recognise the device as a CD/DVD. However, the latter approach does work in VMware. Setting /dev/nbd0 as the CD/DVD device doesn’t work, but setting it as an ISO image does. You could use VMware Workstation or VMware Server instead of VirtualBox to run distros on the DVD, or you could copy the DVD to an ISO image on the PC. I know you said you didn’t want to do this, but it’s a more efficient way of doing it than using NBD. Not only would the transfer be faster, although that would be offset by having to copy the whole DVD, but it only has to be done once and in the background while you are not trying to run or install the distro on the virtual machine. You can copy the ISO image directly from the DVD drive to the PC by running this command on the laptop:

cat /dev/dvd | ssh -c blowfish ip-address “cat >~/lxfdvd.iso”

where ip-address is the address (or hostname) of the PC. The -c option switches SSH to the relatively insecure blowfish cipher. Although less secure, and not recommended for use on public networks, it is faster and reduces the load on both computers when transferring over a private network. You can then use the ISO image in VirtualBox, and it will run a lot faster than an NBD mount would have. The third option, and surely the simplest, is to fit a DVD-ROM drive to the PC. Your differentiation between this and the laptop indicates that this is a desktop computer, in which case a standard DVDROM drive can be bought for around £10 from an online supplier or a local computer fair, or a DVD re-writer for around £15. Unless there are good technical reasons for not replacing your CD-ROM with a DVD drive, I would suggest this as the fastest and most hassle-free solution. </answer>

<title>Office server</title>

<question>I am new to Linux and have been taking your magazine for three months. I want to install a file server in the office with web accessibility so we can all call code off the server. We also want to access emails (currently emails are picked up on one machine using Outlook, with no web access). Can you recommend a basic Linux server that would suit our requirements? </question>

<answer>Is this computer to be used exclusively as your server? If so, I would recommend one of the distros aimed at dedicated servers. ClarkConnect (www.clarkconnect.com) is best known as an internet gateway (a means of connecting a network to the internet with suitable content filters and access controls), but it can also be used as an intranet server. Because ClarkConnect (and similar distros like SME Server – www.smeserver.org) are put together for this particular purpose, they include all the software and admin tools you need. They are also potentially more secure than a general purpose distribution, because of their focus and the fact that they contain fewer programs. When installing ClarkConnect, you have a choice of a standalone server (one that is only accessible from your LAN and connected to the internet by your existing router), or as a full internet gateway. In the latter mode, it operates as a router and firewall for your network. If you already have a suitable ADSL modem/router, the standalone mode is easier to set up. The Community Edition is free but limited to ten users and without technical support, although there is community support on the forums. The Enterprise edition has a price tag, technical support, no user limit and some extra features. If you wish to use this in a business, the Enterprise Edition would be advisable. Once initial installation is complete, you can detach the keyboard and monitor for the server and put it somewhere out of the way. All administration is done via a web interface from any computer on your network (provided the user knows the password). This can include setting it up as a local mail server. This would collect emails from your ISP email account(s) using the maildrop module, and all computers on your network would be set up to read their mail from here. The server can also filter spam and viruses from incoming mails, saving the need to set up and maintain this protection on every computer in the office. </answer>

<title>Knoppix passwords</title>

<question>I have installed Knoppix on my hard drive and wish to configure dialup with Wvdial on my external modem. To do this I need root permissions but have no password. I have tried to gain permission with a Live CD without success. So how do I gain root/administration permission on Knoppix? Using ‘Root shell’ or ‘root password’ in the menu brings the message ‘su error’ </question>

<answer> Knoppix uses kdesu to ask for the root password when trying to run programs as root from its menus, but kdesu won’t work if there is no root password, which is how Knoppix is set up. Running a system without a root password is a bad idea, and not only because it stops kdesu working, so open a terminal as your normal user and type

su -
passwd

The first command will take you straight into a root session, because there is no root password – this is one of the reasons such a setup is bad. The passwd command will set the root password – type in your new password twice and all will be well. You’ll now have a more secure box and the programs that KDE needs to run as root will work. </answer>

<title>Understanding installation</title>

<question>I bought your mag for the first time, intrigued at the prospect of a free OS. Unfortunately, despite trying everything I can think of, I am unable to install VMware. I have a Linux version on trial ware which runs out in the next few days. On OpenSUSE 10 it appeared to install, but there were no options, such as which folder or the option to have a Desktop icon. Then I couldn’t find the program anywhere, let alone the icons on the desktop or indeed anywhere else. I now have OpenSUSE 11, and am experiencing similar problems. I also find that even a simple program that doesn’t normally require an installation, such as TrueCrypt, will not run. The program asks me which program to use to open it! How unintelligent. I have tried various things, but surely any modern OS should be able to recognise a program that is specifically set up for it? I have in desperation tried two other versions of Linux. All seem at least three generations behind Windows. Maybe I am assuming too much. It is free, after all. I also have a MacBook. I am not especially fond of it, but at least it recognises programs and appears to install them automatically. What am I missing here? Is there some generic process I have to go through to install and operate a program? I am very disappointed because I hate Vista. Everything seems bloated and it appears a waste of money. I am sincerely hoping that Linux can fill this gap. Please try and help. I will be very grateful indeed. BTW, if you suggest I have to use the CLI, please forget it. I left that system in 1993. </question>

<answer>It’s odd that you are interested in free software, but your first stumbling block is with a commercial program. The best way to install software on any distro is through that distro’s software repositories. While it is perfectly possible to download and install VMware Workstation from vmware.com, this is the Windows way of doing things. Linux distros have repositories of software packages that are tailored to fit in with that distro, including adding menu entries to launch the programs. They also have methods of letting you know when something has been updated, so you don’t need to check back with the web site to look for updates. However, the two packages you mention are atypical and do not appear in the OpenSUSE repositories. Download the RPM (not the tar.gz archive) from www.vmware.com. If you use the Konqueror web browser, click on the browser icon in the task bar, it will give you the choice of installing the file directly. Or you can download the file and then “run” it to install. If you use the tar.gz file, you will need to use the command line to install it. While TrueCrypt may run as a single file on Windows, on Linux it requires installation. Unfortunately, they choose to supply it in a weird format. This is an installer script inside a compressed archive, even though the archive is no smaller than the unpacked script, so you will have to use the command line for this. Open a terminal and type

su
tar xf truecrypt-6.0a-opensuse-x86.tar.gz
sh truecrypt-6.0a-setup-opensuse-x86

These three commands give you root permissions, unpack the archive and run the installer script. Replace truecrypt-6.0aopensuse-x86.tar.gz with the name of the file you downloaded, if different. This installer in turn contains an RPM file (RPM is the package format used by OpenSUSE) that could, if supplied separately, have been installed with no more than a mouse click, but the installer they use requires you to accept the licence before installation. While most distros have substantially reduced the need for the command line, many Linux users still prefer it because it is faster than clicking through a GUI. There are very few occasions when you absolutely have to use it, provided you stick with the distro’s way of doing things, but some software still requires the terminal, as is also the case with Windows. The terminal is a different way of doing things, but it is a tool to be used when appropriate, not avoided at all costs. </answer>

<title>Reeepositories</title>

<question>I have recently bought an EEE PC 901 and tried to add programs as in Mike Saunders’ tutorial on adding extra applications in LXF107. All I got was a load of error messages. I assume that the line

deb http://xn4.xandros.com/xs2.0/upkg-srv2 etch main contrib non-free 

is on a single line? I tried looking at the web address http://xn4.xandros.com/xs2.0/upkgsrv2 but could not find the directory etch, only dists and pool. I found AbiWord at http://xn4.xandros.com/xs2.0/upkg-srv2/pool/main/a. Where am I going wrong? Has the address changed or do I need to use a different address for the 901? </question>

<answer>The information you have entered looks correct. The address given in sources.list is the parent directory that contains subdirectories for various releases of the distro. The dist directory then contains specific information for those releases; in this case, the Etch and testing releases. The second item on the sources line, Etch in this case, tells the package manager which of the directories in dist to use, and the remaining items say which subdirectories to use, from dists/etch. Some of the repositories for the 900 series are different, but in most cases you can use the same repositories as the 700 series as the software runs on both sets of computers. It is only a few system packages that are specific to the different Eee variations. It is difficult to be more specific without knowing what the error messages were. Even if they appeared meaningless to you, they contain specific information that helps pinpoint the source of the problem. Were you using the Eee to browse the web addresses, or another computer? If the latter, I suspect a network problem – I have found the wireless handling in the Eee’s default Xandros installation to be a little unreliable. I would recommend trying again and capturing the error messages. Get back to us with the details, or post to the forums at www.linuxformat.co.uk, for a more detailed response. </answer>

<title>Third time unlucky</title>

<question>I recently took the leap of faith and decided to stop using Live CDs and install Hardy Heron on a standalone system. Hardy is brilliant but as a freshie to Linux I am at a loss as to how to share my internet connection between my one desktop running Win XP Service Pack 3 and the other desktop running Hardy 8.04. I have a Sky Netgear wireless router that comes as standard on Sky Broadband the Netgear DG834GT-SKUKS. The Linux desktop has a Wireless-G PCI Wireless Adaptor WG311 v3. I have done a search on the internet to no avail as some of the help out there is not easy for freshies to understand. Please help me before I’m sucked back to the dark side by uninstalling Ubuntu and installing XP on the second machine, which I am dreading. </question>

<answer> There are three versions of the WG311 card, using completely different chipsets. The first two are supported by the MadWifi and ACX drivers respectively. The v3 card uses the Marvel chipset, for which there is no useful driver right now. This means you have to use NdisWrapper, which in turn uses the Windows drivers supplied with the card. Install NdisWrapper through the Synaptic package manager, then copy the driver files from the CD to your home directory. The three files you need are, WG311v3.INF, WG311v3.sys and WG311v3XP.sys. If these are not available on the CD in anything but a Windows installer file (or you no longer have the CD), you can download them from www.jimbo7.com/wiki/files/good_WG311v3-driver.tgz. If that file is no longer available, Google for “WG311v3 linux wiki” – this is a set of instructions for Debian but the driver files are good. Once you have the files, open a terminal and run

sudo ndiswrapper -i /WG311v3.INF

to install and register the driver with NdisWrapper, then test that the module loads and detects your wireless card with

sudo modprobe ndiswrapper
sudo ifconfig -a

The first command should produce no output, and the second should show your wireless interface, wlan0. Now edit /etc/modules as root with

sudo gedit /etc/modules

and add ndiswrapper on a separate line at the end of the file. This loads the driver each time you boot, so your wireless card is available. Now you can set up the wireless connection using the standard Ubuntu program, System > Administration > Network. </answer>

<title>Playing host over Wi-Fi</title>

<question>My Hardy Heron desktop computer has two printers connected: an HP LaserJet that I use for correspondence and various business reports and an Epson photo printer that I use for my holiday snaps. Both work well, but I would like to be able to use them to print from my laptop that dual boots OpenSUSE and Windows XP, and my wife’s laptop that runs XP only. Can I share these printers to Linux and Windows over my wireless network? </question>

<answer>Linux uses CUPS (Common Unix Printing System) for all its printing needs. By default most distros set it to work only with the local computer but it’s a simple step to make it available over the network. Windows usually uses its SMB (Server Message Block) system to share files and printers, but it can also connect to printers using IPP, the Internet Printing Protocol, which CUPS uses. To make your desktop’s printers available to the local network, either edit /etc/cups/cupsd.conf and change the line starting BrowseAllow to BrowseAllow @LOCAL or use the browser-based configuration. Load http://localhost:631 into your browser, click on the Manager Server button and tick the box to share your published printers. Then go to the Printers section and check that each of your printers says published in Printer State. This way you can decide which printers are to be available. Turning to your laptop, running Linux, there are two ways to add the remote printers. The quickest is to edit /etc/cups/client.conf (create the file is it does not exist) and add

ServerName your.desktop.address

Where your.desktop.address can be an IP address or hostname. Now all your published printers are immediately available to all programs using CUPS forprinting. The only real disadvantage of this method is that all your printers must be connected to the same computer. If you want to use printers attached to different computers, you need to add them individually, either by using the CUPS web interface on the laptop or your distro’s configuration tools. The standard way of printing to a Linux printer from Windows has been to use Samba, and this is essential if you still use Windows 9x. More recent version of Windows can work with IPP. Fire up the Windows Add Printer Wizard from wherever your version of Windows hides it in the control panel and tell it you want to use a network printer. When it asks you if you want to browse for a printer, take the option to enter a URL, enter it in the form

http://hostname:631/printers/printername

where hostname is the name of your desktop computer and printername is the name given it in CUPS. Then you will be asked for a driver, if there is none for your printer model, select a PostScript driver, CUPS will take care of the translation. Finally, right-click on the new printer’s icon, go to Properties and print a test page to make sure all is well. </answer>