Hardware on Linux
Från Wikipedia, den fria encyklopedin.
Innehåll |
Mobile broadband
I got it working with a dongle from Comviq, having the brand Huawei E1550.
The above worked for me. If it doesn't for you, maybe the following might do:
LED
Wifi LED on Thinkpad
Audio
Digital Audio
Optical audio works out of the box for me. I am running Ubuntu 8.10 on a Asus p5n7a-vm motherboard, which has integrated NVIDIA GeForce® 9300 GPU.
Just make sure it is enabled in the sound mixer: System->Preferences->Sound.
For Ubuntu 9.04 it was no longer working out of the box. After installing the latest ALSA driver it started working though! Use the upgrade script here: http://ubuntuforums.org/showthread.php?p=6589810
USB Speakers
USB Speakers are seen as another sound card, therefore you have to change the preferred sound card in System Settings -> Multimedia.
Also change the master channel to the USB speaker by right clicking on the speaker in the notification tray.
Fan control and show motherboard sensor values
If your motherboard has PWM support you might be able to control the fans using fancontrol.
- Follow this guide to display your sensor values (don't forget to install a gui/applet, I used this one sensors-applet): https://help.ubuntu.com/community/SensorInstallHowto
- For fan control, run sudo pwmconfig and follow the guide to setup config file
- start fancontrol: sudo /etc/init.d/fancontrol start
Fan control should now start automatically every time the computer starts.
Links:
Example of the gnome sensor applet (from my HTPC):
![]() |
Firewire
Follow this guide:
http://www.aldolat.it/2006/12/08/kino-e-firewire-su-ubuntu-edgy/
Unless you know italian, you should probably run the site through Google translator!
Mobile phone
Phone Managers
Obextool
Follow this guide to be able to access your Nokia phone content (both internal and memory card).
KMobileTools
"KMobileTools is a nice KDE-based application that allows to control mobile phones with your PC. It handles full SMS control, dialing calls, phonebook, and phone status monitoring. It's also integrated with the KDE environment, so it can be embedd in Kontact, or import/export from and to KAddressBook. It has been tested on Motorola, Nokia, Siemens, Sony Ericsson and LG mobile phones. Anyway each AT Command compliant device should be well supported."
- Site: http://www.kmobiletools.org/
- Package: kmobiletools
Wammu
Another mobile phone manager. Claims to support almost everything, but I had some problems with it.
- Site: http://wammu.eu/
- Package: wammu
Gnokii
Did not get this to work with my Nokia 6300.
- Site: http://gnokii.org/
- Package: gnokii
- Nokia 6300 tutorial: http://graemehunter.co.uk/2007/05/linking-your-nokia-6300-mobile-phone-to-ubuntu/
Mouse
Bluetooth mouse
Latest working
http://ubuntuforums.org/showthread.php?p=1440347#post1440347
Older tips
I got my Logitech V270 bluetooth mouse working after following the bluetooth mouse tutorial at Ubuntu.com, with the following addition:
In the tutorial it says that you should restart the bluetooth service. However, when I did that, I always got an error message complaining about SDP server not running. I solved this by running the command hcid -s before restarting service. I found out this info from a bug report at https://bugs.launchpad.net/ubuntu.
Microsoft Intellimouse
Follow this guide to make the thumb buttons work as they do in Windows, i.e. going back and forth in history for file manager and web browser!
- Make sure the package imwheel is installed
- Create the file .imwheelrc under your home directory:
vim ~/.imwheelrc
- Add the following content to that file
".*" None, Thumb1, Alt_L|Left None, Thumb2, Alt_L|Right
Thumb1 is your left thumb button, which will be bound to the keyboard shortcut Alt+Left. ".*" means that it will be active for all windows.
- To activate run the following command:
imwheel -f -k
- Try it out in Firefox, Konqueror or whatever listens to Alt+Left/Right...
- To make it work every time the computer is restarted, add the command as a script under ~/.kde/Autostart/.
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen" 0 0
InputDevice "Generic Keyboard"
InputDevice "Mouse0"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/input/mice"
EndSection
Links:
- http://imwheel.sourceforge.net/imwheel.1.html
- http://gentoo-wiki.com/HOWTO_Advanced_Mouse
- http://gentoo-wiki.com/HOWTO_Mouse_Nav_Buttons
- http://gentoo-wiki.com/HOWTO_Advanced_Mouse/Individual_Configurations
Printer
Installing a HP printer
Alternative 1
Simply use HPLIP to install your HP Printer. Works even if it is on the network.
If you are on Kubuntu (7.04 or later) it's already installed. Just go to KMenu -> System -> HPLIP.
Alternative 2
System Settings -> Printers -> Add
Canon (IP4600)
Ubuntu (8.10) might automatically install some driver when you attach the printer to the computer. This driver did not work for me at least, instead the following steps worked:
- Download and install linux driver from Canon's website (http://software.canon-europe.com/products/0010649.asp)
- Use the wizard in Kubuntu to add a local printer and select Canon and IP4600 in the list.
Turn off pc speaker
You can disable the, usually annoying, pc speaker by editing a file and entering two simple lines.
vim /etc/modprobe.d/blacklist
And then add:
#silly speaker beep blacklist pcspkr
Save your file and the speaker beep will be gone when you reboot. If you don’t want to wait until a reboot, simply type:
sudo rmmod pcspkr
Thanks to ArsGeek!
Keyboard
Keyboard on laptop
So I noticed that the default keyboard layout wasn't really working. For instance I was not able to use the button next to the left shift key, i.e. I could not type '|', '<' and '>'.
To make it work I entered control center (KDE menu -> Computer -> KDE Settings). Then 'Regional & Accessibility' -> 'Keyboard layout'. Here I changed 'Keyboard model' to 'IBM Thinkpad 560Z/600/600E/A22E'. Voila!
I also noticed that this changed the function of the 'Win' key to be what I am used to for Linux, before this, all it did was opening the KDE Menu, but now I can instead use it for shortcuts, much like a second 'Ctrl' key. Nice!
Remote Control
KDE Lirc
There is a nice tool for KDE which simplifies the task of setting up buttons to control different functions in different applications. Before using this tool, Lirc must be installed and configured, see #Microsoft MCE remote control.
To be able to use this tool install kde-lirc, then run irkick. A icon will show in the tray, right click it and select configure....
The tool is pretty straight forward. If you've set up Lirc correctly your remote control will show up in the left pane. Click add under that pane to setup different modes. A mode is, for example, a specific application, e.g. AmaroK or Kaffeine.
Actions added directly under the remote will always work. Actions added under a specific mode will only work when that mode is enabled. Preferably you should enable a mode by assigning a button to it directly under the remote.
VLC
As VLC does not have a DCOP interface, it's a bit more work to get IRKick to work with VLC. But it's possible with some workarounds:
- Start VLC with the additional http interface
vlc --extraintf http --http-host=localhost:8888
- In IRKick add a new button that uses the action 'I wish to manually select a function from a running program'.
- When selecting program choose 'klauncher' -> 'klauncher' -> 'kdeinit_exec'
- Set first parameter to 'wget'
- Set arguments to 'http://localhost:8888?control=pause', '-O' and '/dev/null'
- Change pause in the URL to be whatever you want it to be, see this page for more commands.
- Move /usr/bin/vlc to /usr/bin/vlc_prog
- Create a new script under /usr/bin: sudo vim /usr/bin/vlc.
- Add the followinging line to the script: vlc_prog --extraintf http --http-host=localhost:8888.
- Make the script executable.
Microsoft MCE remote control
I have gotten my MCE remote working with MythTV media center.
It is now rather simple, just run:
sudo apt-get install lirc
And select your remote in the installation wizard.
Older instructions
LIRC must be installed, I did not get it to work by just installing it with a package manager, although some people claim they have gotten it to work that way too. Go to their homepage and download the latest release.
I also had to install the package g++ before I was able to install LIRC.
Instead of just copying a lot of text I will redirect you to an excellent tutorial on how to get it working: MythTV - Ubuntu Lirc Install
Still not working? Check out these as well:
- MCE Remotes Tutorial Note: they forget sudo sometimes here even though it's needed
- Ubuntu.com - Lirc Edgy
Other nice links:
Here is my configuration for .lircrc.
IRExec
Using irexec you can execute pretty much any program using your remote, and also supply parameters to the program. I use it for instance to control MPD.
Note that irexec must be running for this to work! Whenever you reload lirc, irexec has to be started again.
To run irexec, type:
irexec -d
This will set it in daemon mode.
Autostart
You probably want to autostart the irexec daemon when the computer boots. This is done as with any other program, by
- For KDE - adding a desktop shortcut to ~/.kde/Autostart
- For GNOME - adding an entry under System -> Preferences -> Sessions
Start a program
begin remote = mceusb button = DVD prog = irexec repeat = 0 config = /usr/bin/xbmc & end
Turn off computer using remote
- Make sure you don't have to provide a password for using the shutdown command:
- sudo visudo
- Add the line <username> ALL = NOPASSWD: /sbin/shutdown (replace <username> with your username)
- add this to ~/.lircrc:
begin remote = mceusb button = Power prog = irexec repeat = 0 config = sudo /sbin/shutdown -h now & end
Suspend computer using remote
- Make sure you don't have to provide a password for using the suspend command:
- sudo visudo
- Add the line <username> ALL = NOPASSWD: /usr/sbin/pmi action suspend (replace <username> with your username)
- Install PMI package sudo apt-get install powermanagement-interface
- add this to ~/.lircrc:
begin remote = mceusb button = RecTV prog = irexec repeat = 0 config = sudo /usr/sbin/pmi action suspend & end
Tips
- Whenever you have modified your config file ~/.lircrc make sure to restart the lirc daemon by sending the HUP signal to it (kill -HUP <pid>).
Graphics
HDMI
Works out of the box for me on my Full-HD LCD. I am running Ubuntu 8.10 on a Asus p5n7a-vm motherboard, which has integrated NVIDIA GeForce® 9300 GPU.
Changing screen resolution on the fly
-
First make sure that /etc/X11/xorg.conf is configured to support more than one resolution. For my dual display I have a line looking like this:
... Section "Screen" ... Option "Metamodes" "1600x1200,1600x1200;1024x768,1024x768" - Restart X-Server if you've changed your xorg.conf
- Use xrandr to change resolution in one of two ways:
- Download http://www.kde-apps.org/content/show.php/xramdr?content=70521 which is a nice GUI for xrandr
- Write something like: xrandr --output default --mode 2048x768
Drivers
Intel graphics drivers
As of (K)ubuntu 7.10 intel graphic drivers are installed right out of the box. On most Intel computers it will work without requiring any changes.
Thinkpad Z60t
After version 7.10 if Kubuntu the instructions below were no longer needed for me
This computer has an integrated Intel graphics card from the Mobile Intel® 915GM/GMS, 910GML Express Chipset Family.
Intel has quite a good support for Linux drivers, to install simply run the three commands on the download page. Then round up by following section 4 of the install guide. Some comments on the install guide though:
- all the stuff mentioned about editing xorg.conf was not needed for me, everything was already there. It also says that you should change the driver in xorg.conf to 'intel', which did not work at all for me, I just left it as it was ('i810'), and it worked perfect.
- the modprobing stuff. First of all agpgart module wasn't found on my comp, I just ignored it and it still worked fine. On Sabayon (maybe Gentoo in general?) to automatically load modules add them to the file /etc/modules.autoload.d/kernel-2.6, so that is where I added intel-agp, drm and i915.
HP 6510b
My work laptop required some tweaking to make it work flawlessly. See my solution here.
Nvidia
New method
Works out of the box with Gutsy (8.04). Install nvidia-settings if you want to configure tv-out etc. Only manual thing I had to add was:
Option "TVOutFormat" "S-VIDEO" Option "TVStandard" "PAL-G"
Under device. Complete device section:
83 Section "Device" 84 Identifier "Videocard1" 85 Driver "nvidia" 86 VendorName "NVIDIA Corporation" 87 BoardName "GeForce 6150" 88 option "TVOutFormat" "S-VIDEO" 89 Option "TVStandard" "PAL-G" 90 BusID "PCI:0:5:0" 91 Screen 1 92 EndSection
Old method 1
Installing drivers for the graphic card can be a real pain. However I found out after a lot of trying and searching that the following method works well:
- Download the latest driver from Nvidia
- Go into terminal mode (Alt+Ctrl+F1)
- Stop the X Server:
GNOME/etc/init.d/gdm stop
KDE
/etc/init.d/kde stop
- Uninstall all nvidia packages, e.g:
nvidia-kernel-common nvidia-glx
- run the installer you downloaded earlier:
sudo sh <NVIDIA-installer-file>.run
I got some warnings during the installer, but I just pressed ok, and it still worked fine.
- Start the X Server again. If it doesn't work, it probably works after a reboot.
Old method 2
Install package nvidia-glx, then make sure you use the driver nvidia in xorg.conf. Check out my configuration file here.
TV-out
To make TV-out work it's all a matter of typing in the correct stuff in the Xorg config file. Here is my config file which disables the monitor and enables the TV (since my graphics card does not allow both at the same time).
Thanks to Promete who wrote the HOWTO that made it happen for me!
Links
- HOWTO: change resolution/refresh rate in Xorg - A very good and complete HOWTO, the title actually does not give it justice, it has so much more. For instance it will help you if the desktop on your TV is larger than it should be!
Hard drives
Disable file system check on boot
Set the last number in fstab to zero. For example, change:
/dev/sda5 /mnt/sda5 ext3 relatime 0 2
to:
/dev/sda5 /mnt/sda5 ext3 relatime 0 0
Filesystem check
sudo fsck -VC /dev/sdXX
Replace X with correct letter and number, e.g. /dev/sda2. Change s to h if not running sata disks, e.g. /dev/hda2. V=verbose, C=progress counter.
ext2 -> ext3
Convert an ext2 partition to the superior ext3 by writing:
tune2fs -j /dev/<partition>
Mounting an NTFS drive
- sudo fdisk -l <- Check what drive is the NTFS drive, in my case it was /dev/sda1
- sudo mkdir /mnt/win <- create a dir to mount the drive on
- sudo mount /dev/sda1 /mnt/win -t ntfs -r -o umask=0222 <- perform the actual mount
- -t indicates the filesystem to mount.
- -r indicates that it should be readable.
- Without -o umask=0222 the mounted drive would only be readable by root user, with it it will be readable by all and executable by all.
fstab
By adding the drive to /etc/fstab it will be automatically mounted everytime you boot. Example of line to insert into fstab:
/dev/sda1 /mnt/win ntfs umask=0222 0 0
Adding a new hard drive
http://wiki.linuxquestions.org/wiki/Add_a_new_hard_drive
Using S.M.A.R.T to check the health of your hard drive
Are you hearing strange sounds from your hdd? Then it's about time to install the SMART monitoring tool! Install the package:
smartmontools
Then run the following to enable smart for your hdd:
sudo smartctl -s on /dev/hda
(assuming that the hdd is indeed hda)
To perform the hdd check:
sudo smartlctl -a /dev/hda
The examples above are for ATA disks. If you instead want to see the status of a SATA disk, it would look something like this:
sudo smartctl -d ata -a /dev/sda
There are features like creating mail when errors occur etc which might be nice, but I haven't looked into that (yet).
Moving Linux installation to a new hard drive
- Boot up a Live CD (to make sure the partitions you are working with are not in use)
- Set up the partition table of your new hard drive. Use for instance gparted (comes with the Ubuntu install CD).
- One primary partition, ext3
- One primary partition, linux swap (at least 256mb, I used 1gb)
- mount the new hdd
mkdir /media/newdisk sudo mount /dev/hdb1 /media/newdisk
If your new disk is indeed hdb1.
- copy all files to your new hard drive
cp -av /* /media/newdisk
- change fstab on new disk:
sudo vim /media/newdisk/etc/fstab
Look for the line where mount point is / (root) and change the device there to be your new disk.
- change grub on old disk to point to your new disk.
sudo vim /boot/grub/menu.lst
Look for the strings:
root (hdx,y) root=/dev/hdxy
Where x and y is of course some value. Set these values to point to your new disk.
- Reboot
- Linux should now boot up on your new disk. When it's done booting you reconfigure grub to use the new disk.
sudo grub root (hdx,y) setup (hdx) quit
- Reboot All done!

