https://wiki.archlinux.org/api.php?action=feedcontributions&user=VitaminJ&feedformat=atomArchWiki - User contributions [en]2024-03-29T05:52:42ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Touchpad_Synaptics&diff=204018Touchpad Synaptics2012-06-08T04:19:32Z<p>VitaminJ: Consolidate into one line</p>
<hr />
<div>{{i18n|Touchpad Synaptics}}<br />
[[de:Synaptics Touchpad Treiber]]<br />
[[fr:Touchpad Synaptics]]<br />
[[Category:Input devices]]<br />
{{Article summary start}}<br />
{{Article summary text|This article details the installation and configuration of the Synaptics input driver in Arch Linux. }}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Xorg}}<br />
{{Article summary end}}<br />
<br />
This article details the installation and configuration process of the '''''Synaptics input driver''''' for Synaptics (and ALPS) touchpads found on most notebooks.<br />
<br />
== Installation ==<br />
The Synaptics driver can be [[pacman|installed]] with the package {{Pkg|xf86-input-synaptics}}, available in the [[official repositories]]:<br />
<br />
== Configuration ==<br />
The primary method of configuration for the touchpad is through an [[Xorg]] server configuration file. After installation of {{ic|xf86-input-synaptics}}, a default configuration file is located at {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}. <br />
<br />
Users can edit this file to configure the various driver options available, for a complete list of all available options users should refer to the synaptics manual page:<br />
<br />
{{bc|$ man synaptics}}<br />
<br />
=== Frequently used options ===<br />
The following lists options that many users may wish to configure. Note that all these options can simply be added to the main configuration file in {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}, as shown in this example configuration file where we have enabled vertical, horizontal and circular scrolling:<br />
{{hc|/etc/X11/xorg.conf.d/10-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
Identifier "touchpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "2"<br />
Option "TapButton3" "3"<br />
Option "VertEdgeScroll" "on"<br />
Option "VertTwoFingerScroll" "on"<br />
Option "HorizEdgeScroll" "on"<br />
Option "HorizTwoFingerScroll" "on"<br />
Option "CircularScrolling" "on"<br />
Option "CircScrollTrigger" "2"<br />
Option "EmulateTwoFingerMinZ" "40"<br />
Option "EmulateTwoFingerMinW" "8"<br />
Option "CoastingSpeed" "0"<br />
...<br />
EndSection<br />
</nowiki>}}<br />
<br />
; '''TapButton1''': (integer) configures which mouse-button is reported on a non-corner, one finger tap.<br />
; '''TapButton2''': (integer) configures which mouse-button is reported on a non-corner, two finger tap<br />
; '''TapButton3''': (integer) configures which mouse-button is reported on a non-corner, three finger tap<br />
; '''RBCornerButton''': (integer) configures which mouse-button is reported on a right bottom corner, one finger tap (use {{ic|Option "RBCornerButton" "3"}} to achieve Ubuntu style tap behaviour for right mouse button in lower right corner)<br />
; '''RTCornerButton''': (integer) as above, but for top right corner, one finger tap.<br />
; '''VertEdgeScroll''': (boolean) enables vertical scrolling while dragging across the right edge of the touch pad.<br />
; '''HorizEdgeScroll''': (boolean) enables horizontal scrolling while dragging across the bottom edge of the touch pad.<br />
; '''VertTwoFingerScroll''': (boolean) enables vertical scrolling using two fingers.<br />
; '''HorizTwoFingerScroll''': (boolean) enables horizontal scrolling using two fingers.<br />
; '''EmulateTwoFingerMinZ/W''': (integer) play with this value to set the precision of two finger scroll.<br />
<br />
[[Touchpad_Synaptics/10-synaptics.conf_example|An example]] with a brief description of all options. As usual settings will vary between machines. It is recommended that you discover your own options using [[Touchpad_Synaptics#Fine-tuning_with_synclient|synclient]].<br />
<br />
{{Note|If you find that your hand frequently brushes your touchpad, causing the TapButton2 option to be triggered (which will more than likely paste from your clipboard), and you do not mind losing two-finger-tap functionality, set {{ic|TapButton2}} to 0.}}<br />
<br />
{{Note|Recent versions include a "Coasting" feature, enabled by default, which may have the undesired effect of continuing almost any scrolling until the next tap or click, even if you are no longer touching the touchpad. This means that to scroll just a bit, you need to scroll (by using the edge, or a multitouch option) and then almost immediately tap the touchpad, otherwise scrolling will continue forever. If wish to avoid this, set {{ic|CoastingSpeed}} to 0.}}<br />
<br />
=== Other options ===<br />
; '''VertScrollDelta''' and '''HorizScrollDelta''': (integer) configures the speed of scrolling, it's a bit counter-intuitive because higher values produce greater precision and thus slower scrolling.<br />
<br />
=== GNOME ===<br />
Users of [[GNOME]] may have to edit its configuration as well, because in default it is set to disable tapping to click, horizontal scrolling and not to allow touchpad disabling while typing.<br />
<br />
To change these settings in '''Gnome 2''':<br />
# Run {{ic|gconf-editor}}<br />
# Edit the keys in the {{ic|/desktop/gnome/peripherals/touchpad/}} folder.<br />
<br />
To change these settings in '''Gnome 3''':<br />
# Open ''System Settings''.<br />
# Click ''Mouse and Touchpad''.<br />
# Change the settings on the ''Touchpad'' tab.<br />
<br />
Gnome settings daemon may override existing settings (for example ones set in {{ic|xorg.conf.d}}) for which there is no equivalent in any of the graphical configuration utilities. It is possible to stop gnome from touching mouse settings at all:<br />
# Run {{ic|dconf-editor}}<br />
# Edit {{ic|/org/gnome/settings-daemon/plugins/mouse/}}<br />
# Uncheck the '''active''' setting<br />
It will now respect your system's existing synaptics configuration.<br />
<br />
=== Configuration on the fly ===<br />
Next to the traditional method of configuration, the Synaptics driver also supports on the fly configuration. This means that users can set certain options through a software application, these options are applied immediately without needing a restart of X. This is useful to test configuration options before you include them in the configuration file. On-the-fly configuration is non-permanent and will not remain active though a reboot, suspend / resume or restart of udev. This should only be used to test, fine-tune or script configuration features.<br />
<br />
In order for many of this tools to work you need to have the {{ic|SHMConfig Option}} in your '''10-synaptic.conf'''<br />
{{hc|/etc/X11/xorg.conf.d/10-synaptics.conf|<br />
…<br />
Option "SHMConfig" "on" # or Option "SHMConfig" "true"<br />
…<br />
}}<br />
<br />
==== Console tools ====<br />
* {{App|[[Touchpad_Synaptics#Synclient|Synclient]] (Recommended)|command line utility to configure and query Synaptics driver settings on a live system, the tool is developed by the synaptics driver maintainers and is provided with the synaptics driver|http://xorg.freedesktop.org/|{{Pkg|xf86-input-synaptics}}}}<br />
* {{App|[[Touchpad_Synaptics#xinput|xinput]]|small general-purpose CLI tool to configure devices|http://xorg.freedesktop.org/|{{Pkg|xorg-xinput}}}}<br />
<br />
==== Graphical tools ====<br />
* {{App|GPointing Device Settings|provides graphical on the fly configuration for several pointing devices connected to the system, including your synaptics touch pad. This application replaces GSynaptics as the preferred tool for graphical touchpad configuration through the synaptics driver|http://live.gnome.org/GPointingDeviceSettings|{{AUR|gpointing-device-settings}}}}<br />
:{{Note|For GPointingDeviceSettings to work with Synaptics touchpads both {{Pkg|xf86-input-synaptics}} and {{Pkg|libsynaptics}} have to be installed!}}<br />
* {{App|GSynaptics (Deprecated!)|allows the user to configure options such as horizontal, vertical and circular scrolling as well as the option to enable or disable the touchpad. The [http://gsynaptics.sourceforge.jp/ GSynaptics website] mentions that its development has stopped and that it will eventually be outdated, the application functions perfectly with xorg 1.11, through users looking for a graphical tools are suggested to use '''GPointingDeviceSettings''' instead, GSynaptics should only be used as a last resort|http://gsynaptics.sourceforge.jp/|{{Pkg|gsynaptics}}}}<br />
* {{App|Synaptiks|touchpad configuration and management tool for [[KDE]]. It provides a System Settings module to configure basic and advanced features of the touchpad. Additionally it comes with a little system tray application, which can switch the touchpad automatically off, while an external mouse is plugged or while you are typing.|http://synaptiks.lunaryorn.de|{{Pkg|synaptiks}}}}<br />
<br />
== Advanced Configuration ==<br />
=== xinput ===<br />
Depending on your model, synaptic touchpads may or may not these features:<br />
* left, middle or right hardware buttons<br />
* two finger detection<br />
* three finger detection<br />
* configurable resolution<br />
<br />
Use {{ic|xinput list}} to find your device name.<br />
<br />
First, find the name of your touchpad:<br />
{{bc|$ xinput -list}}<br />
<br />
You can now use {{ic|xinput}} to find your touchpad's capabilities:<br />
$ xinput list-props "SynPS/2 Synaptics TouchPad" | grep Capabilities<br />
<br />
Synaptics Capabillities (309): 1, 0, 1, 0, 0, 1, 1<br />
<br />
From left to right, this shows:<br />
* (1) device has a physical left button<br />
* (0) device does not have a physical middle button<br />
* (1) device has a physical right button<br />
* (0) device does not support two-finger detection<br />
* (0) device does not support three-finger detection<br />
* (1) device can configure vertical resolution<br />
* (1) device can configure horizontal resolution<br />
<br />
Use {{ic|xinput list-props "SynPS/2 Synaptics TouchPad"}} to list the device properties.<br />
<br />
Read the xinput and synaptics manuals and such.<br />
<br />
=== Synclient ===<br />
Synclient can configure every option available to the user as documented in {{ic|$ man synaptics}}. A full list of the current user settings can be brought up:<br />
{{bc|$ synclient -l}}<br />
<br />
Every listed configuration option can be controlled through synclient, for example:<br />
$ synclient PalmDetect=1 (to enable palm detection)<br />
$ synclient TapButton1=1 (configure button events)<br />
$ synclient TouchpadOff=1 (disable the touchpad)<br />
<br />
After you have successfully tried and tested your options through synclient, you can make these changes permanent by adding them to {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}. <br />
<br />
The synclient monitor can display pressure and placement on the touchpad in real-time, allowing further refinement of the default Synaptics settings.<br />
<br />
You can start the Synaptics monitor with the following command:<br />
{{bc|$ synclient -m 100}}<br />
Where -m activates the monitor and the following number specifies the update interval in milliseconds.<br />
<br />
This monitor provides information about the current state of your touchpad. For example, if you move the mouse with the touchpad, the x and y values in the monitor will change. Therewith you can easy figure out your touchpad's dimension which is defined in the LeftEdge-, RightEdge-, BottomEdge- and TopEdge-Options.<br />
<br />
The abbreviations for the parameters are as follow:<br />
<br />
{| class="wikitable"<br />
|- align="left"<br />
!width="200"|Abbreviation<br />
!width="400|Description<br />
|-<br />
|'''time'''<br />
|Time in seconds since the logging was started.<br />
|-<br />
|'''x, y'''<br />
|The x/y coordinates of the finger on the touchpad. The origin is in the upper left corner.<br />
|-<br />
|'''z'''<br />
|The pressure value. It represents the pressure you are using to navigate on your touchpad.<br />
|-<br />
|'''f'''<br />
|Number of fingers currently touching the touchpad.<br />
|-<br />
|'''w'''<br />
|Value that represents the finger width.<br />
|-<br />
|'''l,r,u,d,m,multi'''<br />
|Those values represent the state of the left, right, up, down, middle and multi buttons pressed where zero means not pressed and one means pressed.<br />
|-<br />
|'''gl,gm,gr'''<br />
|For touchpads which have a guest device, this are the associated button states for guest left, guest middle and guest right pressed (1) and not pressed (0).<br />
|-<br />
|'''gdx, gdy'''<br />
|x/y coordinates of the guest device.<br />
|}<br />
If a value constantly is zero, it implies that this option is not supported by your device.<br />
<br />
Now use {{ic|synclient}} to test new values. For example, to adjust minimum pointer speed:<br />
<br />
$ synclient MinSpeed=0.5<br />
<br />
To make the changes permanent, they will need to be put in your {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}} file.<br />
<br />
=== Circular scrolling ===<br />
Circular scrolling is a feature that Synaptics offers which closely resembles the behaviour of iPods. Instead of (or additional to) scrolling horizontally or vertically, you can scroll circularly. Some users find this faster and more precise.<br />
To enable circular scrolling, add the following options to the touchpad device section of {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}:<br />
{{hc|/etc/X11/xorg.conf.d/10-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
...<br />
Option "CircularScrolling" "on"<br />
Option "CircScrollTrigger" "0"<br />
...<br />
EndSection<br />
</nowiki>}}<br />
<br />
The option '''CircScrollTrigger''' may be one of the following values, determining which edge circular scrolling should start:<br />
0 All Edges<br />
1 Top Edge<br />
2 Top Right Corner<br />
3 Right Edge<br />
4 Bottom Right Corner<br />
5 Bottom Edge<br />
6 Bottom Left Corner<br />
7 Left Edge<br />
8 Top Left Corner<br />
<br />
Specifying something different from zero may be useful if you want to use circular scrolling in conjunction with horizontal and/or vertical scrolling. If you do so, the type of scrolling is determined by the edge you start from.<br />
<br />
To scroll fast, draw small circles in the center of your touchpad. To scroll slowly and more precise, draw large circles.<br />
<br />
=== Software Toggle ===<br />
You may find it useful to have a software toggle that will turn on or off your touchpad, especially if it is extremely sensitive and you are doing a lot of typing. Please also see [[#Disable touchpad upon external mouse detection]] as that may be better solution, a matter of choice. The advantage here is you have the control, while the other solution has a daemon determine when to turn off the trackpad.<br />
<br />
You will want to grab [[xbindkeys]] if you do not already have key binding software.<br />
<br />
Then save this script to something such as {{ic|/sbin/trackpad-toggle.sh}}:<br />
{{hc|/sbin/trackpad-toggle.sh|<nowiki><br />
#!/bin/bash<br />
<br />
synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')<br />
<br />
</nowiki>}}<br />
<br />
Then finally add a key binding to use the script. It is best to call with xbindkeys like so (file {{ic|~/.xbindkeysrc}}):<br />
{{hc|~/.xbindkeysrc|<nowiki><br />
"/sbin/trackpad-toggle.sh"<br />
m:0x5 + c:65<br />
Control+Shift + space<br />
</nowiki>}}<br />
<br />
Now just (re)start {{ic|xbindkeys}} and {{keypress|Ctrl}}+{{keypress|Shift}}+{{keypress|Space}} will now toggle your trackpad!<br />
<br />
Of course you could easily use any other keybinding software, such as the ones provided by Xfce4 and GNOME.<br />
<br />
== Troubleshooting ==<br />
=== ALPS Touchpads ===<br />
{{Expansion}}<br />
{{Box YELLOW|TODO|needs to be rewritten for udev}}<br />
<br />
For ALPS Touchpads, if the above configuration does not provide the desired results, try the following configuration instead:<br />
<br />
Section "ServerLayout"<br />
...<br />
InputDevice "USB Mouse" "CorePointer"<br />
InputDevice "Touchpad" "SendCoreEvents"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Touchpad"<br />
Driver "synaptics"<br />
Option "Device" "/dev/input/mouse0"<br />
Option "Protocol" "auto-dev"<br />
Option "LeftEdge" "130"<br />
Option "RightEdge" "840"<br />
Option "TopEdge" "130"<br />
Option "BottomEdge" "640"<br />
Option "FingerLow" "7"<br />
Option "FingerHigh" "8"<br />
Option "MaxTapTime" "180"<br />
Option "MaxTapMove" "110"<br />
Option "EmulateMidButtonTime" "75"<br />
Option "VertScrollDelta" "20"<br />
Option "HorizScrollDelta" "20"<br />
Option "MinSpeed" "0.25"<br />
Option "MaxSpeed" "0.50"<br />
Option "AccelFactor" "0.010"<br />
Option "EdgeMotionMinSpeed" "200"<br />
Option "EdgeMotionMaxSpeed" "200"<br />
Option "UpDownScrolling" "1"<br />
Option "CircularScrolling" "1"<br />
Option "CircScrollDelta" "0.1"<br />
Option "CircScrollTrigger" "2"<br />
Option "SHMConfig" "on"<br />
Option "Emulate3Buttons" "on"<br />
EndSection<br />
<br />
=== The touchpad is not working, Xorg.0.log shows "Query no Synaptics: 6003C8" ===<br />
Due to the way synaptics is currently set-up, 2 instances of the synaptics module are loaded. We can recognize this situation by opening the xorg log file ({{ic|/var/log/Xorg.0.log}}) and noticing this:<br />
{{hc|/var/log/Xorg.0.log|<nowiki><br />
[ 9304.803] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "evdev touchpad catchall"<br />
[ 9304.803] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "touchpad catchall"<br />
</nowiki>}}<br />
<br />
Notice how 2 differently named instances of the module are being loaded. In some cases, this causes the touchpad to become nonfunctional.<br />
<br />
We can prevent this double loading by adding {{ic|MatchDevicePath "/dev/input/event*"}} to our {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}} file:<br />
{{hc|/etc/X11/xorg.conf.d/10-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "2"<br />
Option "TapButton3" "3"<br />
EndSection <br />
</nowiki>}}<br />
<br />
Restart X and check xorg logs again, the error should be gone and the touchpad should be functional.<br />
<br />
related bugreport: {{Bug|20830}}<br />
<br />
related forum topics:<br />
* https://bbs.archlinux.org/viewtopic.php?id=104769<br />
* https://bbs.archlinux.org/viewtopic.php?pid=825690<br />
<br />
=== Touchpad detected as "PS/2 Generic Mouse" or "Logitech PS/2 mouse" ===<br />
This is caused by a [https://bugzilla.kernel.org/show_bug.cgi?id=27442 kernel bug] which was fixed in kernel version 3.3. Wrongly detected touchpads cannot be configured with the Synaptic input driver. To fix this, simply install the [[AUR]] package {{AUR|psmouse-elantech}}.<br />
<br />
Among the affected notebooks are the following models:<br />
<br />
* Acer Aspire 7750G<br />
* Dell Latitude e6520 (ALPS touchpad), Inspiron N5110 (ALPS GlidePoint)<br />
* Samsung NC110/NF210/QX310/QX410/QX510/SF310/SF410/SF510/RF410/RF510/RF710/RV515<br />
<br />
You can check whether your touchpad is correctly detected by running:<br />
<br />
{{bc|$ xinput list}}<br />
<br />
More information can be found in [https://bbs.archlinux.org/viewtopic.php?id=117109 this thread].<br />
<br />
=== Non-functional Synaptics Special Abilities (multi-tap, scrolling, etc.) ===<br />
In some cases Synaptics touchpads only work partially. Features like two-finger scrolling or two-finger middle-click do not work even if properly enabled. This is probably related to the [[#The_touchpad_is_not_working.2C_Xorg.0.log_shows_.22Query_no_Synaptics:_6003C8.22|The touchpad is not working]] problem mentioned above. Fix is the same, prevent double module loading.<br />
<br />
If preventing the module from loading twice does not solve your issue, try commenting out the toggle "MatchIsTouchpad" (which is now included by default in the synaptics config).<br />
<br />
=== Disable touchpad upon external mouse detection ===<br />
With the assistance of [[udev]], it is possible to automatically disable the touchpad if an external mouse has been plugged in. To achieve this, add the following udev rules to {{ic|/etc/udev/rules.d/01-touchpad.rules}}:<br />
{{hc|/etc/udev/rules.d/01-touchpad.rules|<nowiki><br />
ACTION=="add", SUBSYSTEM=="input", KERNEL=="mouse[1-9]", ENV{DISPLAY}=":0.0",<br />
ENV{XAUTHORITY}="/home/USERNAME/.Xauthority", ENV{ID_CLASS}="mouse", RUN+="/usr/bin/synclient TouchpadOff=1"<br />
ACTION=="remove", SUBSYSTEM=="input", KERNEL=="mouse[1-9]", ENV{DISPLAY}=":0.0",<br />
ENV{XAUTHORITY}="/home/USERNAME/.Xauthority", ENV{ID_CLASS}="mouse", RUN+="/usr/bin/synclient TouchpadOff=0"<br />
</nowiki>}}<br />
<br />
GDM stores Xauthority files in {{ic|/var/run/gdm}} in a randomly-named directory. So udev rules will look like this:<br />
<br />
ACTION=="add", KERNEL=="mouse[0-9]", SUBSYSTEM=="input", PROGRAM="/usr/bin/find /var/run/gdm -name *username*", ENV{DISPLAY}=":0.0",<br />
ENV{XAUTHORITY}="$result/database", RUN+="/usr/bin/synclient TouchpadOff=1"<br />
ACTION=="remove", KERNEL=="mouse[0-9]", SUBSYSTEM=="input", PROGRAM="/usr/bin/find /var/run/gdm -name *username*", ENV{DISPLAY}=":0.0",<br />
ENV{XAUTHORITY}="$result/database", RUN+="/usr/bin/synclient TouchpadOff=0"<br />
<br />
{{Note|[[udev]] rules must be a single line each, so format accordingly.}}<br />
<br />
{{ic|SHMConfig}} must be enabled (see the [[#Configuration]] section for details)<br />
<br />
{{Note|{{ic|SHMConfig}} has been deprecated.}}<br />
<br />
=== Cursor Jump ===<br />
Some users have their cursor inexplicably ''jump'' around the screen. There currently no patch for this, but the developers are aware of the problem and are working on it.<br />
<br />
Another posibility is that you're experiencing ''IRQ losses'' related to the i8042 controller (this device handles the keyboard and the touchpad of many laptops), so you have two posibilities here:<br />
<br />
1. rmmod && insmod the psmouse module.<br />
2. append i8042.nomux=1 to the boot line and reboot your machine.<br />
<br />
=== Touchpad device is not located at {{ic|/dev/input/*}} ===<br />
If that is the case, you can use this command to display information about your input devices:<br />
{{bc|$ cat /proc/bus/input/devices}}<br />
<br />
Search for an input device which has the name "SynPS/2 Synaptics TouchPad". The "Handlers" section of the output specifies what device you need to specify.<br />
<br />
'''Example output:'''<br />
{{hc|$ cat /proc/bus/input/devices|<nowiki><br />
I: Bus=0011 Vendor=0002 Product=0007 Version=0000<br />
N: Name="SynPS/2 Synaptics TouchPad"<br />
P: Phys=isa0060/serio4/input0<br />
S: Sysfs=/class/input/input1<br />
H: Handlers=mouse0 event1<br />
B: EV=b<br />
B: KEY=6420 0 7000f 0<br />
</nowiki>}}<br />
<br />
In this case, the {{ic|Handlers}} are {{ic|mouse0}} and {{ic|event1}}, so {{ic|/dev/input/mouse0}} would be used.<br />
<br />
{{Expansion}}<br />
{{Box YELLOW|TODO|explain how to apply this in {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}}}<br />
<br />
=== Disable Trackpad while Typing ===<br />
==== Using automatic palm detection ====<br />
First of all you should test if it works properly for your trackpad and if the settings are accurate:<br />
<br />
$ synclient PalmDetect=1<br />
<br />
Then test the typing. You can tweak the detection with:<br />
<br />
$ synclient PalmMinWidth=<br />
which is the width of the area your hand touches, and<br />
<br />
$ synclient PalmMinZ=<br />
<br />
which is the minimum Z distance at which the detection is performed.<br />
<br />
Once you have found the correct settings, save them into {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}} like this:<br />
<br />
{{bc|<nowiki>#synclient PalmDetect=1<br />
Option "PalmDetect" "1"<br />
#synclient PalmMinWidth=10<br />
Option "PalmMinWidth" "10"<br />
#synclient PalmMinZ=200<br />
Option "PalmMinZ" "200"</nowiki>}}<br />
<br />
==== Using .xinitrc ====<br />
{{Note|You will need to have {{ic|SHMConfig}} enabled in your {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.}}<br />
<br />
To have the touchpad disabled automatically when you begin typing, add the following line to your {{ic|~/.xinitrc}} before you run your window manager (if not using a login manager):<br />
{{bc|$ syndaemon -t -k -i 2 -d &}}<br />
<br />
; '''-i 2''': sets the idle time to 2 seconds. The idle time specifies how many seconds to wait after the last key-press before enabling the touchpad again.<br />
; '''-t''': tells the daemon not to disable mouse movement when typing and only disable tapping and scrolling.<br />
; '''-k''': tells the daemon to ignore modifier keys when monitoring keyboard activity (e.g.: allows Ctrl+Left Click).<br />
; '''-d''': starts as a daemon, in the background.<br />
<br />
More details are available in the man page:<br />
{{bc|$ man syndaemon}}<br />
<br />
If you are using a login manager, you will need to specify the command where your DE allows you to do so.<br />
<br />
==== Using a Login Manager ====<br />
{{Note|You will need to have {{ic|SHMConfig}} enabled in your {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.}}<br />
<br />
The "-d" option is necessary to start syndaemon as a background process for post Login instructions.<br />
<br />
'''For GNOME: (GDM)'''<br />
<br />
To start syndaemon you need to use Gnome's Startup Applications Preferences program. Login to Gnome and go to '''System > Preferences > Startup Applications'''. In the Startup Programs tab click the '''Add''' button. Name the Startup Program whatever you like and input any comments you like (or leave this field blank). In the command field add:<br />
<br />
{{bc|$ syndaemon -t -k -i 2 -d &}}<br />
<br />
When you are done, click the '''Add''' button in the '''Add Startup Program''' dialogue. Make sure the check box next to the startup program you have created is checked, in the list of additional startup programs. Close the '''Startup Applications Preferences''' window and you are done.<br />
<br />
'''For KDE: (KDM)'''<br />
<br />
Goto '''System Settings > Startup and Shutdown > Autostart''', then click '''Add Program''', enter:<br />
<br />
{{bc| syndaemon -t -k -i 2 -d &}}<br />
<br />
Then check '''Run in terminal'''.<br />
<br />
=== Firefox and special touchpad events ===<br />
By default, Firefox is set up to do special events upon tapping or scrolling certain parts of your touchpad.<br />
You can edit the settings of those actions by typing '''about:config''' in your Firefox address bar.<br />
To alter these options, double-click on the line in question, changing "true" to "false" and vise versa.<br />
<br />
To prevent Firefox from scrolling (backward/forward) through browser history and instead scroll through pages, edit these settings as shown:<br />
mousewheel.horizscroll.withnokey.action = 1<br />
mousewheel.horizscroll.withnokey.sysnumlines = true<br />
<br />
To prevent Firefox from redirecting you to URLs formed from your clipboard content upon tapping the upper-right corner of your touchpad (or middle mouse button), set the following option to "false":<br />
middlemouse.contentLoadURL = false<br />
<br />
=== Opera: horizontal scrolling issues ===<br />
Same as above.<br />
To fix it, go to Tools -> Preferences -> Advanced -> Shortcuts. Select "Opera Standard" mouse setup and click "Edit". In "Application" section:<br />
* assign key "Button 6" to command "Scroll left"<br />
* assign key "Button 7" to command "Scroll right"<br />
<br />
=== Scrolling and multiple actions with Synaptics on LG Laptops ===<br />
These problems seem to be occurring on several models of LG laptops.<br />
Symptoms include: when pressing Mouse Button 1, Synaptics interprets it as ScrollUP and a regular button 1 click; same goes for button 2.<br />
<br />
The scrolling issue can be resolved by entering in {{ic|xorg.conf}}:<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|Option "UpDownScrolling" "0"}}<br />
<br />
NOTE that this will make Synaptics interpret one button push as three. There is a patch written by Oskar Sandberg[http://www.math.chalmers.se/~ossa/linux/lg_tx_express.html] that removes these clicks.<br />
<br />
Apparently, when trying to compile this against the latest version of Synaptics it fails. The solution to this is using the GIT repository for Synaptics[http://web.telia.com/~u89404340/touchpad/synaptics/.git].<br />
<br />
There is also a package build file in the AUR to automate this: {{AUR|xf86-input-synaptics-lg}}.<br />
<br />
To build the package after downloading the tarball and unpacking it, execute:<br />
{{bc|$ cd synaptics-git}}<br />
{{bc|$ makepkg}}<br />
<br />
=== Other external mouse issues ===<br />
First, make sure your section describing the external mouse contains this line (or that the line looks like this):<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|Option "Device" "/dev/input/mice"}}<br />
<br />
If the "Device" line is different, change it to the above and try to restart X. If this does not solve your problem, make your '''touchpad''' the CorePointer in the "Server Layout" section:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|InputDevice "Touchpad" "CorePointer"}}<br />
<br />
and make your external device "SendCoreEvents":<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|InputDevice "USB Mouse" "SendCoreEvents"}}<br />
<br />
finally add this to your external device's section:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|Option "SendCoreEvents" "true"}}<br />
<br />
If all of the above does not work for you, please check relevant bug trackers for possible bugs, or go through the forums to see if anyone has found a better solution.<br />
<br />
=== Touchpad synchronization issues ===<br />
Sometimes the cursor may freeze for several seconds or start acting on its own for no apparent reason. This behavior is accompanied by records in {{ic|/var/log/messages.log}}<br />
<br />
{{hc|/var/log/messages.log|psmouse.c: TouchPad at isa0060/serio1/input0 lost synchronization, throwing 3 bytes away}}<br />
<br />
This problem has no general solution, but there are several possible workarounds.<br />
* If you use CPU frequency scaling, avoid using the "ondemand" governor and use the "performance" governor when possible, as the touchpad may lose sync when the CPU frequency changes.<br />
* Avoid using an ACPI battery monitor.<br />
* Attempt to load psmouse with "proto=imps" option. To do that, add this line to your {{ic|/etc/modprobe.d/modprobe.conf}}:<br />
<br />
{{hc|/etc/modprobe.d/modprobe.conf|2=options psmouse proto=imps}}<br />
<br />
* Try another desktop environment. Some users report that this problem only occurs when using XFCE or GNOME, for whatever reason<br />
<br />
=== Delay between a button tap and the actual click ===<br />
If you experience a delay between the tap on the touchpad and the actual click that is registered you need to enable FastTaps:<br />
<br />
To do so, you should add '''Option "FastTaps" "1"''' to {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}} so that you have:<br />
{{hc|/etc/X11/xorg.conf.d/10-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
Identifier "Synaptics Touchpad"<br />
Driver "synaptics"<br />
...<br />
Option "FastTaps" "1"<br />
...<br />
EndSection<br />
</nowiki>}}<br />
<br />
=== SynPS/2 Synaptics TouchPad can not grab event device, errno=16 ===<br />
If you are using Xorg 7.4, you may get a warning like this from {{ic|/var/log/Xorg.0.log}}, thais is because the driver will grab the event device for exclusive use when using the Linux 2.6 event protocol. When it fails, X will return this error message.<br />
<br />
Grabbing the event device means that no other user space or kernel space program sees the touchpad events. This is desirable if the X config file includes {{ic|/dev/input/mice}} as an input device, but is undesirable if you want to monitor the device from user space.<br />
<br />
If you want to control it, add or modify the "GrabEventDevice" option in you touchpad section in {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}:<br />
{{hc|/etc/X11/xorg.conf.d/10-synaptics.conf|<nowiki><br />
...<br />
Option "GrabEventDevice" "''boolean''"<br />
...<br />
</nowiki>}}<br />
This will come into effect when X is restarted, though you can also change it by using synclient. When changing this parameter with the synclient program, the change will not take effect until the Synaptics driver is disabled and re-enabled. This can be achieved by switching to a text console and then switching back to X.<br />
<br />
=== Synaptics Loses Multitouch Detection After Rebooting From Windows ===<br />
Many drivers include a firmware that is loaded into flash memory when the computer boots. This firmware is not necessarily cleared upon shutdown, and is not always compatible with Linux drivers. The only way to clear the flash memory is to shutdown completely rather than using reboot. It is generally considered best practice to never use reboot when switching between operating systems.<br />
<br />
=== Buttonless TouchPads (aka ClickPads) ===<br />
Some laptops have a special kind of touchpad which has the mouse buttons as part of the tracking plate, instead of being external buttons. For example HP series 4500 ProBooks, ThinkPad X220 and X1 ThinkPad series have this kind of a touchpad. By default whole button area is detected as a left button resulting in the second mouse button being unusable and click + drag will not work. Previously support for such devices was achieved by using third party patches, but from version 1.6.0 the synaptics driver has native multitouch support (using the ''mtdev'' library).<br />
<br />
<br />
To enable other buttons modify the touchpad section in {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}} (or better, of your custom synaptics configuration file prefixed with a higher number):<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-synaptics.conf|<nowiki><br />
...<br />
Option "ClickPad" "true"<br />
Option "EmulateMidButtonTime" "0"<br />
Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"<br />
...<br />
</nowiki>}}<br />
<br />
These three options are the key, first one will enable multitouch support, second will disable middle button emulation (not supported for ClickPads), and third will define the button areas. <br />
<br />
Format for the SoftButtonAreas option is (from {{ic|man 4 synaptics}}):<br />
{{bc|RightButtonAreaLeft RightButtonAreaRight RightButtonAreaTop RightButtonAreaBottom MiddleButtonAreaLeft MiddleButtonAreaRight MiddleButtonAreaTop MiddleButtonAreaBottom}}<br />
<br />
The above example is commonly found in documentation or synaptics packages, and it translates to right half of the bottom 18% of the touchpad to be a right button. There is '''no middle button''' defined. If you want to define a middle button remember one key piece of information from the manual; edge set to 0 extends to infinity in that direction.<br />
<br />
In the following example right button will occupy 40% of the rightmost part of the button area. We then proceed to setup the middle button to occupy 20% of the touchpad in a small area in the center.<br />
<br />
...<br />
Option "SoftButtonAreas" "60% 0 82% 0 40% 59% 82% 0"<br />
...<br />
<br />
You can use {{ic|<nowiki>synclient</nowiki>}} to check the new soft button areas: <br />
<br />
$ synclient -l | grep -i ButtonArea<br />
RightButtonAreaLeft = 3914<br />
RightButtonAreaRight = 0<br />
RightButtonAreaTop = 3918<br />
RightButtonAreaBottom = 0<br />
MiddleButtonAreaLeft = 3100<br />
MiddleButtonAreaRight = 3873<br />
MiddleButtonAreaTop = 3918<br />
MiddleButtonAreaBottom = 0<br />
<br />
If your buttons aren't working, soft button areas are not changing, ensure you do not have a synaptics configuration file distributed by a package which is overriding your custom settings (ie. some AUR packages distribute configurations prefixed with very high numbers).<br />
<br />
<br />
=== Touchpad detected as mouse (elantech touchpads) ===<br />
This can happend on some laptops with elantech touchpad, for example ASUS x53s. In this situation you need {{AUR|psmouse-elantech}} package from [[AUR]].<br />
<br />
=== Infinite-Scrolling-Bug introduced with 1.5.99.903 ===<br />
In the 1.5.99.903 release, a [http://cgit.freedesktop.org/xorg/driver/xf86-input-synaptics/commit/?id=1c155f644824133315ac5b3dac9076db71430eb6 bug] was introduced which caused the CoastingFriction to have little to no effect,<br />
causing the coasting to continue on virtually infinitely. Either patch {{ic|xf86-input-synaptics}} and recompile<br />
yourself, or disable the coasting feature by adding the following option to {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}:<br />
{{hc|/etc/X11/xorg.conf.d/10-synaptics.conf|<nowiki><br />
...<br />
Option "CoastingSpeed" "0"<br />
...<br />
</nowiki>}}<br />
<br />
== External Resources ==<br />
* [http://cgit.freedesktop.org/xorg/driver/xf86-input-synaptics/ Synaptics TouchPad driver]<br />
<!-- vim: set ft=Wikipedia: --></div>VitaminJhttps://wiki.archlinux.org/index.php?title=Touchpad_Synaptics&diff=204017Touchpad Synaptics2012-06-08T04:16:00Z<p>VitaminJ: Add 'ScrollDelta' comments, in my experience, higher values make slower scrolling.</p>
<hr />
<div>{{i18n|Touchpad Synaptics}}<br />
[[de:Synaptics Touchpad Treiber]]<br />
[[fr:Touchpad Synaptics]]<br />
[[Category:Input devices]]<br />
{{Article summary start}}<br />
{{Article summary text|This article details the installation and configuration of the Synaptics input driver in Arch Linux. }}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Xorg}}<br />
{{Article summary end}}<br />
<br />
This article details the installation and configuration process of the '''''Synaptics input driver''''' for Synaptics (and ALPS) touchpads found on most notebooks.<br />
<br />
== Installation ==<br />
The Synaptics driver can be [[pacman|installed]] with the package {{Pkg|xf86-input-synaptics}}, available in the [[official repositories]]:<br />
<br />
== Configuration ==<br />
The primary method of configuration for the touchpad is through an [[Xorg]] server configuration file. After installation of {{ic|xf86-input-synaptics}}, a default configuration file is located at {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}. <br />
<br />
Users can edit this file to configure the various driver options available, for a complete list of all available options users should refer to the synaptics manual page:<br />
<br />
{{bc|$ man synaptics}}<br />
<br />
=== Frequently used options ===<br />
The following lists options that many users may wish to configure. Note that all these options can simply be added to the main configuration file in {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}, as shown in this example configuration file where we have enabled vertical, horizontal and circular scrolling:<br />
{{hc|/etc/X11/xorg.conf.d/10-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
Identifier "touchpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "2"<br />
Option "TapButton3" "3"<br />
Option "VertEdgeScroll" "on"<br />
Option "VertTwoFingerScroll" "on"<br />
Option "HorizEdgeScroll" "on"<br />
Option "HorizTwoFingerScroll" "on"<br />
Option "CircularScrolling" "on"<br />
Option "CircScrollTrigger" "2"<br />
Option "EmulateTwoFingerMinZ" "40"<br />
Option "EmulateTwoFingerMinW" "8"<br />
Option "CoastingSpeed" "0"<br />
...<br />
EndSection<br />
</nowiki>}}<br />
<br />
; '''TapButton1''': (integer) configures which mouse-button is reported on a non-corner, one finger tap.<br />
; '''TapButton2''': (integer) configures which mouse-button is reported on a non-corner, two finger tap<br />
; '''TapButton3''': (integer) configures which mouse-button is reported on a non-corner, three finger tap<br />
; '''RBCornerButton''': (integer) configures which mouse-button is reported on a right bottom corner, one finger tap (use {{ic|Option "RBCornerButton" "3"}} to achieve Ubuntu style tap behaviour for right mouse button in lower right corner)<br />
; '''RTCornerButton''': (integer) as above, but for top right corner, one finger tap.<br />
; '''VertEdgeScroll''': (boolean) enables vertical scrolling while dragging across the right edge of the touch pad.<br />
; '''HorizEdgeScroll''': (boolean) enables horizontal scrolling while dragging across the bottom edge of the touch pad.<br />
; '''VertTwoFingerScroll''': (boolean) enables vertical scrolling using two fingers.<br />
; '''HorizTwoFingerScroll''': (boolean) enables horizontal scrolling using two fingers.<br />
; '''EmulateTwoFingerMinZ/W''': (integer) play with this value to set the precision of two finger scroll.<br />
<br />
[[Touchpad_Synaptics/10-synaptics.conf_example|An example]] with a brief description of all options. As usual settings will vary between machines. It is recommended that you discover your own options using [[Touchpad_Synaptics#Fine-tuning_with_synclient|synclient]].<br />
<br />
{{Note|If you find that your hand frequently brushes your touchpad, causing the TapButton2 option to be triggered (which will more than likely paste from your clipboard), and you do not mind losing two-finger-tap functionality, set {{ic|TapButton2}} to 0.}}<br />
<br />
{{Note|Recent versions include a "Coasting" feature, enabled by default, which may have the undesired effect of continuing almost any scrolling until the next tap or click, even if you are no longer touching the touchpad. This means that to scroll just a bit, you need to scroll (by using the edge, or a multitouch option) and then almost immediately tap the touchpad, otherwise scrolling will continue forever. If wish to avoid this, set {{ic|CoastingSpeed}} to 0.}}<br />
<br />
=== Other options ===<br />
; '''VertScrollDelta''': (integer) configures the speed of scrolling, it's a bit counter-intuitive because higher values produce greater precision and thus slower scrolling.<br />
; '''HorizScrollDelta''': (integer) configures the speed of scrolling, it's a bit counter-intuitive because higher values produce greater precision and thus slower scrolling.<br />
<br />
=== GNOME ===<br />
Users of [[GNOME]] may have to edit its configuration as well, because in default it is set to disable tapping to click, horizontal scrolling and not to allow touchpad disabling while typing.<br />
<br />
To change these settings in '''Gnome 2''':<br />
# Run {{ic|gconf-editor}}<br />
# Edit the keys in the {{ic|/desktop/gnome/peripherals/touchpad/}} folder.<br />
<br />
To change these settings in '''Gnome 3''':<br />
# Open ''System Settings''.<br />
# Click ''Mouse and Touchpad''.<br />
# Change the settings on the ''Touchpad'' tab.<br />
<br />
Gnome settings daemon may override existing settings (for example ones set in {{ic|xorg.conf.d}}) for which there is no equivalent in any of the graphical configuration utilities. It is possible to stop gnome from touching mouse settings at all:<br />
# Run {{ic|dconf-editor}}<br />
# Edit {{ic|/org/gnome/settings-daemon/plugins/mouse/}}<br />
# Uncheck the '''active''' setting<br />
It will now respect your system's existing synaptics configuration.<br />
<br />
=== Configuration on the fly ===<br />
Next to the traditional method of configuration, the Synaptics driver also supports on the fly configuration. This means that users can set certain options through a software application, these options are applied immediately without needing a restart of X. This is useful to test configuration options before you include them in the configuration file. On-the-fly configuration is non-permanent and will not remain active though a reboot, suspend / resume or restart of udev. This should only be used to test, fine-tune or script configuration features.<br />
<br />
In order for many of this tools to work you need to have the {{ic|SHMConfig Option}} in your '''10-synaptic.conf'''<br />
{{hc|/etc/X11/xorg.conf.d/10-synaptics.conf|<br />
…<br />
Option "SHMConfig" "on" # or Option "SHMConfig" "true"<br />
…<br />
}}<br />
<br />
==== Console tools ====<br />
* {{App|[[Touchpad_Synaptics#Synclient|Synclient]] (Recommended)|command line utility to configure and query Synaptics driver settings on a live system, the tool is developed by the synaptics driver maintainers and is provided with the synaptics driver|http://xorg.freedesktop.org/|{{Pkg|xf86-input-synaptics}}}}<br />
* {{App|[[Touchpad_Synaptics#xinput|xinput]]|small general-purpose CLI tool to configure devices|http://xorg.freedesktop.org/|{{Pkg|xorg-xinput}}}}<br />
<br />
==== Graphical tools ====<br />
* {{App|GPointing Device Settings|provides graphical on the fly configuration for several pointing devices connected to the system, including your synaptics touch pad. This application replaces GSynaptics as the preferred tool for graphical touchpad configuration through the synaptics driver|http://live.gnome.org/GPointingDeviceSettings|{{AUR|gpointing-device-settings}}}}<br />
:{{Note|For GPointingDeviceSettings to work with Synaptics touchpads both {{Pkg|xf86-input-synaptics}} and {{Pkg|libsynaptics}} have to be installed!}}<br />
* {{App|GSynaptics (Deprecated!)|allows the user to configure options such as horizontal, vertical and circular scrolling as well as the option to enable or disable the touchpad. The [http://gsynaptics.sourceforge.jp/ GSynaptics website] mentions that its development has stopped and that it will eventually be outdated, the application functions perfectly with xorg 1.11, through users looking for a graphical tools are suggested to use '''GPointingDeviceSettings''' instead, GSynaptics should only be used as a last resort|http://gsynaptics.sourceforge.jp/|{{Pkg|gsynaptics}}}}<br />
* {{App|Synaptiks|touchpad configuration and management tool for [[KDE]]. It provides a System Settings module to configure basic and advanced features of the touchpad. Additionally it comes with a little system tray application, which can switch the touchpad automatically off, while an external mouse is plugged or while you are typing.|http://synaptiks.lunaryorn.de|{{Pkg|synaptiks}}}}<br />
<br />
== Advanced Configuration ==<br />
=== xinput ===<br />
Depending on your model, synaptic touchpads may or may not these features:<br />
* left, middle or right hardware buttons<br />
* two finger detection<br />
* three finger detection<br />
* configurable resolution<br />
<br />
Use {{ic|xinput list}} to find your device name.<br />
<br />
First, find the name of your touchpad:<br />
{{bc|$ xinput -list}}<br />
<br />
You can now use {{ic|xinput}} to find your touchpad's capabilities:<br />
$ xinput list-props "SynPS/2 Synaptics TouchPad" | grep Capabilities<br />
<br />
Synaptics Capabillities (309): 1, 0, 1, 0, 0, 1, 1<br />
<br />
From left to right, this shows:<br />
* (1) device has a physical left button<br />
* (0) device does not have a physical middle button<br />
* (1) device has a physical right button<br />
* (0) device does not support two-finger detection<br />
* (0) device does not support three-finger detection<br />
* (1) device can configure vertical resolution<br />
* (1) device can configure horizontal resolution<br />
<br />
Use {{ic|xinput list-props "SynPS/2 Synaptics TouchPad"}} to list the device properties.<br />
<br />
Read the xinput and synaptics manuals and such.<br />
<br />
=== Synclient ===<br />
Synclient can configure every option available to the user as documented in {{ic|$ man synaptics}}. A full list of the current user settings can be brought up:<br />
{{bc|$ synclient -l}}<br />
<br />
Every listed configuration option can be controlled through synclient, for example:<br />
$ synclient PalmDetect=1 (to enable palm detection)<br />
$ synclient TapButton1=1 (configure button events)<br />
$ synclient TouchpadOff=1 (disable the touchpad)<br />
<br />
After you have successfully tried and tested your options through synclient, you can make these changes permanent by adding them to {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}. <br />
<br />
The synclient monitor can display pressure and placement on the touchpad in real-time, allowing further refinement of the default Synaptics settings.<br />
<br />
You can start the Synaptics monitor with the following command:<br />
{{bc|$ synclient -m 100}}<br />
Where -m activates the monitor and the following number specifies the update interval in milliseconds.<br />
<br />
This monitor provides information about the current state of your touchpad. For example, if you move the mouse with the touchpad, the x and y values in the monitor will change. Therewith you can easy figure out your touchpad's dimension which is defined in the LeftEdge-, RightEdge-, BottomEdge- and TopEdge-Options.<br />
<br />
The abbreviations for the parameters are as follow:<br />
<br />
{| class="wikitable"<br />
|- align="left"<br />
!width="200"|Abbreviation<br />
!width="400|Description<br />
|-<br />
|'''time'''<br />
|Time in seconds since the logging was started.<br />
|-<br />
|'''x, y'''<br />
|The x/y coordinates of the finger on the touchpad. The origin is in the upper left corner.<br />
|-<br />
|'''z'''<br />
|The pressure value. It represents the pressure you are using to navigate on your touchpad.<br />
|-<br />
|'''f'''<br />
|Number of fingers currently touching the touchpad.<br />
|-<br />
|'''w'''<br />
|Value that represents the finger width.<br />
|-<br />
|'''l,r,u,d,m,multi'''<br />
|Those values represent the state of the left, right, up, down, middle and multi buttons pressed where zero means not pressed and one means pressed.<br />
|-<br />
|'''gl,gm,gr'''<br />
|For touchpads which have a guest device, this are the associated button states for guest left, guest middle and guest right pressed (1) and not pressed (0).<br />
|-<br />
|'''gdx, gdy'''<br />
|x/y coordinates of the guest device.<br />
|}<br />
If a value constantly is zero, it implies that this option is not supported by your device.<br />
<br />
Now use {{ic|synclient}} to test new values. For example, to adjust minimum pointer speed:<br />
<br />
$ synclient MinSpeed=0.5<br />
<br />
To make the changes permanent, they will need to be put in your {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}} file.<br />
<br />
=== Circular scrolling ===<br />
Circular scrolling is a feature that Synaptics offers which closely resembles the behaviour of iPods. Instead of (or additional to) scrolling horizontally or vertically, you can scroll circularly. Some users find this faster and more precise.<br />
To enable circular scrolling, add the following options to the touchpad device section of {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}:<br />
{{hc|/etc/X11/xorg.conf.d/10-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
...<br />
Option "CircularScrolling" "on"<br />
Option "CircScrollTrigger" "0"<br />
...<br />
EndSection<br />
</nowiki>}}<br />
<br />
The option '''CircScrollTrigger''' may be one of the following values, determining which edge circular scrolling should start:<br />
0 All Edges<br />
1 Top Edge<br />
2 Top Right Corner<br />
3 Right Edge<br />
4 Bottom Right Corner<br />
5 Bottom Edge<br />
6 Bottom Left Corner<br />
7 Left Edge<br />
8 Top Left Corner<br />
<br />
Specifying something different from zero may be useful if you want to use circular scrolling in conjunction with horizontal and/or vertical scrolling. If you do so, the type of scrolling is determined by the edge you start from.<br />
<br />
To scroll fast, draw small circles in the center of your touchpad. To scroll slowly and more precise, draw large circles.<br />
<br />
=== Software Toggle ===<br />
You may find it useful to have a software toggle that will turn on or off your touchpad, especially if it is extremely sensitive and you are doing a lot of typing. Please also see [[#Disable touchpad upon external mouse detection]] as that may be better solution, a matter of choice. The advantage here is you have the control, while the other solution has a daemon determine when to turn off the trackpad.<br />
<br />
You will want to grab [[xbindkeys]] if you do not already have key binding software.<br />
<br />
Then save this script to something such as {{ic|/sbin/trackpad-toggle.sh}}:<br />
{{hc|/sbin/trackpad-toggle.sh|<nowiki><br />
#!/bin/bash<br />
<br />
synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')<br />
<br />
</nowiki>}}<br />
<br />
Then finally add a key binding to use the script. It is best to call with xbindkeys like so (file {{ic|~/.xbindkeysrc}}):<br />
{{hc|~/.xbindkeysrc|<nowiki><br />
"/sbin/trackpad-toggle.sh"<br />
m:0x5 + c:65<br />
Control+Shift + space<br />
</nowiki>}}<br />
<br />
Now just (re)start {{ic|xbindkeys}} and {{keypress|Ctrl}}+{{keypress|Shift}}+{{keypress|Space}} will now toggle your trackpad!<br />
<br />
Of course you could easily use any other keybinding software, such as the ones provided by Xfce4 and GNOME.<br />
<br />
== Troubleshooting ==<br />
=== ALPS Touchpads ===<br />
{{Expansion}}<br />
{{Box YELLOW|TODO|needs to be rewritten for udev}}<br />
<br />
For ALPS Touchpads, if the above configuration does not provide the desired results, try the following configuration instead:<br />
<br />
Section "ServerLayout"<br />
...<br />
InputDevice "USB Mouse" "CorePointer"<br />
InputDevice "Touchpad" "SendCoreEvents"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Touchpad"<br />
Driver "synaptics"<br />
Option "Device" "/dev/input/mouse0"<br />
Option "Protocol" "auto-dev"<br />
Option "LeftEdge" "130"<br />
Option "RightEdge" "840"<br />
Option "TopEdge" "130"<br />
Option "BottomEdge" "640"<br />
Option "FingerLow" "7"<br />
Option "FingerHigh" "8"<br />
Option "MaxTapTime" "180"<br />
Option "MaxTapMove" "110"<br />
Option "EmulateMidButtonTime" "75"<br />
Option "VertScrollDelta" "20"<br />
Option "HorizScrollDelta" "20"<br />
Option "MinSpeed" "0.25"<br />
Option "MaxSpeed" "0.50"<br />
Option "AccelFactor" "0.010"<br />
Option "EdgeMotionMinSpeed" "200"<br />
Option "EdgeMotionMaxSpeed" "200"<br />
Option "UpDownScrolling" "1"<br />
Option "CircularScrolling" "1"<br />
Option "CircScrollDelta" "0.1"<br />
Option "CircScrollTrigger" "2"<br />
Option "SHMConfig" "on"<br />
Option "Emulate3Buttons" "on"<br />
EndSection<br />
<br />
=== The touchpad is not working, Xorg.0.log shows "Query no Synaptics: 6003C8" ===<br />
Due to the way synaptics is currently set-up, 2 instances of the synaptics module are loaded. We can recognize this situation by opening the xorg log file ({{ic|/var/log/Xorg.0.log}}) and noticing this:<br />
{{hc|/var/log/Xorg.0.log|<nowiki><br />
[ 9304.803] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "evdev touchpad catchall"<br />
[ 9304.803] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "touchpad catchall"<br />
</nowiki>}}<br />
<br />
Notice how 2 differently named instances of the module are being loaded. In some cases, this causes the touchpad to become nonfunctional.<br />
<br />
We can prevent this double loading by adding {{ic|MatchDevicePath "/dev/input/event*"}} to our {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}} file:<br />
{{hc|/etc/X11/xorg.conf.d/10-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "2"<br />
Option "TapButton3" "3"<br />
EndSection <br />
</nowiki>}}<br />
<br />
Restart X and check xorg logs again, the error should be gone and the touchpad should be functional.<br />
<br />
related bugreport: {{Bug|20830}}<br />
<br />
related forum topics:<br />
* https://bbs.archlinux.org/viewtopic.php?id=104769<br />
* https://bbs.archlinux.org/viewtopic.php?pid=825690<br />
<br />
=== Touchpad detected as "PS/2 Generic Mouse" or "Logitech PS/2 mouse" ===<br />
This is caused by a [https://bugzilla.kernel.org/show_bug.cgi?id=27442 kernel bug] which was fixed in kernel version 3.3. Wrongly detected touchpads cannot be configured with the Synaptic input driver. To fix this, simply install the [[AUR]] package {{AUR|psmouse-elantech}}.<br />
<br />
Among the affected notebooks are the following models:<br />
<br />
* Acer Aspire 7750G<br />
* Dell Latitude e6520 (ALPS touchpad), Inspiron N5110 (ALPS GlidePoint)<br />
* Samsung NC110/NF210/QX310/QX410/QX510/SF310/SF410/SF510/RF410/RF510/RF710/RV515<br />
<br />
You can check whether your touchpad is correctly detected by running:<br />
<br />
{{bc|$ xinput list}}<br />
<br />
More information can be found in [https://bbs.archlinux.org/viewtopic.php?id=117109 this thread].<br />
<br />
=== Non-functional Synaptics Special Abilities (multi-tap, scrolling, etc.) ===<br />
In some cases Synaptics touchpads only work partially. Features like two-finger scrolling or two-finger middle-click do not work even if properly enabled. This is probably related to the [[#The_touchpad_is_not_working.2C_Xorg.0.log_shows_.22Query_no_Synaptics:_6003C8.22|The touchpad is not working]] problem mentioned above. Fix is the same, prevent double module loading.<br />
<br />
If preventing the module from loading twice does not solve your issue, try commenting out the toggle "MatchIsTouchpad" (which is now included by default in the synaptics config).<br />
<br />
=== Disable touchpad upon external mouse detection ===<br />
With the assistance of [[udev]], it is possible to automatically disable the touchpad if an external mouse has been plugged in. To achieve this, add the following udev rules to {{ic|/etc/udev/rules.d/01-touchpad.rules}}:<br />
{{hc|/etc/udev/rules.d/01-touchpad.rules|<nowiki><br />
ACTION=="add", SUBSYSTEM=="input", KERNEL=="mouse[1-9]", ENV{DISPLAY}=":0.0",<br />
ENV{XAUTHORITY}="/home/USERNAME/.Xauthority", ENV{ID_CLASS}="mouse", RUN+="/usr/bin/synclient TouchpadOff=1"<br />
ACTION=="remove", SUBSYSTEM=="input", KERNEL=="mouse[1-9]", ENV{DISPLAY}=":0.0",<br />
ENV{XAUTHORITY}="/home/USERNAME/.Xauthority", ENV{ID_CLASS}="mouse", RUN+="/usr/bin/synclient TouchpadOff=0"<br />
</nowiki>}}<br />
<br />
GDM stores Xauthority files in {{ic|/var/run/gdm}} in a randomly-named directory. So udev rules will look like this:<br />
<br />
ACTION=="add", KERNEL=="mouse[0-9]", SUBSYSTEM=="input", PROGRAM="/usr/bin/find /var/run/gdm -name *username*", ENV{DISPLAY}=":0.0",<br />
ENV{XAUTHORITY}="$result/database", RUN+="/usr/bin/synclient TouchpadOff=1"<br />
ACTION=="remove", KERNEL=="mouse[0-9]", SUBSYSTEM=="input", PROGRAM="/usr/bin/find /var/run/gdm -name *username*", ENV{DISPLAY}=":0.0",<br />
ENV{XAUTHORITY}="$result/database", RUN+="/usr/bin/synclient TouchpadOff=0"<br />
<br />
{{Note|[[udev]] rules must be a single line each, so format accordingly.}}<br />
<br />
{{ic|SHMConfig}} must be enabled (see the [[#Configuration]] section for details)<br />
<br />
{{Note|{{ic|SHMConfig}} has been deprecated.}}<br />
<br />
=== Cursor Jump ===<br />
Some users have their cursor inexplicably ''jump'' around the screen. There currently no patch for this, but the developers are aware of the problem and are working on it.<br />
<br />
Another posibility is that you're experiencing ''IRQ losses'' related to the i8042 controller (this device handles the keyboard and the touchpad of many laptops), so you have two posibilities here:<br />
<br />
1. rmmod && insmod the psmouse module.<br />
2. append i8042.nomux=1 to the boot line and reboot your machine.<br />
<br />
=== Touchpad device is not located at {{ic|/dev/input/*}} ===<br />
If that is the case, you can use this command to display information about your input devices:<br />
{{bc|$ cat /proc/bus/input/devices}}<br />
<br />
Search for an input device which has the name "SynPS/2 Synaptics TouchPad". The "Handlers" section of the output specifies what device you need to specify.<br />
<br />
'''Example output:'''<br />
{{hc|$ cat /proc/bus/input/devices|<nowiki><br />
I: Bus=0011 Vendor=0002 Product=0007 Version=0000<br />
N: Name="SynPS/2 Synaptics TouchPad"<br />
P: Phys=isa0060/serio4/input0<br />
S: Sysfs=/class/input/input1<br />
H: Handlers=mouse0 event1<br />
B: EV=b<br />
B: KEY=6420 0 7000f 0<br />
</nowiki>}}<br />
<br />
In this case, the {{ic|Handlers}} are {{ic|mouse0}} and {{ic|event1}}, so {{ic|/dev/input/mouse0}} would be used.<br />
<br />
{{Expansion}}<br />
{{Box YELLOW|TODO|explain how to apply this in {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}}}<br />
<br />
=== Disable Trackpad while Typing ===<br />
==== Using automatic palm detection ====<br />
First of all you should test if it works properly for your trackpad and if the settings are accurate:<br />
<br />
$ synclient PalmDetect=1<br />
<br />
Then test the typing. You can tweak the detection with:<br />
<br />
$ synclient PalmMinWidth=<br />
which is the width of the area your hand touches, and<br />
<br />
$ synclient PalmMinZ=<br />
<br />
which is the minimum Z distance at which the detection is performed.<br />
<br />
Once you have found the correct settings, save them into {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}} like this:<br />
<br />
{{bc|<nowiki>#synclient PalmDetect=1<br />
Option "PalmDetect" "1"<br />
#synclient PalmMinWidth=10<br />
Option "PalmMinWidth" "10"<br />
#synclient PalmMinZ=200<br />
Option "PalmMinZ" "200"</nowiki>}}<br />
<br />
==== Using .xinitrc ====<br />
{{Note|You will need to have {{ic|SHMConfig}} enabled in your {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.}}<br />
<br />
To have the touchpad disabled automatically when you begin typing, add the following line to your {{ic|~/.xinitrc}} before you run your window manager (if not using a login manager):<br />
{{bc|$ syndaemon -t -k -i 2 -d &}}<br />
<br />
; '''-i 2''': sets the idle time to 2 seconds. The idle time specifies how many seconds to wait after the last key-press before enabling the touchpad again.<br />
; '''-t''': tells the daemon not to disable mouse movement when typing and only disable tapping and scrolling.<br />
; '''-k''': tells the daemon to ignore modifier keys when monitoring keyboard activity (e.g.: allows Ctrl+Left Click).<br />
; '''-d''': starts as a daemon, in the background.<br />
<br />
More details are available in the man page:<br />
{{bc|$ man syndaemon}}<br />
<br />
If you are using a login manager, you will need to specify the command where your DE allows you to do so.<br />
<br />
==== Using a Login Manager ====<br />
{{Note|You will need to have {{ic|SHMConfig}} enabled in your {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.}}<br />
<br />
The "-d" option is necessary to start syndaemon as a background process for post Login instructions.<br />
<br />
'''For GNOME: (GDM)'''<br />
<br />
To start syndaemon you need to use Gnome's Startup Applications Preferences program. Login to Gnome and go to '''System > Preferences > Startup Applications'''. In the Startup Programs tab click the '''Add''' button. Name the Startup Program whatever you like and input any comments you like (or leave this field blank). In the command field add:<br />
<br />
{{bc|$ syndaemon -t -k -i 2 -d &}}<br />
<br />
When you are done, click the '''Add''' button in the '''Add Startup Program''' dialogue. Make sure the check box next to the startup program you have created is checked, in the list of additional startup programs. Close the '''Startup Applications Preferences''' window and you are done.<br />
<br />
'''For KDE: (KDM)'''<br />
<br />
Goto '''System Settings > Startup and Shutdown > Autostart''', then click '''Add Program''', enter:<br />
<br />
{{bc| syndaemon -t -k -i 2 -d &}}<br />
<br />
Then check '''Run in terminal'''.<br />
<br />
=== Firefox and special touchpad events ===<br />
By default, Firefox is set up to do special events upon tapping or scrolling certain parts of your touchpad.<br />
You can edit the settings of those actions by typing '''about:config''' in your Firefox address bar.<br />
To alter these options, double-click on the line in question, changing "true" to "false" and vise versa.<br />
<br />
To prevent Firefox from scrolling (backward/forward) through browser history and instead scroll through pages, edit these settings as shown:<br />
mousewheel.horizscroll.withnokey.action = 1<br />
mousewheel.horizscroll.withnokey.sysnumlines = true<br />
<br />
To prevent Firefox from redirecting you to URLs formed from your clipboard content upon tapping the upper-right corner of your touchpad (or middle mouse button), set the following option to "false":<br />
middlemouse.contentLoadURL = false<br />
<br />
=== Opera: horizontal scrolling issues ===<br />
Same as above.<br />
To fix it, go to Tools -> Preferences -> Advanced -> Shortcuts. Select "Opera Standard" mouse setup and click "Edit". In "Application" section:<br />
* assign key "Button 6" to command "Scroll left"<br />
* assign key "Button 7" to command "Scroll right"<br />
<br />
=== Scrolling and multiple actions with Synaptics on LG Laptops ===<br />
These problems seem to be occurring on several models of LG laptops.<br />
Symptoms include: when pressing Mouse Button 1, Synaptics interprets it as ScrollUP and a regular button 1 click; same goes for button 2.<br />
<br />
The scrolling issue can be resolved by entering in {{ic|xorg.conf}}:<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|Option "UpDownScrolling" "0"}}<br />
<br />
NOTE that this will make Synaptics interpret one button push as three. There is a patch written by Oskar Sandberg[http://www.math.chalmers.se/~ossa/linux/lg_tx_express.html] that removes these clicks.<br />
<br />
Apparently, when trying to compile this against the latest version of Synaptics it fails. The solution to this is using the GIT repository for Synaptics[http://web.telia.com/~u89404340/touchpad/synaptics/.git].<br />
<br />
There is also a package build file in the AUR to automate this: {{AUR|xf86-input-synaptics-lg}}.<br />
<br />
To build the package after downloading the tarball and unpacking it, execute:<br />
{{bc|$ cd synaptics-git}}<br />
{{bc|$ makepkg}}<br />
<br />
=== Other external mouse issues ===<br />
First, make sure your section describing the external mouse contains this line (or that the line looks like this):<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|Option "Device" "/dev/input/mice"}}<br />
<br />
If the "Device" line is different, change it to the above and try to restart X. If this does not solve your problem, make your '''touchpad''' the CorePointer in the "Server Layout" section:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|InputDevice "Touchpad" "CorePointer"}}<br />
<br />
and make your external device "SendCoreEvents":<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|InputDevice "USB Mouse" "SendCoreEvents"}}<br />
<br />
finally add this to your external device's section:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|Option "SendCoreEvents" "true"}}<br />
<br />
If all of the above does not work for you, please check relevant bug trackers for possible bugs, or go through the forums to see if anyone has found a better solution.<br />
<br />
=== Touchpad synchronization issues ===<br />
Sometimes the cursor may freeze for several seconds or start acting on its own for no apparent reason. This behavior is accompanied by records in {{ic|/var/log/messages.log}}<br />
<br />
{{hc|/var/log/messages.log|psmouse.c: TouchPad at isa0060/serio1/input0 lost synchronization, throwing 3 bytes away}}<br />
<br />
This problem has no general solution, but there are several possible workarounds.<br />
* If you use CPU frequency scaling, avoid using the "ondemand" governor and use the "performance" governor when possible, as the touchpad may lose sync when the CPU frequency changes.<br />
* Avoid using an ACPI battery monitor.<br />
* Attempt to load psmouse with "proto=imps" option. To do that, add this line to your {{ic|/etc/modprobe.d/modprobe.conf}}:<br />
<br />
{{hc|/etc/modprobe.d/modprobe.conf|2=options psmouse proto=imps}}<br />
<br />
* Try another desktop environment. Some users report that this problem only occurs when using XFCE or GNOME, for whatever reason<br />
<br />
=== Delay between a button tap and the actual click ===<br />
If you experience a delay between the tap on the touchpad and the actual click that is registered you need to enable FastTaps:<br />
<br />
To do so, you should add '''Option "FastTaps" "1"''' to {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}} so that you have:<br />
{{hc|/etc/X11/xorg.conf.d/10-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
Identifier "Synaptics Touchpad"<br />
Driver "synaptics"<br />
...<br />
Option "FastTaps" "1"<br />
...<br />
EndSection<br />
</nowiki>}}<br />
<br />
=== SynPS/2 Synaptics TouchPad can not grab event device, errno=16 ===<br />
If you are using Xorg 7.4, you may get a warning like this from {{ic|/var/log/Xorg.0.log}}, thais is because the driver will grab the event device for exclusive use when using the Linux 2.6 event protocol. When it fails, X will return this error message.<br />
<br />
Grabbing the event device means that no other user space or kernel space program sees the touchpad events. This is desirable if the X config file includes {{ic|/dev/input/mice}} as an input device, but is undesirable if you want to monitor the device from user space.<br />
<br />
If you want to control it, add or modify the "GrabEventDevice" option in you touchpad section in {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}:<br />
{{hc|/etc/X11/xorg.conf.d/10-synaptics.conf|<nowiki><br />
...<br />
Option "GrabEventDevice" "''boolean''"<br />
...<br />
</nowiki>}}<br />
This will come into effect when X is restarted, though you can also change it by using synclient. When changing this parameter with the synclient program, the change will not take effect until the Synaptics driver is disabled and re-enabled. This can be achieved by switching to a text console and then switching back to X.<br />
<br />
=== Synaptics Loses Multitouch Detection After Rebooting From Windows ===<br />
Many drivers include a firmware that is loaded into flash memory when the computer boots. This firmware is not necessarily cleared upon shutdown, and is not always compatible with Linux drivers. The only way to clear the flash memory is to shutdown completely rather than using reboot. It is generally considered best practice to never use reboot when switching between operating systems.<br />
<br />
=== Buttonless TouchPads (aka ClickPads) ===<br />
Some laptops have a special kind of touchpad which has the mouse buttons as part of the tracking plate, instead of being external buttons. For example HP series 4500 ProBooks, ThinkPad X220 and X1 ThinkPad series have this kind of a touchpad. By default whole button area is detected as a left button resulting in the second mouse button being unusable and click + drag will not work. Previously support for such devices was achieved by using third party patches, but from version 1.6.0 the synaptics driver has native multitouch support (using the ''mtdev'' library).<br />
<br />
<br />
To enable other buttons modify the touchpad section in {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}} (or better, of your custom synaptics configuration file prefixed with a higher number):<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-synaptics.conf|<nowiki><br />
...<br />
Option "ClickPad" "true"<br />
Option "EmulateMidButtonTime" "0"<br />
Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"<br />
...<br />
</nowiki>}}<br />
<br />
These three options are the key, first one will enable multitouch support, second will disable middle button emulation (not supported for ClickPads), and third will define the button areas. <br />
<br />
Format for the SoftButtonAreas option is (from {{ic|man 4 synaptics}}):<br />
{{bc|RightButtonAreaLeft RightButtonAreaRight RightButtonAreaTop RightButtonAreaBottom MiddleButtonAreaLeft MiddleButtonAreaRight MiddleButtonAreaTop MiddleButtonAreaBottom}}<br />
<br />
The above example is commonly found in documentation or synaptics packages, and it translates to right half of the bottom 18% of the touchpad to be a right button. There is '''no middle button''' defined. If you want to define a middle button remember one key piece of information from the manual; edge set to 0 extends to infinity in that direction.<br />
<br />
In the following example right button will occupy 40% of the rightmost part of the button area. We then proceed to setup the middle button to occupy 20% of the touchpad in a small area in the center.<br />
<br />
...<br />
Option "SoftButtonAreas" "60% 0 82% 0 40% 59% 82% 0"<br />
...<br />
<br />
You can use {{ic|<nowiki>synclient</nowiki>}} to check the new soft button areas: <br />
<br />
$ synclient -l | grep -i ButtonArea<br />
RightButtonAreaLeft = 3914<br />
RightButtonAreaRight = 0<br />
RightButtonAreaTop = 3918<br />
RightButtonAreaBottom = 0<br />
MiddleButtonAreaLeft = 3100<br />
MiddleButtonAreaRight = 3873<br />
MiddleButtonAreaTop = 3918<br />
MiddleButtonAreaBottom = 0<br />
<br />
If your buttons aren't working, soft button areas are not changing, ensure you do not have a synaptics configuration file distributed by a package which is overriding your custom settings (ie. some AUR packages distribute configurations prefixed with very high numbers).<br />
<br />
<br />
=== Touchpad detected as mouse (elantech touchpads) ===<br />
This can happend on some laptops with elantech touchpad, for example ASUS x53s. In this situation you need {{AUR|psmouse-elantech}} package from [[AUR]].<br />
<br />
=== Infinite-Scrolling-Bug introduced with 1.5.99.903 ===<br />
In the 1.5.99.903 release, a [http://cgit.freedesktop.org/xorg/driver/xf86-input-synaptics/commit/?id=1c155f644824133315ac5b3dac9076db71430eb6 bug] was introduced which caused the CoastingFriction to have little to no effect,<br />
causing the coasting to continue on virtually infinitely. Either patch {{ic|xf86-input-synaptics}} and recompile<br />
yourself, or disable the coasting feature by adding the following option to {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}:<br />
{{hc|/etc/X11/xorg.conf.d/10-synaptics.conf|<nowiki><br />
...<br />
Option "CoastingSpeed" "0"<br />
...<br />
</nowiki>}}<br />
<br />
== External Resources ==<br />
* [http://cgit.freedesktop.org/xorg/driver/xf86-input-synaptics/ Synaptics TouchPad driver]<br />
<!-- vim: set ft=Wikipedia: --></div>VitaminJhttps://wiki.archlinux.org/index.php?title=Cacti&diff=192934Cacti2012-04-05T17:07:23Z<p>VitaminJ: getting versions of RRDTool and NET-SNMP</p>
<hr />
<div>[[Category:Daemons and system services (English)]]<br />
[[fr:cacti]]<br />
This article describes how to set up Cacti on an Arch Linux system. Cacti is a web-based system monitoring and graphing solution.<br />
<br />
==Server Setup==<br />
This article assumes that you already have a working LAMP (Linux, Apache, MySQL, PHP) server. If you do not have a web-server set up already, you can follow [[LAMP|these instructions]] to do so.<br />
<br />
==Cacti Setup==<br />
The following should all be performed as root.<br />
<br />
* Install the necessary programs<br />
# pacman -S cacti php-snmp<br />
<br />
* Edit /etc/php/php.ini<br />
:* Uncomment the following lines:<br />
;extension=mysql.so<br />
;extension=sockets.so<br />
;extension=snmp.so<br />
:* Comment the following line:<br />
open_basedir=...<br />
:* Uncomment and set the following:<br />
;date.timezone =<br />
<br />
* Start mysqld and snmpd if they're not already running:<br />
# /etc/rc.d/mysqld start<br />
# /etc/rc.d/snmpd start<br />
:* Add mysqld and snmdp to the DAEMONS array in /etc/rc.conf to ensure that they're running at bootup<br />
<br />
* Edit /etc/httpd/conf/httpd.conf<br />
:* Inside the <Directory "/srv/http"> block, ensure that you have the following line:<br />
AllowOverride All<br />
<br />
* MySQL setup<br />
:* Create the cacti database, load the tables, and set the user. You will be asked for the MySQL root password for each of these commands.<br />
# mysqladmin -u root -p create cacti<br />
# mysql -u root -p cacti < /srv/http/cacti/cacti.sql<br />
# mysql -u root -p<br />
mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'some_password';<br />
mysql> FLUSH PRIVILEGES;<br />
mysql> exit<br />
<br />
''Note:'' As of march 2011 (mysql 5.5.9-1, cacti 0.8.7g-1) mysql fails to import the SQL due to an outdated syntax. You can update the file using this command:<br />
<br />
cd /srv/http/cacti && mv cacti.sql cacti.sql.org && sed s/TYPE=/ENGINE=/g cacti.sql.org > cacti.sql<br />
<br />
* Edit /srv/http/cacti/include/config.php. The password was specified in the previous step.<br />
$database_username = "cacti";<br />
$database_password = "some_password";<br />
<br />
* Clean up cacti directory<br />
# chown -R http:http /srv/http/cacti/{rra,log}<br />
# rm /srv/http/cacti/.htaccess<br />
# chmod +x /srv/http/cacti/{cmd,poller}.php /srv/http/cacti/lib/ping.php<br />
<br />
* Optionally, install [https://aur.archlinux.org/packages.php?ID=21541 cacti-spine], a faster poller for cacti, from the [[AUR]]. Use the same password as in previous steps.<br />
<br />
:* Edit /etc/spine.conf<br />
DB_User cacti<br />
DB_Pass some_password<br />
<br />
* Set up cron job to run poller every 5 minutes<br />
# crontab -e<br />
:* Add the following to the end of the list<br />
*/5 * * * * /usr/bin/sudo -u http /usr/bin/php /srv/http/cacti/poller.php > /dev/null 2>&1<br />
<br />
* Restart cron and apache<br />
# /etc/rc.d/crond restart<br />
# /etc/rc.d/httpd restart<br />
<br />
==Web Configuration==<br />
Open up a browser and go to http://your_ip/cacti. You should be welcomed with the cacti installer.<br />
* Click Next<br />
* Select New Install and click Next<br />
* Ensure that all paths are ok. You need to specify versions of RRDTool and NET-SNMP. Get RRDTool Utility Version using 'rrdtool -v', and'net-snmp-config --version' for NET-SNMP. Click Finish.<br />
** If any paths are invalid, you'll need to figure out why. Check the apache error logs for hints.<br />
* Login with username "admin" and password "admin".<br />
* Change the password as requested, click Save.<br />
* (Optional) If you chose to install spine, follow these instructions to set it up.<br />
** Click on Settings, on the left panel of the Console tab.<br />
** Select the Poller tab.<br />
** Change Poller Type to spine.<br />
** Adjust any other settings on the page as desired, then click Save.<br />
** Select the Paths tab.<br />
** Set Spine Poller File Path to /usr/bin/spine and click Save.<br />
<br />
==See Also==<br />
* [[LAMP]] - Set up a LAMP server<br />
<br />
==External Links==<br />
* http://cacti.net</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Xorg&diff=192920Xorg2012-04-05T15:58:23Z<p>VitaminJ: Middle click emulation on all mice</p>
<hr />
<div>[[Category:X Server (English)]]<br />
{{i18n|Xorg}}<br />
[[de:X]]<br />
[[fr:Xorg]]<br />
[[pl:Xorg]]<br />
[[ro:Xorg]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|An all-inclusive overview about installing and managing Xorg}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Graphical user interface overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Start X at boot}}<br />
{{Article summary wiki|Execute commands after X start}}<br />
{{Article summary wiki|Login Manager}}<br />
{{Article summary wiki|Window Manager}}<br />
{{Article summary wiki|Font Configuration}}<br />
{{Article summary wiki|X11 Cursors}}<br />
{{Article summary wiki|Get All Mouse Buttons Working}}<br />
{{Article summary wiki|Desktop Environment}}<br />
{{Article summary wiki|Wayland}}<br />
{{Article summary heading|Proprietary Video Drivers}}<br />
{{Article summary wiki|NVIDIA}}<br />
{{Article summary wiki|ATI Catalyst}}<br />
{{Article summary heading|Free Video Drivers}}<br />
{{Article summary wiki|Nouveau}}<br />
{{Article summary wiki|ATI}}<br />
{{Article summary wiki|Intel}}<br />
{{Article summary end}}<br />
<br />
'''Xorg''' is the public, open-source implementation of the X window system version 11. Since Xorg is the most popular choice among Linux users, its ubiquity has led to making it an ever-present requisite for GUI applications, resulting in massive adoption from most distributions. See the [[Wikipedia:X.Org Server|Xorg]] Wikipedia article or visit the [http://www.x.org/wiki/ Xorg website] for more details.<br />
<br />
==Installation==<br />
First, you will need to [[pacman|install]] the X server with the package {{Pkg|xorg-server}}, available in the [[Official Repositories]]. You may also want the useful utilities cointained in the {{Grp|xorg-apps}} group.<br />
<br />
[[udev]] will detect your hardware and [[Wikipedia:evdev|evdev]] will act as the hotplugging input driver for almost all devices. Both of them are already required by {{Pkg|xorg-server}}, so there is no need to explicitly install their packages.<br />
<br />
{{Tip|The default X environment is rather bare, and you will typically seek to install a [[Window Manager|window manager]] or a [[Desktop Environment|desktop environment]] to supplement X.}}<br />
<br />
==Running==<br />
''See also: [[Start X at boot]]''<br />
<br />
{{Tip|The easiest way to start X is by using a [[Display Manager|display manager]] such as [[GDM]], [[KDM]] or [[SLiM]].}}<br />
<br />
If you want to start X without a display manager, install the package {{Pkg|xorg-xinit}}. Optionally, the packages {{Pkg|xorg-twm}}, {{Pkg|xorg-xclock}} and {{Pkg|xterm}} allows for a default environment, as described below.<br />
<br />
The {{ic|startx}} and {{ic|xinit}} commands will start the X server and clients (the {{ic|startx}} script is merely a front end to the more versatile {{ic|xinit}} command). To determine the client to run, {{ic|startx}}/{{ic|xinit}} will first look to parse a {{ic|~/.xinitrc}} file in the user's home directory. In the absence of {{ic|~/.xinitrc}}, it defaults to the global file {{ic|/etc/X11/xinit/xinitrc}}, which defaults to starting a basic environment with the [[Twm]] window manager, [[Wikipedia:Xclock|Xclock]] and [[Xterm]].<br />
<br />
For more information, see [[xinitrc]].<br />
<br />
{{Note|<br />
* If a problem occurs, then view the log at {{ic|/var/log/Xorg.0.log}}. Be on the lookout for any lines beginning with {{ic|(EE)}}, which represent errors, and also {{ic|(WW)}}, which are warnings that could indicate other issues.<br />
* If there is an ''empty'' {{ic|.xinitrc}} file in your {{ic|$HOME}}, either delete or [[xinitrc|edit it]] in order for X to start properly. If you do not do this X will show a blank screen with what appears to be no errors in your {{ic|Xorg.0.log}}. Simply deleting it will get it running with a default X environment.}}<br />
<br />
==Configuring==<br />
Xorg can be configured via {{ic|/etc/X11/xorg.conf}} or {{ic|/etc/xorg.conf}} and configuration files located in {{ic|/etc/X11/xorg.conf.d/}}. Arch supplies default configuration files in {{ic|/etc/X11/xorg.conf.d}}, and no extra configuration is necessary for most setups. You are free to create new configuration files, but they must start with {{ic|XX-}} (where XX is a number) and have a {{ic|.conf}} suffix (10 is read before 20, for example).<br />
<br />
Alternatively, your video card drivers may come with a tool to automatically configure Xorg. In the case of NVIDIA, try nvidia-xconfig. For ATI, try aticonfig.<br />
<br />
==Input devices==<br />
Installing input drivers is not needed for most hardware. Nevertheless, if evdev does not support your device, install the needed driver from the {{Grp|xorg-drivers}} group (try {{ic|pacman -Sg xorg-drivers}} for a listing).<br />
<br />
You should have {{ic|10-evdev.conf}} in the {{ic|/etc/X11/xorg.conf.d}} directory, which manages the keyboard, the mouse, the touchpad and the touchscreen.<br />
<br />
===Touchpad Synaptics===<br />
''Main page: [[Touchpad Synaptics]]''<br />
<br />
If you have a laptop, you need to [[pacman|install]] the touchpad driver provided by the {{Pkg|xf86-input-synaptics}} package in the [[Official Repositories]].<br />
<br />
After installation, you can find {{ic|10-synaptics.conf}} in the {{ic|/etc/X11/xorg.conf.d}} directory. It is safe to comment out/delete the {{ic|InputClass}} line regarding the touchpad in {{ic|10-evdev.conf}}.<br />
<br />
===Disabling Input Hot-plugging===<br />
Since version''' 1.8''' Xorg-server uses udev for device detection. The following will disable the use of udev.<br />
<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "False"<br />
EndSection<br />
{{Warning|This will disable Xorg hot-plugging for '''all''' input devices and revert to the same behavior as xorg-server 1.4. It is much more convenient to let udev configure your devices. '''Therefore, disabling hot-plugging is not recommended!'''}}<br />
<br />
===Keyboard settings===<br />
<br />
Xorg may fail to detect your keyboard correctly. This might give problems with your keyboard layout or keyboard model not being set correctly.<br />
<br />
To see a full list of keyboard models, layouts, variants and options, open {{ic|/usr/share/X11/xkb/rules/xorg.lst}}.<br />
<br />
To set the keymap for the current Xorg session:<br />
# setxkbmap dvorak<br />
<br />
====Key repeat delay and rate====<br />
<br />
Use {{ic|xset r rate DELAY RATE}} to change them, then use [[xinitrc]] to make it permanent.<br />
<br />
====Viewing Keyboard Settings====<br />
{{hc|$ setxkbmap -print -verbose 10|<nowiki><br />
<br />
Setting verbose level to 10<br />
locale is C<br />
Applied rules from evdev:<br />
model: evdev<br />
layout: us<br />
options: terminate:ctrl_alt_bksp<br />
Trying to build keymap using the following components:<br />
keycodes: evdev+aliases(qwerty)<br />
types: complete<br />
compat: complete<br />
symbols: pc+us+inet(evdev)+terminate(ctrl_alt_bksp)<br />
geometry: pc(pc104)<br />
xkb_keymap {<br />
xkb_keycodes { include "evdev+aliases(qwerty)" };<br />
xkb_types { include "complete" };<br />
xkb_compat { include "complete" };<br />
xkb_symbols { include "pc+us+inet(evdev)+terminate(ctrl_alt_bksp)" };<br />
xkb_geometry { include "pc(pc104)" };<br />
};<br />
</nowiki>}}<br />
====Setting Keyboard Layout With Hot-Plugging====<br />
To permanently change your keyboard layout, add the following to {{ic|xorg.conf}}:<br />
<br />
Section "InputClass"<br />
Identifier "Keyboard Defaults"<br />
MatchIsKeyboard "yes"<br />
Option "XkbLayout" "us"<br />
Option "XkbVariant" "colemak"<br />
EndSection<br />
<br />
{{Note|This is in an InputClass Section and not the InputDevice section for the keyboard.}}<br />
<br />
====Setting Keyboard Layout Without Hot-Plugging (deprecated)====<br />
{{Note|Changing the keyboard layout through this method requires disabling input hot-plugging.}}<br />
<br />
To change the keyboard layout, use the XkbLayout option in the keyboard InputDevice section. For example, if you have a keyboard with the English (Great Britain) layout, your keyboard InputDevice section might look similar to this:<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "kbd"<br />
Option "XkbLayout" "gb"<br />
EndSection<br />
<br />
To change the keyboard model, use the XkbModel option in the keyboard InputDevice section. For example, if you have a Microsoft Wireless Multimedia Keyboard:<br />
<br />
Option "XkbModel" "microsoftmult"<br />
<br />
====Switching Between Keyboard Layouts====<br />
{{Note|You need to install {{Pkg|xorg-xkbevd}} and add {{ic|xkbevd}} to DAEMONS section of {{ic|/etc/rc.conf}}.}}<br />
<br />
To be able to easily switch keyboard layouts, modify the Options used in either of the above two methods. For example, to switch between a US and a Swedish layout using the {{Keypress|Caps Lock}} key, create a file {{ic|/etc/X11/xorg.conf.d/01-keyboard-layout.conf}} with the following content:<br />
Section "InputClass"<br />
Identifier "keyboard-layout"<br />
MatchIsKeyboard "on"<br />
Option "XkbLayout" "us, se"<br />
Option "XkbOptions" "grp:caps_toggle"<br />
EndSection<br />
<br />
You can get a list of possible options for {{ic|grp:}} in {{ic|/usr/share/X11/xkb/rules/xorg.lst}} (they start about mid way in the file).<br />
<br />
As an alternative, you can add the following to your {{ic|.xinitrc}}:<br />
<br />
setxkbmap -layout "us, se" -option "grp:caps_toggle"<br />
<br />
This is mainly useful if you run a Desktop Environment which does not take care of keyboard layouts for you.<br />
<br />
====Enable pointerkeys====<br />
[[Wikipedia:Mouse keys|Mouse keys]] is now disabled by default and has to be manually enabled:<br />
{{hc|/etc/X11/xorg.conf.d/20-enable-pointerkeys.conf|<nowiki>Section "InputClass"<br />
Identifier "Keyboard Defaults"<br />
MatchIsKeyboard "yes"<br />
Option "XkbOptions" "keypad:pointerkeys"<br />
EndSection</nowiki>}}<br />
<br />
You can also run:<br />
$ setxkbmap -option keypad:pointerkeys<br />
<br />
Both will make the {{Keypress|Shift+Num Lock}} shortcut toggle mouse keys.<br />
<br />
===InputClasses ===<br />
'''Taken from: https://fedoraproject.org/wiki/Input_device_configuration'''<br />
<br />
InputClasses are a new type of configuration section that does not apply to a single device but rather to a class of devices, including hotplugged devices. An InputClass section's scope is limited by the ''matches'' specified &ndash; to apply to an input device, all matches must apply to a device. An example InputClass section is provided below:<br />
<br />
{{bc|<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
MatchIsTouchpad "on"<br />
Driver "synaptics"<br />
EndSection<br />
}}<br />
<br />
The next snippet might also be helpful:<br />
{{bc|<br />
Section "InputClass"<br />
Identifier "evdev touchpad catchall"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "evdev"<br />
EndSection<br />
}}<br />
<br />
If this snippet is present in the {{ic|xorg.conf}} or xorg.conf.d, any touchpad present in the system is assigned the synaptics driver. Note that due to precedence order (alphanumeric sorting of xorg.conf.d snippets) the Driver setting overwrites previously set driver options &ndash; the more generic the class, the earlier it should be listed. The default snippet shipped with the xorg-x11-drv-Xorg package is {{ic|00-evdev.conf}} and applies the evdev driver to all input devices.<br />
<br />
The match options specify which devices a section may apply to. To match a device, all match lines must apply. The following match lines are supported (with examples):<br />
* {{ic|MatchIsPointer}}, {{ic|MatchIsKeyboard}}, {{ic|MatchIsTouchpad}}, {{ic|MatchIsTouchscreen}}, {{ic|MatchIsJoystick}} &ndash; boolean options to apply to a group of devices.<br />
* {{ic|MatchProduct "foo&#124;bar"}}: match any device with a product name containing either "foo" or "bar"<br />
* {{ic|MatchVendor "foo&#124;bar&#124;baz"}}: match any device with a vendor string containing either "foo", "bar", or "baz"<br />
* {{ic|MatchDevicePath "/dev/input/event*"}}: match any device with a device path matching the given patch (see fnmatch(3) for the allowed pattern)<br />
* {{ic|MatchTag "foo&#124;bar"}}: match any device with a tag of either "foo" or "bar". Tags may be assigned by the config backend &ndash; udev in our case &ndash; to label devices that need quirks or special configuration.<br />
<br />
An example section for user-specific configuration is:<br />
<br />
{{bc|<br />
Section "InputClass"<br />
Identifier "lasermouse slowdown"<br />
MatchIsPointer "on"<br />
MatchProduct "Lasermouse"<br />
MatchVendor "LaserMouse Inc."<br />
Option "ConstantDeceleration" 20<br />
EndSection<br />
}}<br />
<br />
This section would match a pointer device containing "Lasermouse" from "Lasermouse Inc." and apply a constant deceleration of 20 on this device &ndash; slowing it down by factor 20.<br />
<br />
Some devices may get picked up by the X server when they really should not be. These devices can be configured to be ignored:<br />
<br />
{{bc|<br />
Section "InputClass"<br />
Identifier "no need for accelerometers in X"<br />
MatchProduct "accelerometer"<br />
Option "Ignore" "on"<br />
EndSection<br />
}}<br />
<br />
====Example configurations====<br />
<br />
The following subsections describe example configurations for commonly used configuration options. Note that if you use a desktop environment such as GNOME or KDE, options you set in the xorg.conf ''may'' get overwritten with user-specific options upon login.<br />
<br />
=====Example: Wheel Emulation (for a Trackpoint)=====<br />
<br />
If you own a computer with a Trackpoint (a Thinkpad for example) you can add the following to the {{ic|xorg.conf}} to use the middle Button to emulate a mouse wheel:<br />
<br />
{{bc|<br />
Section "InputClass"<br />
Identifier "Wheel Emulation"<br />
MatchIsPointer "on"<br />
MatchProduct "TrackPoint"<br />
Option "EmulateWheelButton" "2"<br />
Option "EmulateWheel" "on"<br />
EndSection<br />
}}<br />
<br />
For full support of TrackPoints (including horizontal scrolling) you can use the following:<br />
{{bc|<nowiki><br />
Section "InputClass"<br />
Identifier "Trackpoint Wheel Emulation"<br />
MatchProduct "TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|USB Trackpoint pointing device"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "EmulateWheel" "true"<br />
Option "EmulateWheelButton" "2"<br />
Option "Emulate3Buttons" "false"<br />
Option "XAxisMapping" "6 7"<br />
Option "YAxisMapping" "4 5"<br />
EndSection<br />
</nowiki>}}<br />
<br />
=====Example: Tap-to-click=====<br />
Tap-to-click can be enabled in the mouse configuration dialog (in the touchpad tab) but if you need tapping enabled at gdm already, the following snippet does it for you:<br />
{{bc|<br />
Section "InputClass"<br />
Identifier "tap-by-default"<br />
MatchIsTouchpad "on"<br />
Option "TapButton1" "1"<br />
EndSection<br />
}}<br />
<br />
=====Example: Keyboard layout and model on Acer 5920G Laptop=====<br />
<br />
Keyboard model and layout may be set in the file {{ic|/etc/X11/xorg.conf.d/keyboard.conf}} or any other .conf file in the same directory.<br />
* {{ic|MatchIsKeyboard "yes"}}: set the input device to a keyboard<br />
* {{ic|Option "XkbModel" "acer_laptop"}}: set the keyboard model to an Acer * {{ic|Option "XkbLayout" "be"}}: set the keyboard layout to belgian. You may replace {{ic|be}} with whatever layout you have.<br />
* {{ic|Option "XkbVariant" "sundeadkeys"}}: set the layout variant to Sun dead keys. You may omit the {{ic|XkbVariant}} option if you stick with the default variant.<br />
laptop keyboard. You may replace {{ic|acer_laptop}} with your actual keyboard layout.<br />
<br />
Note that a list of keyboard layouts and models can be found in {{ic|/usr/share/X11/xkb/rules/base.lst}}<br />
<br />
{{bc|<br />
Section "InputClass"<br />
Identifier "Keyboard Defaults"<br />
MatchIsKeyboard "yes"<br />
Option "XkbModel" "acer_laptop"<br />
Option "XkbLayout" "be"<br />
Option "XkbVariant" "sundeadkeys"<br />
EndSection<br />
}}<br />
<br />
=====Example: Third button emulation (for all attached mice)=====<br />
Third button emulation allows you to use the 1 and 2 buttons (left and right click) together to produce a button 3 event (middle-click), which is really useful for copy and paste in X.<br />
<br />
We will modify the mouse input catchall in {{ic|/etc/X11/xorg.conf.d/10-evdev.conf}}<br />
{{bc|<br />
Section "InputClass"<br />
Identifier "evdev pointer catchall"<br />
MatchIsPointer "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "evdev"<br />
Option "Emulate3Buttons" "True"<br />
Option "Emulate3Timeout" "25"<br />
EndSection<br />
}}<br />
<br />
Here you see the {{ic|Option "Emulate3Buttons" "True"}} and {{ic|Option "Emulate3Timeout" "25"}} options that specify that 3 buttons should be emulated and the delay to recognize both buttons down as a middle click is 25ms.<br />
<br />
==Graphics==<br />
===Driver installation===<br />
The default graphics driver is vesa ({{Pkg|xf86-video-vesa}}), which handles a large number of chipsets but does not include any 2D or 3D acceleration. To enable graphics acceleration, you will need to install and use the driver specific to your graphics card.<br />
<br />
First, identify your card:<br />
$ lspci | grep VGA<br />
<br />
Then, install an appropriate driver. You can search for these packages with the following command:<br />
$ pacman -Ss xf86-video<br />
<br />
Common open source drivers:<br />
*NVIDIA: {{Pkg|xf86-video-nouveau}} (see [[Nouveau]])<br />
*Intel: {{Pkg|xf86-video-intel}} (see [[Intel]])<br />
*ATI: {{Pkg|xf86-video-ati}} (see [[ATI]])<br />
<br />
Common proprietary drivers:<br />
*NVIDIA: {{Pkg|nvidia}} (see [[NVIDIA]])<br />
*ATI: {{AUR|catalyst}} (see [[ATI Catalyst]])<br />
<br />
Xorg should run smoothly without closed source drivers, which are typically needed only for advanced features such as fast 3D-accelerated rendering for games, dual-screen setups, and TV-out.<br />
<br />
===Monitor settings===<br />
====Getting started====<br />
{{Note|This step is OPTIONAL and should not be done unless you know what you are doing.<br><br />
This step is '''NOT OPTIONAL''' if using dual monitors or the nouveau driver. See [[Nouveau#Configuration]].}}<br />
<br />
First, create a new config file, such as {{ic|/etc/X11/xorg.conf.d/10-monitor.conf}}.<br />
<br />
Insert the following code into the config file mentioned above:<br />
<br />
{{bc|<nowiki><br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "vesa" #Choose the driver used for this monitor<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0" #Collapse Monitor and Device section to Screen section<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 16 #Choose the depth (16||24)<br />
SubSection "Display"<br />
Depth 16<br />
Modes "1024x768_75.00" #Choose the resolution<br />
EndSubSection<br />
EndSection<br />
</nowiki>}}<br />
<br />
====Multiple monitors/Dual screen====<br />
=====NVIDIA=====<br />
Please see: [[NVIDIA#Multiple monitors]].<br />
<br />
=====More than one graphics card=====<br />
You must define the correct driver to use and put the bus ID of your graphic cards.<br />
{{bc|<br />
Section "Device"<br />
Identifier "Screen0"<br />
Driver "nouveau"<br />
BusID "PCI:0:12:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Screen1"<br />
Driver "radeon"<br />
BusID "PCI:1:0:0"<br />
EndSection<br />
}}<br />
<br />
To get your bus ID:<br />
$ lspci | grep VGA<br />
01:00.0 VGA compatible controller: nVidia Corporation G96 [GeForce 9600M GT] (rev a1)<br />
<br />
The bus ID here is 1:0:0.<br />
<br />
=====Script to toggle internal/external display for laptops=====<br />
Script can be used to the keyboard shortcut.<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
<br />
IN="LVDS1"<br />
EXT="VGA1"<br />
<br />
if (xrandr | grep "$EXT" | grep "+")<br />
then<br />
xrandr --output $EXT --off --output $IN --auto<br />
else<br />
if (xrandr | grep "$EXT" | grep " connected")<br />
then<br />
xrandr --output $IN --off --output $EXT --auto<br />
fi<br />
fi<br />
</nowiki>}}<br />
<br />
Internal/external display names you can check:<br />
# xrandr -q<br />
<br />
If you do not have {{ic|xrandr}}, [[pacman|install]] {{Pkg|xorg-xrandr}} to use it.<br />
<br />
==== Display Size and DPI ====<br />
The DPI of the X server is determined in the following manner:<br />
# The -dpi command line option has highest priority.<br />
# If this is not used, the DisplaySize setting in the X config file is used to derive the DPI, given the screen resolution.<br />
# If no DisplaySize is given, the monitor size values from DDC are used to derive the DPI, given the screen resolution.<br />
# If DDC does not specify a size, 75 DPI is used by default.<br />
<br />
In order to get correct dots per inch (DPI) set, the display size must be recognized or set. Having the correct DPI is especially necessary where fine detail is required (like font rendering). Previously, manufacturers tried to create a standard for 96 DPI (a 10.3" diagonal monitor would be 800x600, a 13.2" monitor 1024x768). These days, screen DPIs vary and may not be equal horizontally and vertically. For example, a 19" widescreen LCD at 1440x900 may have a DPI of 89x87. To be able to set the DPI, the Xorg server attempts to auto-detect your monitor's physical screen size through the graphic card with [http://en.wikipedia.org/wiki/Display_Data_Channel DDC]. When the Xorg server knows the physical screen size, it will be able to set the correct DPI depending on resolution size.<br />
<br />
To see if your display size and DPI are detected/calculated correctly:<br />
<br />
$ xdpyinfo | grep -B2 resolution<br />
<br />
Check that the dimensions match your display size. If the Xorg server is not able to correctly calculate the screen size, it will default to 75x75 DPI and you will have to calculate it yourself.<br />
<br />
If you have specifications on the physical size of the screen, they can be entered in the Xorg configuration file so that the proper DPI is calculated:<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
DisplaySize 286 179 # In millimeters<br />
EndSection<br />
}}<br />
<br />
If you only want to enter the specification of your monitor '''without''' creating a full xorg.conf create a new config file. For example ({{ic|/etc/X11/xorg.conf.d/90-monitor.conf}}):<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "<default monitor>"<br />
DisplaySize 286 179 # In millimeters<br />
EndSection<br />
}}<br />
<br />
If you do not have specifications for physical screen width and height (most specifications these days only list by diagonal size), you can use the monitor's native resolution (or aspect ratio) and diagonal length to calculate the horizontal and vertical physical dimensions. Using the Pythagorean theorem on a 13.3" diagonal length screen with a 1280x800 native resolution (or 16:10 aspect ratio):<br />
<br />
echo 'scale=2;sqrt(1280^2+800^2)' | bc # 1509.43698<br />
<br />
This will give the pixel diagonal length and with this value you can discover the physical horizontal and vertical lengths (and convert them to millimeters):<br />
<br />
{{bc|<nowiki><br />
echo 'scale=2;(13.3/1509)*1280*25.4' | bc # 286.43072<br />
echo 'scale=2;(13.3/1509)*800*25.4' | bc # 179.01920<br />
</nowiki>}}<br />
<br />
{{Note|This calculation works for monitors with square pixels; however, there is the seldom monitor that may compress aspect ratio (e.g 16:10 aspect resolution to a 16:9 monitor). If this is the case, you should measure your screen size manually.}}<br />
<br />
===== Setting DPI manually =====<br />
DPI can be set manually if you only plan to use one resolution ([http://pxcalc.com/ DPI calculator]):<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "DPI" "96 x 96"<br />
EndSection<br />
}}<br />
<br />
If you use an NVIDIA card, you can manually set the DPI adding the options bellow on {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}} (inside '''Device''' section):<br />
<br />
Option "UseEdidDpi" "False"<br />
Option "DPI" "96 x 96"<br />
<br />
For RandR compliant drivers, you can set it by:<br />
<br />
xrandr --dpi 96<br />
<br />
See [[Execute commands after X start]] to make it permanent.<br />
<br />
====DPMS====<br />
DPMS (Display Power Management Signaling) is a technology that allows power saving behaviour of monitors when the computer is not in use. This will allow you to have your monitors automatically go into standby after a predefined period of time. See: [[DPMS]]<br />
<br />
== Composite ==<br />
The Composite extension for X causes an entire sub-tree of the window hierarchy to be rendered to an off-screen buffer. Applications can then take the contents of that buffer and do whatever they like. The off-screen buffer can be automatically merged into the parent window or merged by external programs, called compositing managers.<br />
<br />
{{Accuracy|Is this actually still true in recent Xorg releases?}}<br />
The Composite extension can't be used simultaneously with Xinerama. However, it can be used simultaneously with Nvidia Twinview.<br />
<br />
=== Disabling the extension ===<br />
The composite extension is enabled by default. To disable it, add this to xorg.conf or a file in /etc/xorg.conf.d:<br />
<br />
Section "Extensions"<br />
Option "Composite" "Disable"<br />
EndSection<br />
<br />
This may slightly improve your performance with some drivers.<br />
<br />
=== See also ===<br />
*[[AIGLX]]<br />
*[[Compiz]] -- The original composite/window manager from Novell<br />
*[[Xcompmgr]] -- A simple composite manager capable of drop shadows and primitive transparency<br />
*[[Cairo Compmgr|Cairo Composite Manager]] -- A versatile and extensible composite manager which uses cairo for rendering.<br />
*[[Wikipedia:Compositing window manager]]<br />
<br />
==Sample configurations==<br />
Anyone who has an {{ic|xorg.conf}} file written up that works, go ahead and post a link to it here for others to look at. Please do not in-line the entire configuration file; upload it somewhere else and link to it.<br />
<br />
'''Please post input hotplugging configurations only, otherwise note that your config is not using input hotplugging.''' (Xorg 1.8 = udev)<br />
<br />
=== Sample 1: {{ic|xorg.conf}} & {{ic|/etc/X11/xorg.conf.d/10-evdev.conf}} ===<br />
This is a sample configuration file using {{ic|/etc/X11/xorg.conf.d/10-evdev.conf}} for the keyboard layouts:<br />
<br />
{{Note|The "InputDevice" sections are commented out, because {{ic|/etc/X11/xorg.conf.d/10-evdev.conf}} is taking care of them.}}<br />
{{ic|xorg.conf}}: http://pastebin.com/raw.php?i=EuSKahkn<br />
{{ic|/etc/X11/xorg.conf.d/10-evdev.conf}}: http://pastebin.com/raw.php?i=4mPY35Mw<br />
{{ic|/etc/X11/xorg.conf.d/10-monitor.conf}} (VMware): http://pastebin.com/raw.php?i=fJv8EXGb<br />
{{ic|/etc/X11/xorg.conf.d/10-monitor.conf}} (KVM): http://pastebin.com/raw.php?i=NRz7v0Kn<br />
<br />
==Tips and tricks==<br />
===X startup ({{ic|/usr/bin/startx}}) tweaking===<br />
For X's option reference see:<br />
$ man Xserver<br />
<br />
The following options have to be appended to the variable {{ic|"defaultserverargs"}} in the {{ic|/usr/bin/startx}} file:<br />
<br />
* Enable deferred glyph loading for 16 bit fonts:<br />
-deferglyphs 16<br />
<br />
{{Note|1=If you start X with kdm, the startx script does not seem to be executed. X options must be appended to the variable {{ic|"ServerArgsLocal"}} or {{ic|"ServerCmd"}} in the {{ic|/usr/share/config/kdm/kdmrc}} file. By default kdm options are:<br />
{{bc|1=ServerArgsLocal=-nolisten tcp<br />
ServerCmd=/usr/bin/X}}<br />
}}<br />
<br />
===Virtual X session===<br />
To start another X session in, for example, {{Keypress|Ctrl+Alt+F8}}, you need to type this on a console:<br />
xinit /path/to/wm -- :1<br />
<br />
Change "/path/to/wm" to your window manager start file or to your login manager like gdm, kdm, or slim.<br />
<br />
===Nested X session===<br />
To run a nested session of another desktop environment:<br />
$ /usr/bin/Xnest :1 -geometry 1024x768+0+0 -ac -name Windowmaker & wmaker -display :1<br />
<br />
This will launch a Window Maker session in a 1024 by 768 window within your current X session.<br />
<br />
This needs the package {{Pkg|xorg-server-xnest}} to be installed.<br />
<br />
==Troubleshooting==<br />
===Common problems===<br />
If Xorg will not start, the screen is completely black, the keyboard and mouse are not working, etc., first take these simple steps:<br />
*Check the log file: {{ic|cat /var/log/Xorg.0.log}}<br />
*Install input driver (keyboard, mouse, joystick, tablet, etc...):<br />
*Finally, search for common problems in [[ATI]], [[Intel]] and [[NVIDIA]] articles.<br />
<br />
===Ctrl+Alt+Backspace does not work===<br />
There are two ways of restoring {{Keypress|Ctrl+Alt+Backspace}}; with and without input-hotplugging. Using hot-plugging is recommended.<br />
<br />
====With input hot-plugging====<br />
=====System-wide=====<br />
Within {{ic|/etc/X11/xorg.conf.d/10-evdev.conf}}, simply add the following:<br />
{{bc|<br />
Section "InputClass"<br />
Identifier "Keyboard Defaults"<br />
MatchIsKeyboard "yes"<br />
Option "XkbOptions" "terminate:ctrl_alt_bksp"<br />
EndSection<br />
}}<br />
<br />
{{Note|On KDE, this system-wide setting has no effect. To restore, go to Kickoff > Computer > System Settings which will open up the System Settings window. Click on 'Input Devices'. In this new window click the Keyboard tab and then click on the advanced tab. In this new window, click the box for 'Configure keyboard options.' Expand the entry for 'Key sequence to kill the X server' and ensure {{keypress|Ctrl+Alt+Backspace}} is checked. Click Apply and close the System Settings window. You now have your {{keypress|Ctrl+Alt+Backspace}} back in KDE.}}<br />
<br />
=====User-specific=====<br />
Another way is to put this line in [[xinitrc]]:<br />
setxkbmap -option terminate:ctrl_alt_bksp<br />
<br />
{{Note|This setting has no effect on Gnome 3.}}<br />
<br />
====Without input hot-plugging====<br />
New Xorg disables zapping with {{keypress|Ctrl+Alt+Backspace}} by default. You can enable it by adding the following line to {{ic|/etc/X11/xorg.conf}},<br />
Option "XkbOptions" "terminate:ctrl_alt_bksp"<br />
to {{ic|InputDevice}} section for keyboard.<br />
<br />
===Apple keyboard issues===<br />
:''See: [[Apple Keyboard]]''<br />
<br />
===Touchpad tap-click issues===<br />
:''See: [[Synaptics]]''<br />
<br />
===Extra mouse buttons not recognized===<br />
:''See: [[Get All Mouse Buttons Working]]''<br />
<br />
===X clients started with "su" fail===<br />
If you are getting "Client is not authorized to connect to server", try adding the line:<br />
session optional pam_xauth.so<br />
to {{ic|/etc/pam.d/su}}. {{ic|pam_xauth}} will then properly set environment variables and handle {{ic|xauth}} keys.<br />
<br />
===Program requests "font '(null)'"===<br />
*Error message: "''unable to load font `(null)'.''"<br />
Some programs only work with bitmap fonts. Two major packages with bitmap fonts are available, {{Pkg|xorg-fonts-75dpi}} and {{Pkg|xorg-fonts-100dpi}}. You do not need both; one should be enough. To find out which one would be better in your case, try this:<br />
$ xdpyinfo | grep resolution<br />
and use what is closer to you (75 or 100 instead of XX)<br />
# pacman -S xorg-fonts-XXdpi<br />
<br />
===Frame-buffer mode problems===<br />
If X fails to start with the following log messages,<br />
{{bc|<nowiki><br />
(WW) Falling back to old probe method for fbdev<br />
(II) Loading sub module "fbdevhw"<br />
(II) LoadModule: "fbdevhw"<br />
(II) Loading /usr/lib/xorg/modules/linux//libfbdevhw.so<br />
(II) Module fbdevhw: vendor="X.Org Foundation"<br />
compiled for 1.6.1, module version=0.0.2<br />
ABI class: X.Org Video Driver, version 5.0<br />
(II) FBDEV(1): using default device<br />
<br />
Fatal server error:<br />
Cannot run in framebuffer mode. Please specify busIDs for all framebuffer devices<br />
</nowiki>}}<br />
uninstall fbdev:<br />
# pacman -R xf86-video-fbdev<br />
<br />
===DRI with Matrox cards stops working===<br />
If you use a Matrox card and DRI stops working after upgrading to Xorg, try adding the line:<br />
Option "OldDmaInit" "On"<br />
to the Device section that references the video card in {{ic|xorg.conf}}.<br />
<br />
===Recovery: disabling Xorg before GUI login===<br />
If Xorg is set to boot up automatically and for some reason you need to prevent it from starting up before the login/display manager appears (if {{ic|/etc/rc.conf}} is wrongly configured and Xorg does not recognize your mouse or keyboard input, for instance), you can accomplish this task with two methods.<br />
<br />
*From the GRUB menu, you can specify the runlevel in the kernel line by adding a number to the end of the kernel line specifying the run level you want. The following example sets the run level to 3:<br />
kernel /boot/vmlinuz-linux root=/dev/disk/by-uuid/..ro 3<br />
<br />
*If you have not only a faulty {{ic|/etc/rc.conf}} to make Xorg unusable, but you have also set the GRUB menu wait time to zero, or cannot otherwise use GRUB to prevent Xorg from booting, you can use the Arch Linux live CD. Boot up the live CD and login as root. You need a mount point, such as {{ic|/mnt}}, and you need to know the name of the partition you want to mount.<br />
<br />
:You can use the command,<br />
# fdisk -l<br />
:to see your partitions. Usually, the one you want will be resembling {{ic|/dev/sda1}}. Then, to mount this to {{ic|/mnt}}, use<br />
# mount /dev/sda1 /mnt<br />
<br />
:Then your filesystem will show up under {{ic|/mnt}}. So your {{ic|/etc/rc.conf}} file, for example, would be in {{ic|/mnt/etc/rc.conf}}. From here you can delete the {{ic|gdm}} daemon to prevent Xorg from booting up normally or make any other necessary changes to the configuration.<br />
<br />
===X failed to start : Keyboard initialization failed===<br />
If your hard disk is full, startx will fail. {{ic|/var/log/Xorg.0.log}} will end with:<br />
(EE) Error compiling keymap (server-0)<br />
(EE) XKB: Couldn't compile keymap<br />
(EE) XKB: Failed to load keymap. Loading default keymap instead.<br />
(EE) Error compiling keymap (server-0)<br />
(EE) XKB: Couldn't compile keymap<br />
XKB: Failed to compile keymap<br />
Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config.<br />
Fatal server error:<br />
Failed to activate core devices.<br />
Please consult the The X.Org Foundation support at http://wiki.x.org<br />
for help.<br />
Please also check the log file at "/var/log/Xorg.0.log" for additional information.<br />
(II) AIGLX: Suspending AIGLX clients for VT switch<br />
<br />
Make some free space on your root partition and X will start.</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Music_Player_Daemon&diff=192540Music Player Daemon2012-04-01T23:43:10Z<p>VitaminJ: Permissions to audio device problem if you change the user group that MPD runs as.</p>
<hr />
<div>[[Category:Audio/Video (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
{{i18n|Music Player Daemon}}<br />
[[de:Music Player Daemon]]<br />
[[pl:Music Player Daemon]]<br />
[[fr:MPD]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|[[Wikipedia:MPD|MPD]] (music player daemon) is an audio player that has a server-client architecture. It plays audio files, organizes playlists and maintains a music database all while using very few resources. In order to interface with it, a separate client is needed.}}<br />
{{Article summary heading|Related Articles}}<br />
{{Article summary wiki|MPD/Tips and Tricks}}<br />
{{Article summary wiki|MPD/Troubleshooting}}<br />
{{Article summary end}}<br />
<br />
== Installation ==<br />
[[pacman|Install]] {{Pkg|mpd}}, available in the [[Official Repositories]].<br />
<br />
== Setup ==<br />
MPD is able to run globally (settings apply to all users), locally (per user settings), and in multiple instances.<br />
The way of setting up mpd depends on the way it is supposed to be used.<br />
A local configuration may prove more useful on a desktop system than on a system that is used by several people simultaneously.<br />
<br />
For a comfortable use, it is sensible to provide MPD access to the following files and directories:<br />
mpd.db # The music database<br />
mpd.pid # The file where mpd stores its process ID<br />
mpd.log # mpd logs here<br />
mpdstate # mpd's current state is noted here<br />
playlists # the folder where playlists are saved into<br />
<br />
In order for MPD to be able to play back audio, [[ALSA]] or [[PulseAudio]] needs to be setup and working.<br />
<br />
=== Global Configuration ===<br />
{{Note|For a user-specific permissions, change the "user" line above to reflect one of the system users.}}<br />
{{Warning|Users making use of PulseAudio will not be able to correctly use mpd when the daemon is set to run as its own user!}}<br />
<br />
MPD comes with an example configuration file, available at {{ic|/usr/share/mpd/mpd.conf.example}}. This file holds an abundance of information on MPD configuration, and holds default mixer values.<br />
<br />
* As root, copy this example file to {{ic|/etc/mpd.conf}}.<br />
cp /usr/share/mpd/mpd.conf.example /etc/mpd.conf<br />
<br />
==== Editing {{ic|mpd.conf}} ====<br />
The default Arch install keeps the setup in {{ic|/var}} and uses "mpd" as default user.<br />
<br />
Edit {{ic|/etc/mpd.conf}} to reflect as such:<br />
{{hc|/etc/mpd.conf|<br />
music_directory "/home/user/music"<br />
playlist_directory "/var/lib/mpd/playlists"<br />
db_file "/var/lib/mpd/mpd.db"<br />
log_file "/var/log/mpd/mpd.log"<br />
pid_file "/var/run/mpd/mpd.pid"<br />
state_file "/var/lib/mpd/mpdstate"<br />
user "mpd"<br />
# bind_to_address "127.0.0.1"<br />
# port "6600"<br />
}}<br />
<br />
* To change the volume of audio from mpd independent of other programs, uncomment or add the switch in mpd.conf:<br />
<br />
{{hc|/etc/mpd.conf|<br />
mixer_type "software"<br />
}}<br />
<br />
* Users of [[PulseAudio]] will need to make the following modification:<br />
{{hc|/etc/mpd.conf|2=<br />
audio_output {<br />
type "pulse"<br />
name "pulse audio"<br />
}<br />
}}<br />
<br />
* Users of [[ALSA]] will want to have the following device definition, which allows the software volume control in your MPD client to control the volume separately from other applications.<br />
{{hc|/etc/mpd.conf|2=<br />
audio_output {<br />
type "alsa"<br />
name "My Sound Card"<br />
mixer_type "software" # optional<br />
}<br />
}}<br />
Note that if you change the group that MPD runs as, you will get errors like "output: Failed to open "My ALSA Device"" "[alsa]: Failed to open ALSA device "default": No such file or directory" "player_thread: problems opening audio device while playing "Song Name.mp3""<br />
<br />
This is because by default MPD runs as group 'audio' and the sound devices under /dev/snd/ are owned by group 'audio'.<br />
<br />
<br />
===== Music directory =====<br />
<br />
* MPD needs to have {{ic|+x}} permissions on ''all'' parent directories to the music collection (ie. if it's located outside of "mpd" home directory {{ic|/var/lib/mpd}}). By default useradd sets permissions on home directories to {{ic|1700 drwx------}}. Thus users will most likely need to remount the music directory under a directory that mpd has access to -- this only applies if running as the 'mpd' user.<br />
<br />
# mkdir /var/lib/mpd/music<br />
# echo "/home/$USER/music /var/lib/mpd/music none bind" >> /etc/fstab<br />
# mount -a<br />
# rc.d restart mpd<br />
See also [https://bbs.archlinux.org/viewtopic.php?id=86449 the forum thread.]<br />
<br />
* Another simpler solution would be to just create a symbolic link into {{ic|/var/lib/mpd/music}}.<br />
# mkdir /var/lib/mpd/music<br />
# ln -s MUSIC_FOLDER /var/lib/mpd/music/<br />
# rc.d restart mpd<br />
<br />
If the music collection is contained under multiple directories, create symbolic links under the main music directory in {{ic|/var/lib/mpd}}. Remember to set permissions accordingly on the directories being linked.<br />
<br />
==== Creating the required files ====<br />
Now, having finished configuring MPD, the files and directories for MPD to write in need to be created:<br />
<br />
* As root, create the directories and files specified in {{ic|/etc/mpd.conf}}:<br />
# mkdir -p /var/lib/mpd/playlists <br />
# touch /var/lib/mpd/{mpd.db,mpdstate} <br />
<br />
* Usually the init-script should properly create {{ic|/var/run/mpd/}} when starting. The deamon will use this directory to create {{ic|mpd.pid}} in it. However: If you are running mpd as a different user, you will have to fix the init script: In {{ic|/etc/rc.d/mpd}} change the line<br />
<nowiki>[[</nowiki> -d /run/mpd <nowiki>]]</nowiki> || install -d -o mpd -g mpd /run/mpd<br />
to:<br />
<nowiki>[[</nowiki> -d /run/mpd <nowiki>]]</nowiki> || install -d -o ''username'' -g ''groupname'' /run/mpd<br />
<br />
* Change the file's permissions so that the daemon can modify them.<br />
# chown -R mpd /var/lib/mpd<br />
<br />
==== Create database ====<br />
Creating the database is now accomplished via the update feature of the client, for example {{ic|mpc update}}. <br />
{{Box RED | Note: | Creating the MPD database as root using {{ic|# mpd --create-db}} is deprecated.}}<br />
<br />
==== Timeline of MPD startup ====<br />
To depict when MPD drops its superuser privileges and assumes those of the user set in the configuration, the timeline of a normal MPD startup is listed here:<br />
<br />
# MPD is started on boot by {{ic|/etc/rc.conf}}, by including it in the {{ic|DAEMONS}} array. (Or, this can be done manually each session by running {{ic|rc.d start mpd}} with root privileges).<br />
# Since MPD is now started as root, it first reads the {{ic|/etc/mpd.conf}} file.<br />
# MPD reads the user variable in the {{ic|/etc/mpd.conf}} file, and changes from root to this user.<br />
# MPD then reads the contents of the {{ic|/etc/mpd.conf}} file and configures itself accordingly.<br />
<br />
Notice that MPD changes the running user from root to the one named in the {{ic|/etc/mpd.conf}} file. <br />
This way, uses of {{ic|~}} in the configuration file point correctly to the home user's directory, and not root's directory. <br />
It may be worthwhile to change all uses of {{ic|~}} to {{ic|/home/username}} to avoid any confusion over this aspect of MPD's behavior.<br />
<br />
=== Local Configuration (per user) ===<br />
MPD does not need to be run globally as a daemon and can rather work per user. <br />
The usual method to configure MPD globally is because the listed files and folders in the default configuration file point to directories owned by root (the {{ic|/var}} directory). <br />
A less used (but perhaps more sensible) method is to make MPD work with files and directories owned by a normal user.<br />
Running MPD as a normal user has the benefits of:<br />
<br />
* A single directory {{ic|~/.mpd}} (or any other directory under {{ic|/home/username}}) that will contain all the MPD configuration files.<br />
* Easier to avoid unforeseen read/write permission errors.<br />
<br />
{{Note|This approach will not work with multiple users to having access to MPD at the same time.}}<br />
<br />
* Begin the setup by creating a directory for the required files and the playlists:<br />
<br />
{{bc|mkdir -p ~/.mpd/playlists}}<br />
<br />
* Copy the contents of the default MPD configuration file in {{ic|/usr/share/mpd/mpd.conf.example}} to the target user's home directory:<br />
<br />
{{bc|cp /usr/share/mpd/mpd.conf.example ~/.mpdconf}}<br />
<br />
* Create all of the requisite files:<br />
<br />
{{bc|<nowiki>touch ~/.mpd/{mpd.db,mpd.log,mpd.pid,mpdstate}</nowiki>}}<br />
<br />
* Edit {{ic|~/.mpdconf}} to specify these files:<br />
<br />
{{hc|~/.mpdconf|<br />
music_directory "/home/USER/music" # Keep commented if your XDG directory already points to it<br />
playlist_directory "/home/USER/.mpd/playlists"<br />
db_file "/home/USER/.mpd/mpd.db"<br />
log_file "/home/USER/.mpd/mpd.log"<br />
pid_file "/home/USER/.mpd/mpd.pid"<br />
state_file "/home/USER/.mpd/mpdstate"<br />
}}<br />
<br />
* MPD can now be started by typing {{ic|mpd}} on the command line.<br />
To have MPD start with the X server add it to {{ic|~/.xinitrc}} or create a {{ic|.desktop}} if using a common desktop and save it to {{ic|~/.config/autostart/mpd.desktop}}:<br />
<br />
{{hc|mpd.desktop|2=<br />
[Desktop Entry]<br />
Encoding=UTF-8<br />
Version=0.9.4<br />
Type=Application<br />
Name=Music Player Daemon<br />
Comment=<br />
Exec=mpd<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
}}<br />
<br />
==== Scripted Configuration ====<br />
<br />
Rasi has written a script that will create the proper directory structure, configuration files and prompt for the location of the user's Music directory; it can be downloaded [http://karif.server-speed.net/~carnager/mpdsetup.tar here].<br />
<br />
=== Multi-mpd setup ===<br />
<br />
'''Useful if running an icecast server.'''<br />
<br />
For a second MPD (e.g., with icecast output to share music over the network) using the same music and playlist as the one above, simply copy the above configuration file and make a new file (e.g., {{ic|/home/username/.mpd/config-icecast}}), and only change the log_file, error_file, pid_file, and state_file parameters (e.g., {{ic|mpd-icecast.log}}, {{ic|mpd-icecast.error}}, and so on); using the same directory paths for the music and playlist directories would ensure that this second mpd would use the same music collection as the first one e.g., creating and editing a playlist under the first daemon would affect the second daemon as well. Users do not have to create the same playlists all over again for the second daemon. Call this second daemon the same way from {{ic|~/.xinitrc}} above. (Just be sure to have a different port number, so as to not conflict with the first mpd daemon).<br />
<br />
== Clients ==<br />
A separate client is needed to control mpd. Popular options are:<br />
<br />
=== Console ===<br />
* {{App|mpc|Simple KISS client. All basic functionality available|http://mpd.wikia.com/wiki/Client:Mpc|{{Pkg|mpc}}}}<br />
* {{App|ncmpc|A NCurses client for mpd|http://mpd.wikia.com/wiki/Client:Ncmpc|{{Pkg|ncmpc}}}}<br />
* {{App|ncmpcpp|An almost exact clone of ncmpc with some new features written in C++ (tag editor, search engine)|http://unkart.ovh.org/ncmpcpp/|{{Pkg|ncmpcpp}}}}<br />
* {{App|pms|Highly configurable and accessible ncurses client|http://pms.sourceforge.net/|{{AUR|pmus}}}}<br />
<br />
=== Graphical ===<br />
* {{App|Ario|A very feature-rich GTK2 GUI client for mpd, inspired by Rhythmbox|http://ario-player.sourceforge.net/|{{Pkg|ario}}}}<br />
* {{App|QmpdClient|A GUI client written with Qt 4.x|http://bitcheese.net/wiki/QMPDClient|{{Pkg|qmpdclient}}}}<br />
* {{App|Sonata|An elegant Python GTK+ client|http://sonata.berlios.de/|{{Pkg|sonata}}}}<br />
* {{App|gmpc|GNOME Client|http://gmpc.wikia.com/wiki/Gnome_Music_Player_Client|{{Pkg|gmpc}}}}<br />
* {{App|Dpmc|Dmenu-based MPC client with a playlist manager and state-saving on playlist changes|http://wintervenom.mine.nu/|{{AUR|dmpc}}}}<br />
<br />
=== Web ===<br />
* {{App|Patchfork|web client for MPD written in PHP and Ajax|http://mpd.wikia.com/wiki/Client:Pitchfork|{{AUR|patchfork-git}}}}.<br />
<br />
See a long list of clients at the [http://mpd.wikia.com/wiki/Clients mpd wiki].<br />
<br />
== External links ==<br />
* [http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki Official Web Site and wiki]<br />
* [http://mpd.wikia.com/wiki/Clients Sorted List of MPD Clients]<br />
* [http://www.musicpd.org/forum/ MPD forum]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=User:VitaminJ&diff=191868User:VitaminJ2012-03-26T21:48:30Z<p>VitaminJ: Fill out some of my page</p>
<hr />
<div>I run an IT consultancy in Montreal. Over the last 2 years my distros of choice<br />
<br />
Some skills:<br />
*LTSP<br />
*Windows Network administration with WMI and VBscript and open source tools like rsync and ssh<br />
*Linux server administration<br />
<br />
Hobbies:<br />
*Hydroponics<br />
*Motorcycles</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Bluetooth&diff=191851Bluetooth2012-03-26T16:11:15Z<p>VitaminJ: Blueman permissions for regular users.</p>
<hr />
<div>[[Category:Wireless Networking (English)]]<br />
{{i18n|Bluetooth}}<br />
[[fr:Bluetooth]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Covers the installation and use of Bluetooth on Arch Linux.}}<br />
{{Article summary end}}<br />
<br />
[http://www.bluetooth.org/ Bluetooth] is a standard for the short-range wireless interconnection of cellular phones, computers, and other electronic devices. In Linux, the canonical implementation of the Bluetooth protocol stack is [http://www.bluez.org/ BlueZ].<br />
<br />
== Installation ==<br />
To use Bluetooth, [[pacman|install]] {{Pkg|bluez}}, available in the [[Official Repositories]]. Once the package is installed, both the {{ic|dbus}} and the {{ic|bluetooth}} [[daemons]] must be started, '''in that order'''.<br />
{{Note|It is important that {{ic|dbus}} is started '''before''' {{ic|bluetooth}}.}}<br />
The {{ic|dbus}} daemon is used to read settings and for PIN pairing, while the {{ic|bluetooth}} daemon is required for the Bluetooth protocol.<br />
<br />
== Graphical front-ends ==<br />
<br />
The following packages allow for a graphical interface to customize Bluetooth.<br />
<br />
=== Blueman ===<br />
<br />
[http://blueman-project.org Blueman] is a full featured Bluetooth manager written in [[GTK+]] and, as such, is recommended for [[GNOME]] or [[Xfce]]. You can install Blueman with the package {{Pkg|blueman}}, available in the [[Official Repositories]].<br />
<br />
Be sure that {{ic|bluetooth}} daemon is running as described above (added to rc.conf after dbus), and execute {{ic|blueman-applet}}. To make the applet run on login add {{ic|blueman-applet}} either under ''System -> Preferences -> Startup Applications'' (GNOME) or ''Xfce Menu -> Settings -> Session and Startup'' (Xfce).<br />
<br />
In order for a user to add and manage Bluetooth devices using Blueman, the user must be added to the 'lp' group. See /etc/dbus-1/system.d/bluetooth.conf for the section that enables users of the 'lp' group to communicate with the Bluetooth daemon.<br />
<br />
{{Note|<br />
*If you are running Blueman outside GNOME/GDM (e.g., in Xfce using the {{ic|startx}} command) you should add {{ic|. /etc/X11/xinit/xinitrc.d/*}} on top of your {{ic|~/.xinitrc}} to make Nautilus capable to browse your devices.<br />
*If you are not using Nautilus (for example Thunar) you may find the following script useful:<br />
{{hc|obex_thunar.sh|<br />
#!/bin/bash<br />
fusermount -u ~/bluetooth<br />
obexfs -b $1 ~/bluetooth<br />
thunar ~/bluetooth<br />
}}<br />
Now you will need to move the script to an appropriate location (e.g., {{ic|/usr/bin}}). After that, mark it as executable:<br />
{{bc|chmod +x /usr/bin/obex_thunar.sh}}<br />
The last step is to change the line in ''Blueman tray icon -> Local Services -> Transfer -> Advanced'' to {{ic|obex_thunar.sh %d}}.}}<br />
<br />
=== GNOME Bluetooth ===<br />
<br />
[http://live.gnome.org/GnomeBluetooth GNOME Bluetooth] is a fork of the old ''bluez-gnome'' and is focused on integration with the [[GNOME]] desktop environment. GNOME Bluetooth is required by {{Pkg|gnome-shell}}, so you should already have it installed if you are running GNOME 3. Otherwise, it can be installed with the package {{Pkg|gnome-bluetooth}}.<br />
<br />
Run {{ic|bluetooth-applet}} for a nice Bluetooth applet. You should now be able to setup devices and send files by right-clicking the Bluetooth icon. To make the applet run on login, add it to ''System -> Preferences -> Startup Applications''.<br />
<br />
To add a Bluetooth entry to the ''SendTo'' menu in Thunar's file properties menu, see instructions [http://thunar.xfce.org/pwiki/documentation/sendto_menu here].<br />
<br />
=== BlueDevil ===<br />
<br />
The Bluetooth tool for [[KDE]] is [https://projects.kde.org/projects/extragear/base/bluedevil BlueDevil]. It can be installed with the package {{Pkg|bluedevil}}, available in the [[Official Repositories]].<br />
<br />
Make sure {{ic|bluetooth}} daemon is running, as described above. You should get a Bluetooth icon both in Dolphin and in the system tray, from which you can configure BlueDevil and detect Bluetooth devices by clicking the icon. You can also configure BlueDevil from the KDE System Settings<br />
<br />
=== Fluxbox, Openbox, other WM ===<br />
Of course you can still use the preceding applications even if GNOME, Xfce or KDE are not your desktop manager. This list should help you figuring out which application does what:<br />
* bluetooth-applet -- tray icon with access to settings, pairing wizard, management of known devices<br />
* /usr/lib/gnome-user-share/gnome-user-share -- needs to be running if you're about to receive files via obexBT from a paired/bonded device<br />
<br />
if you're receiving an error during transmission and/or there's no file received add this into<br />
<br />
<tt>/etc/dbus-1/system.d/bluetooth.conf</tt><br />
<policy user="your_user_id"><br />
<allow own="org.bluez"/><br />
<allow send_destination="org.bluez"/><br />
<allow send_interface="org.bluez.Agent"/><br />
</policy><br />
<br />
* bluetooth-wizard -- for new devices to be paired<br />
* bluetooth-properties -- accessible also via bluetooth-applet icon<br />
* gnome-file-share-properties -- permissions on receiving files via bluetooth<br />
* bluez-sendto -- gui for sending files to a remote device<br />
<br />
== Manual configuration ==<br />
<br />
To configure BlueZ manually, you will need to edit the configuration files in {{ic|/etc/bluetooth}}. These are:<br />
audio.conf<br />
input.conf<br />
main.conf<br />
network.conf<br />
rfcomm.conf<br />
<br />
The default configuration should work for most purposes. Most configuration options are well-documented in these files, so customization is a simple matter of reading the option descriptions. For general options, start with {{ic|main.conf}}.<br />
<br />
=== Audio streaming ===<br />
If you would like to enable audio streaming from your device to your computer, you must modify {{ic|audio.conf}} and add this to the {{ic|[General]}} section:<br />
Enable=Source<br />
<br />
With bluez 4.98 and alsa-lib 1.0.24.1, you may have to try with:<br />
Enable=Socket<br />
<br />
== Pairing ==<br />
{{Note | This section might not be completely accurate. Thanks to Gattschardo for the pin solution''}}<br />
<br />
Many bluetooth devices require [http://en.wikipedia.org/wiki/Bluetooth#Pairing pairing].<br />
The exact procedure depends among other on the devices involved, and their input functionality.<br />
The procedure on a mobile may be as follows:<br />
* The computer sends a connect request to the mobile. <br />
* A pin, determined by the computer, is prompted for at the mobile<br />
* The same key must be re-entered at the computer.<br />
<br />
To scan for external devices, do<br />
$> hcitool scan<br />
<br />
To pair with a device without using the gnome-bluez package you will need to use a tool named ''bluez-simple-agent'' that comes with the bluez package. You need a few python related packages from the regular repositories to get this to run: dbus-python and pygobject. If you have everything ready you can start the script from the root user:<br />
<br />
$> bluez-simple-agent<br />
<br />
If it all works, you should get the message "Agent registered" on that console. You can now start pairing from your mobile device, and the script will ask you for the passcode on this console, you type it and confirm with enter - voila that's all. You can now also shut down the agent using ^C-c, you need it only for pairing, not every time you want to connect. If you can`t discover computer from your phone, go to [[Bluetooth#My_computer_isn.27t_visible|troubleshooting section]].<br />
<br />
If you want to pair with a 'passive' device such as a headset, you can provide it's address to attempt pairing from your computer:<br />
<br />
$> bluez-simple-agent hci0 00:11:22:33:AA:BB<br />
<br />
For an example scroll down to the example section.<br />
<br />
== Using Obex for sending and receiving files ==<br />
Another option, rather than using KDE or Gnome Bluetooth packages, is Obexfs which allows you to mount your phone and treat it as part of your filesystem. Note that to use Obexfs, you need a device that provides an Obex FTP service.<br />
<br />
To install;<br />
# pacman -S obexfs<br />
<br />
and then your phone can then be mounted running as root <br />
# obexfs -b <devices mac address> /mountpoint<br />
<br />
For more mounting options see http://dev.zuckschwerdt.org/openobex/wiki/ObexFs<br />
<br />
For devices don't support Obex FTP service, check if Obex Object Push is supported.<br />
<br />
# sdptool browse XX:XX:XX:XX:XX:XX<br />
<br />
Read the output, look for Obex Object Push, remember the channel for this service. If supported, you can use ussp-push to send files to this device:<br />
<br />
# ussp-push XX:XX:XX:XX:XX:XX@CHANNEL file wanted_file_name_on_phone<br />
<br />
== Examples ==<br />
<br />
=== Siemens S55 ===<br />
<br />
This is what I did to connect to my S55. (I have not figured out how to initiate the connection from the phone)<br />
* The steps under installation<br />
* <br />
$> hcitool scan<br />
Scanning ...<br />
XX:XX:XX:XX:XX:XX NAME<br />
$> B=XX:XX:XX:XX:XX:XX<br />
Start the simple-agent in a second terminal<br />
$> su -c bluez-simple-agent <br />
Password: <br />
Agent registered<br />
Back to the first console <br />
$> obexftp -b $B -l "Address book"<br />
# Phone ask for pin, I enter it and answer yes when asked if I want to save the device<br />
...<br />
<file name="5F07.adr" size="78712" modified="20030101T001858" user-perm="WD" group-perm="" /><br />
...<br />
$> obexftp -b 00:01:E3:6B:FF:D7 -g "Address book/5F07.adr"<br />
Browsing 00:01:E3:6B:FF:D7 ...<br />
Channel: 5<br />
Connecting...done<br />
Receiving "Address book/5F07.adr"... Sending "Address book"... done<br />
Disconnecting...done<br />
$> obexftp -b 00:01:E3:6B:FF:D7 -p a <br />
...<br />
Sending "a"... done<br />
Disconnecting...done<br />
<br />
=== Logitech Mouse MX Laser / M555b ===<br />
<br />
To quickly test the connection:<br />
<br />
$> hidd --connect XX:XX:XX:XX:XX:XX<br />
<br />
For automated reconnection, use your desktop wizard to configure the bluetooth mouse.<br />
If your desktop environment doesn't includes support for this task, see the [[Bluetooth mouse manual configuration]] guide.<br />
<br />
=== Motorola V900 ===<br />
<br />
After installing blueman and running blueman-applet, click "find me" under connections -> bluetooth in motorla device. In blueman-applet, scan devices, find the motorola, click "add" in blueman-applet. Click "bond" in blueman-applet, enter some pin, enter the same pin in motorola when it asks. In terminal:<br />
<br />
cd ~/<br />
mkdir bluetooth-temp<br />
obexfs -n xx:yy:zz:... ~/bluetooth-temp<br />
cd ~/bluetooth-temp<br />
<br />
and browse... Only audio, video, and pictures are available when you do this.<br />
<br />
=== Motorola RAZ ===<br />
<br />
> pacman -S obextool obexfs obexftp openobex bluez<br />
<br />
> lsusb<br />
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 002 Device 002: ID 03f0:171d Hewlett-Packard Wireless (Bluetooth + WLAN) Interface [Integrated Module]<br />
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
<br />
> hciconfig hci0 up<br />
<br />
> hciconfig<br />
hci0: Type: BR/EDR Bus: USB<br />
BD Address: 00:16:41:97:BA:5E ACL MTU: 1017:8 SCO MTU: 64:8<br />
UP RUNNING<br />
RX bytes:348 acl:0 sco:0 events:11 errors:0<br />
TX bytes:38 acl:0 sco:0 commands:11 errors:0<br />
<br />
> hcitool dev<br />
Devices:<br />
hci0 00:16:41:97:BA:5E<br />
<br />
'''Attention: make sure that bluetooth on your phone is enabled and your phone is visible! <br />
'''<br />
<br />
> hcitool scan<br />
Scanning ...<br />
00:1A:1B:82:9B:6D [quirxi]<br />
<br />
> hcitool inq<br />
Inquiring ...<br />
00:1A:1B:82:9B:6D clock offset: 0x1ee4 class: 0x522204<br />
<br />
> l2ping 00:1A:1B:82:9B:6D<br />
Ping: 00:1A:1B:82:9B:6D from 00:16:41:97:BA:5E (data size 44) ...<br />
44 bytes from 00:1A:1B:82:9B:6D id 0 time 23.94ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 1 time 18.85ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 2 time 30.88ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 3 time 18.88ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 4 time 17.88ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 5 time 17.88ms<br />
6 sent, 6 received, 0% loss<br />
<br />
> hcitool name 00:1A:1B:82:9B:6D<br />
[quirxi]<br />
<br />
# hciconfig -a hci0<br />
hci0: Type: BR/EDR Bus: USB<br />
BD Address: 00:16:41:97:BA:5E ACL MTU: 1017:8 SCO MTU: 64:8<br />
UP RUNNING<br />
RX bytes:9740 acl:122 sco:0 events:170 errors:0<br />
TX bytes:2920 acl:125 sco:0 commands:53 errors:0<br />
Features: 0xff 0xff 0x8d 0xfe 0x9b 0xf9 0x00 0x80<br />
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3<br />
Link policy:<br />
Link mode: SLAVE ACCEPT<br />
Name: 'BCM2045'<br />
Class: 0x000000<br />
Service Classes: Unspecified<br />
Device Class: Miscellaneous,<br />
HCI Version: 2.0 (0x3) Revision: 0x204a<br />
LMP Version: 2.0 (0x3) Subversion: 0x4176<br />
Manufacturer: Broadcoml / Corporation (15)<br />
<br />
> hcitool info 00:1A:1B:82:9B:6D<br />
Requesting information ...<br />
BD Address: 00:1A:1B:82:9B:6D<br />
Device Name: [quirxi]<br />
LMP Version: 1.2 (0x2) LMP Subversion: 0x309<br />
Manufacturer: Broadcom Corporation (15)<br />
Features: 0xff 0xfe 0x0d 0x00 0x08 0x08 0x00 0x00<br />
<3-slot packets> <5-slot packets> <encryption> <slot offset><br />
<timing accuracy> <role switch> <hold mode> <sniff mode><br />
<RSSI> <channel quality> <SCO link> <HV2 packets><br />
<HV3 packets> <A-law log> <CVSD> <power control><br />
<transparent SCO> <AFH cap. slave> <AFH cap. master><br />
<br />
<br />
'''Edit your main.conf and enter the proper class for your phone ( Class = 0x100100 ):'''<br />
> vim /etc/bluetooth/main.conf<br />
<br />
# Default device class. Only the major and minor device class bits are<br />
# considered.<br />
#Class = 0x000100<br />
Class = 0x100100<br />
<br />
> /etc/rc.d/dbus start<br />
:: Starting D-BUS system messagebus <br />
[DONE]<br />
<br />
> /etc/rc.d/bluetooth start<br />
:: Stopping bluetooth subsystem: pand dund rfcomm hidd bluetoothd<br />
[DONE]<br />
:: Starting bluetooth subsystem: bluetoothd<br />
<br />
<br />
'''Pairing with bluez-simple-agent only has to be done once. On your motorola-phone give 0000 in as your pin when phone asks for it !!'''<br />
> /usr/bin/bluez-simple-agent hci0 00:1A:1B:82:9B:6D<br />
RequestPinCode (/org/bluez/10768/hci0/dev_00_1A_1B_82_9B_6D)<br />
Enter PIN Code: 0000<br />
Release<br />
New device (/org/bluez/10768/hci0/dev_00_1A_1B_82_9B_6D)<br />
<br />
'''Now you can browse the filesystem of your phone with obexftp:'''<br />
> obexftp -v -b 00:1A:1B:82:9B:6D -B 9 -l<br />
Connecting..\done<br />
Tried to connect for 448ms<br />
Receiving "(null)"...-<?xml version="1.0" ?><br />
<!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd"><br />
<folder-listing><br />
<parent-folder /><br />
<folder name="audio" size="0" type="folder" modified="20101010T132323Z" user-perm="RW" /><br />
<folder name="video" size="0" type="folder" modified="20101010T132323Z" user-perm="RW" /><br />
<folder name="picture" size="0" type="folder" modified="20101010T132323Z" user-perm="RW" /><br />
</folder-listing><br />
done<br />
Disconnecting..\done<br />
<br />
'''Or you can mount your phone into a directory on your computer and treat it like a normal file system:'''<br />
<br />
> groupadd bluetooth<br />
> mkdir /mnt/bluetooth<br />
> chown root:bluetooth /mnt/bluetooth<br />
> chmod 775 /mnt/bluetooth<br />
> usermod -a -G bluetooth arno<br />
<br />
> obexfs -b 00:1A:1B:82:9B:6D /mnt/bluetooth/<br />
> l /mnt/bluetooth/<br />
total 6<br />
drwxr-xr-x 1 root root 0 10. Okt 13:25 .<br />
drwxr-xr-x 5 root root 4096 10. Okt 10:08 ..<br />
drwxr-xr-x 1 root root 0 10. Okt 2010 audio<br />
drwxr-xr-x 1 root root 0 10. Okt 2010 picture<br />
drwxr-xr-x 1 root root 0 10. Okt 2010 video<br />
<br />
=== Pairing with an iPhone using bluez-simple-agent ===<br />
<br />
Assuming a bluetooth device called hci0 and an iPhone that showed up in a hcitool scan as '00:00:DE:AD:BE:EF':<br />
<br />
# bluez-simple-agent hci0 00:00:DE:AD:BE:EF<br />
Passcode:<br />
<br />
<br />
=== Headset and Alsa Devices ===<br />
1. First if you have not already, install bluez<br />
# pacman -S bluez<br />
2. Scan for your device<br />
$ hcitool (-i <optional hci#>***) scan<br />
3. Pair your headset with your device<br />
$ bluez-simple-agent (optional hci# ***) XX:XX:XX:XX:XX:XX<br />
and put in your pin (0000 or 1234, etc)<br />
4. Add this to your/etc/asound.conf file<br />
#/etc/asound.conf<br />
<br />
pcm.btheadset {<br />
type plug<br />
slave {<br />
pcm {<br />
type bluetooth<br />
device XX:XX:XX:XX:XX:XX <br />
profile "auto"<br />
} <br />
} <br />
hint {<br />
show on<br />
description "BT Headset"<br />
} <br />
}<br />
ctl.btheadset {<br />
type bluetooth<br />
} <br />
<br />
5. Check to see if it has been added to alsa devices<br />
$ aplay -L<br />
<br />
6. Now play with aplay:<br />
$ aplay -D btheadset /path/to/audio/file<br />
<br />
or Mplayer:<br />
$ mplayer -ao alsa:device=btheadset /path/to/audio/or/video/file<br />
<br />
*** To find hci# for a usb dongle, type in <br />
$ hcitool dev<br />
<br />
== Troubleshooting ==<br />
<br />
=== Segfaults in Bluez 4.95 ===<br />
If bluetoothd stops working after enabling oder disabling your bluetooth device via rfkill or via gnome-bluetooth applet, look at your dmesg output. If it looks like:<br />
<br />
bluetoothd[2330]: segfault at 1 ip 00007fcef2327b75 sp 00007fff9f769cb0 error 4 in libglib-2.0.so.0.2800.8[7fcef22ca000+e9000]<br />
<br />
then you shoud consider downgrade to 4.94 (just grab the PKGBUILD/etc from arch and change version to 4.94 and correct the md5sum for bluez) or wait for an update of bluez. [https://bugs.archlinux.org/task/25088?project=1&openedfrom=-1+week Here] is also some (arch) bugreport about it.<br />
<br />
=== passkey-agent ===<br />
$> passkey-agent --default 1234<br />
Can't register passkey agent<br />
The name org.bluez was not provided by any .service files<br />
You probably started <tt>/etc/rc.d/bluetooth</tt> before <tt>/etc/rc.d/dbus</tt><br />
$> hciconfig dev<br />
# (no listing)<br />
Try running <tt>hciconfig hc0 up</tt><br />
<br />
=== Blueman ===<br />
If blueman-applet fails to start, try removing the entire ''/var/lib/bluetooth'' directory and restarting the machine (or just the hal, dbus, and bluetooth services).<br />
# rm -rf /var/lib/bluetooth<br />
# reboot<br />
<br />
=== gnome-bluetooth ===<br />
If you see this when trying to enable receiving files in bluetooth-properties:<br />
Bluetooth OBEX start failed: Invalid path<br />
Bluetooth FTP start failed: Invalid path<br />
Then run:<br />
# pacman -S xdg-user-dirs<br />
$ xdg-user-dirs-update<br />
You can edit the paths using:<br />
$ vi ~/.config/user-dirs.dirs<br />
<br />
=== Bluetooth USB Dongle ===<br />
If you are using a USB dongle, you should check that your Bluetooth dongle is recognized. You can do that by inspecting <tt>/var/log/messages.log</tt> when plugging in the USB dongle. It should look something like the following (look out for hci):<br />
<br />
# tail -f /var/log/messages.log<br />
Feb 20 15:00:24 hostname kernel: [ 2661.349823] usb 4-1: new full-speed USB device number 3 using uhci_hcd<br />
Feb 20 15:00:24 hostname bluetoothd[4568]: HCI dev 0 registered<br />
Feb 20 15:00:24 hostname bluetoothd[4568]: Listening for HCI events on hci0<br />
Feb 20 15:00:25 hostname bluetoothd[4568]: HCI dev 0 up<br />
Feb 20 15:00:25 hostname bluetoothd[4568]: Adapter /org/bluez/4568/hci0 has been enabled<br />
<br />
For a list of supported hardware please refer to the [[Bluetooth#Resources|resources]] section on this page.<br />
<br />
If you only get the first two lines, you may see that it found the device but you need to bring it up.<br />
Example:<br />
<br />
hciconfig -a hci0<br />
hci0: Type: USB<br />
BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0<br />
DOWN <br />
RX bytes:0 acl:0 sco:0 events:0 errors:0<br />
TX bytes:0 acl:0 sco:0 commands:0 errors:<br />
sudo hciconfig hci0 up<br />
hciconfig -a hci0<br />
hci0: Type: USB<br />
BD Address: 00:02:72:C4:7C:06 ACL MTU: 377:10 SCO MTU: 64:8<br />
UP RUNNING <br />
RX bytes:348 acl:0 sco:0 events:11 errors:0<br />
TX bytes:38 acl:0 sco:0 commands:11 errors:0<br />
<br />
To verify that the device was detected you can use <tt>hcitool</tt> which is part of the <tt>bluez-utils</tt>. You can get a list of available devices and their identifiers and their MAC address by issuing:<br />
<br />
$ hcitool dev<br />
Devices:<br />
hci0 00:1B:DC:0F:DB:40<br />
<br />
More detailed informations about the device can be retrieved by using <tt>hciconfig</tt>.<br />
<br />
$ hciconfig -a hci0<br />
hci0: Type: USB<br />
BD Address: 00:1B:DC:0F:DB:40 ACL MTU: 310:10 SCO MTU: 64:8<br />
UP RUNNING PSCAN ISCAN <br />
RX bytes:1226 acl:0 sco:0 events:27 errors:0<br />
TX bytes:351 acl:0 sco:0 commands:26 errors:0<br />
Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80<br />
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 <br />
Link policy: RSWITCH HOLD SNIFF PARK <br />
Link mode: SLAVE ACCEPT <br />
Name: 'BlueZ (0)'<br />
Class: 0x000100<br />
Service Classes: Unspecified<br />
Device Class: Computer, Uncategorized<br />
HCI Ver: 2.0 (0x3) HCI Rev: 0xc5c LMP Ver: 2.0 (0x3) LMP Subver: 0xc5c<br />
Manufacturer: Cambridge Silicon Radio (10)<br />
<br />
=== Logitech Bluetooth USB Dongle ===<br />
There are Logitech dongles (ex. Logitech MX5000) that can work in two modes Embedded and HCI. In embedded mode dongle emulates a USB device so it seems to your PC that your using a normal USB mouse/keyoard.<br />
<br />
If you hold the little red Button on the USB BT mini-receiver it will enable the other mode. Hold the red button on the BT dongle and plug it into the computer, and after 3-5 seconds of holding the button, the Bluetooth icon will appear in the system tray. [http://ubuntuforums.org/showthread.php?t=1332197 Discussion]<br />
<br />
=== hcitool scan: Device not found ===<br />
* On some Dell laptops (e.g. Studio 15) you have to switch the Bluetooth mode from HID to HCI using<br />
# hid2hci<br />
<br />
{{Note|hid2hci is no longer in the $PATH, it is under /lib/udev/hid2hci, but udev should run it automatically for you.}}<br />
<br />
* If the device won't show up and you have a Windows operating system on your machine, try booting it and enable the bluetooth adapter from windows.<br />
<br />
* Sometimes also this simple command helps:<br />
# hciconfig hci0 up<br />
<br />
=== My computer isn't visible ===<br />
Can't discover computer from your phone? Enable PSCAN and ISCAN:<br />
# enable PSCAN and ISCAN<br />
$ hciconfig hci0 piscan <br />
# check it worked<br />
$ hciconfig <br />
hci0: Type: USB<br />
BD Address: 00:12:34:56:78:9A ACL MTU: 192:8 SCO MTU: 64:8<br />
'''UP RUNNING PSCAN ISCAN'''<br />
RX bytes:20425 acl:115 sco:0 events:526 errors:0<br />
TX bytes:5543 acl:84 sco:0 commands:340 errors:0<br />
<br />
{{Note | Check DiscoverableTimeout and PairableTimeout in /etc/bluetooth/main.conf}}<br />
<br />
Try changing device class in /etc/bluetooth/main.conf as following<br />
# Default device class. Only the major and minor device class bits are<br />
# considered.<br />
#Class = 0x000100 (from default config)<br />
Class = 0x100100<br />
<br />
This was the only solution to make my computer visible for my phone. <br />
<br />
=== Nautilus cannot browse files ===<br />
If nautilus doesn't open and show this error:<br />
Nautilus cannot handle obex: locations. Couldn't display "obex://[XX:XX:XX:XX:XX:XX]/".<br />
Install gvfs-obexftp package:<br />
# pacman -S gvfs-obexftp<br />
<br />
=== Bluetooth is disabled when starting GNOME ===<br />
If you have {{ic|dbus}} and {{ic|bluetooth}} backgrounded (@) in your {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}}, it might happen that {{ic|bluetooth}} will be disabled when starting up GNOME. To solve this, make sure {{ic|dbus}} is not backgrounded.<br />
<br />
=== Sennheiser MM400 Headset connection problems ===<br />
If your {{ic|Sennheiser MM400 Headset}} immediately disconnects after connecting as {{ic|Headset Service}} with Blueman, try to connect it as {{ic|Audio Sink}}. Afterwards you can change the headset's {{ic|Audio Profile}} to {{ic|Telephony Duplex}} with a right click in Blueman.<br />
With this option headset functionality will be available although the headset was only connected as {{ic|Audio Sink}} in first place and no disconnection will happen (tested with bluez 4.96-3, pulseaudio 1.1-1 and blueman 1.23-2).<br />
<br />
=== My device is paired but no sound is played from it ===<br />
Try to first inspect '''/var/log/messages.log'''<br />
{{bc|# tail /var/log/messages.log<br />
Jan 12 20:08:58 localhost pulseaudio[1584]: [pulseaudio] module-bluetooth-device.c: Service not connected<br />
Jan 12 20:08:58 localhost pulseaudio[1584]: [pulseaudio] module-bluetooth-device.c: Bluetooth audio service not available}}<br />
<br />
If you see such messages, try first:<br />
{{bc|# pactl load-module module-bluetooth-device}}<br />
<br />
If the module fails to work, do this workaround:<br />
Open '''/etc/bluetooth/audio.conf''' and add after '''[General]''' (on a new line)<br />
{{bc|Enable&#61;Socket}}<br />
Then restart the bluetooth daemon with {{ic|/etc/rc.d/bluetooth restart}}.<br />
Pair again your device, and you should find it in the pulseaudio settings (advanced settings for the sound)<br />
<br />
[http://wiki.gentoo.org/index.php?title=Bluetooth_Headset&redirect=no More information on Gentoo Wiki]<br />
<br />
If after fixing this you still can't get sound, try using blueman (this is the only one that works for me), make sure that notify-osd is installed or it might show you weird error messages like this one: "Stream setup failed"<br />
<br />
fail (/usr/lib/python2.7/site-packages/blueman/gui/manager/ManagerDeviceMenu.py:134)<br />
fail (DBusException(dbus.String(u'Stream setup failed'),),)<br />
<br />
== See also ==<br />
*[http://www.gentoo.org/doc/en/bluetooth-guide.xml Gentoo Linux Bluetooth Guide]<br />
*[http://en.opensuse.org/HCL:Bluetooth openSUSE Bluetooth Hardware Compatibility List]<br />
*[http://linuxgazette.net/109/oregan3.html Accessing a Bluetooth phone (Linux Gazette)]<br />
*[http://www.adamish.com/blog/#a000361 Bluetooth computer visibility]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Talk:Diskless_system&diff=133005Talk:Diskless system2011-03-06T15:46:46Z<p>VitaminJ: /* NBD */</p>
<hr />
<div>Thanks, Net147, those edits helped me remove the last issues I had with my diskless setup. I moved your DHCP workaround to the top of the list, that is a very good script you have. --[[User:Geekner|Geekner]]<br />
<br />
== dnsmasq and pxe boot ==<br />
<br />
I sucessful booted a VirtualBox machine without the three dhcp-option-force parameter in dnsmasq.conf.<br />
The configfile is searched along a path according to the syslinux wiki, so it it is not neccessary.<br />
<br />
<br />
== DHCP/Network Daemon Workaround ==<br />
Changed to a more simple fix (derived from Net147's script) making use of confd to keep it closer to vanilla. <br />
Also note if you want to change it back to the old way that the -p option is not actually required as it is implied by -s.<br />
--[[User:Mikep|Mikep]] 18:29, 9 January 2010 (EST)<br />
<br />
<br />
== NBD ==<br />
It seems like the thing to do these days is NBD instead of NFS. Any interest in changing the article or amending it with an NBD option? (I would do it, not asking anyone else to.) -- [[User:Piezoelectric|Piezoelectric]] 21:00, 10 April 2010 (EDT)<br />
<br />
:YES! I'd like to see this, a RO NBD root could be a lot faster. --[[User:VitaminJ|VitaminJ]] 10:46, 6 March 2011 (EST)<br />
<br />
== Wireless boot ==<br />
"'''Hardware Considerations''': [..] Wireless will not work, with exception of a wireless-to-ethernet external bridge."<br />
<br />
Not entirely true! See http://www.etherboot.org/wiki/wirelessboot --[[User:Huuhaa|Huuhaa]] 15:09, 20 January 2011 (EST)</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Talk:Acpid&diff=131366Talk:Acpid2011-02-18T10:33:16Z<p>VitaminJ: </p>
<hr />
<div>= Kacpid =<br />
<br />
Q: Can someone add a section about this? Is it an alternative to ACPID?<br />
<br />
A: No it's actually a kernel thread that is running due to an acpi module that is loaded into the kernel, like "thermal" or "battery". You can use the kernel argument noacpi in grub to disable acpi in the kernel. --[[User:VitaminJ|VitaminJ]] 05:33, 18 February 2011 (EST)<br />
<br />
==Screen Blanking==<br />
Q: How do you keep the screen blanked when an external mouse is plugged in? Screen will blank when lid is closed, but if you move the mouse it will light up again and you'll see the light coming through the cracks. --[[User:VitaminJ|VitaminJ]] 05:32, 18 February 2011 (EST)</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Talk:Acpid&diff=131365Talk:Acpid2011-02-18T10:32:52Z<p>VitaminJ: Answer prev question, add new one</p>
<hr />
<div>= Kacpid =<br />
<br />
Q: Can someone add a section about this? Is it an alternative to ACPID?<br />
A: No it's actually a kernel thread that is running due to an acpi module that is loaded into the kernel, like "thermal" or "battery". You can use the kernel argument noacpi in grub to disable acpi in the kernel.<br />
<br />
==Screen Blanking==<br />
Q: How do you keep the screen blanked when an external mouse is plugged in? Screen will blank when lid is closed, but if you move the mouse it will light up again and you'll see the light coming through the cracks. --[[User:VitaminJ|VitaminJ]] 05:32, 18 February 2011 (EST)</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Laptop_Mode_Tools&diff=131361Laptop Mode Tools2011-02-18T09:55:33Z<p>VitaminJ: /* Troubleshooting */</p>
<hr />
<div>[[Category:Laptops (English)]]<br />
[[Category:Power management (English)]]<br />
{{Expansion}}<br />
{{Article summary start}}<br />
{{Article summary text|Overview of the Laptop Mode Tools power management suite for notebooks.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|acpid}}<br />
{{Article summary wiki|cpufrequtils}}<br />
{{Article summary wiki|pm-utils}}<br />
{{Article summary heading|Resources}}<br />
{{Article summary link|Laptop Mode Tools|http://samwel.tk/laptop_mode/}}<br />
{{Article summary link|Mailing List Archives|http://mailman.samwel.tk/pipermail/laptop-mode/ }}<br />
{{Article summary link|Less Watts - Official Site|http://www.lesswatts.org/index.php}}<br />
{{Article summary link|Laptop - ArchWiki|http://wiki.archlinux.org/index.php/Laptop|lll}}<br />
<br />
<br />
{{Article summary end}}<br />
<br />
==Preface==<br />
The Linux kernel, starting from version 2.6.6, contains a feature called ''laptop mode''. This feature is also present in the Linux 2.4 series starting from version 2.4.23. When enabled, the kernel allows the hard drive to spin down more often, resulting in significant power savings. Laptop Mode Tools (LTM) evolved from a simple program that controlled the hard drives to a centralized power saving solution providing a wide selection of options and can perform a number of varying power saving functions across separate subsystems simultaneously. Combined with [[acpid]], [[cpufrequtils]] and [[pm-utils]], LTM provides most users with a complete notebook power management suite.<br />
<!--<br />
=== Relationship to ACPID ===<br />
=== Relationship to cpufrequtils ===<br />
=== Relationship to pm-utils ===<br />
--><br />
==Installation==<br />
{{Package Official|laptop-mode-tools}} is part of the official [[Official Repositories|Arch Linux [extra] repository]].<br />
# pacman -S laptop-mode-tools<br />
<br />
==Configuration==<br />
Add {{Codeline|laptop-mode}} to the {{Codeline|DAEMONS}} array in {{Filename|/etc/rc.conf}}:<br />
DAEMONS=(...laptop-mode...)<br />
<br />
Configuration is handled through the primary configuration file {{Filename|/etc/laptop-mode/laptop-mode.conf}} and through the configuration of dozens of feature-specific files in {{Filename|/etc/laptop-mode/conf.d/*}}. Recent versions of LTM are able to automatically enable commonly used {{Filename|conf.d/*}} settings by way of the {{Codeline|ENABLE_AUTO_MODULES}} variable in {{Filename|/etc/laptop-mode/laptop-mode.conf}}.<br />
<br />
===Disks===<br />
====Hard disks====<br />
Spinning down the hard drive through {{codeline|hdparm -S}} valuessaves power and makes everything a lot more quiet. By using the readahead function you can allow the drives to spin down more often even though you are using the computer. LTM can also establish {{codeline|hdparm -B}} values. 1 is maximum hard drive power saving and 254 is minimum. Set this value to 254 when on AC and 1 when on battery. If you move around a lot when on battery it might be a good idea to set it higher (eg. 128)<sup>[clarifiy]</sup>. {{codeline|hdparm -S}} and {{codeline|hdparm -B}} values are configured in {{Filename|/etc/laptop-mode/laptop-mode.conf}}.<br />
<br />
====HAL polling====<br />
<br />
# hal-polling.conf<br />
# ThinkPad T40/T42/T60 Example<br />
#<br />
DEBUG=0<br />
CONTROL_HAL_POLLING=1<br />
BATT_DISABLE_HAL_POLLING=1<br />
AC_DISABLE_HAL_POLLING=1<br />
HAL_POLLING_DEVICES="/dev/scd?"<br />
<br />
===Processor===<br />
====CPU frequency====<br />
<br />
# cpufreq.conf<br />
# ThinkPad T40/T42/T60 Example<br />
#<br />
CONTROL_CPU_FREQUENCY=1<br />
BATT_CPU_MAXFREQ=fastest<br />
BATT_CPU_MINFREQ=slowest<br />
BATT_CPU_GOVERNOR=ondemand<br />
BATT_CPU_IGNORE_NICE_LOAD=1<br />
LM_AC_CPU_MAXFREQ=fastest<br />
LM_AC_CPU_MINFREQ=slowest<br />
LM_AC_CPU_GOVERNOR=ondemand<br />
LM_AC_CPU_IGNORE_NICE_LOAD=1<br />
NOLM_AC_CPU_MAXFREQ=fastest<br />
NOLM_AC_CPU_MINFREQ=slowest<br />
NOLM_AC_CPU_GOVERNOR=ondemand<br />
NOLM_AC_CPU_IGNORE_NICE_LOAD=0<br />
CONTROL_CPU_THROTTLING=0<br />
<br />
* See [[CPU Frequency Scaling]] for details on how to setup the needed kernel modules.<br />
<br />
===Device and bus===<br />
====Intel SATA====<br />
* Enable the Intel SATA AHCI controller Aggressive Link Power Management feature to set the disk link into a very low power mode in the absence of disk IO.<br />
# intel-sata-powermgmt.conf<br />
# ThinkPad T40/T42/T60 Example<br />
#<br />
DEBUG=0<br />
CONTROL_INTEL_SATA_POWER=1<br />
BATT_ACTIVATE_SATA_POWER=1<br />
LM_AC_ACTIVATE_SATA_POWER=1<br />
NOLM_AC_ACTIVATE_SATA_POWER=0<br />
<br />
{{Note|Review the well-documented {{Filename|/etc/laptop-mode/conf.d/intel-sata-powermgmt.conf}} file for additional configuration details.}}<br />
<br />
====USB autosuspend====<br />
# usb-autosuspend.conf<br />
# ThinkPad T40/T42/T60 Example<br />
#<br />
DEBUG=0<br />
CONTROL_USB_AUTOSUSPEND=1<br />
BATT_SUSPEND_USB=1<br />
LM_AC_SUSPEND_USB=1<br />
NOLM_AC_SUSPEND_USB=0<br />
AUTOSUSPEND_TIMEOUT=2<br />
<br />
{{Note|Review the well-documented {{Filename|/etc/laptop-mode/conf.d/usb-autosuspend.conf}} file for additional configuration details.}}<br />
<br />
===Display and graphics===<br />
====LCD brightness====<br />
* Available brightness values for certain laptops can can be obtained by running following two commands:<br />
$ cat /proc/acpi/video/VID/LCD/brightness<br />
<br />
For [http://en.wikipedia.org/wiki/ThinkPad ThinkPad] notebooks, minimum brightness values can be obtained by running one of the following two commands:<br />
$ cat /sys/class/backlight/acpi_video0/brightness<br />
<br />
$ cat /sys/class/backlight/thinkpad_screen/brightness<br />
<br />
* For [http://en.wikipedia.org/wiki/ThinkPad ThinkPad] notebooks, maximum brightness values can be obtained by running one of the following two commands:<br />
$ cat /sys/class/backlight/acpi_video0/max_brightness<br />
<br />
$ cat /sys/class/backlight/thinkpad_screen/max_brightness<br />
<br />
# lcd-brightness.conf<br />
# ThinkPad T40/T42 Example<br />
#<br />
DEBUG=0<br />
CONTROL_BRIGHTNESS=1<br />
BATT_BRIGHTNESS_COMMAND="echo 0"<br />
LM_AC_BRIGHTNESS_COMMAND="echo 7"<br />
NOLM_AC_BRIGHTNESS_COMMAND="echo 7"<br />
BRIGHTNESS_OUTPUT="/sys/class/backlight/thinkpad_screen/brightness"<br />
<br />
# lcd-brightness.conf<br />
# ThinkPad T60 Example<br />
#<br />
DEBUG=0<br />
CONTROL_BRIGHTNESS=1<br />
BATT_BRIGHTNESS_COMMAND="echo 0"<br />
LM_AC_BRIGHTNESS_COMMAND="echo 7"<br />
NOLM_AC_BRIGHTNESS_COMMAND="echo 7"<br />
BRIGHTNESS_OUTPUT="/sys/class/backlight/acpi_video0/brightness"<br />
<br />
{{Note|Review the well-documented {{Filename|/etc/laptop-mode/conf.d/lcd-brightness.conf}} file for additional configuration details.}}<br />
<br />
====Terminal blanking====<br />
<br />
# terminal-blanking.conf<br />
# ThinkPad T40/T42/T60 Example<br />
#<br />
DEBUG=0<br />
CONTROL_TERMINAL=1<br />
TERMINALS="/dev/tty1"<br />
BATT_TERMINAL_BLANK_MINUTES=1<br />
BATT_TERMINAL_POWERDOWN_MINUTES=2<br />
LM_AC_TERMINAL_BLANK_MINUTES=10<br />
LM_AC_TERMINAL_POWERDOWN_MINUTES=10<br />
NOLM_AC_TERMINAL_BLANK_MINUTES=10<br />
NOLM_AC_TERMINAL_POWERDOWN_MINUTES=10<br />
<br />
{{Note|Review the well-documented {{Filename|/etc/laptop-mode/conf.d/terminal-blanking.conf}} file for additional configuration details.}}<br />
<br />
===Networking===<br />
====Ethernet====<br />
# ethernet.conf<br />
# ThinkPad T40/T42/T60 Example<br />
#<br />
DEBUG=0<br />
CONTROL_ETHERNET=1<br />
LM_AC_THROTTLE_ETHERNET=0<br />
NOLM_AC_THROTTLE_ETHERNET=0<br />
DISABLE_WAKEUP_ON_LAN=1<br />
DISABLE_ETHERNET_ON_BATTERY=1<br />
ETHERNET_DEVICES="eth0"<br />
<br />
====Wireless LAN====<br />
Wireless interface power management settings are hardware-dependent, and thus a bit trickier to configure. Depending on the wireless chipset, the settings are managed in one of the following three files:<br />
#{{Filename|/etc/laptop-mode/conf.d/wireless-power.conf}} for a generic method of saving power (using "iwconfig wlan0 power on/off"). This applies to most chipsets (that is, anything but Intel chipsets listed below).<br />
#{{Filename|/etc/laptop-mode/conf.d/wireless-ipw-power.conf}} for Intel chipsets driven by the old ipw driver. This apply to IPW3945, IPW2200 and IPW2100. It currently (as of LMT 1.55-1) uses iwpriv for IPW3945, and a combination of iwconfig and iwpriv settings for IPW2100 and IPW220. See {{Filename|/usr/share/laptop-mode-tools/modules/wireless-ipw-power}} for details. (note that the ipw3945 isn't used anymore, see below)<br />
#{{Filename|/etc/laptop-mode/conf.d/wireless-iwl-power.conf}} for Intel chipsets driven by modules iwl4965, iwl3945 and iwlagn (this latter supports chipsets 4965, 5100, 5300, 5350, 5150, 1000, and 6000)<br />
Note that activating the three of them shouldn't be much of a problem, since LTM detects the module used by the interface and acts accordingly.<br />
<br />
The supported modules for each config file, indicated above, are taken directly from LTM. However, this seems to be a bit out-of-date, since the current 2.6.34 kernel doesn't provide the ipw3945 and iwl4965 modules anymore (3945 chipset uses iwl3945 instead, and 4965 uses the generic module iwlagn). This is only brought here for information, as this doesn't (or shouldn't) affect the way LTM works.<br />
<br />
There is a known issue with some chipsets running with the iwlagn module (namely, the 5300 chipset, and maybe others). On those chipsets, the following settings of {{Filename|/etc/laptop-mode/conf.d/wireless-iwl-power.conf}} :<br />
IWL_AC_POWER<br />
IWL_BATT_POWER<br />
are ignored, because the {{Filename|/sys/class/net/wlan*/device/power_level}} file doesn't exist. Instead, the standard method (with "iwconfig wlan0 power on/off") is automatically used.<br />
<br />
===Audio===<br />
====AC97====<br />
<br />
# ac97-powersave.conf<br />
# ThinkPad T40/T42/T60 Example<br />
#<br />
DEBUG=0<br />
CONTROL_AC97_POWER=1<br />
<br />
====Intel HDA====<br />
<br />
# intel-hda-powersave.conf<br />
# ThinkPad T40/T42/T60 Example<br />
#<br />
DEBUG=0<br />
CONTROL_INTEL_HDA_POWER=1<br />
BATT_INTEL_HDA_POWERSAVE=1<br />
LM_AC_INTEL_HDA_POWERSAVE=1<br />
NOLM_AC_INTEL_HDA_POWERSAVE=0<br />
INTEL_HDA_DEVICE_TIMEOUT=10<br />
INTEL_HDA_DEVICE_CONTROLLER=0<br />
<br />
==Tips and tricks==<br />
===Aliases===<br />
===lm-profiler===<br />
===Disabling===<br />
<br />
==Troubleshooting==<br />
===laptop-mode-tools is not picking up events!===<br />
You need to install and enable acpid. Add it to your daemons list in {{filename|/etc/rc.conf}}</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Execute_on_USB_insert&diff=130692Execute on USB insert2011-02-13T00:06:15Z<p>VitaminJ: Add section on disabling trackpad on external mouse connection</p>
<hr />
<div>{{i18n|Execute on usb insert}}<br />
<br />
Suppose you want to execute a certain program on the insertion of a usb dongle.<br />
Personally, I added this feature because I was getting frustrated with the computer locking up and all keyboard and mouse input was lost (The sysrq keys were not working).<br />
<br />
There is an added security feature so that only dongles with the correct key can run the program.<br />
<br />
== Installation ==<br />
<br />
Put a copy of the [[Execute_on_usb_insert#exdongle_script|{{Filename|exdongle}} script]] (given below) in your path.<br />
<br />
Add the following line to your udev [[Udev#Auto_mounting_USB_devices|USB mount rule]] (Modify to fit your configuration):<br />
<br />
ACTION=="add", RUN+="/usr/bin/exdongle run /media/%k-%E{dir_name}"<br />
<br />
Run the configuration option, for example<br />
<br />
exdongle conf -k "$RANDOM$RANDOM$RANDOM$RANDOM$RANDOM$RANDOM$RANDOM$RANDOM" -p "-10" -s "on"<br />
<br />
This sets the configuration to a random key value (only programs with the correct keys can be run on the computer), and the runtime priority to -10.<br />
<br />
== Setting up a USB dongle ==<br />
<br />
First, write a script that you want to run when the dongle is inserted.<br />
<br />
For example:<br />
<br />
{{File|name=test.sh|content=<nowiki><br />
#!/bin/sh<br />
<br />
DISPLAY=:0 xterm<br />
</nowiki>}}<br />
<br />
Now run the new option:<br />
<br />
exdongle new <Dongle mount point> test.sh<br />
<br />
Now, whenever you insert the dongle, a root shell will be opened under the X server running on display :0.<br />
This may be useful for some administrative purposes.<br />
<br />
== Security ==<br />
<br />
There may be security issues with this, and it is probably best used only on a personal computer.<br />
<br />
== exdongle script ==<br />
<br />
{{File|name=/usr/bin/exdongle|content=<nowiki><br />
#!/bin/sh<br />
<br />
# exdongle mkexdongle<br />
<br />
###############################################################################<br />
<br />
CONFFILE="/etc/exdongle.conf"<br />
<br />
###############################################################################<br />
<br />
function usage() {<br />
<br />
echo ""<br />
echo "USAGE: $0 new <DIR> <PROG>"<br />
echo " $0 del <DIR>"<br />
echo " $0 conf [-k KEY] [-p PRIORITY] [-s SWITCH]"<br />
echo " $0 run <DIR>"<br />
echo ""<br />
echo " new:"<br />
echo " DIR <S>: The directory on the dongle to execute"<br />
echo " SCRIPT <S>: The script to run on dongle"<br />
echo ""<br />
echo " del:"<br />
echo " DIR [S]: The directory on the dongle to execute"<br />
echo ""<br />
echo " conf:"<br />
echo " -k <S>: specify key"<br />
echo " -p <N>: priority to run script at"<br />
echo " -s <on|off>: Activate or deactivate exdongle"<br />
echo ""<br />
echo " run:"<br />
echo " DIR <S>: Directory to find script in"<br />
echo ""<br />
<br />
exit 0<br />
<br />
}<br />
<br />
###############################################################################<br />
<br />
function new() {<br />
<br />
if [ ! "$#" -eq 3 ]; then<br />
usage $@;<br />
exit 1;<br />
fi<br />
<br />
DIR="$2"<br />
PROG="$3"<br />
PLOC="$DIR/.$(hostname).$key"<br />
<br />
rm "$PLOC" &> /dev/null<br />
cp "$PROG" "$PLOC"<br />
<br />
exit 0<br />
<br />
}<br />
<br />
###############################################################################<br />
<br />
function del() {<br />
<br />
DIR="$2"<br />
PLOC="$DIR/.$(hostname).$key"<br />
<br />
if [ -e "$PLOC" ]; then<br />
rm -f "$PLOC"<br />
fi<br />
<br />
exit 0<br />
<br />
}<br />
<br />
###############################################################################<br />
<br />
function conf() {<br />
<br />
shift<br />
while getopts "k:p:s:" optname; do<br />
case "$optname" in<br />
k)<br />
key="$OPTARG"<br />
;;<br />
p)<br />
priority="$OPTARG"<br />
;;<br />
s)<br />
if [ "$OPTARG" = "on" ] || [ "$OPTARG" = "off" ]; then<br />
switch="$OPTARG"<br />
fi<br />
;;<br />
esac<br />
done<br />
<br />
echo "# exdongle configuration file" > "$CONFFILE"<br />
echo "key=\"$key\"" >> "$CONFFILE"<br />
echo "priority=\"$priority\"" >> "$CONFFILE"<br />
echo "switch=\"$switch\"" >> "$CONFFILE"<br />
<br />
chmod 0600 "$CONFFILE"<br />
<br />
exit 0<br />
<br />
}<br />
<br />
###############################################################################<br />
<br />
function run() {<br />
<br />
if [ ! "$switch" = "on" ]; then<br />
exit 0<br />
fi<br />
<br />
if [ ! "$#" -eq 2 ]; then<br />
usage $@<br />
exit 1<br />
fi<br />
<br />
DIR="$2"<br />
PLOC="$DIR/.$(hostname).$key"<br />
ELOC="/tmp/.exdongle.prog"<br />
<br />
if [ ! -e "$PLOC" ]; then<br />
echo "No executable file found!" 1>&2<br />
exit 0<br />
fi<br />
<br />
rm -f "$ELOC"<br />
cp "$PLOC" "$ELOC"<br />
chmod 0500 "$ELOC"<br />
nice -n "$priority" $ELOC<br />
rm -f "$ELOC"<br />
exit 0<br />
<br />
}<br />
<br />
###############################################################################<br />
<br />
if [ ! "$UID" == "0" ]; then<br />
echo "You must be root to perform this operation" 1>&2<br />
exit 1<br />
fi<br />
<br />
if [ -e "$CONFFILE" ]; then<br />
. "$CONFFILE"<br />
fi<br />
<br />
case "$1" in<br />
new)<br />
new "$@"<br />
;;<br />
del)<br />
del "$@"<br />
;;<br />
conf)<br />
conf "$@" <br />
;;<br />
run)<br />
run "$@"<br />
;;<br />
*)<br />
usage "$@"<br />
;;<br />
esac<br />
<br />
exit 0<br />
<br />
</nowiki>}}<br />
<br />
== Disable Trackpad on Mouse Connection ==<br />
Adapted from [http://www.howtoforge.com/how-to-auto-disable-the-touchpad-when-the-mouse-is-plugged-in-fedora-13 Howto Forge].<br />
<br />
<br />
<br />
== Notes ==<br />
<br />
Some notes:<br />
* The programs/scripts used should be self contained, the only file treated is the one passed.</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Talk:Start_X_at_login&diff=130108Talk:Start X at login2011-02-06T15:17:42Z<p>VitaminJ: Question about</p>
<hr />
<div>The section on using {{Filename|/etc/inittab}}, the note about not getting the right privileges and session recording. If the .xinitrc for PREFERRED_USER has a line like {{file|name=.xinitrc|content=exec ck-launch-session dbus-launch xfce4session}}<br />
then everything RE reboot should be okay? --[[User:VitaminJ|VitaminJ]] 10:17, 6 February 2011 (EST)</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Talk:Laptop_Mode_Tools&diff=130064Talk:Laptop Mode Tools2011-02-06T00:32:45Z<p>VitaminJ: </p>
<hr />
<div>LTM is one of my favorite packages and I hope we can clean up this empty entry and make it a lot more up to date. <br />
<br />
I think it's a good idea to present most of the options in a explicative way, even though the different configuration files are so well commented.<br />
<br />
:Agreed. I also mean to do a troubleshooting section. A lot of the modules can be problematic, such as auto-hibernate w/o battery-polling and terminal/lcd blank on its own. [[User:Dres|Dres]] 17:29, 28 January 2010 (EST)<br />
<br />
I'd like to see some more explanation of how all of these power management/laptop subsystems relate to each other. Do I need acpid now that udev and dbus exist? Will laptop mode tools talk to pm-suspend to initiate suspend on lid close? Or can this be signalled by dbus, or acpid? --[[User:VitaminJ|VitaminJ]] 19:32, 5 February 2011 (EST)</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Laptop_Mode_Tools&diff=130063Laptop Mode Tools2011-02-06T00:30:45Z<p>VitaminJ: Add subsections to outline the relationship between laptop-mode tools and other power management tools</p>
<hr />
<div>[[Category:Laptops (English)]]<br />
[[Category:Power management (English)]]<br />
{{Expansion}}<br />
{{Article summary start}}<br />
{{Article summary text|Overview of the Laptop Mode Tools power management suite for notebooks.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|acpid}}<br />
{{Article summary wiki|cpufrequtils}}<br />
{{Article summary wiki|pm-utils}}<br />
{{Article summary heading|Resources}}<br />
{{Article summary link|Laptop Mode Tools|http://samwel.tk/laptop_mode/}}<br />
{{Article summary link|Mailing List Archives|http://mailman.samwel.tk/pipermail/laptop-mode/ }}<br />
{{Article summary link|Less Watts - Official Site|http://www.lesswatts.org/index.php}}<br />
{{Article summary link|Laptop - ArchWiki|http://wiki.archlinux.org/index.php/Laptop|lll}}<br />
<br />
<br />
{{Article summary end}}<br />
<br />
==Preface==<br />
The Linux kernel, starting from version 2.6.6, contains a feature called ''laptop mode''. This feature is also present in the Linux 2.4 series starting from version 2.4.23. When enabled, the kernel allows the hard drive to spin down more often, resulting in significant power savings. Laptop Mode Tools (LTM) evolved from a simple program that controlled the hard drives to a centralized power saving solution providing a wide selection of options and can perform a number of varying power saving functions across separate subsystems simultaneously. Combined with [[acpid]], [[cpufrequtils]] and [[pm-utils]], LTM provides most users with a complete notebook power management suite.<br />
=== Relationship to ACPID ===<br />
=== Relationship to cpufrequtils ===<br />
=== Relationship to pm-utils ===<br />
<br />
==Installation==<br />
{{Package Official|laptop-mode-tools}} is part of the official [[Official Repositories|Arch Linux [extra] repository]].<br />
# pacman -S laptop-mode-tools<br />
<br />
==Configuration==<br />
Add {{Codeline|laptop-mode}} to the {{Codeline|DAEMONS}} array in {{Filename|/etc/rc.conf}}:<br />
DAEMONS=(...laptop-mode...)<br />
<br />
Configuration is handled through the primary configuration file {{Filename|/etc/laptop-mode/laptop-mode.conf}} and through the configuration of dozens of feature-specific files in {{Filename|/etc/laptop-mode/conf.d/*}}. Recent versions of LTM are able to automatically enable commonly used {{Filename|conf.d/*}} settings by way of the {{Codeline|ENABLE_AUTO_MODULES}} variable in {{Filename|/etc/laptop-mode/laptop-mode.conf}}.<br />
<br />
===Disks===<br />
====Hard disks====<br />
Spinning down the hard drive through {{codeline|hdparm -S}} valuessaves power and makes everything a lot more quiet. By using the readahead function you can allow the drives to spin down more often even though you are using the computer. LTM can also establish {{codeline|hdparm -B}} values. 1 is maximum hard drive power saving and 254 is minimum. Set this value to 254 when on AC and 1 when on battery. If you move around a lot when on battery it might be a good idea to set it higher (eg. 128)<sup>[clarifiy]</sup>. {{codeline|hdparm -S}} and {{codeline|hdparm -B}} values are configured in {{Filename|/etc/laptop-mode/laptop-mode.conf}}.<br />
<br />
====HAL polling====<br />
<br />
# hal-polling.conf<br />
# ThinkPad T40/T42/T60 Example<br />
#<br />
DEBUG=0<br />
CONTROL_HAL_POLLING=1<br />
BATT_DISABLE_HAL_POLLING=1<br />
AC_DISABLE_HAL_POLLING=1<br />
HAL_POLLING_DEVICES="/dev/scd?"<br />
<br />
===Processor===<br />
====CPU frequency====<br />
<br />
# cpufreq.conf<br />
# ThinkPad T40/T42/T60 Example<br />
#<br />
CONTROL_CPU_FREQUENCY=1<br />
BATT_CPU_MAXFREQ=fastest<br />
BATT_CPU_MINFREQ=slowest<br />
BATT_CPU_GOVERNOR=ondemand<br />
BATT_CPU_IGNORE_NICE_LOAD=1<br />
LM_AC_CPU_MAXFREQ=fastest<br />
LM_AC_CPU_MINFREQ=slowest<br />
LM_AC_CPU_GOVERNOR=ondemand<br />
LM_AC_CPU_IGNORE_NICE_LOAD=1<br />
NOLM_AC_CPU_MAXFREQ=fastest<br />
NOLM_AC_CPU_MINFREQ=slowest<br />
NOLM_AC_CPU_GOVERNOR=ondemand<br />
NOLM_AC_CPU_IGNORE_NICE_LOAD=0<br />
CONTROL_CPU_THROTTLING=0<br />
<br />
* See [[CPU Frequency Scaling]] for details on how to setup the needed kernel modules.<br />
<br />
===Device and bus===<br />
====Intel SATA====<br />
* Enable the Intel SATA AHCI controller Aggressive Link Power Management feature to set the disk link into a very low power mode in the absence of disk IO.<br />
# intel-sata-powermgmt.conf<br />
# ThinkPad T40/T42/T60 Example<br />
#<br />
DEBUG=0<br />
CONTROL_INTEL_SATA_POWER=1<br />
BATT_ACTIVATE_SATA_POWER=1<br />
LM_AC_ACTIVATE_SATA_POWER=1<br />
NOLM_AC_ACTIVATE_SATA_POWER=0<br />
<br />
{{Note|Review the well-documented {{Filename|/etc/laptop-mode/conf.d/intel-sata-powermgmt.conf}} file for additional configuration details.}}<br />
<br />
====USB autosuspend====<br />
# usb-autosuspend.conf<br />
# ThinkPad T40/T42/T60 Example<br />
#<br />
DEBUG=0<br />
CONTROL_USB_AUTOSUSPEND=1<br />
BATT_SUSPEND_USB=1<br />
LM_AC_SUSPEND_USB=1<br />
NOLM_AC_SUSPEND_USB=0<br />
AUTOSUSPEND_TIMEOUT=2<br />
<br />
{{Note|Review the well-documented {{Filename|/etc/laptop-mode/conf.d/usb-autosuspend.conf}} file for additional configuration details.}}<br />
<br />
===Display and graphics===<br />
====LCD brightness====<br />
* Available brightness values for certain laptops can can be obtained by running following two commands:<br />
$ cat /proc/acpi/video/VID/LCD/brightness<br />
<br />
For [http://en.wikipedia.org/wiki/ThinkPad ThinkPad] notebooks, minimum brightness values can be obtained by running one of the following two commands:<br />
$ cat /sys/class/backlight/acpi_video0/brightness<br />
<br />
$ cat /sys/class/backlight/thinkpad_screen/brightness<br />
<br />
* For [http://en.wikipedia.org/wiki/ThinkPad ThinkPad] notebooks, maximum brightness values can be obtained by running one of the following two commands:<br />
$ cat /sys/class/backlight/acpi_video0/max_brightness<br />
<br />
$ cat /sys/class/backlight/thinkpad_screen/max_brightness<br />
<br />
# lcd-brightness.conf<br />
# ThinkPad T40/T42 Example<br />
#<br />
DEBUG=0<br />
CONTROL_BRIGHTNESS=1<br />
BATT_BRIGHTNESS_COMMAND="echo 0"<br />
LM_AC_BRIGHTNESS_COMMAND="echo 7"<br />
NOLM_AC_BRIGHTNESS_COMMAND="echo 7"<br />
BRIGHTNESS_OUTPUT="/sys/class/backlight/thinkpad_screen/brightness"<br />
<br />
# lcd-brightness.conf<br />
# ThinkPad T60 Example<br />
#<br />
DEBUG=0<br />
CONTROL_BRIGHTNESS=1<br />
BATT_BRIGHTNESS_COMMAND="echo 0"<br />
LM_AC_BRIGHTNESS_COMMAND="echo 7"<br />
NOLM_AC_BRIGHTNESS_COMMAND="echo 7"<br />
BRIGHTNESS_OUTPUT="/sys/class/backlight/acpi_video0/brightness"<br />
<br />
{{Note|Review the well-documented {{Filename|/etc/laptop-mode/conf.d/lcd-brightness.conf}} file for additional configuration details.}}<br />
<br />
====Terminal blanking====<br />
<br />
# terminal-blanking.conf<br />
# ThinkPad T40/T42/T60 Example<br />
#<br />
DEBUG=0<br />
CONTROL_TERMINAL=1<br />
TERMINALS="/dev/tty1"<br />
BATT_TERMINAL_BLANK_MINUTES=1<br />
BATT_TERMINAL_POWERDOWN_MINUTES=2<br />
LM_AC_TERMINAL_BLANK_MINUTES=10<br />
LM_AC_TERMINAL_POWERDOWN_MINUTES=10<br />
NOLM_AC_TERMINAL_BLANK_MINUTES=10<br />
NOLM_AC_TERMINAL_POWERDOWN_MINUTES=10<br />
<br />
{{Note|Review the well-documented {{Filename|/etc/laptop-mode/conf.d/terminal-blanking.conf}} file for additional configuration details.}}<br />
<br />
===Networking===<br />
====Ethernet====<br />
# ethernet.conf<br />
# ThinkPad T40/T42/T60 Example<br />
#<br />
DEBUG=0<br />
CONTROL_ETHERNET=1<br />
LM_AC_THROTTLE_ETHERNET=0<br />
NOLM_AC_THROTTLE_ETHERNET=0<br />
DISABLE_WAKEUP_ON_LAN=1<br />
DISABLE_ETHERNET_ON_BATTERY=1<br />
ETHERNET_DEVICES="eth0"<br />
<br />
====Wireless LAN====<br />
Wireless interface power management settings are hardware-dependent, and thus a bit trickier to configure. Depending on the wireless chipset, the settings are managed in one of the following three files:<br />
#{{Filename|/etc/laptop-mode/conf.d/wireless-power.conf}} for a generic method of saving power (using "iwconfig wlan0 power on/off"). This applies to most chipsets (that is, anything but Intel chipsets listed below).<br />
#{{Filename|/etc/laptop-mode/conf.d/wireless-ipw-power.conf}} for Intel chipsets driven by the old ipw driver. This apply to IPW3945, IPW2200 and IPW2100. It currently (as of LMT 1.55-1) uses iwpriv for IPW3945, and a combination of iwconfig and iwpriv settings for IPW2100 and IPW220. See {{Filename|/usr/share/laptop-mode-tools/modules/wireless-ipw-power}} for details. (note that the ipw3945 isn't used anymore, see below)<br />
#{{Filename|/etc/laptop-mode/conf.d/wireless-iwl-power.conf}} for Intel chipsets driven by modules iwl4965, iwl3945 and iwlagn (this latter supports chipsets 4965, 5100, 5300, 5350, 5150, 1000, and 6000)<br />
Note that activating the three of them shouldn't be much of a problem, since LTM detects the module used by the interface and acts accordingly.<br />
<br />
The supported modules for each config file, indicated above, are taken directly from LTM. However, this seems to be a bit out-of-date, since the current 2.6.34 kernel doesn't provide the ipw3945 and iwl4965 modules anymore (3945 chipset uses iwl3945 instead, and 4965 uses the generic module iwlagn). This is only brought here for information, as this doesn't (or shouldn't) affect the way LTM works.<br />
<br />
There is a known issue with some chipsets running with the iwlagn module (namely, the 5300 chipset, and maybe others). On those chipsets, the following settings of {{Filename|/etc/laptop-mode/conf.d/wireless-iwl-power.conf}} :<br />
IWL_AC_POWER<br />
IWL_BATT_POWER<br />
are ignored, because the {{Filename|/sys/class/net/wlan*/device/power_level}} file doesn't exist. Instead, the standard method (with "iwconfig wlan0 power on/off") is automatically used.<br />
<br />
===Audio===<br />
====AC97====<br />
<br />
# ac97-powersave.conf<br />
# ThinkPad T40/T42/T60 Example<br />
#<br />
DEBUG=0<br />
CONTROL_AC97_POWER=1<br />
<br />
====Intel HDA====<br />
<br />
# intel-hda-powersave.conf<br />
# ThinkPad T40/T42/T60 Example<br />
#<br />
DEBUG=0<br />
CONTROL_INTEL_HDA_POWER=1<br />
BATT_INTEL_HDA_POWERSAVE=1<br />
LM_AC_INTEL_HDA_POWERSAVE=1<br />
NOLM_AC_INTEL_HDA_POWERSAVE=0<br />
INTEL_HDA_DEVICE_TIMEOUT=10<br />
INTEL_HDA_DEVICE_CONTROLLER=0<br />
<br />
==Tips and tricks==<br />
===Aliases===<br />
===lm-profiler===<br />
===Disabling===<br />
<br />
==Troubleshooting==</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Thunar&diff=130061Thunar2011-02-05T23:46:22Z<p>VitaminJ: Put date on Thunar udev note, link to udev automounting section</p>
<hr />
<div>[[Category: Utilities (English)]]<br />
[[Category: File managers (English)]]<br />
{{i18n|Thunar}}<br />
<br />
Thunar is a new file manager that is designed to be fast, lightweight, and easy-to-use. It is a part of Xfce4, but can be used with various standalone window managers.<br />
<br />
==Installation==<br />
To install, simply run:<br />
{{cli|# pacman -S thunar}}<br />
<br />
If you are running Xfce4, you will probably already have Thunar.<br />
<br />
==Plugins and Addons==<br />
Many of these plugins are part of the xfce4-goodies group, so if you have downloaded it, you will probably have all of these anyway.<br />
<br />
===Thunar Volume Manager===<br />
While Thunar can support automatic mounting and unmounting of removable media, the Thunar Volume Manager allows extended functionality, such as auto-running commands or automatically opening a Thunar window for mounted media.<br />
<br />
====Requirements====<br />
Please note that, to work correctly, the Thunar Volume Manager requires Dbus and HAL to be running.<br />
'''Note:''' Thunar-volman's automount doesn't work currently because of the hal to udev switch, Sept 2010. See section on [[Thunar#udev Automounting|udev Automounting]].<br />
<br />
====Installation====<br />
It can be installed by running:<br />
{{cli|# pacman -S thunar-volman}}<br />
<br />
====Configuration====<br />
It can also be configured to execute certain actions when cameras and audio players are connected. <br />
After installing the plugin:<br />
# Launch Thunar and go to Preferences<br />
# Under the 'Advanced' tab, check 'Enable Volume Management'<br />
# Click configure and make desired changes (see below for an example)<br />
Here's an example setting for making Amarok play an audio CD.<br />
Multimedia - Audio CDs: <code>amarok --cdplay %d</code><br />
<br />
====Tips and Tricks====<br />
=====Starting in Daemon Mode=====<br />
Thunar may be run in daemon mode. This has several advantages including a faster startup for Thunar as well as Thunar running in the background and only opening a window when necessary (for instance, when a flash drive is inserted).<br />
<br />
One option is to autostart it using {{Filename|.xinitrc}} or an autostart script (such as [[Openbox]]'s {{Filename|autostart.sh}}). It is up to you to decide the best way to start it, and this option can be run from a script or run directly as a command in the terminal.<br />
<br />
To run it in daemon mode, simply add to your autostart script or run from the terminal:<br />
{{cli|$ thunar --daemon &}}<br />
<br />
=====Eliminating Conflicts=====<br />
If you have hal and autofs running at the same time, you will have a lock in hal-mtab. To avoid this, use only one of them.<br />
<br />
If you cannot get automount running and start your window manager via {{Filename|.xinitrc}} you maybe want to change the start line for your window manger from<br />
<br />
{{cli|$ exec /usr/bin/dwm}}<br />
<br />
to<br />
{{cli|$ exec ck-launch-session /usr/bin/dwm}}<br />
<br />
=====Setting the Icon Theme=====<br />
When using Thunar outside of Gnome or Xfce, certain packages and configurations that control which icons are used may be missing. Window Managers like Awesopme and Xmonad do not come with XSettings managers, which is where Thunar looks first for it's icon setting. It is possible install and run xfce-mcs-manager from a startup script if many Xfce4 and Gnome applications are going to be used. The gtk-icon-theme-name setting for gtk2 can be set for a user by adding something like the following to {{Filename|~/.gtkrc-2.0}}:<br />
gtk-icon-theme-name = "Tango"<br />
<br />
Of course, just installing the gnome-icon-them package will give Thunar an icon theme to use other than the default paper icon for all items.<br />
{{cli|# pacman -S gnome-icon-theme}}<br />
<br />
===Thunar Archive Plugin===<br />
The Thunar Archive Plugin is a frontend to file archive software such as File Roller, Ark, or Xarchiver to allow a simple, consistent interface to opening and decompressing archives.<br />
<br />
====Installation====<br />
It can be installed by running:<br />
{{cli|# pacman -S thunar-archive-plugin}}<br />
<br />
===Thunar Media Tags Plugin===<br />
The media tags plugin will display detailed information about media files. It supports ID3 (the MP3 file format's system) and Ogg/Vorbis tags. It also has a bulk renamer and allows editing of media tags.<br />
====Installation====<br />
It can be installed by running:<br />
{{cli|# pacman -S thunar-media-tags-plugin}}<br />
<br />
===Thunar Thumbnailers===<br />
The aim of the Thunar Thumbnailers project is to provide thumbnail generation for media formats that are neglected by other thumbnailers. If you want thumbnails and deal with media formats that are not compatible with other thumbnailers, use this. For a full list of supported formats, see the [http://goodies.xfce.org/projects/thunar-plugins/thunar-thumbnailers/ project page].<br />
====Installation====<br />
It can be installed by running:<br />
{{cli|# pacman -S thunar-thumbnailers}}<br />
<br />
===Thunar Shares===<br />
The Thunar Shares Plugin allows you to quickly share a folder using Samba from Thunar without requiring root access.<br />
<br />
====Installation====<br />
<br />
Install [http://aur.archlinux.org/packages.php?ID=24152 thunar-shares-plugin] package from the [[AUR]].<br />
<br />
====Configuration====<br />
<br />
as root user:<br />
<br />
This marks the named objects for automatic export to the environment of subsequently executed commands:<br />
{{cli|<nowiki># export USERSHARES_DIR="/var/lib/samba/usershares"<br />
# export USERSHARES_GROUP="sambashare"</nowiki>}}<br />
<br />
This creates the usershares directory in var/lib/samba:<br />
{{cli|<nowiki># mkdir -p ${USERSHARES_DIR}</nowiki>}}<br />
This makes the group sambashare:<br />
{{cli|<nowiki># groupadd ${USERSHARES_GROUP}</nowiki>}}<br />
This changes the owner of the directory and group you just created to root:<br />
{{cli|<nowiki># chown root:${USERSHARES_GROUP} ${USERSHARES_DIR}</nowiki>}}<br />
This changes the permissions of the usershares directory so that users in the group sambashare can read, write and execute files:<br />
{{cli|<nowiki># chmod 01770 ${USERSHARES_DIR}</nowiki>}}<br />
<br />
Using your favorite text editor as root, create the file {{Filename|/etc/samba/smb.conf}}<br />
<br />
{{cli|# joe /etc/samba/smb.conf}}<br />
<br />
Use this {{Filename|smb.conf}} configuration file: <br />
{{File|name=/etc/samba/smb.conf|content=<nowiki><br />
##This is the main Samba configuration file. You should read the<br />
##smb.conf(5) manual page in order to understand the options listed<br />
##here. Samba has a huge number of configurable options (perhaps too<br />
##many!) most of which are not shown in this example<br />
##<br />
##For a step to step guide on installing, configuring and using samba, <br />
## read the Samba-HOWTO-Collection. This may be obtained from:<br />
## http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf<br />
##<br />
## Many working examples of smb.conf files can be found in the <br />
## Samba-Guide which is generated daily and can be downloaded from: <br />
## http://www.samba.org/samba/docs/Samba-Guide.pdf<br />
##<br />
## Any line which starts with a ; (semi-colon) or a # (hash) <br />
## is a comment and is ignored. In this example we will use a #<br />
## for commentry and a ; for parts of the config file that you<br />
## may wish to enable<br />
##<br />
## NOTE: Whenever you modify this file you should run the command "testparm"<br />
## to check that you have not made any basic syntactic errors. <br />
##<br />
#[global]<br />
# workgroup = WORKGROUP<br />
# security = share<br />
# server string = My Share<br />
# load printers = yes<br />
# log file = /var/log/samba/%m.log<br />
# max log size = 50<br />
# usershare path = /var/lib/samba/usershares<br />
# usershare max shares = 100<br />
# usershare allow guests = yes<br />
# usershare owner only = yes<br />
# <br />
#<br />
# #Windows Internet Name Serving Support Section:<br />
#<br />
# #WINS Support - Tells the NMBD component of Samba to enable it's WINS Server<br />
#; wins support = yes<br />
#<br />
## WINS Server - Tells the NMBD components of Samba to be a WINS Client<br />
## Note: Samba can be either a WINS Server, or a WINS Client, but NOT both<br />
#; wins server = w.x.y.z<br />
#<br />
##WINS Proxy - Tells Samba to answer name resolution queries on<br />
## behalf of a non WINS capable client, for this to work there must be<br />
## at least one WINS Server on the network. The default is NO.<br />
#; wins proxy = yes</nowiki>}}<br />
<br />
Save the file and then add your user to the group sambashares replacing "your_username" with the name of your user:<br />
<br />
{{cli|# usermod -a -G <USERSHARES_GROUP> your_username}}<br />
<br />
Restart Samba:<br />
<br />
{{cli|# /etc/rc.d/samba restart}}<br />
<br />
Log out and log back in. You should now be able to right click on any directory and share it on the network.<br />
<br />
To have samba start at boot, add samba to daemons in your {{Filename|/etc/rc.conf}} file.<br />
<br />
For more infomration, visit the [[Samba]] wiki page.<br />
<br />
== udev Automounting ==<br />
Thunar and XFCE4 are in transition to using the kernel [[udev]] architecture for detecting and automounting removable media. '''18:42, 5 February 2011 (EST)'''<br />
<br />
Install Thunar as usual, but be sure to include the user in the 'storage' group of {{Filename|/etc/group}}.<br />
<br />
{{cli|# usermod -a -G storage <user>}}<br />
<br />
In the user's {{Filename|.xinitrc}}, include ck-launch-seassion and dbus-launch before the startxfce4 command.<br />
<br />
{{File|name=~/.xinitrc|content=<nowiki>setxkbmap -option terminate:ctrl_alt_bksp <br />
exec ck-launch-session dbus-launch startxfce4</nowiki>}}<br />
<br />
==Links and References==<br />
* [http://thunar.xfce.org/index.html Thunar] project page.<br />
* [http://goodies.xfce.org/projects/thunar-plugins/thunar-volman Thunar Volume Manager] project page.<br />
* [http://goodies.xfce.org/projects/thunar-plugins/thunar-archive-plugin Thunar Archive Plugin] project page.<br />
* [http://goodies.xfce.org/projects/thunar-plugins/thunar-media-tags-plugin Thunar Media Tags Plugin] project page.<br />
* [http://goodies.xfce.org/projects/thunar-plugins/thunar-thumbnailers/ Thunar Thumbnailers] project page.<br />
*[http://goodies.xfce.org/projects/thunar-plugins/thunar-shares-plugin/ Thunar Shares Plugin] project page.<br />
* This [http://goodies.xfce.org/projects/thunar-plugins/start list] of plugins.</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Thunar&diff=130060Thunar2011-02-05T23:44:12Z<p>VitaminJ: Add templates to all filenames, cli's. Also add section on new automounting with Udev</p>
<hr />
<div>[[Category: Utilities (English)]]<br />
[[Category: File managers (English)]]<br />
{{i18n|Thunar}}<br />
<br />
Thunar is a new file manager that is designed to be fast, lightweight, and easy-to-use. It is a part of Xfce4, but can be used with various standalone window managers.<br />
<br />
==Installation==<br />
To install, simply run:<br />
{{cli|# pacman -S thunar}}<br />
<br />
If you are running Xfce4, you will probably already have Thunar.<br />
<br />
==Plugins and Addons==<br />
Many of these plugins are part of the xfce4-goodies group, so if you have downloaded it, you will probably have all of these anyway.<br />
<br />
===Thunar Volume Manager===<br />
While Thunar can support automatic mounting and unmounting of removable media, the Thunar Volume Manager allows extended functionality, such as auto-running commands or automatically opening a Thunar window for mounted media.<br />
<br />
====Requirements====<br />
Please note that, to work correctly, the Thunar Volume Manager requires Dbus and HAL to be running.<br />
[Note: Thunar-volman's automount doesn't work currently because of the hal to udev switch.]<br />
<br />
====Installation====<br />
It can be installed by running:<br />
{{cli|# pacman -S thunar-volman}}<br />
<br />
====Configuration====<br />
It can also be configured to execute certain actions when cameras and audio players are connected. <br />
After installing the plugin:<br />
# Launch Thunar and go to Preferences<br />
# Under the 'Advanced' tab, check 'Enable Volume Management'<br />
# Click configure and make desired changes (see below for an example)<br />
Here's an example setting for making Amarok play an audio CD.<br />
Multimedia - Audio CDs: <code>amarok --cdplay %d</code><br />
<br />
====Tips and Tricks====<br />
=====Starting in Daemon Mode=====<br />
Thunar may be run in daemon mode. This has several advantages including a faster startup for Thunar as well as Thunar running in the background and only opening a window when necessary (for instance, when a flash drive is inserted).<br />
<br />
One option is to autostart it using {{Filename|.xinitrc}} or an autostart script (such as [[Openbox]]'s {{Filename|autostart.sh}}). It is up to you to decide the best way to start it, and this option can be run from a script or run directly as a command in the terminal.<br />
<br />
To run it in daemon mode, simply add to your autostart script or run from the terminal:<br />
{{cli|$ thunar --daemon &}}<br />
<br />
=====Eliminating Conflicts=====<br />
If you have hal and autofs running at the same time, you will have a lock in hal-mtab. To avoid this, use only one of them.<br />
<br />
If you cannot get automount running and start your window manager via {{Filename|.xinitrc}} you maybe want to change the start line for your window manger from<br />
<br />
{{cli|$ exec /usr/bin/dwm}}<br />
<br />
to<br />
{{cli|$ exec ck-launch-session /usr/bin/dwm}}<br />
<br />
=====Setting the Icon Theme=====<br />
When using Thunar outside of Gnome or Xfce, certain packages and configurations that control which icons are used may be missing. Window Managers like Awesopme and Xmonad do not come with XSettings managers, which is where Thunar looks first for it's icon setting. It is possible install and run xfce-mcs-manager from a startup script if many Xfce4 and Gnome applications are going to be used. The gtk-icon-theme-name setting for gtk2 can be set for a user by adding something like the following to {{Filename|~/.gtkrc-2.0}}:<br />
gtk-icon-theme-name = "Tango"<br />
<br />
Of course, just installing the gnome-icon-them package will give Thunar an icon theme to use other than the default paper icon for all items.<br />
{{cli|# pacman -S gnome-icon-theme}}<br />
<br />
===Thunar Archive Plugin===<br />
The Thunar Archive Plugin is a frontend to file archive software such as File Roller, Ark, or Xarchiver to allow a simple, consistent interface to opening and decompressing archives.<br />
<br />
====Installation====<br />
It can be installed by running:<br />
{{cli|# pacman -S thunar-archive-plugin}}<br />
<br />
===Thunar Media Tags Plugin===<br />
The media tags plugin will display detailed information about media files. It supports ID3 (the MP3 file format's system) and Ogg/Vorbis tags. It also has a bulk renamer and allows editing of media tags.<br />
====Installation====<br />
It can be installed by running:<br />
{{cli|# pacman -S thunar-media-tags-plugin}}<br />
<br />
===Thunar Thumbnailers===<br />
The aim of the Thunar Thumbnailers project is to provide thumbnail generation for media formats that are neglected by other thumbnailers. If you want thumbnails and deal with media formats that are not compatible with other thumbnailers, use this. For a full list of supported formats, see the [http://goodies.xfce.org/projects/thunar-plugins/thunar-thumbnailers/ project page].<br />
====Installation====<br />
It can be installed by running:<br />
{{cli|# pacman -S thunar-thumbnailers}}<br />
<br />
===Thunar Shares===<br />
The Thunar Shares Plugin allows you to quickly share a folder using Samba from Thunar without requiring root access.<br />
<br />
====Installation====<br />
<br />
Install [http://aur.archlinux.org/packages.php?ID=24152 thunar-shares-plugin] package from the [[AUR]].<br />
<br />
====Configuration====<br />
<br />
as root user:<br />
<br />
This marks the named objects for automatic export to the environment of subsequently executed commands:<br />
{{cli|<nowiki># export USERSHARES_DIR="/var/lib/samba/usershares"<br />
# export USERSHARES_GROUP="sambashare"</nowiki>}}<br />
<br />
This creates the usershares directory in var/lib/samba:<br />
{{cli|<nowiki># mkdir -p ${USERSHARES_DIR}</nowiki>}}<br />
This makes the group sambashare:<br />
{{cli|<nowiki># groupadd ${USERSHARES_GROUP}</nowiki>}}<br />
This changes the owner of the directory and group you just created to root:<br />
{{cli|<nowiki># chown root:${USERSHARES_GROUP} ${USERSHARES_DIR}</nowiki>}}<br />
This changes the permissions of the usershares directory so that users in the group sambashare can read, write and execute files:<br />
{{cli|<nowiki># chmod 01770 ${USERSHARES_DIR}</nowiki>}}<br />
<br />
Using your favorite text editor as root, create the file {{Filename|/etc/samba/smb.conf}}<br />
<br />
{{cli|# joe /etc/samba/smb.conf}}<br />
<br />
Use this {{Filename|smb.conf}} configuration file: <br />
{{File|name=/etc/samba/smb.conf|content=<nowiki><br />
##This is the main Samba configuration file. You should read the<br />
##smb.conf(5) manual page in order to understand the options listed<br />
##here. Samba has a huge number of configurable options (perhaps too<br />
##many!) most of which are not shown in this example<br />
##<br />
##For a step to step guide on installing, configuring and using samba, <br />
## read the Samba-HOWTO-Collection. This may be obtained from:<br />
## http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf<br />
##<br />
## Many working examples of smb.conf files can be found in the <br />
## Samba-Guide which is generated daily and can be downloaded from: <br />
## http://www.samba.org/samba/docs/Samba-Guide.pdf<br />
##<br />
## Any line which starts with a ; (semi-colon) or a # (hash) <br />
## is a comment and is ignored. In this example we will use a #<br />
## for commentry and a ; for parts of the config file that you<br />
## may wish to enable<br />
##<br />
## NOTE: Whenever you modify this file you should run the command "testparm"<br />
## to check that you have not made any basic syntactic errors. <br />
##<br />
#[global]<br />
# workgroup = WORKGROUP<br />
# security = share<br />
# server string = My Share<br />
# load printers = yes<br />
# log file = /var/log/samba/%m.log<br />
# max log size = 50<br />
# usershare path = /var/lib/samba/usershares<br />
# usershare max shares = 100<br />
# usershare allow guests = yes<br />
# usershare owner only = yes<br />
# <br />
#<br />
# #Windows Internet Name Serving Support Section:<br />
#<br />
# #WINS Support - Tells the NMBD component of Samba to enable it's WINS Server<br />
#; wins support = yes<br />
#<br />
## WINS Server - Tells the NMBD components of Samba to be a WINS Client<br />
## Note: Samba can be either a WINS Server, or a WINS Client, but NOT both<br />
#; wins server = w.x.y.z<br />
#<br />
##WINS Proxy - Tells Samba to answer name resolution queries on<br />
## behalf of a non WINS capable client, for this to work there must be<br />
## at least one WINS Server on the network. The default is NO.<br />
#; wins proxy = yes</nowiki>}}<br />
<br />
Save the file and then add your user to the group sambashares replacing "your_username" with the name of your user:<br />
<br />
{{cli|# usermod -a -G <USERSHARES_GROUP> your_username}}<br />
<br />
Restart Samba:<br />
<br />
{{cli|# /etc/rc.d/samba restart}}<br />
<br />
Log out and log back in. You should now be able to right click on any directory and share it on the network.<br />
<br />
To have samba start at boot, add samba to daemons in your {{Filename|/etc/rc.conf}} file.<br />
<br />
For more infomration, visit the [[Samba]] wiki page.<br />
<br />
== udev Automounting ==<br />
Thunar and XFCE4 are in transition to using the kernel [[udev]] architecture for detecting and automounting removable media. '''18:42, 5 February 2011 (EST)'''<br />
<br />
Install Thunar as usual, but be sure to include the user in the 'storage' group of {{Filename|/etc/group}}.<br />
<br />
{{cli|# usermod -a -G storage <user>}}<br />
<br />
In the user's {{Filename|.xinitrc}}, include ck-launch-seassion and dbus-launch before the startxfce4 command.<br />
<br />
{{File|name=~/.xinitrc|content=<nowiki>setxkbmap -option terminate:ctrl_alt_bksp <br />
exec ck-launch-session dbus-launch startxfce4</nowiki>}}<br />
<br />
==Links and References==<br />
* [http://thunar.xfce.org/index.html Thunar] project page.<br />
* [http://goodies.xfce.org/projects/thunar-plugins/thunar-volman Thunar Volume Manager] project page.<br />
* [http://goodies.xfce.org/projects/thunar-plugins/thunar-archive-plugin Thunar Archive Plugin] project page.<br />
* [http://goodies.xfce.org/projects/thunar-plugins/thunar-media-tags-plugin Thunar Media Tags Plugin] project page.<br />
* [http://goodies.xfce.org/projects/thunar-plugins/thunar-thumbnailers/ Thunar Thumbnailers] project page.<br />
*[http://goodies.xfce.org/projects/thunar-plugins/thunar-shares-plugin/ Thunar Shares Plugin] project page.<br />
* This [http://goodies.xfce.org/projects/thunar-plugins/start list] of plugins.</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Xfce&diff=130058Xfce2011-02-05T23:10:31Z<p>VitaminJ: Categorize into sections</p>
<hr />
<div>[[Category:Desktop environments (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|Xfce}}<br />
[[pl:XFCE]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Xfce is a lightweight desktop environment for Unix-like operating systems. It aims to be fast and lightweight, while still being visually appealing and user friendly. This article covers its installation, configuration, and troubleshooting.}}<br />
{{Article summary text|Xfce uses the [[GTK+]] toolkit.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Graphical user interface overview}}}}<br />
{{Article summary end}}<br />
<br />
From [http://www.xfce.org/about/ Xfce - About]:<br />
<br />
:''Xfce embodies the traditional UNIX philosophy of modularity and re-usability. It consists of a number of components that provide the full functionality one can expect of a modern desktop environment. They are packaged separately and you can pick among the available packages to create the optimal personal working environment.''<br />
<br />
== What is Xfce? ==<br />
Xfce is a Desktop Environment, like GNOME or KDE. It contains a suite of apps like a root window app, window manager, file manager, panel, etc. Xfce is written using the GTK2 toolkit, and contains its own development environment (libraries, daemons, etc), similar to other big DEs. Unlike GNOME or KDE, Xfce is lightweight and designed more around [http://www.opengroup.org/cde/ CDE] than Windows or Mac. It has a much slower development cycle, but is very stable and extremely fast. Xfce is great for older hardware.<br />
<br />
== Why use Xfce? ==<br />
Here is a (subjective) list of reasons to use Xfce:<br />
* It's fast; faster than the other major DEs.<br />
* It's stable. In the long time Xfce-4 has been out, only a relatively small handful of bugs has been discovered, despite it having a rather large following.<br />
* It's pretty. It uses GTK2 and is themable. You can make Xfce look very nice. The fonts are completely AA as well.<br />
* It works great with multiple monitors. Xfce's [[Wikipedia:Xinerama|Xinerama]] support is arguably the best out of any WM/DE.<br />
* It doesn't get in your way. You'll find Xfce helps your work flow, rather than always making itself "present."<br />
* It comes with a built-in compositor which allows for true transparency, among other cool things.<br />
<br />
== Why not use Xfce? ==<br />
Here is a (subjective) list of reasons not to use Xfce:<br />
* Doesn't contain all the features and integration of the major DEs.<br />
* Slower development cycle.<br />
* Because it's based on the CDE design, the layout may not be as familiar.<br />
<br />
== How to Install Xfce ==<br />
Xfce is somewhat modular. That means there is no need for you to run every part, you can pick and choose some of them. Because of this, Xfce has some separate Arch packages.<br />
<br />
=====Installing Xfce=====<br />
Make sure that the X system is installed and working correctly before proceding.<br />
<br />
To install the base Xfce system, run:<br />
<br />
# pacman -S xfce4<br />
<br />
If you want extras, like panel plugins, run this:<br />
<br />
# pacman -S xfce4-goodies<br />
<br />
When asked by pacman if you wish to install the whole group, you can select 'no' to install only the packages you wish.<br />
<br />
{{Note |'''xfce4-xfapplet-plugin''' (a plugin that allows the use of GNOME applets in the Xfce4 panel) is part of the '''xfce4-goodies''' group and depends on '''gnome-panel''', which in turn depends on '''gnome-desktop'''. You may wish to take this into consideration before installing, since it represents a significant number of extra dependencies.}}<br />
<br />
If you don't want xfce4-xfapplet-plugin to be installed, install xfce4-goodies this way:<br />
<br />
# pacman -S $(pacman -Sgq xfce4-goodies | egrep -v xfce4-xfapplet-plugin)<br />
<br />
To install the standard menu icons:<br />
<br />
# pacman -S gnome-icon-theme<br />
<br />
(These are included in the previous packages.)<br />
<br />
If you wish to admire 'Tips and Tricks' on login, install the fortune-mod package:<br />
<br />
# pacman -S fortune-mod<br />
<br />
In order to get the xfce4-mixer to work with alsa, you need to install gstreamer0.10-base-plugins. (See below for help with OSS.)<br />
<br />
# pacman -S gstreamer0.10-base-plugins<br />
<br />
Since the 4.6.0 release Xfce doesn't come with its own icon theme anymore. It now depends on tango-icon-theme. As an alternative you may want to install the gnome-icon-theme package.<br />
<br />
=====Installing and configuring the Daemons=====<br />
Install dbus:<br />
# pacman -S dbus<br />
<br />
To start automatically on boot, you should add <tt>dbus</tt> to your DAEMONS array in {{filename|/etc/rc.conf}}:<br />
<br />
DAEMONS=(syslog-ng '''dbus''' network crond)<br />
<br />
If you need to start dbus without rebooting, run<br />
# /etc/rc.d/dbus start<br />
<br />
Install gamin (the successor of fam). It is configured to automatically run in the background by default, do not add it to rc.conf.<br />
<br />
# pacman -S gamin<br />
<br />
== Running Xfce ==<br />
<br />
=====Automatically at boot time=====<br />
See [[Display Manager]] to install and configure a Display Manager.<br />
<br />
=====Manually=====<br />
<br />
You can execute:<br />
$ startxfce4<br />
from the console, or configure xinitrc and use xinit or startx.<br />
<br />
If you have not created a ~/.xinitrc yet, do so with:<br />
<br />
$ cp /etc/skel/.xinitrc ~/.xinitrc<br />
<br />
and add the following line:<br />
<br />
exec ck-launch-session startxfce4<br />
<br />
Example:<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
<br />
# exec gnome-session<br />
# exec startkde<br />
# exec startxfce4<br />
# ...or the Window Manager of your choice<br />
exec ck-launch-session startxfce4<br />
<br />
{{{Note |<code>ck-launch-session</code> starts a clean consolekit session needed by Xfce for power management, automounting, shutting down/rebooting etc. Consolekit/policykit capable display managers such as gdm do this for you automatically.}}}<br />
<br />
=====Shutting down and rebooting from withing Xfce=====<br />
* Make sure that '''dbus''' is enabled in the DAEMONS array in /etc/rc.conf.<br />
* Make sure you are a member of the ''power'' group.<br />
* Make sure that you are using <code>exec ck-launch-session startxfce4</code> in ~/.xinitrc or a consolekit/policykit capable display manager (e.g. gdm)<br />
<br />
== Tips ==<br />
=== Panel ===<br />
==== How to customize xfce panel background ====<br />
The same, edit ~/.gtkrc-2.0. ( foo.bar is path to your image )<br />
Note that you must place the image in the same directory as the configuration, which is ~/. You can not specify the path to the image, or it won't work.<br />
style "panel-background" {<br />
bg_pixmap[NORMAL] = "foo.bar"<br />
bg_pixmap[PRELIGHT] = "foo.bar"<br />
bg_pixmap[ACTIVE] = "foo.bar"<br />
bg_pixmap[SELECTED] = "foo.bar"<br />
bg_pixmap[INSENSITIVE] = "foo.bar"<br />
}<br />
widget_class "*Panel*" style "panel-background"<br />
<br />
==== Replacements for the default 'menu' panel applet ====<br />
The "Ubuntu System Panel" (Gnome) panel applet has similar features to those found in its KDE v4.2 equivalent. It can be added to an Xfce panel via the 'XfApplet' panel applet, which allows Gnome applets to be used in Xfce.<br />
<br />
It is available in [http://aur.archlinux.org/packages.php?ID=10259 the AUR]<br />
<br />
==== How to remove menu entries from the System menu ==== <br />
With the built-in menu editor, you cannot remove menu entries from the System menu. Here’s how to hide them:<br />
# Go to the /usr/share/applications folder. Type in the terminal (Xfce menu > System > Terminal): <pre>$ cd /usr/share/applications</pre><br />
# This folder should be full of .desktop files. To see how many there are, type: <pre>$ ls</pre>Say the one you want to edit is Firefox. Type in the terminal:<pre>$ sudo mousepad firefox.desktop</pre><br />
# In the bottom of the file, paste the following: <pre>NoDisplay=true</pre><br />
# Save and exit. Now Firefox won’t show up in the System menu. You can do this with any program.<br />
<br />
<br />
Another method is to copy the entire contents of the global applications directory over to your local applications directory, and then proceed to modify and/or disable unwanted .desktop entries. This will survive application updates that overwrite changes under /usr/share/applications/.<br />
# In a terminal, copy everything from /usr/share/applications to ~/.local/share/applications/: <pre>$ cp /usr/share/applications/* ~/.local/share/applications/</pre><br />
# For any entry you wish to hide from the menu, add the NoDisplay=true option: <pre>$ echo "NoDisplay=true" >> ~/.local/share/applications/foo.desktop</pre><br />
<br />
You can also edit the application's category by editing the .desktop file with a text editor and modifying the Categories= line.<br />
<br />
==== But what do you do with menu entries which do not show up in /usr/share/applications (e.g., apps installed via wine)? ==== <br />
I've found some shortcuts that show in the category “Other” in this directory:<br />
~/.local/share/applications/wine/.<br />
<br />
=== Desktop ===<br />
==== Why doesn't my desktop refresh? ====<br />
Xfce 4.6 uses [[FAM]] (File Alteration Monitor) or [[gamin]] (FAM's successor) to get notification when a file or directory changes.<br />
If you decide to use FAM, don't forget to add 'fam' to the list of DAEMONS in /etc/rc.conf.<br />
This step is not necessary for gamin.<br />
<br />
NOTE: After recent updates, FAM has caused issues opening some mounts, such as sshfs, that gamin does not have an issue with.<br />
<br />
==== Use a transparent background for desktop icon titles ====<br />
To change the default white background of desktop icon titles to something more suitable, edit the .gtkrc-2.0 file in your home directory (or create the file if needed) and add the following:<br />
style "xfdesktop-icon-view" {<br />
XfdesktopIconView::label-alpha = 10<br />
base[NORMAL] = "#000000"<br />
base[SELECTED] = "#71B9FF"<br />
base[ACTIVE] = "#71FFAD"<br />
fg[NORMAL] = "#ffffff"<br />
fg[SELECTED] = "#71B9FF"<br />
fg[ACTIVE] = "#71FFAD" }<br />
widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view"<br />
<br />
==== Switch to old desktop right click menu without Thunar things ====<br />
xfconf-query -c xfce4-desktop -v --create -p /desktop-icons/style -t int -s 0<br />
<br />
=== App suggestions ===<br />
==== A drop down console like in quake ====<br />
<br />
# pacman -S tilda<br />
<br />
will install tilda, a drop down console, similar to yakuake. A more lightweight alternative would be '''stjerm''' which can be found in the AUR.<br />
<br />
To configure tilda, type<br />
<br />
# tilda -C<br />
<br />
which opens a configuration window in X.<br />
<br />
====Guake====<br />
Another functional alternative is guake, which is available in the community repo:<br />
<br />
# pacman -S guake<br />
<br />
=== XFWM4 ===<br />
==== How to enable the compositor in Xfce 4.6 ====<br />
Xfce 4.6 comes with a builtin compositor adding the option for fancy window effects, shadows and transparency and so on. It can be enabled in the Window Manager Tweaks and works on the fly. No additional settings are needed in your /etc/xorg.conf. To enable and adjust settings, go to:<br />
<br />
Menu --> Settings --> Window Manager Tweaks<br />
<br />
==== Persistent window placement per-app ====<br />
<br />
=== Commands for the settings manager ===<br />
<br />
There is no official documentation for the commands executed. One must look at .desktop files ''/usr/share/applications/'' folder. For the people who like to know exactly what is happening, here is a handy list to save the effort:<br />
<br />
xfce-setting-show backdrop<br />
xfce-setting-show display<br />
xfce-setting-show keyboard<br />
xfce4-menueditor<br />
xfce-setting-show sound<br />
xfce-setting-show mouse<br />
xfce-setting-show session<br />
xfce-setting-show<br />
xfce-setting-show splash<br />
xfce-setting-show ui<br />
xfce-setting-show xfwm4<br />
xfce-setting-show wmtweaks<br />
xfce-setting-show workspaces<br />
xfce-setting-show printing_system<br />
xfce4-appfinder<br />
xfce4-autostart-editor<br />
xfce4-panel -c<br />
<br />
To review all the available setting manager commands run the following in a terminal:<br />
<br />
$ grep xfce-setting-show /usr/share/applications/xfce*settings*<br />
<br />
=== Session ===<br />
==== Customizing Startup Applications ====<br />
<br />
This includes getting necessary environment variables into the GUI runtime.<br />
<br />
* Copy the file /etc/xdg/xfce4/xinitrc to ~/.config/xfce4/<br />
* Edit this file. For example, you can add something like this somehwere in the middle:<br />
source $HOME/.bashrc<br />
# start rxvt-unicode server<br />
urxvtd -q -o -f<br />
<br />
==== Switch between users ====<br />
<br />
It is possible to switch between X sessions thanks to [http://goodies.xfce.org/projects/panel-plugins/xfswitch-plugin xfswitch-plugin ]. It adds an icon to the Xfce panel, and requires gdm to work at the moment.<br />
<br />
xfswitch-plugin is available through [http://aur.archlinux.org/packages.php?ID=40677 AUR ]<br />
<br />
==== Modify XML settings files directly ====<br />
It may be useful, especially when upgrading, to manually edit .xml files in the ~/.config/xfce4/xfconf/ folder. For application keyboard shortcuts for example, the file is ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml. It's faster to copy and paste the XML keys that you want rather than using the GUI.<br />
<br />
<br />
=== How to add themes to XFCE === <br />
<br />
1. Go to [http://xfce-look.org xfce-look.org] and click "Themes" in the left navbar. Look around for a theme you want and click "Download".<br />
<br />
2. Go to the directory where you downloaded the tarball/file and extract it using Squeeze/Xarchiver/CLI.<br />
<br />
3. Move the extracted folder to /usr/share/themes (for all users) or ~/.themes (for just you). Inside /usr/share/themes/abc, there is a folder that you create called xfwm4 that will contain whatever files that is included with that theme.<br />
<br />
4. GTK theme is available here:<br />
Menu --> Settings --> Appearance<br />
You select your xfwm theme in:<br />
Menu --> Settings --> Window Manager<br />
<br />
=== Fonts ===<br />
<br />
If you find the standard fonts rather thick and or slightly out of focus open Settings>Appearence click on the Fonts tab and under Hinting: change to Full<br />
<br />
You could also try using a custom DPI setting.<br />
<br />
=== Sound ===<br />
<br />
==== How do I get xfce4-mixer and OSS4 to work together? ====<br />
<br />
Xfce 4.6 uses gstreamer as the backend to control volume, so first you have to make gstreamer cooperate with xfce4-mixer.<br />
<br />
pacman -S xfce4-mixer gstreamer0.10-base-plugins<br />
<br />
(Optional) Second, try to install gstreamer0.10-good-plugins, gstreamer0.10-bad-plugins<br />
<br />
pacman -S gstreamer0.10-good-plugins gstreamer0.10-bad-plugins<br />
<br />
login and logout, or just remove the mixer plugin and add it again. If it doesn't work at all, then you have to compile gstreamer0.10-good-plugins yourself. and can <br />
<br />
Download the PKGBUILD and other files needed from ABS or [http://repos.archlinux.org/viewvc.cgi/gstreamer0.10-good-plugins/repos/extra-i686/ here], edit the PKGBUILD, add --enable-oss. <br />
<br />
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var '''--enable-oss'''\<br />
--disable-static --enable-experimental \<br />
--enable-ladspa \<br />
--with-package-name="GStreamer Good Plugins (Arch Linux)" \<br />
--with-package-origin="http://www.archlinux.org/" || return 1<br />
<br />
and then run makepkg -i. <br />
<br />
makepkg -i<br />
<br />
Still not working? Try tis package in AUR [http://aur.archlinux.org/packages.php?ID=17024 gstreamer0.10-good-plugins-ossv4], modify the pkgver to the newest in the PKGBUILD, and it should work.<br />
<br />
Other LINKS: [http://www.4front-tech.com/forum/ OSS forum]<br />
<br />
==== Change volume with keyboard volume buttons ====<br />
<br />
Go to <br />
Settings --> Keyboard<br />
Click the "Application Shortcuts" tab and add click the "Add" button. Add the following by entering the command, then pressing the corresponding button at the next window:<br />
<br />
===== ALSA =====<br />
For the raise volume button:<br />
amixer set Master 5%+<br />
For the lower volume button:<br />
amixer set Master 5%-<br />
For the mute button:<br />
amixer set Master toggle<br />
<br />
You can also run these commands to set the above commands to the standard XF86Audio keys:<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioRaiseVolume -n -t string -s "amixer set Master 5%+"<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioLowerVolume -n -t string -s "amixer set Master 5%-"<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioMute -n -t string -s "amixer set Master toggle"<br />
<br />
If {{codeline|amixer set Master toggle}} does not work, try the PCM channel ({{codeline|amixer set PCM toggle}}) instead.<br />
<br />
The channel must have a "mute" option for the toggle command to work. To check whether or not your Master channel supports toggling mute, run {{codeline|alsamixer}} in a terminal and look for the double M's (MM) under the Master channel. If they are not present, then it does not support the mute option. If, for example, you had to change the toggle button to use the PCM channel, make sure to also set the PCM channel as the Mixer Track under Xfce Mixer properties.<br />
<br />
===== OSS =====<br />
Use one of these scripts:<br />
[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS<br />
]<br />
<br />
If using ossvol (recommended), add:<br />
ossvol -i 1<br />
for the volume up button<br />
ossvol -d 1<br />
for the volume down button<br />
ossvol -t<br />
for the mute/unmute button<br />
<br />
<br />
=== Screenshots ===<br />
<br />
==== Using print-screen key ====<br />
<br />
A simple way is to use a command-line screenshot utility:<br />
<br />
# pacman -S scrot<br />
<br />
Then<br />
<br />
XFCE Menu --> Settings --> Keyboard >>> Application Shortcuts.<br />
<br />
Add the "scrot" command to use the "PrintScreen" key.<br />
<br />
All screenshots will be placed in your home folder with unique names like<br />
<br />
"2009-02-19-063052_1280x1024_scrot.png".<br />
<br />
====Screenshooter====<br />
<br />
There is also an a screenshot plugin for the Xfce panel that is available in extra:<br />
<br />
# pacman -S xfce4-screenshooter<br />
<br />
=== Change mount options ===<br />
<br />
A common problem when automounting USB sticks formatted with fat filesystem is the inability to properly show characters as umlauts, ñ, ß, etc. This may be solved changing the default iocharset to utf8, which is easily done adding a line to '''/etc/xdg/xfce4/mount.rc''':<br />
<br />
[vfat]<br />
uid=<auto><br />
shortname=winnt<br />
'''utf8=true'''<br />
# FreeBSD specific option<br />
longnames=true<br />
<br />
Note that when using utf-8, the system will distinct between upper- and lowercases, potentially corrupting your files. Be careful.<br />
<br />
It is also recommendable to mount vfat devices with the '''flush''' option, so that when copying to usb sticks data flushes more often, thus making thunar's progress bar to stays up until things are on the disk.<br />
<br />
[vfat]<br />
flush=true<br />
<br />
== Troubleshooting ==<br />
=== Keyboard shortcuts aren't working ===<br />
Under Xfce 4.6 there is a problem where the user's [http://bugzilla.xfce.org/show_bug.cgi?id=5639 keyboard shortcuts will intermittently not work]. This is usually the case when the settings helper is either not running or has been started improperly due to a conflict. This bug has been fixed in Xfce 4.8, which replaced 4.6 in the main repositories.<br />
<br />
A workaround is to disable ''xfce4-settings-helper-autostart'' from autostarting in a user's session. The settings helper daemon will start upon loading an Xfce session, anyways. The following two steps seem to have resolved this issue.<br />
<br />
Remove or rename the global autostart .desktop file:<br />
mv /etc/xdg/autostart/xfce4-settings-helper-autostart.desktop /etc/xdg/autostart/xfce4-settings-helper-autostart.desktop.disabled<br />
<br />
Remove or rename the local autostart .desktop file:<br />
mv ~/.config/autostart/xfce4-settings-helper-autostart.desktop ~/.config/autostart/xfce4-settings-helper-autostart.desktop.disabled<br />
<br />
After logging out and logging back in, your shortcut keys should be working fine now.<br />
<br />
=== Restore default settings ===<br />
If for any reason you need to revert back to the default settings, try renaming ~/.config/xfce4-session/ and ~/.config/xfce4/<br />
<br />
$ mv ~/.config/xfce4-session/ ~/.config/xfce4-session-bak<br />
$ mv ~/.config/xfce4/ ~/.config/xfce4-bak<br />
<br />
Logout and login for changes to take effect.<br />
<br />
== Xfce 4.8 (development version) ==<br />
<br />
=== Repository (development version) ===<br />
[xfce4-devel]<br />
Server = http://arch.ouranos.be/$repo/$arch/<br />
<br />
=== Start Xfce ===<br />
Use this command in .xinitrc to launch Xfce<br />
exec dbus-launch ck-launch-session xfce4-session<br />
<br />
=== Thunar - Removable devices ===<br />
Make sure dbus is running: /etc/rc.d/dbus start<br />
Create the file /etc/polkit-1/localauthority/50-local.d/org.freedesktop.udisks.pkla and add yourself into the ''storage'' group<br />
[Local Users]<br />
Identity=unix-group:storage<br />
Action=org.freedesktop.udisks.*<br />
ResultAny=yes<br />
ResultInactive=no<br />
ResultActive=yes<br />
The changes doesn't need any restart or reload.<br />
Please note that this is a temporary solution as Ionut and other core dev prefer to fix the pam + ck issues<br />
<br />
=== Reboot/Shutdown ===<br />
Create the file /etc/polkit-1/localauthority/50-local.d/org.freedesktop.consolekit.pkla and add yourself into the ''power'' group<br />
[Local restart]<br />
Identity=unix-group:power<br />
Action=org.freedesktop.consolekit.system.restart<br />
ResultAny=yes<br />
ResultInactive=no<br />
ResultActive=yes<br />
<br />
[Local shutdown]<br />
Identity=unix-group:power<br />
Action=org.freedesktop.consolekit.system.stop<br />
ResultAny=yes<br />
ResultInactive=no<br />
ResultActive=yes<br />
<br />
[Local restart - multiple]<br />
Identity=unix-group:power<br />
Action=org.freedesktop.consolekit.system.restart-multiple-users<br />
ResultAny=yes<br />
ResultInactive=no<br />
ResultActive=yes<br />
<br />
[Local shutdown - multiple]<br />
Identity=unix-group:power<br />
Action=org.freedesktop.consolekit.system.stop-multiple-users<br />
ResultAny=yes<br />
ResultInactive=no<br />
ResultActive=yes<br />
Now, some rules can be changed as if the ''Local * - multiple'' are redundant with the ''Local *''<br />
The changes doesn't need any restart or reload.<br />
Please note that this is a temporary solution as Ionut and other core dev prefer to fix the pam + ck issues<br />
<br />
=== Suspend/Hibernate ===<br />
Create the file /etc/polkit-1/localauthority/50-local.d/org.freedesktop.upower.pkla and add yourself into the ''power'' group<br />
[Local Users]<br />
Identity=unix-group:power<br />
Action=org.freedesktop.upower.*<br />
ResultAny=yes<br />
ResultInactive=no<br />
ResultActive=yes<br />
The changes doesn't need any restart or reload.<br />
Please note that this is a temporary solution as Ionut and other core dev prefer to fix the pam + ck issues<br />
<br />
=== Forum related thread ===<br />
https://bbs.archlinux.org/viewtopic.php?pid=851985#p851985<br />
<br />
== Related Articles ==<br />
* [[Build order for XFCE]]<br />
* [[Improve GTK Application Looks]]<br />
* [[Autostart applications#Graphical]]<br />
<br />
== External Resources ==<br />
* [http://www.us.xfce.org/documentation/ Xfce.org] - The complete documentation.<br />
* [http://www.xfce-look.org/ Xfce-Look] - Themes, wallpapers, and more.<br />
* [http://xfce.wikia.com/wiki/Frequently_Asked_Questions Xfce Wikia] - How to edit the auto generated menu with the menu editor<br />
* [http://wiki.xfce.org Xfce Wiki]<br />
* [https://xubuntu.wordpress.com/2006/08/04/howto-remove-menu-entries-from-the-system-menu/ Howto: Remove menu entries from the System menu]<br />
* [http://www.linuxquestions.org/questions/linux-general-1/how-to-use-xfce-themes-658354/ XFCE themes at linuxquestions.org]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Synchronization_and_backup_programs&diff=113512Synchronization and backup programs2010-08-08T13:52:24Z<p>VitaminJ: Add a few details to CLI tools, rm Link-Backup bullet about not recreating identical trees, this should go w/out saying</p>
<hr />
<div>== Intro ==<br />
<br />
This wiki page contains information about various backup programs. It's a good idea to ''have'' regular backups of important data, most notably configuration files (<tt>/etc/*</tt>) and local pacman database (usually <tt>/var/lib/pacman/local/*</tt>).<br />
<br />
Few words to end the introduction: before you start trying programs out, try to think about your needs, e.g. consider the following questions:<br />
* What backup medium do I have available?<br />
** cd / dvd<br />
** remote server (With what access? Ssh? Can I install some software on it (necessary for e.g. rsync-based solutions)?)<br />
** external harddrive<br />
* How often do I plan to backup?<br />
** daily?<br />
** weekly?<br />
** less often?<br />
* What goodies do I expect from the backup solution?<br />
** compression? (what algorithms?)<br />
** encryption? (gpg or something more straightforward?)<br />
* Most importantly: how do I plan to restore backups if needed?<br />
<br />
All right, enough with this, let's see some options!<br />
<br />
== Incremental backups ==<br />
<br />
The point with these is that they remember what has been backed up during the last run, and back up only what has changed. Great if you back up often.<br />
<br />
=== Rsync-type backups ===<br />
The main characteristic of this type of backups is that they maintain a copy of the directory you want to keep a backup of, in a traditional "mirror" fashion.<br />
<br />
Certain rsync-type packages also do snapshot backups by storing files which describe the how the contents of files and folders changed from the last backup (the so-called 'diffs'). Hence, they are inherently incremental, but usually they don't have compression/encryption. On the other hand, a working copy of everything is immediately available, no decompression/decryption needed. Finally the way it works makes it hard to burn backups to cd/dvd..<br />
<br />
===== CLI =====<br />
*[[rsync]] (in extra repo)<br />
**rsync almost always makes a mirror of the source<br />
**Impossible to restore a backup before the most recent backup<br />
**Standard install on all distros<br />
**Can run over SSH (port 22) or native rsync protocol (port 873)<br />
**Win32 version available<br />
*[http://www.nongnu.org/rdiff-backup/ rdiff-backup] (in community repo)<br />
**Stores most recent backup as regular files<br />
**To revert to older versions, you apply the diff files to recreate the older versions<br />
**It is granularly incremental (delta backup), it only stores changes to a file; will not create a new copy of a file upon change<br />
**Required python and librsync<br />
**Win32 version available<br />
*[http://www.rsnapshot.org rsnapshot] (in community repo) <br />
**Does not store diffs, instead it copies entire files if they have changed<br />
**Creates hard links between a series of backed-up trees (snapshots)<br />
**It is differential in that the size of the backup is only the original backup size plus the size of all files that have changed since the last backup.<br />
**Destination filesystem must support hard links<br />
**Requires perl<br />
**Win32 version available<br />
*[http://safekeep.sourceforge.net/ SafeKeep] (in AUR)<br />
**Enhancement to rdiff-backup<br />
**Integrates with Linux LVM and databases to create consistent backups<br />
**Bandwidth throttling<br />
* [http://www.scottlu.com/Content/Link-Backup.html Link-Backup] ([http://aur.archlinux.org/packages.php?ID=16929 AUR] may be patched with additional features) is similar to rsync based scripts, but does not use rsync<br />
** Creates hard links between a series of backed-up trees (snapshots)<br />
** Intelligently handles renames, moves, and duplicate files without additional storage or transfer<br />
** dstdir/.catalog is a catalog of all unique file instances; backup trees hard-link to the catalog<br />
** Transfer occurs over standard I/O locally or remotely between a client and server instance of this script<br />
** It copies itself to the server; it does not need to be installed on the server<br />
** Requires SSH for remote backups<br />
** It resumes stopped backups; it can even be told to run for n minutes<br />
<br />
===== GUI =====<br />
*[http://backintime.le-web.org/ Back In Time] (in AUR)<br />
**Creates hard links between a series of backed-up trees (snapshots)<br />
**Inspired by FlyBack and TimeVault<br />
**Really is just a front-end to rsync, diff, cp<br />
**A new snapshot is created only if something changed since the last snapshot<br />
*[http://www.flyback-project.org/ FlyBack] (in AUR)<br />
**A clone of Apple's Mac OS X Time Machine software<br />
*[http://areca.sourceforge.net/ Areca Backup] (in AUR)<br />
**Written in Java<br />
**Primarily archive-based (ZIP), but will do file-based backup as well<br />
**Claims delta backup supported (stores only changes)<br />
*[https://wiki.ubuntu.com/TimeVault TimeVault] (in AUR)<br />
**Creates hard links between a series of backed-up trees (snapshots)<br />
**Imitates Windows Volume Shadow Copy feature in that it integrates with Nautilus to provide a "Previous Versions" tab in the Properties dialog.<br />
*[http://luckybackup.sourceforge.net/index.html Luckybackup] (in [http://aur.archlinux.org/packages.php?ID=23121 AUR])<br />
**Luckybackup it's an easy program to backup and sync your files.<br />
**It is written in Qt and C++<br />
**It has Sync,Backup (with include and exclude options),Restore operations,Remote connection backup,Scheduled backups,Command line mode and more abilities.<br />
<br />
=== Not rsync-based ===<br />
<br />
They tend to create (big) archive files (like tar.bz2), and (of course) keep track of what's been archived. Now creating tar.bz2 or tar.gz archives has the advantage that you can extract the backups with just tar/bzip2/gzip, so you don't need to have the backup program around.<br />
<br />
* [[backup-manager|backup-manager]] (in AUR); [http://www.backup-manager.org/ homepage] Backup Manager is a command line backup tool for GNU/Linux, designed to help you make daily archives of your file system. Written in bash and perl, it can make archives in lots of open formats (tar, gzip, bzip2, lzma, dar, zip) and provides lots of interesting features (such as network exports or CD/DVD automated-burning). The program is designed to be as easy to use as possible and is popular with desktop users and sysadmins. The whole backup process is defined in one full-documented configuration file which needs no more than 5 minutes to tune for your needs. It just works. Archives are kept for a given number of days and the upload system can use ftp or scp to transfer the generated archives to a list of remote hosts. Gettext is used for internationalization.<br />
** 1 configuration file, 5 minutes setup<br />
** Manually invoke backup process or run daily unattended via CRON<br />
** Backup files, MySQL databases and Subversion repositories<br />
** Specify multiple targets to backup at once (/etc, /home, etc…)<br />
** Ability to exclude files from backup<br />
** Automatically purge old backups<br />
** Full backup only or Full + Incremental backup<br />
** Backup to an attached disk, LAN or Internet<br />
** Burns backup to CD/DVD with MD5 checksum verification<br />
** Archives in lots of open formats: tar, gzip, bzip2, lzma, dar, zip<br />
** Slice archives to 2 GB if using dar archives format<br />
** Backup over SSH<br />
** Encrypts archives<br />
** Offsite remote upload of archives via FTP, SSH, RSYNC or Amazon S3<br />
** Can run with different configuration files concurrently<br />
** Easy external hooks<br />
**Simply uncompressed the open format backup archives with any command line or GUI tool<br />
<br />
* [[Backup with arch-backup|arch-backup]] (in community repo); [http://code.google.com/p/archlinux-stuff/ website]); trivial backup scripts with simple configuration:<br />
** compression method can be configured<br />
** possible to specify more directories to backup<br />
<br />
* [[Backup with hdup|hdup]] (in extra repo; [http://miek.nl/projects/hdup2/ website]; it's no longer developed, the author develops rdup now (below); but it's still a decent one):<br />
** creates tar.gz or tar.bz2 archives<br />
** supports gpg encryption<br />
** supports pushing over ssh<br />
** possible to specify more directories to backup<br />
<br />
* [http://miek.nl/projects/rdup rdup] (in [http://aur.archlinux.org/packages.php?ID=3728 AUR]) successor to hdup: the program *just determines* which files have changed since the last backup. It's completely up to you what do you want to do with that list. Some helper scripts are supplied, and with them it supports:<br />
** creating tar.gz archives '''or''' rsync-type copy<br />
** encryption (gpg and usual strong (eg. blowfish)), also applies for rsync-type copy<br />
** compression (also for rsync-type copy)<br />
<br />
* [http://www.nongnu.org/duplicity/ duplicity] (in community repo) is similar to hdup, supports tarring and encrypting. But:<br />
** the files backed up are "randomly" distributed between encrypted tar archives, which makes it harder to recover a particular file<br />
** you can backup just one directory at a time (while with hdup you can specify as many as you want in one backup profile)<br />
<br />
* [http://dar.linux.free.fr/ dar] (in community repo): <br />
** it uses its own format for archives (so you need to have it around when you want to restore)<br />
** supports splitting backups into more files by size<br />
** makefile-type config files, some custom scripts are available along with it<br />
** supports basic encryption (not gpg; but also strong, but you need to supply a password every time)<br />
** some gui tools for inspecting backups are also available (kdar, in [http://aur.archlinux.org/packages.php?ID=7586 AUR], but current dar needs beta version)<br />
** a script suitable for running from cron is [http://sarab.sourceforge.net/ sarab] (in [http://aur.archlinux.org/packages.php?ID=17044 AUR]): supports pretty much any backup scheme (Towers of Hanoi, Grandfather-Father-Son, etc..)<br />
<br />
* [http://sourceforge.net/projects/backerupper/ backerupper] (in [http://aur.archlinux.org/packages.php?ID=17441 AUR]) Backerupper is a simple program for backing up selected directories over a local network. Its main intended purpose is backing up a user's personal data.<br />
** GUI based<br />
** creating tar.gz archives<br />
** possible to define : backup frequency, backup time, Max copies<br />
<br />
* [http://trac.manent-backup.com/ Manent] (in [http://aur.archlinux.org/packages.php?ID=19241 AUR]) is an algorithmically strong backup and archival program. It's Python based and has the following features:<br />
** Efficient backup to anything that looks like a storage<br />
** Works well over a slow and unreliable network<br />
** Offers online access to the contents of the backup<br />
** Backed up storage is completely encrypted<br />
** Several computers can use the same storage for backup, automatically sharing data<br />
** Not reliant on timestamps of the remote system to detect changes<br />
** Cross-platform support for Unicode file names<br />
<br />
=== Cloud backups ===<br />
<br />
* [http://www.getdropbox.com Dropbox] (in [http://aur.archlinux.org/packages.php?ID=19615 AUR] with Gnome support, and also [http://aur.archlinux.org/packages.php?ID=23363 AUR] without Gnome dependencies). <br />
** A daemon monitors a specified directory, and uploads incremental changes to Dropbox.com. <br />
** Changes automatically show up on your other computers. <br />
** Includes file sharing and a public directory. <br />
** You can recover deleted files. <br />
** Community written add-ons. <br />
** Free accounts have 2GB storage.<br />
<br />
* [http://www.jungledisk.com/ Jungle Disk] (in [http://aur.archlinux.org/packages.php?ID=15015 AUR])<br />
** Automatic backups to Amazon's servers.<br />
** Not free, but very low prices.<br />
<br />
== Not incremental backups ==<br />
* [http://k7z.sourceforge.net/ Q7Z] (in [http://aur.archlinux.org/packages.php?ID=12822 AUR]) is a P7Zip GUI for Linux, which attempts to simplify data compression and backup. It can create the following archive types: 7z, BZip2, Zip, GZip, Tar. Use Q7Z if you want to:<br />
** Update existing archives quickly<br />
** Backup multiple folders to a storage location<br />
** Create or extract protected archives<br />
** Lessen effort by using archiving profiles and lists<br />
* "Just copy everything into one big archive, but support writing to cd/dvd"-type: [http://www2.backup-manager.org/ backup-manager] (in [http://aur.archlinux.org/packages.php?ID=4351 AUR])<br />
* [[Partclone]] -- back up and restore only the used blocks of a partition<br />
* filesystem-backup -- simple bash script (was originally a MySQL backup script) that creates a rolling 7 days, rolling 4 weeks and static monthly backups in tar format. Good for servers without a GUI. Available in repo: http://repo.falconn.nl/any/<br />
* [http://clonezilla.org/ Clonezilla]<br />
**Boots from live CD, USB flash drive, or PXE server<br />
**Uses Partimage, ntfsclone, partclone, and dd, <br />
**Compatability with many file systems (ext2, ext3, ext4, reiserfs, xfs, jfs of GNU/Linux, FAT, NTFS, and HFS+)<br />
**Multicasting server to restore to many machines at once<br />
**If file system is supported , only used blocks in harddisk are saved and restored. For unsupported file system, sector-to-sector copy is done<br />
* [http://www.partimage.org/Main_Page Partimage]<br />
*[http://www.fsarchiver.org/Main_Page Fsarchiver] (in extra repo)<br />
**Support for basic file attributes (permissions, owner, ...)<br />
**Support for multiple file-systems per archive<br />
**Support for extended attributes (they are used by SELinux)<br />
**Support the basic file-system attributes (label, uuid, block-size) for all linux file-systems<br />
**Support for [http://www.fsarchiver.org/Cloning-ntfs ntfs filesystems] (ability to create flexible clones of windows partitions)<br />
**Checksumming of everything which is written in the archive (headers, data blocks, whole files)<br />
**Ability to restore an archive which is corrupt (it will just skip the current file)<br />
**Multi-threaded lzo, gzip, bzip2, lzma [[Compression|compression]]: if you have a dual-core / quad-core it will use all the power of your cpu<br />
**Lzma [[Compression|compression]] (slow but very efficient algorithm) to make your archive smaller.<br />
**Support for splitting large archives into several files with a fixed maximum size<br />
**Encryption of the archive using a password. Based on blowfish from libcrypto from openssl.<br />
**Support backup of a mounted root filesystem (-A option)<br />
<br />
<br />
== Versioning systems ==<br />
<br />
These are traditionally used for keeping track of software development; but if you want to have a simple way to manage your config files in one directory, it might be a good solution.<br />
<br />
* [http://www.selenic.com/mercurial/wiki/ mercurial] or [http://git.or.cz/ git] (both in extra repo)<br />
* [http://eigenclass.org/hiki/gibak-backup-system-introduction gibak]: a backup system based on git. it also supports binary diffs (for binaries, e-books, pictures, multimedia files, etc). on the homepage there is a short usage advice. it is meant to backup only the $HOME directory. one could also backup other directories (like /etc) by changing the $HOME variable to point to that directory (though i don't really recommend this). gibak is handy for people who are familiar with git. it uses .gitignore to filter files and one can use the git commands to restore files, browse through logs, diffs, etc. if one needs a gui, it is also possible to use gitk or qgit to browse through commits or do whatever these interfaces support. get it from AUR: http://aur.archlinux.org/packages.php?ID=18318.<br />
== Articles ==<br />
<br />
* [http://www.halfgaar.net/backing-up-unix Backing up Linux and other Unix(-like) systems]<br />
<br />
[[Category:System recovery (English)]]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Talk:VirtualBox&diff=110441Talk:VirtualBox2010-07-02T23:09:57Z<p>VitaminJ: Since 3.2.2 /etc/rc.d/vboxdrv rebuilds modules.</p>
<hr />
<div>The mount command under the guestadditions doesn't seem to work in all conditions, in my case it didn't work and I had to change the command.<br />
<br />
The command is listed as: "mount /media/cdrom" but I had to actually use "mount /dev/cdrom /mount/cdrom" (I used -r but that shouldn't matter).<br />
<br />
[[User:Serpardum|Serpardum]] (Thu, April 13, 2010)<br />
<br />
--<br />
<br />
I really think this article should be cleaned up and simplified. It is a little confusing- specifically the "Using host interface networking" section. I would atempt to do it myself, but I am not super knowlegable about this topic. Even Breaking this into sections with advice on which way would be best to use would be helpful. ~[[User:meskarune|meskarune]] (Fri, June 26, 2009)<br />
<br />
Anybody, any experience with how to use existing vmware virtual machine in virtualbox? I tried, but without success. I'll retry using: http://liquidat.wordpress.com/2007/11/23/howto-transform-a-qemu-image-to-a-virtualbox-image/ and post my findings.<br />
<br />
The main problem I find with this article is that it is not always clear which parts refer to an archlinux host and which to an archlinux guest. I think ideally the whole article should be re-structured to make this super-clear. [[User:maninalift|maninalift]]<br />
<br />
--<br />
<br />
Could someone please update the wiki with instructions on how to install Guest Additions on an Arch Linux virtual machine? I have been trying to figure this one out for a while now and I can't seem to get the proper daemons/modules to install. ~[[User:Thayer.w|Thayer]] (Thursday, 19 July 2007)<br />
:<strike>I'm bumping this again, because the current instructions don't seem to work.</strike> Nevermind, got it working =) ~[[User:Thayer.w|Thayer]] (Weds, Aug 6, 2008)<br />
<br />
--<br />
<br />
== Corrected USB-problem ==<br />
<br />
The fstab entry contains the group-id 85 which can vary on other PCs. I added a possible solution...<br />
=== More USB ===<br />
Can confirm that you can use mass storage USB passthrough with 3.0.4. But you must mount /proc/bus/usb as described in the article for any other types of USB devices such as mice & Blackberries<br />
<br />
For me an entry in the fstab was also necessary to use my USB flash drive in the WinXP guest. But instead of the line in the wiki article I had to use this one: <br />
none /sys/bus/usb/drivers usbfs devgid=108,devmode=664 0 0 (see this thread: http://bbs.archlinux.org/viewtopic.php?pid=640440)<br />
<br />
== Using host interface networking (the Arch way) & udev rules ==<br />
<br />
the wiki ask to set a file called 60-vboxdrv.rules under the directory /etc/udev/rules.d, but when I've tried, a file named 60-virtualbox.rules is already here, with the same setting. I don't know if the name matter, how from where the file come (virtualbox-ose via pacman ? guest addition ?)<br />
<br />
So I report this.<br />
--[[User:Gkrnours|Gkrnours]] 04:38, 13 May 2009 (EDT)<br />
<br />
== vboxdrv module ==<br />
Since Arch uses MODULES_AUTOLAD=yes by default in /etc/rc.conf, is it still mandatory to add vboxdrv in the MODULES array? I don't think so but I'm not totally sure.<br />
<br />
rent0n<br />
<br />
=== Rebuilding ===<br />
My mistake on an article edit, I was running an older virtualbox_bin from AUR. It is now /etc/rc.d/vboxdrv setup, this changed in 3.2.2.<br />
--[[User:VitaminJ|VitaminJ]] 19:09, 2 July 2010 (EDT)<br />
<br />
== vboxusers group ==<br />
It would be nice if someone explained why you might need to add your user to {{Codeline|vboxusers}} group. I did not add my user to this group and everything worked as expected. --[[User:Bhobbit|Bhobbit]] 19:11, 12 April 2010 (EDT)<br />
<br />
== Arch Host vs. Arch Guest ==<br />
<br />
I think the whole article is a bit unclear with regard to instructions for setting up ''VirtualBox on Arch Linux'' and ''Arch Linux in VirtualBox'' - particularly when it comes to obtaining Guest Additions etc. Unless there's really no difference, I think a great improvement would be adding this clarification wherever applicable.<br />
<br />
== Deleted kmod rebuild instructions for VBox pre-3.1.? ==<br />
<br />
I just deleted the instructions for rebuilding the VirtualBox kernel modules for VBox versions before 3.1.?, because they described obsolete versions of VBox and were poorly written. If anyone still wants those instructions around, please <strike>undo that edit ASAP (and then improve the instructions if possible)</strike> re-add them manually. <strike>[[User:Rransom|Rransom]] 15:04, 21 June 2010 (EDT)</strike> [[User:Rransom|Rransom]] 10:32, 22 June 2010 (EDT)</div>VitaminJhttps://wiki.archlinux.org/index.php?title=VirtualBox&diff=109322VirtualBox2010-06-22T14:22:21Z<p>VitaminJ: vbox_build_module is part of the AUR bin packages</p>
<hr />
<div>[[Category:Emulators (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|VirtualBox}}<br />
<br />
[http://www.virtualbox.org VirtualBox] is a virtual pc emulator like vmware. It has many of the features vmware has, as well as some of its own. It is in constant development and new features are implemented all the time. eg. version 2.2 introduced OpenGL 3D acceleration support for Linux and Solaris guests. It has a nice GUI interface (Qt and/or SDL) or command line tools for managing virtual machines. Headless operation is also supported. Running iTunes under VirtualBox is the only way (currently) to sync iPod Touch/iPhone firmware 3.0+.<br />
<br />
==Editions==<br />
VirtualBox is available in two editions: VirtualBox (OSE) and VirtualBox (Personal Use and Evaluation License (PUEL))<br />
<br />
===VirtualBox (OSE)===<br />
VirtualBox (OSE) is the open source version of VirtualBox, which can be found in the community repository. It lacks some features such as USB device support and the built-in RDP server. <br />
<br />
===VirtualBox (PUEL)===<br />
VirtualBox PUEL is a binary-only version (free for personal use). There are several available from the AUR, but the most popular PKGBUILD was written by thotypous and is currently maintained by cryptocrack. You can download it from the [http://aur.archlinux.org/packages.php?ID=9753 AUR at this link] or directly from the <br />
[http://www.virtualbox.org/wiki/Downloads VirtualBox] website. The PUEL edition offers the following advantages:<br />
<br />
*'''Remote Display Protocol (RDP) Server''' - a complete RDP server on top of the virtual hardware, allowing users to connect to a virtual machine remotely using any RDP compatible client<br />
<br />
*'''USB support''' - a virtual USB controller which allows USB 1.1 and USB 2.0 devices to be passed through to virtual machines<br />
<br />
*'''USB over RDP''' - a combination of the RDP server and USB support, allowing users to make USB devices available to virtual machines running remotely<br />
<br />
*'''iSCSI initiator''' - a builtin iSCSI initiator making it possible to use iSCSI targets as virtual disks without the guest requiring support for iSCSI<br />
<br />
==Installation==<br />
<br />
===Install VirtualBox (OSE)===<br />
VirtualBox (OSE) is available from the community repository:<br />
# pacman -S virtualbox-ose<br />
<br />
{{Note | 1=This package is not in x86_64 Repositories (see [http://bbs.archlinux.org/viewtopic.php?id=80991&p=1 this thread] why). See the link to the PKGBUILD by thotypous in the AUR above if you are running Arch x86_64 and want to use VirtualBox.}}<br />
<br />
{{Note | 1=This package can be installed for x86_64 systems by following the instructions below, however the previous note will remain for those of you who wish to install VirtualBox (OSE) from the AUR.}}<br />
<br />
Once installed, a desktop entry can be located in ''Applications &rarr; System Tools &rarr; VirtualBox OSE''<br />
<br />
Now, add the desired username to the '''vboxusers''' group:<br />
# gpasswd -a USERNAME vboxusers<br />
<br />
{{Note | You must logout/login in order for this change to take effect.}}<br />
<br />
To build '''vboxdrv''' module, run as root:<br />
# /etc/rc.d/vboxdrv setup<br />
<br />
Lastly, edit {{Filename|/etc/rc.conf}} as root and add '''vboxdrv''' to the MODULES array in order to load the VirtualBox drivers at startup. For example:<br />
MODULES=(loop '''vboxdrv''' fuse ...)<br />
<br />
To load the module manually, run the following in a terminal as root: <br />
# modprobe vboxdrv<br />
<br />
===Install VirtualBox (OSE) on x86_64===<br />
VirtualBox (OSE) can be installed on the x86_64 platform without downloading a version from the AUR. The current download of VirtualBox (OSE) from the VirtualBox website for *all distributions* under VirtualBox for Linux hosts installs properly after installing the kernel26-headers.<br />
<br />
# pacman -S kernel26-headers<br />
<br />
Once the kernel headers are downloaded and installed, you may run the VirtualBox OSE install downloaded from the VirtualBox website.<br />
The current version as of 2010/15/06 is 3.2.4 and can be downloaded from this URL: [http://download.virtualbox.org/virtualbox/3.2.4/VirtualBox-3.2.4-62467-Linux_amd64.run] If you choose to download this file from the website yourself, make sure you are downloading the amd64 version for all distributions as mentioned above. After the file is successfully downloaded to your preferred location, run the installer as root (or with sudo) with the following command:<br />
<br />
# sh VirtualBox-3.2.4-62467-Linux_amd64.run<br />
{{Note | Edit the file name to match the version (if applicable) of which you downloaded.}}<br />
<br />
After a successful installation, you may run the program from your Applications menu, usually under system tools.<br />
<br />
===Install VirtualBox PUEL (virtualbox_bin)===<br />
VirtualBox PUEL is available from the [http://aur.archlinux.org/packages.php?ID=9753 AUR: virtualbox_bin].<br />
<br />
Download the tarball from the above page. As a normal user, unpack, change directory, and {{Codeline|makepkg}}:<br />
$ tar -xzf virtualbox_bin.tar.gz<br />
$ cd virtualbox_bin<br />
$ makepkg<br />
This will create a .pkg.tar.gz file in the virtualbox_bin directory.<br />
Then, as root:<br />
# pacman -U PACKAGE-NAME.pkg.tar.gz<br />
This will compile the vboxdrv kernel modules and install VirtualBox in {{Filename|/opt/VirtualBox}}, and add the vboxusers group.<br />
<br />
Now, add the desired username to the '''vboxusers''' group:<br />
# gpasswd -a USERNAME vboxusers<br />
<br />
{{Note | You must logout/login in order for this change to take effect.}}<br />
<br />
Lastly, edit {{Filename|/etc/rc.conf}} as root and add '''vboxdrv''' to the MODULES array in order to load the VirtualBox drivers at startup. For example:<br />
MODULES=(loop '''vboxdrv''' fuse ...)<br />
<br />
To load the module manually, run the following in a terminal as root: <br />
# modprobe vboxdrv<br />
<br />
====Install required QT libraries====<br />
Currently, VirtualBox relies on QT4 for its graphical interface. If you require a GUI, ensure you have QT4 installed:<br />
# pacman -S qt<br />
<br />
==Configuration==<br />
After having installed VirtualBox on your system and added yourself to the vboxusers group, you can start configuring your system in order to make all the features of VirtualBox available. Create a new virtual machine using the wizard provided by the GUI and then click settings in order to edit the virtual machine settings.<br />
<br />
===Keyboard and mouse between the host and the guest===<br />
*To capture the keyboard and mouse, click the mouse inside the Virtual Machine display.<br />
*To uncapture, press the right Ctrl key, alone.<br />
<br />
To get seamless mouse integration between host and guest, you need to install the Virtualbox additions into the guest.<br />
<br />
Also, mouse pointer integration does not work out of the box. To fix it, make sure you have the following sections in your guest's {{Filename|xorg.conf}}:<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "vboxmouse"<br />
Option "Protocol" "auto"<br />
Option "Device" "/dev/input/mice"<br />
Option "ZAxisMapping" "4 5 6 7"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "X.org Configured"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Mouse0" "CorePointer"<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
EndSection<br />
<br />
When generating your {{Filename|xorg.conf}} with {{Codeline|"X -configure"}}, you will end up with an InputDevice section that uses the {{Codeline|mouse}} driver. After installing the Guest Additions, you should replace {{Codeline|mouse}} with {{Codeline|vboxmouse}} and then restart X or reboot your VM.<br />
<br />
===Getting network in the guest machine to work===<br />
First, get network working in the guest machine. Click the network tab. The not attached option means you will have "Network cable unplugged" or similar error in the guest computer.<br />
<br />
====Using NAT network====<br />
This is the simplest way to get network. Select NAT network and it should be ready to use. Then, the guest operating system can be automatically configured by using DHCP.<br />
<br />
The NAT IP address on the first card is 10.0.2.0, 10.0.3.0 on the second and so on.<br />
<br />
Also in VirtualBox 2.2.0+ NAT network DHCP clients will not configure your nameserver (DNS server for windows guests) you will have to manually configure the nameserver(DNS server)<br />
<br />
====Using host interface networking (the VirtualBox way)====<br />
Since VirtuaBox 2.1.0 it has a native support for host interface networking. Just add '''vboxnetflt''' to your MODULES section in {{Filename|[[rc.conf]]}} and choose ''Host Interface Networking'' (or ''Bridged adapter'' in [http://forums.virtualbox.org/viewtopic.php?f=1&t=16447 2.2]) in the virtual machine configuration.<br />
<br />
'''Note''': DHCP broadcasting does not seem to work properly under this way. Set up your guest networking with static IP assignment.<br />
<br />
====Using host interface networking (the Arch way)====<br />
You are going to just edit these files and reboot:<br />
<br />
* {{Filename|/etc/conf.d/bridges}}<br />
* {{Filename|/etc/rc.conf}}<br />
* {{Filename|/etc/vbox/interfaces}}<br />
<br />
Edit:<br />
'''{{Filename|/etc/conf.d/bridges}}'''<br />
bridge_br0="eth0 vbox0" # Put any interfaces you need.<br />
BRIDGE_INTERFACES=(br0)<br />
<br />
'''{{Filename|/etc/rc.conf}}'''<br />
<br />
First add the bridge module to your MODULES line<br />
MODULES=( <your other modules> '''bridge''')<br />
<br />
Then, in your NETWORKING section, make the following changes:<br />
eth0="eth0 up"<br />
br0="dhcp" # Maybe you have some static configuration; change to fit<br />
INTERFACES=(eth0 br0)<br />
<br />
'''Note''' by gpan:<br />
<br />
'''{{Filename|/etc/rc.conf}}'''<br />
<br />
First add the vboxdrv (and vboxnetflt in case of 2.1.0 version) module to your MODULES line:<br />
MODULES=( <your other modules> vboxdrv vboxnetflt )<br />
<br />
'''Note''' by vit:<br />
<br />
'''{{Filename|/etc/rc.conf}}'''<br />
<br />
In my case it did not work untill adding vboxnetadp to modules.<br />
<br />
Next, you should edit your {{Filename|/etc/udev/rules.d/60-vboxdrv.rules}} and type:<br />
KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="vboxusers", MODE="0660"<br />
<br />
Save it and exit.<br />
<br />
Then open terminal and type:<br />
# pacman -S bridge-utils uml_utilities<br />
<br />
Create a new bridge with this command:<br />
# brctl addbr br0<br />
<br />
'''{{Filename|/etc/vbox/interfaces}}'''<br />
<br />
(You can set up more interfaces if you want. Sky is the limit!):<br />
vbox0 your_user br0 # Be sure that your user is in the vboxusers group.<br />
<br />
Reboot.<br />
<br />
{{Note | Remember to set up your virtual machine with proper network configuration. (Attach a "Bridged Adapter" and choose "br0") }}<br />
{{Note | If you have any issue, make sure that you have the bridge-utils package installed and vboxnet daemon loaded.}}<br />
<br />
====Using host interface networking (generic)====<br />
This way is a bit harder, but it allows you to see the VirtualMachine as a "real" computer on your local network. You need to get bridge-utils <br />
<br />
# pacman -S bridge-utils uml_utilities<br />
<br />
'''Note''' by Sp1d3rmxn:<br />
:You also need to have the TUN module loaded... in {{Filename|[[rc.conf]]}} add {{Codeline|"tun"}} (without the quotes) to your MODULES section. For testing this out right now without rebooting you can load the module from the command line by {{Codeline|"modprobe tun"}}.<br />
:<br />
:Then you MUST set these permissions otherwise you will never get VBox to init the interface. The command is {{Codeline|"chmod 666 /dev/net/tun"}} (without the quotes).<br />
<br />
:Now proceed with the rest as it is written below.<br />
<br />
'''Note'''<br />
:As said by Sp1d3rmxn, set these permissions, but, instead of using the command, set them in {{Filename|/etc/udev/rules.d/60-vboxdrv.rules}}, which will apply them on boot:<br />
KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="vboxusers", MODE="0660"<br />
KERNEL=="tun", OWNER="root", GROUP="vboxusers", MODE="0660"<br />
<br />
<br />
'''1.''' Create a new bridge with this command:<br />
# brctl addbr br0<br />
<br />
'''2.''' If you are not using DHCP, run ifconfig and note down the network configuration of your existing network interface (e.g. eth0), which will need to be copied to the bridge.<br />
<br />
{{Note|You will need this settings so make sure you do not lose them.}}<br />
<br />
'''3.''' Switch your physical network adapter to "promiscuous" mode so that it will accept Ethernet frames for MAC addresses other than its own (replace {{Codeline|eth0}} with your network interface):<br />
# ifconfig eth0 0.0.0.0 promisc <br />
<br />
{{Note | You will lose network connectivity on eth0 at this point.}}<br />
<br />
'''4.''' Add your network adapter to the bridge:<br />
# brctl addif br0 eth0<br />
<br />
'''5.''' Transfer the network configuration previously used with your physical ethernet adapter to the new bridge. If you are using DHCP, this should work:<br />
# dhclient br0<br />
<br />
'''Note''' by Sp1d3rmxn:<br />
:Use {{Codeline|"dhcpcd -t 30 -h yourhostname br0 &"}} instead of the above<br />
<br />
Otherwise, run {{Codeline|"ifconfig br0 x.x.x.x netmask x.x.x.x"}} and use the values that you noted down previously.<br />
<br />
'''6.''' To create a permanent host interface called vbox0 (all host interfaces created in this way must be called vbox followed by a number) and add it to the network bridge created above, use the following command:<br />
VBoxAddIF vbox0 vboxuser br0<br />
<br />
Replace {{Codeline|vboxuser}} with the name of the user who is supposed to be able to use the new interface.<br />
<br />
{{Note | VboxAddIF is located in /opt/VirtualBox-VERSION OF VIRTUALBOX/VBoxAddIF}}<br />
<br />
Alternatively, you can [http://mychael.gotdns.com/blog/2007/05/31/virtualbox-bridging/ setup VirtualBox networking] through your {{Filename|/etc/rc.conf}} to enable a bridged connection.<br />
<br />
====Using host interface networking with a wireless device====<br />
Bridging as described above will not work with a wireless device. Using [http://aur.archlinux.org/packages.php?ID=16356 parprouted] however it can be accomplished.<br />
<br />
# Install parprouted and iproute<br />
# {{Codeline|# ln -s /usr/sbin/ip /sbin/ip}}<br />
# Make sure IP fowarding is enabled: {{Codeline|# sysctl net.ipv4.ip_forward&#61;1}}, and/or edit {{Filename|/etc/sysctl.conf}}.<br />
# {{Codeline|# VBoxTunctl -b -u <user>}}, to create the tap device<br />
# {{Codeline|# ip link set tap0 up; ip addr add 192.168.0.X/24 dev tap0}}, needs to be a manually set IP on the same network your wireless device is.<br />
# {{Codeline|# parprouted wlan0 tap0}}<br />
<br />
===Getting USB to work in the guest machine===<br />
(Only available in the PUEL edition)<br />
<br />
{{Note|As of VirtualBox>2.2.4 this is no longer necessary to mount a usb filesystem.}}<br />
<br />
First in order to make USB available for use to the virtual machine you must add this line to your {{Filename|/etc/fstab}}:<br />
none /proc/bus/usb usbfs auto,busgid=108,busmode=0775,devgid=108,devmode=0664 0 0<br />
<br />
Then tell mount to reread {{Filename|/etc/fstab}}:<br />
# mount -a<br />
<br />
{{Codeline|108}} is is the id of the group which should be allowed to access USB-devices. Change it to the id of your vboxusers group. You can get the id by running:<br />
$ grep vboxusers /etc/group<br />
<br />
Restart Virtualbox and click the USB tab in the settings of the virtual machine and select which devices are available to your pc on boot. If you wish your virtual machine to use device that you have just plugged in (assuming the virtual machine has booted already), go to the VirtualMachine screen go to ''Devices &rarr; USB Devices'' and select the device you wish to plug in the virtual PC.<br />
<br />
'''Note''' by bjimba:<br />
<br />
Recent versions of VirtualBox, as noted above, do not require usbfs, however you will need the HAL daemon running if you do not use usbfs. See the [[HAL]] wiki page for details.<br />
<br />
===Installing Guest Additions===<br />
The Guest Additions make the shared folders feature available, as well as better video (3D available in version 2.1+) and mouse drivers. You will have mouse integration, thus no need to release the mouse after using it in the guest and one can also enable a bidirectional clipboard.<br />
<br />
{{Note | The instructions immediately below are for an Archlinux guest on an Archlinux host.}}<br />
<br />
After you booted the virtual machine, go to menu ''Devices &rarr; Install Guest Additions...'' Once you have clicked it, VirtualBox loads an ISO into the current CD-ROM, so you will not see anything happen yet.<br />
<br />
You will require gcc and make if you do not already have them so install them typing the following as root:<br />
# pacman -S gcc make <br />
<br />
If you are running arch in VirtualBox install the kernel headers<br />
# pacman -S kernel26-headers<br />
<br />
Then do the following as root:<br />
# mount /media/cdrom<br />
for i686 systems (32 bit):<br />
# sh /media/cdrom/VBoxLinuxAdditions-x86.run<br />
for x86-64 systems (64 bit):<br />
# sh /media/cdrom/VBoxLinuxAdditions-amd64.run<br />
<br />
It will build and install the kernel modules, install the Xorg drivers and create init scripts. It will most probably print out errors about init scripts and run levels and what not. Ignore them. You will find {{Filename|rc.vboxadd}} in /etc/rc.d which will load them on demand. To have the Guest Additions loaded at boot time, just add those to the DAEMONS array in {{Filename|/etc/rc.conf}} eg.:<br />
DAEMONS=(syslog-ng network netfs crond alsa '''rc.vboxadd''')<br />
<br />
Another option is to install one of these packages:<br />
# pacman -S virtualbox-additions<br />
or<br />
# pacman -S virtualbox-ose-additions<br />
<br />
You will then have an ISO to mount as a loop device. Remember to load the loop kernel module before:<br />
# modprobe loop<br />
# mount /usr/lib/virtualbox/additions/VBoxGuestAdditions.iso /media/cdrom -o loop<br />
<br />
Then execute {{Filename|VBoxLinuxAdditions.run}} as before. Before adding {{Filename|rc.vboxadd}} to DAEMONS check {{Filename|/etc/rc.local}} for commands to load the vboxadd daemons put by the installation script.<br />
<br />
'''Using full resolution of the host system in the guest'''<br />
<br />
Set the resolution of your guest in the grub boot script {{Filename|/boot/grub/menu.lst}}, i.e. add the correct vga code to the kernel command line.<br />
For a resolution of 1280x1024, this would e.g. look like<br />
# kernel /vmlinuz26 root=/dev/disk/by-uuid/7bdc5dee-8fb0-4260-bc43-60ac6e4e4a54 ro vga=795<br />
Add the resolution to {{Filename|/etc/X11/xorg.conf}}, e.g.<br />
<br />
# Section "Screen"<br />
# ...<br />
# SubSection "Display"<br />
# Viewport 0 0<br />
# Depth 24<br />
# Modes "1280x1024" "1024x768"<br />
# EndSubSection<br />
# ...<br />
# EndSection<br />
<br />
<br />
'''Windows Guests'''<br />
<br />
After installing Windows (XP etc.) on your virtual machine, simply select ''Devices &rarr; Install Guest Additions...''<br />
<br />
This will mount the iso image and windows should then automatically launch the guest additions installer. Follow the instructions to the end.<br />
<br />
===Sharing folders between the host and the guest===<br />
In the settings of the virtual machine go to shared folders tab and add the folders you want to share.<br />
<br />
*NOTE: You need to install Guest Additions in order to use this feature.<br />
In a Linux host, ''Devices &rarr; Install Guest Additions''<br />
Yes (when asked to download the CD image)<br />
Mount (when asked to register and mount)<br />
<br />
In a Linux host, create one folder for sharing files.<br />
<br />
In a Windows guest, starting with VirtualBox 1.5.0, shared folders are browseable and are therefore visible in Windows Explorer. Open Windows Explorer and look for it under ''My Networking Places &rarr; Entire Network &rarr; VirtualBox Shared Folders''.<br />
<br />
Alternatively, on the Windows command line, you can also use the following:<br />
net use x: \\VBOXSVR\sharename<br />
<br />
While {{Codeline|VBOXSVR}} is a fixed name, replace {{Codeline|x:}} with the drive letter that you want to use for the share, and sharename with the share name specified with VBoxManage.<br />
<br />
In a Windows guest, to improve loading and saving files (e.g. MS Office) by VirtualBox Shared Folders edit ''c:\windows\system32\drivers\etc\hosts'' as below:<br />
127.0.0.1 localhost vboxsvr<br />
<br />
In a Linux guest, use the following command:<br />
# mount -t vboxsf [-o OPTIONS] sharename mountpoint<br />
<br />
Replace {{Codeline|sharename}} with the share name specified with VBoxManage, and mountpoint with the path where you want the share to be mounted (e.g. /mnt/share). The usual mount rules apply, that is, create this directory first if it does not exist yet.<br />
<br />
Beyond the standard options supplied by the mount command, the following are available:<br />
iocharset=CHARSET<br />
to set the character set used for I/O operations (utf8 by default) and<br />
convertcp=CHARSET<br />
to specify the character set used for the shared folder name (utf8 by default).<br />
<br />
===Getting audio to work in the guest machine===<br />
<br />
In the machine settings, go to the audio tab and select the correct driver according to your sound system (ALSA, OSS or PulseAudio).<br />
<br />
===Setting up the RAM and Video Memory for the virtual PC===<br />
<br />
You can change the default values by going to ''Settings &rarr; General''.<br />
<br />
===Setting up CD-ROM for the Virtual PC===<br />
<br />
You can change the default values by going to ''Settings &rarr; CD/DVD-ROM''.<br />
<br />
Check mount CD/DVD drive and select one of the following options.<br />
<br />
'''Note:''' If no CD-ROM drive is detected, make sure the HAL daemon is running. To start it, run the following command as root:<br />
# /etc/rc.d/hal start<br />
<br />
===Enabling OpenGL acceleration in Arch Linux guests===<br />
Due to a bug in the VirtualBox guest addition setup scripts (as of VBox 3.1.2), simply ticking the "3D acceleration" checkbox in the virtual machine settings and installing the guest additions won't enable 3D acceleration for OpenGL applications under X for Arch Linux guests (and possibly others). In order to still get OpenGL acceleration, a bit of manual intervention is necessary after installing the guest additions. <br />
As root, run:<br />
ln -s /usr/lib/VBoxOGL.so /usr/lib/xorg/modules/dri/vboxvideo_dri.so<br />
ln -s /usr/lib/xorg/modules/dri /usr/lib/dri<br />
Also make sure the user starting X in the guest is in the '''video''' group.<br />
<br />
{{Note | Don't compare before-after performance using glxgears! You may get a lot less FPS due to now-working vsync support. Compare performance using a real, heavy 3D application (like a game).}}<br />
<br />
===Enabling D3D acceleration in Windows guests===<br />
Recent versions of Virtualbox have support for accelerating OpenGL inside guests. This can be enabled with a simple checkbox in the machine's settings, right below where video ram is set, and installing the Virtualbox guest additions. However, most Windows games use Direct3D (part of DirectX), not OpenGL, and are thus not helped by this method. However, it is possible to gain accelerated Direct3D in your Windows guests by borrowing the d3d libraries from Wine, which translate d3d calls into OpenGL, which is then accelerated. <br />
<br />
After enabling OpenGL acceleration as described above, go to http://www.nongnu.org/wined3d/ in your Windows guest and grab the "Latest version (Installer):". Reboot the guest into safe mode (press F8 before the Windows screen appears but after the Virtualbox screen disappears), and install wined3d, accepting the defaults during the install. (You may check the box for DirectX 10 support if you like, dont touch anything else.) Reboot back to normal mode and you should have accelerated Direct3D. <br />
<br />
{{Note | This hack may or may not work for some games depending on what hardware checks they make and what parts of D3D they use.}}<br />
{{Note | This has only been tried on Windows XP and Windows 7 RC guests AFAIK, and does not work on the Windows 7 guest. If you have experience with this on a different windows version, please add that data here.}}<br />
<br />
==Start VirtualBox==<br />
To start Virtualbox, run the following command in a terminal:<br />
$ VirtualBox<br />
<br />
Or in KDE menu, select: <System><Sun Virtualbox><br />
<br />
==Virtualized OS Setup==<br />
Virtualbox needs to be setup to virtualize another operating system.<br />
<br />
===Test a LiveCD/DVD===<br />
Click the 'New' button to create a new virtual environment. Name it appropriately and select Operating System type and version. Select base memory size (note: most operating systems will need at least 512MB to function properly). Create a new hard disk image (a hard disk image is a file that will contain the operating system's filesystem and files).<br />
<br />
When the new image has been created, click 'Settings', then CD/DVD-ROM, check 'Mount CD/DVD Drive' then select an ISO image.<br />
<br />
==Maintenance==<br />
<br />
===Rebuild the vboxdrv Module===<br />
Note that any time your kernel version changes (due to an upgrade, recompile, etc.) you must also rebuild the VirtualBox kernel modules.<br />
<br />
Ensure that ''kernel26-headers'' is still installed, and run the following command:<br />
# /etc/rc.d/vboxdrv setup<br />
This will build the VirtualBox kernel modules for the ''currently running kernel''; if you have just upgraded your kernel package, reboot before trying to rebuild your kernel modules.<br />
<br />
After rebuilding the module, do not forget to load it with<br />
# modprobe vboxdrv<br />
<br />
''vboxdrv'' and ''vboxnetflt'' should be in the MODULES=() section of your /etc/rc.conf<br />
<br />
If you are using the virtualbox_bin packages from AUR<br />
# vbox_build_module<br />
<br />
===Compact a Disk Image===<br />
See [http://my.opera.com/locksley90/blog/2008/06/01/how-to-compact-a-virtualbox-virtual-disk-image-vdi How to compact a VirtualBox virtual disk image (VDI)]<br />
<br />
===Windows Xp and Nokia phones===<br />
To get working Windows XP and Nokia phones with Pc Suite mode, Virtualbox needs two simple steps:<br />
<br />
'''1.''' Add a rule to udev with {{Filename|/etc/udev/rules.d/40-permissions.rules}}:<br />
LABEL="usb_serial_start"<br />
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", \<br />
GROUP="usbfs", MODE="0660", GROUP="dialout"<br />
LABEL="usb_serial_end"<br />
<br />
'''2.''' Create the group usbfs and add its user to it<br />
$ sudo groupadd usbfs<br />
$ sudo usermod -a -G usbfs $USER<br />
<br />
After a logout, connect a Nokia phone with PC Suite mode and start Windows XP to test new rule.<br />
<br />
==Migrating From Another VM==<br />
The <code>qemu-img</code> program can be used to convert images from one format to another, or add compression or encryption to an image. <br />
# pacman -S qemu<br />
<br />
===Converting from QEMU images===<br />
To convert a QEMU image for use with VirtualBox, first convert it to ''raw'' format, then use VirtualBox's conversion utility to convert and compact it in its native format.<br />
$ qemu-img convert -O raw test.qcow2 test.raw<br />
$ VBoxManage modifyvdi /full/path/to/test.vdi compact<br />
<br />
===Converting from VMware images ===<br />
Do <br />
$ VBoxManage clonehd source.vmdk target.vdi --format VDI<br />
<br />
This may not be needed anymore with recent virtualbox versions (to be confirmed)<br />
<br />
==Tips and Tricks==<br />
<br />
===Sending a CTRL+ALT+F1 to the Guest===<br />
If your guest O/S is a Linux distro, and you want to open a new tty text shell or exit X via typing {{Keypress|Ctrl}}+{{Keypress|Alt}}+{{Keypress|F1}}, you can easily send this command to the guest O/S simply by hitting your 'Host Key' (usually the {{Keypress|Ctrl}} in the Right side of your keyboard) + {{Keypress|F1}} or {{Keypress|F2}}, etc.<br />
<br />
===Speeding up HDD Access for the Guest===<br />
Enabling the SATA(AHCI) controller within Virtualbox can speed up Host disk operations. This is available though Settings>Hard Disks in current versions of Virtual Box.<br />
<br />
===Starting VMs at System Boot on Headless Servers===<br />
Add this line to /etc/rc.local<br />
exec /bin/su PREFERRED_USER -l -c "/bin/bash --login -c \"VBoxHeadless -startvm {UUID}\" >/dev/null 2>&1" &<br />
Where PREFERRED_USER is the user profile that contains the VM definitions and .vdi files. This will start the VM with a RDP server running on port 3389.<br />
To determine the available VMs for a user:<br />
su PREFERRED_USER -c "VBoxManage list vms"<br />
To suspend the VM:<br />
su PREFERRED_USER -c "VBoxManage controlvm {UUID} savestate"<br />
<br />
===Accessing Server on VM from Host===<br />
To access apache on a VM from the Host machine ONLY, simply execute the following lines on the Host:<br />
$ VBoxManage setextradata GuestName "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/HostPort" 8888<br />
$ VBoxManage setextradata GuestName "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/GuestPort" 80<br />
$ VBoxManage setextradata GuestName "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/Protocol" TCP<br />
Where 8888 is the port the host should listen on and 80 is the port the VM will send Apache's signal on. <br />
To use a port lower than 1024 on the host machine changes need to be made to the firewall on the host machine. This can also be set up to work with SSH, etc.. by changing "Apache" to whatever service and using different ports. <br />
<br />
Note: "pcnet" refers to the network card of the VM. If you use an Intel card in your VM settings change "pcnet" to "e1000"<br />
<br />
*from [http://mydebian.blogdns.org/?p=111 ]<br />
<br />
It might also be necessary to allow connections from the outside to the server in your VM. E.g. if the guest OS is Arch, you may want to add the line <br />
httpd: ALL<br />
to your /etc/hosts.allow file.<br />
<br />
===Daemon Tools===<br />
While VirtualBox can mount ISO images without a problem, there are some image formats which cannot reliably be converted to ISO. For instance, ccd2iso ignores .ccd and .sub files, which can give disk images with broken files. cdemu, fuseiso, and MagicISO will do the same. In this case there is no choice but to use Daemon Tools inside VirtualBox.<br />
<br />
Recent Daemon Tools versions won't install, so use this old one: [http://www.disc-tools.com/download/daemon347+hashcalc]<br />
<br />
==Running Arch Linux as a guest==<br />
To install guest additions with support for Xorg follow these steps:<br />
{{Note|Run the following steps as root}}<br />
* install entire xorg group: (is everything actually required?) <pre># pacman -S xorg</pre><br />
* install dependencies needed to build the guest additions: <pre># pacman -S kernel26-headers gcc make</pre><br />
* mount and install VirtualBox guest additions<br />
* create <tt>/etc/X11/xorg.conf</tt> with the following contents:<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "vboxmouse"<br />
Option "Device" "/dev/vboxguest"<br />
Option "CorePointer" "yes"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Card0"<br />
Driver "vboxvideo"<br />
EndSection<br />
* add <tt>hal</tt> to <tt>DAEMONS</tt> in <tt>rc.conf</tt> (not needed if you use X.org Server >= 1.8)<br />
{{Note|It is not required to add rc.vboxadd to DAEMONS because it is added to /etc/rc.local automatically}}<br />
{{Note|Run the following steps while logged into your user account}}<br />
* add <tt>/usr/bin/VBoxClient-all &</tt> to the top of <tt>~/.xinitrc</tt> (even if <tt>~/.xinitrc</tt> does not exist)<br />
<br />
==External Links==<br />
* [http://www.virtualbox.org/manual/UserManual.html VirtualBox User Manual]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=VirtualBox&diff=109321VirtualBox2010-06-22T14:19:23Z<p>VitaminJ: vbox_build_module command</p>
<hr />
<div>[[Category:Emulators (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|VirtualBox}}<br />
<br />
[http://www.virtualbox.org VirtualBox] is a virtual pc emulator like vmware. It has many of the features vmware has, as well as some of its own. It is in constant development and new features are implemented all the time. eg. version 2.2 introduced OpenGL 3D acceleration support for Linux and Solaris guests. It has a nice GUI interface (Qt and/or SDL) or command line tools for managing virtual machines. Headless operation is also supported. Running iTunes under VirtualBox is the only way (currently) to sync iPod Touch/iPhone firmware 3.0+.<br />
<br />
==Editions==<br />
VirtualBox is available in two editions: VirtualBox (OSE) and VirtualBox (Personal Use and Evaluation License (PUEL))<br />
<br />
===VirtualBox (OSE)===<br />
VirtualBox (OSE) is the open source version of VirtualBox, which can be found in the community repository. It lacks some features such as USB device support and the built-in RDP server. <br />
<br />
===VirtualBox (PUEL)===<br />
VirtualBox PUEL is a binary-only version (free for personal use). There are several available from the AUR, but the most popular PKGBUILD was written by thotypous and is currently maintained by cryptocrack. You can download it from the [http://aur.archlinux.org/packages.php?ID=9753 AUR at this link] or directly from the <br />
[http://www.virtualbox.org/wiki/Downloads VirtualBox] website. The PUEL edition offers the following advantages:<br />
<br />
*'''Remote Display Protocol (RDP) Server''' - a complete RDP server on top of the virtual hardware, allowing users to connect to a virtual machine remotely using any RDP compatible client<br />
<br />
*'''USB support''' - a virtual USB controller which allows USB 1.1 and USB 2.0 devices to be passed through to virtual machines<br />
<br />
*'''USB over RDP''' - a combination of the RDP server and USB support, allowing users to make USB devices available to virtual machines running remotely<br />
<br />
*'''iSCSI initiator''' - a builtin iSCSI initiator making it possible to use iSCSI targets as virtual disks without the guest requiring support for iSCSI<br />
<br />
==Installation==<br />
<br />
===Install VirtualBox (OSE)===<br />
VirtualBox (OSE) is available from the community repository:<br />
# pacman -S virtualbox-ose<br />
<br />
{{Note | 1=This package is not in x86_64 Repositories (see [http://bbs.archlinux.org/viewtopic.php?id=80991&p=1 this thread] why). See the link to the PKGBUILD by thotypous in the AUR above if you are running Arch x86_64 and want to use VirtualBox.}}<br />
<br />
{{Note | 1=This package can be installed for x86_64 systems by following the instructions below, however the previous note will remain for those of you who wish to install VirtualBox (OSE) from the AUR.}}<br />
<br />
Once installed, a desktop entry can be located in ''Applications &rarr; System Tools &rarr; VirtualBox OSE''<br />
<br />
Now, add the desired username to the '''vboxusers''' group:<br />
# gpasswd -a USERNAME vboxusers<br />
<br />
{{Note | You must logout/login in order for this change to take effect.}}<br />
<br />
To build '''vboxdrv''' module, run as root:<br />
# /etc/rc.d/vboxdrv setup<br />
<br />
Lastly, edit {{Filename|/etc/rc.conf}} as root and add '''vboxdrv''' to the MODULES array in order to load the VirtualBox drivers at startup. For example:<br />
MODULES=(loop '''vboxdrv''' fuse ...)<br />
<br />
To load the module manually, run the following in a terminal as root: <br />
# modprobe vboxdrv<br />
<br />
===Install VirtualBox (OSE) on x86_64===<br />
VirtualBox (OSE) can be installed on the x86_64 platform without downloading a version from the AUR. The current download of VirtualBox (OSE) from the VirtualBox website for *all distributions* under VirtualBox for Linux hosts installs properly after installing the kernel26-headers.<br />
<br />
# pacman -S kernel26-headers<br />
<br />
Once the kernel headers are downloaded and installed, you may run the VirtualBox OSE install downloaded from the VirtualBox website.<br />
The current version as of 2010/15/06 is 3.2.4 and can be downloaded from this URL: [http://download.virtualbox.org/virtualbox/3.2.4/VirtualBox-3.2.4-62467-Linux_amd64.run] If you choose to download this file from the website yourself, make sure you are downloading the amd64 version for all distributions as mentioned above. After the file is successfully downloaded to your preferred location, run the installer as root (or with sudo) with the following command:<br />
<br />
# sh VirtualBox-3.2.4-62467-Linux_amd64.run<br />
{{Note | Edit the file name to match the version (if applicable) of which you downloaded.}}<br />
<br />
After a successful installation, you may run the program from your Applications menu, usually under system tools.<br />
<br />
===Install VirtualBox PUEL (virtualbox_bin)===<br />
VirtualBox PUEL is available from the [http://aur.archlinux.org/packages.php?ID=9753 AUR: virtualbox_bin].<br />
<br />
Download the tarball from the above page. As a normal user, unpack, change directory, and {{Codeline|makepkg}}:<br />
$ tar -xzf virtualbox_bin.tar.gz<br />
$ cd virtualbox_bin<br />
$ makepkg<br />
This will create a .pkg.tar.gz file in the virtualbox_bin directory.<br />
Then, as root:<br />
# pacman -U PACKAGE-NAME.pkg.tar.gz<br />
This will compile the vboxdrv kernel modules and install VirtualBox in {{Filename|/opt/VirtualBox}}, and add the vboxusers group.<br />
<br />
Now, add the desired username to the '''vboxusers''' group:<br />
# gpasswd -a USERNAME vboxusers<br />
<br />
{{Note | You must logout/login in order for this change to take effect.}}<br />
<br />
Lastly, edit {{Filename|/etc/rc.conf}} as root and add '''vboxdrv''' to the MODULES array in order to load the VirtualBox drivers at startup. For example:<br />
MODULES=(loop '''vboxdrv''' fuse ...)<br />
<br />
To load the module manually, run the following in a terminal as root: <br />
# modprobe vboxdrv<br />
<br />
====Install required QT libraries====<br />
Currently, VirtualBox relies on QT4 for its graphical interface. If you require a GUI, ensure you have QT4 installed:<br />
# pacman -S qt<br />
<br />
==Configuration==<br />
After having installed VirtualBox on your system and added yourself to the vboxusers group, you can start configuring your system in order to make all the features of VirtualBox available. Create a new virtual machine using the wizard provided by the GUI and then click settings in order to edit the virtual machine settings.<br />
<br />
===Keyboard and mouse between the host and the guest===<br />
*To capture the keyboard and mouse, click the mouse inside the Virtual Machine display.<br />
*To uncapture, press the right Ctrl key, alone.<br />
<br />
To get seamless mouse integration between host and guest, you need to install the Virtualbox additions into the guest.<br />
<br />
Also, mouse pointer integration does not work out of the box. To fix it, make sure you have the following sections in your guest's {{Filename|xorg.conf}}:<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "vboxmouse"<br />
Option "Protocol" "auto"<br />
Option "Device" "/dev/input/mice"<br />
Option "ZAxisMapping" "4 5 6 7"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "X.org Configured"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Mouse0" "CorePointer"<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
EndSection<br />
<br />
When generating your {{Filename|xorg.conf}} with {{Codeline|"X -configure"}}, you will end up with an InputDevice section that uses the {{Codeline|mouse}} driver. After installing the Guest Additions, you should replace {{Codeline|mouse}} with {{Codeline|vboxmouse}} and then restart X or reboot your VM.<br />
<br />
===Getting network in the guest machine to work===<br />
First, get network working in the guest machine. Click the network tab. The not attached option means you will have "Network cable unplugged" or similar error in the guest computer.<br />
<br />
====Using NAT network====<br />
This is the simplest way to get network. Select NAT network and it should be ready to use. Then, the guest operating system can be automatically configured by using DHCP.<br />
<br />
The NAT IP address on the first card is 10.0.2.0, 10.0.3.0 on the second and so on.<br />
<br />
Also in VirtualBox 2.2.0+ NAT network DHCP clients will not configure your nameserver (DNS server for windows guests) you will have to manually configure the nameserver(DNS server)<br />
<br />
====Using host interface networking (the VirtualBox way)====<br />
Since VirtuaBox 2.1.0 it has a native support for host interface networking. Just add '''vboxnetflt''' to your MODULES section in {{Filename|[[rc.conf]]}} and choose ''Host Interface Networking'' (or ''Bridged adapter'' in [http://forums.virtualbox.org/viewtopic.php?f=1&t=16447 2.2]) in the virtual machine configuration.<br />
<br />
'''Note''': DHCP broadcasting does not seem to work properly under this way. Set up your guest networking with static IP assignment.<br />
<br />
====Using host interface networking (the Arch way)====<br />
You are going to just edit these files and reboot:<br />
<br />
* {{Filename|/etc/conf.d/bridges}}<br />
* {{Filename|/etc/rc.conf}}<br />
* {{Filename|/etc/vbox/interfaces}}<br />
<br />
Edit:<br />
'''{{Filename|/etc/conf.d/bridges}}'''<br />
bridge_br0="eth0 vbox0" # Put any interfaces you need.<br />
BRIDGE_INTERFACES=(br0)<br />
<br />
'''{{Filename|/etc/rc.conf}}'''<br />
<br />
First add the bridge module to your MODULES line<br />
MODULES=( <your other modules> '''bridge''')<br />
<br />
Then, in your NETWORKING section, make the following changes:<br />
eth0="eth0 up"<br />
br0="dhcp" # Maybe you have some static configuration; change to fit<br />
INTERFACES=(eth0 br0)<br />
<br />
'''Note''' by gpan:<br />
<br />
'''{{Filename|/etc/rc.conf}}'''<br />
<br />
First add the vboxdrv (and vboxnetflt in case of 2.1.0 version) module to your MODULES line:<br />
MODULES=( <your other modules> vboxdrv vboxnetflt )<br />
<br />
'''Note''' by vit:<br />
<br />
'''{{Filename|/etc/rc.conf}}'''<br />
<br />
In my case it did not work untill adding vboxnetadp to modules.<br />
<br />
Next, you should edit your {{Filename|/etc/udev/rules.d/60-vboxdrv.rules}} and type:<br />
KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="vboxusers", MODE="0660"<br />
<br />
Save it and exit.<br />
<br />
Then open terminal and type:<br />
# pacman -S bridge-utils uml_utilities<br />
<br />
Create a new bridge with this command:<br />
# brctl addbr br0<br />
<br />
'''{{Filename|/etc/vbox/interfaces}}'''<br />
<br />
(You can set up more interfaces if you want. Sky is the limit!):<br />
vbox0 your_user br0 # Be sure that your user is in the vboxusers group.<br />
<br />
Reboot.<br />
<br />
{{Note | Remember to set up your virtual machine with proper network configuration. (Attach a "Bridged Adapter" and choose "br0") }}<br />
{{Note | If you have any issue, make sure that you have the bridge-utils package installed and vboxnet daemon loaded.}}<br />
<br />
====Using host interface networking (generic)====<br />
This way is a bit harder, but it allows you to see the VirtualMachine as a "real" computer on your local network. You need to get bridge-utils <br />
<br />
# pacman -S bridge-utils uml_utilities<br />
<br />
'''Note''' by Sp1d3rmxn:<br />
:You also need to have the TUN module loaded... in {{Filename|[[rc.conf]]}} add {{Codeline|"tun"}} (without the quotes) to your MODULES section. For testing this out right now without rebooting you can load the module from the command line by {{Codeline|"modprobe tun"}}.<br />
:<br />
:Then you MUST set these permissions otherwise you will never get VBox to init the interface. The command is {{Codeline|"chmod 666 /dev/net/tun"}} (without the quotes).<br />
<br />
:Now proceed with the rest as it is written below.<br />
<br />
'''Note'''<br />
:As said by Sp1d3rmxn, set these permissions, but, instead of using the command, set them in {{Filename|/etc/udev/rules.d/60-vboxdrv.rules}}, which will apply them on boot:<br />
KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="vboxusers", MODE="0660"<br />
KERNEL=="tun", OWNER="root", GROUP="vboxusers", MODE="0660"<br />
<br />
<br />
'''1.''' Create a new bridge with this command:<br />
# brctl addbr br0<br />
<br />
'''2.''' If you are not using DHCP, run ifconfig and note down the network configuration of your existing network interface (e.g. eth0), which will need to be copied to the bridge.<br />
<br />
{{Note|You will need this settings so make sure you do not lose them.}}<br />
<br />
'''3.''' Switch your physical network adapter to "promiscuous" mode so that it will accept Ethernet frames for MAC addresses other than its own (replace {{Codeline|eth0}} with your network interface):<br />
# ifconfig eth0 0.0.0.0 promisc <br />
<br />
{{Note | You will lose network connectivity on eth0 at this point.}}<br />
<br />
'''4.''' Add your network adapter to the bridge:<br />
# brctl addif br0 eth0<br />
<br />
'''5.''' Transfer the network configuration previously used with your physical ethernet adapter to the new bridge. If you are using DHCP, this should work:<br />
# dhclient br0<br />
<br />
'''Note''' by Sp1d3rmxn:<br />
:Use {{Codeline|"dhcpcd -t 30 -h yourhostname br0 &"}} instead of the above<br />
<br />
Otherwise, run {{Codeline|"ifconfig br0 x.x.x.x netmask x.x.x.x"}} and use the values that you noted down previously.<br />
<br />
'''6.''' To create a permanent host interface called vbox0 (all host interfaces created in this way must be called vbox followed by a number) and add it to the network bridge created above, use the following command:<br />
VBoxAddIF vbox0 vboxuser br0<br />
<br />
Replace {{Codeline|vboxuser}} with the name of the user who is supposed to be able to use the new interface.<br />
<br />
{{Note | VboxAddIF is located in /opt/VirtualBox-VERSION OF VIRTUALBOX/VBoxAddIF}}<br />
<br />
Alternatively, you can [http://mychael.gotdns.com/blog/2007/05/31/virtualbox-bridging/ setup VirtualBox networking] through your {{Filename|/etc/rc.conf}} to enable a bridged connection.<br />
<br />
====Using host interface networking with a wireless device====<br />
Bridging as described above will not work with a wireless device. Using [http://aur.archlinux.org/packages.php?ID=16356 parprouted] however it can be accomplished.<br />
<br />
# Install parprouted and iproute<br />
# {{Codeline|# ln -s /usr/sbin/ip /sbin/ip}}<br />
# Make sure IP fowarding is enabled: {{Codeline|# sysctl net.ipv4.ip_forward&#61;1}}, and/or edit {{Filename|/etc/sysctl.conf}}.<br />
# {{Codeline|# VBoxTunctl -b -u <user>}}, to create the tap device<br />
# {{Codeline|# ip link set tap0 up; ip addr add 192.168.0.X/24 dev tap0}}, needs to be a manually set IP on the same network your wireless device is.<br />
# {{Codeline|# parprouted wlan0 tap0}}<br />
<br />
===Getting USB to work in the guest machine===<br />
(Only available in the PUEL edition)<br />
<br />
{{Note|As of VirtualBox>2.2.4 this is no longer necessary to mount a usb filesystem.}}<br />
<br />
First in order to make USB available for use to the virtual machine you must add this line to your {{Filename|/etc/fstab}}:<br />
none /proc/bus/usb usbfs auto,busgid=108,busmode=0775,devgid=108,devmode=0664 0 0<br />
<br />
Then tell mount to reread {{Filename|/etc/fstab}}:<br />
# mount -a<br />
<br />
{{Codeline|108}} is is the id of the group which should be allowed to access USB-devices. Change it to the id of your vboxusers group. You can get the id by running:<br />
$ grep vboxusers /etc/group<br />
<br />
Restart Virtualbox and click the USB tab in the settings of the virtual machine and select which devices are available to your pc on boot. If you wish your virtual machine to use device that you have just plugged in (assuming the virtual machine has booted already), go to the VirtualMachine screen go to ''Devices &rarr; USB Devices'' and select the device you wish to plug in the virtual PC.<br />
<br />
'''Note''' by bjimba:<br />
<br />
Recent versions of VirtualBox, as noted above, do not require usbfs, however you will need the HAL daemon running if you do not use usbfs. See the [[HAL]] wiki page for details.<br />
<br />
===Installing Guest Additions===<br />
The Guest Additions make the shared folders feature available, as well as better video (3D available in version 2.1+) and mouse drivers. You will have mouse integration, thus no need to release the mouse after using it in the guest and one can also enable a bidirectional clipboard.<br />
<br />
{{Note | The instructions immediately below are for an Archlinux guest on an Archlinux host.}}<br />
<br />
After you booted the virtual machine, go to menu ''Devices &rarr; Install Guest Additions...'' Once you have clicked it, VirtualBox loads an ISO into the current CD-ROM, so you will not see anything happen yet.<br />
<br />
You will require gcc and make if you do not already have them so install them typing the following as root:<br />
# pacman -S gcc make <br />
<br />
If you are running arch in VirtualBox install the kernel headers<br />
# pacman -S kernel26-headers<br />
<br />
Then do the following as root:<br />
# mount /media/cdrom<br />
for i686 systems (32 bit):<br />
# sh /media/cdrom/VBoxLinuxAdditions-x86.run<br />
for x86-64 systems (64 bit):<br />
# sh /media/cdrom/VBoxLinuxAdditions-amd64.run<br />
<br />
It will build and install the kernel modules, install the Xorg drivers and create init scripts. It will most probably print out errors about init scripts and run levels and what not. Ignore them. You will find {{Filename|rc.vboxadd}} in /etc/rc.d which will load them on demand. To have the Guest Additions loaded at boot time, just add those to the DAEMONS array in {{Filename|/etc/rc.conf}} eg.:<br />
DAEMONS=(syslog-ng network netfs crond alsa '''rc.vboxadd''')<br />
<br />
Another option is to install one of these packages:<br />
# pacman -S virtualbox-additions<br />
or<br />
# pacman -S virtualbox-ose-additions<br />
<br />
You will then have an ISO to mount as a loop device. Remember to load the loop kernel module before:<br />
# modprobe loop<br />
# mount /usr/lib/virtualbox/additions/VBoxGuestAdditions.iso /media/cdrom -o loop<br />
<br />
Then execute {{Filename|VBoxLinuxAdditions.run}} as before. Before adding {{Filename|rc.vboxadd}} to DAEMONS check {{Filename|/etc/rc.local}} for commands to load the vboxadd daemons put by the installation script.<br />
<br />
'''Using full resolution of the host system in the guest'''<br />
<br />
Set the resolution of your guest in the grub boot script {{Filename|/boot/grub/menu.lst}}, i.e. add the correct vga code to the kernel command line.<br />
For a resolution of 1280x1024, this would e.g. look like<br />
# kernel /vmlinuz26 root=/dev/disk/by-uuid/7bdc5dee-8fb0-4260-bc43-60ac6e4e4a54 ro vga=795<br />
Add the resolution to {{Filename|/etc/X11/xorg.conf}}, e.g.<br />
<br />
# Section "Screen"<br />
# ...<br />
# SubSection "Display"<br />
# Viewport 0 0<br />
# Depth 24<br />
# Modes "1280x1024" "1024x768"<br />
# EndSubSection<br />
# ...<br />
# EndSection<br />
<br />
<br />
'''Windows Guests'''<br />
<br />
After installing Windows (XP etc.) on your virtual machine, simply select ''Devices &rarr; Install Guest Additions...''<br />
<br />
This will mount the iso image and windows should then automatically launch the guest additions installer. Follow the instructions to the end.<br />
<br />
===Sharing folders between the host and the guest===<br />
In the settings of the virtual machine go to shared folders tab and add the folders you want to share.<br />
<br />
*NOTE: You need to install Guest Additions in order to use this feature.<br />
In a Linux host, ''Devices &rarr; Install Guest Additions''<br />
Yes (when asked to download the CD image)<br />
Mount (when asked to register and mount)<br />
<br />
In a Linux host, create one folder for sharing files.<br />
<br />
In a Windows guest, starting with VirtualBox 1.5.0, shared folders are browseable and are therefore visible in Windows Explorer. Open Windows Explorer and look for it under ''My Networking Places &rarr; Entire Network &rarr; VirtualBox Shared Folders''.<br />
<br />
Alternatively, on the Windows command line, you can also use the following:<br />
net use x: \\VBOXSVR\sharename<br />
<br />
While {{Codeline|VBOXSVR}} is a fixed name, replace {{Codeline|x:}} with the drive letter that you want to use for the share, and sharename with the share name specified with VBoxManage.<br />
<br />
In a Windows guest, to improve loading and saving files (e.g. MS Office) by VirtualBox Shared Folders edit ''c:\windows\system32\drivers\etc\hosts'' as below:<br />
127.0.0.1 localhost vboxsvr<br />
<br />
In a Linux guest, use the following command:<br />
# mount -t vboxsf [-o OPTIONS] sharename mountpoint<br />
<br />
Replace {{Codeline|sharename}} with the share name specified with VBoxManage, and mountpoint with the path where you want the share to be mounted (e.g. /mnt/share). The usual mount rules apply, that is, create this directory first if it does not exist yet.<br />
<br />
Beyond the standard options supplied by the mount command, the following are available:<br />
iocharset=CHARSET<br />
to set the character set used for I/O operations (utf8 by default) and<br />
convertcp=CHARSET<br />
to specify the character set used for the shared folder name (utf8 by default).<br />
<br />
===Getting audio to work in the guest machine===<br />
<br />
In the machine settings, go to the audio tab and select the correct driver according to your sound system (ALSA, OSS or PulseAudio).<br />
<br />
===Setting up the RAM and Video Memory for the virtual PC===<br />
<br />
You can change the default values by going to ''Settings &rarr; General''.<br />
<br />
===Setting up CD-ROM for the Virtual PC===<br />
<br />
You can change the default values by going to ''Settings &rarr; CD/DVD-ROM''.<br />
<br />
Check mount CD/DVD drive and select one of the following options.<br />
<br />
'''Note:''' If no CD-ROM drive is detected, make sure the HAL daemon is running. To start it, run the following command as root:<br />
# /etc/rc.d/hal start<br />
<br />
===Enabling OpenGL acceleration in Arch Linux guests===<br />
Due to a bug in the VirtualBox guest addition setup scripts (as of VBox 3.1.2), simply ticking the "3D acceleration" checkbox in the virtual machine settings and installing the guest additions won't enable 3D acceleration for OpenGL applications under X for Arch Linux guests (and possibly others). In order to still get OpenGL acceleration, a bit of manual intervention is necessary after installing the guest additions. <br />
As root, run:<br />
ln -s /usr/lib/VBoxOGL.so /usr/lib/xorg/modules/dri/vboxvideo_dri.so<br />
ln -s /usr/lib/xorg/modules/dri /usr/lib/dri<br />
Also make sure the user starting X in the guest is in the '''video''' group.<br />
<br />
{{Note | Don't compare before-after performance using glxgears! You may get a lot less FPS due to now-working vsync support. Compare performance using a real, heavy 3D application (like a game).}}<br />
<br />
===Enabling D3D acceleration in Windows guests===<br />
Recent versions of Virtualbox have support for accelerating OpenGL inside guests. This can be enabled with a simple checkbox in the machine's settings, right below where video ram is set, and installing the Virtualbox guest additions. However, most Windows games use Direct3D (part of DirectX), not OpenGL, and are thus not helped by this method. However, it is possible to gain accelerated Direct3D in your Windows guests by borrowing the d3d libraries from Wine, which translate d3d calls into OpenGL, which is then accelerated. <br />
<br />
After enabling OpenGL acceleration as described above, go to http://www.nongnu.org/wined3d/ in your Windows guest and grab the "Latest version (Installer):". Reboot the guest into safe mode (press F8 before the Windows screen appears but after the Virtualbox screen disappears), and install wined3d, accepting the defaults during the install. (You may check the box for DirectX 10 support if you like, dont touch anything else.) Reboot back to normal mode and you should have accelerated Direct3D. <br />
<br />
{{Note | This hack may or may not work for some games depending on what hardware checks they make and what parts of D3D they use.}}<br />
{{Note | This has only been tried on Windows XP and Windows 7 RC guests AFAIK, and does not work on the Windows 7 guest. If you have experience with this on a different windows version, please add that data here.}}<br />
<br />
==Start VirtualBox==<br />
To start Virtualbox, run the following command in a terminal:<br />
$ VirtualBox<br />
<br />
Or in KDE menu, select: <System><Sun Virtualbox><br />
<br />
==Virtualized OS Setup==<br />
Virtualbox needs to be setup to virtualize another operating system.<br />
<br />
===Test a LiveCD/DVD===<br />
Click the 'New' button to create a new virtual environment. Name it appropriately and select Operating System type and version. Select base memory size (note: most operating systems will need at least 512MB to function properly). Create a new hard disk image (a hard disk image is a file that will contain the operating system's filesystem and files).<br />
<br />
When the new image has been created, click 'Settings', then CD/DVD-ROM, check 'Mount CD/DVD Drive' then select an ISO image.<br />
<br />
==Maintenance==<br />
<br />
===Rebuild the vboxdrv Module===<br />
Note that any time your kernel version changes (due to an upgrade, recompile, etc.) you must also rebuild the VirtualBox kernel modules.<br />
<br />
Ensure that ''kernel26-headers'' is still installed, and run the following command:<br />
# /etc/rc.d/vboxdrv setup<br />
This will build the VirtualBox kernel modules for the ''currently running kernel''; if you have just upgraded your kernel package, reboot before trying to rebuild your kernel modules.<br />
<br />
After rebuilding the module, do not forget to load it with<br />
# modprobe vboxdrv<br />
<br />
''vboxdrv'' and ''vboxnetflt'' should be in the MODULES=() section of your /etc/rc.conf<br />
<br />
This may have changed in recent VirtualBox packages, where the command is<br />
# vbox_build_module<br />
<br />
===Compact a Disk Image===<br />
See [http://my.opera.com/locksley90/blog/2008/06/01/how-to-compact-a-virtualbox-virtual-disk-image-vdi How to compact a VirtualBox virtual disk image (VDI)]<br />
<br />
===Windows Xp and Nokia phones===<br />
To get working Windows XP and Nokia phones with Pc Suite mode, Virtualbox needs two simple steps:<br />
<br />
'''1.''' Add a rule to udev with {{Filename|/etc/udev/rules.d/40-permissions.rules}}:<br />
LABEL="usb_serial_start"<br />
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", \<br />
GROUP="usbfs", MODE="0660", GROUP="dialout"<br />
LABEL="usb_serial_end"<br />
<br />
'''2.''' Create the group usbfs and add its user to it<br />
$ sudo groupadd usbfs<br />
$ sudo usermod -a -G usbfs $USER<br />
<br />
After a logout, connect a Nokia phone with PC Suite mode and start Windows XP to test new rule.<br />
<br />
==Migrating From Another VM==<br />
The <code>qemu-img</code> program can be used to convert images from one format to another, or add compression or encryption to an image. <br />
# pacman -S qemu<br />
<br />
===Converting from QEMU images===<br />
To convert a QEMU image for use with VirtualBox, first convert it to ''raw'' format, then use VirtualBox's conversion utility to convert and compact it in its native format.<br />
$ qemu-img convert -O raw test.qcow2 test.raw<br />
$ VBoxManage modifyvdi /full/path/to/test.vdi compact<br />
<br />
===Converting from VMware images ===<br />
Do <br />
$ VBoxManage clonehd source.vmdk target.vdi --format VDI<br />
<br />
This may not be needed anymore with recent virtualbox versions (to be confirmed)<br />
<br />
==Tips and Tricks==<br />
<br />
===Sending a CTRL+ALT+F1 to the Guest===<br />
If your guest O/S is a Linux distro, and you want to open a new tty text shell or exit X via typing {{Keypress|Ctrl}}+{{Keypress|Alt}}+{{Keypress|F1}}, you can easily send this command to the guest O/S simply by hitting your 'Host Key' (usually the {{Keypress|Ctrl}} in the Right side of your keyboard) + {{Keypress|F1}} or {{Keypress|F2}}, etc.<br />
<br />
===Speeding up HDD Access for the Guest===<br />
Enabling the SATA(AHCI) controller within Virtualbox can speed up Host disk operations. This is available though Settings>Hard Disks in current versions of Virtual Box.<br />
<br />
===Starting VMs at System Boot on Headless Servers===<br />
Add this line to /etc/rc.local<br />
exec /bin/su PREFERRED_USER -l -c "/bin/bash --login -c \"VBoxHeadless -startvm {UUID}\" >/dev/null 2>&1" &<br />
Where PREFERRED_USER is the user profile that contains the VM definitions and .vdi files. This will start the VM with a RDP server running on port 3389.<br />
To determine the available VMs for a user:<br />
su PREFERRED_USER -c "VBoxManage list vms"<br />
To suspend the VM:<br />
su PREFERRED_USER -c "VBoxManage controlvm {UUID} savestate"<br />
<br />
===Accessing Server on VM from Host===<br />
To access apache on a VM from the Host machine ONLY, simply execute the following lines on the Host:<br />
$ VBoxManage setextradata GuestName "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/HostPort" 8888<br />
$ VBoxManage setextradata GuestName "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/GuestPort" 80<br />
$ VBoxManage setextradata GuestName "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/Protocol" TCP<br />
Where 8888 is the port the host should listen on and 80 is the port the VM will send Apache's signal on. <br />
To use a port lower than 1024 on the host machine changes need to be made to the firewall on the host machine. This can also be set up to work with SSH, etc.. by changing "Apache" to whatever service and using different ports. <br />
<br />
Note: "pcnet" refers to the network card of the VM. If you use an Intel card in your VM settings change "pcnet" to "e1000"<br />
<br />
*from [http://mydebian.blogdns.org/?p=111 ]<br />
<br />
It might also be necessary to allow connections from the outside to the server in your VM. E.g. if the guest OS is Arch, you may want to add the line <br />
httpd: ALL<br />
to your /etc/hosts.allow file.<br />
<br />
===Daemon Tools===<br />
While VirtualBox can mount ISO images without a problem, there are some image formats which cannot reliably be converted to ISO. For instance, ccd2iso ignores .ccd and .sub files, which can give disk images with broken files. cdemu, fuseiso, and MagicISO will do the same. In this case there is no choice but to use Daemon Tools inside VirtualBox.<br />
<br />
Recent Daemon Tools versions won't install, so use this old one: [http://www.disc-tools.com/download/daemon347+hashcalc]<br />
<br />
==Running Arch Linux as a guest==<br />
To install guest additions with support for Xorg follow these steps:<br />
{{Note|Run the following steps as root}}<br />
* install entire xorg group: (is everything actually required?) <pre># pacman -S xorg</pre><br />
* install dependencies needed to build the guest additions: <pre># pacman -S kernel26-headers gcc make</pre><br />
* mount and install VirtualBox guest additions<br />
* create <tt>/etc/X11/xorg.conf</tt> with the following contents:<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "vboxmouse"<br />
Option "Device" "/dev/vboxguest"<br />
Option "CorePointer" "yes"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Card0"<br />
Driver "vboxvideo"<br />
EndSection<br />
* add <tt>hal</tt> to <tt>DAEMONS</tt> in <tt>rc.conf</tt> (not needed if you use X.org Server >= 1.8)<br />
{{Note|It is not required to add rc.vboxadd to DAEMONS because it is added to /etc/rc.local automatically}}<br />
{{Note|Run the following steps while logged into your user account}}<br />
* add <tt>/usr/bin/VBoxClient-all &</tt> to the top of <tt>~/.xinitrc</tt> (even if <tt>~/.xinitrc</tt> does not exist)<br />
<br />
==External Links==<br />
* [http://www.virtualbox.org/manual/UserManual.html VirtualBox User Manual]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Touchpad_Synaptics&diff=109215Touchpad Synaptics2010-06-21T08:37:08Z<p>VitaminJ: HAL policy movearound for Xorg server 1.8</p>
<hr />
<div>{{i18n|Touchpad Synaptics}}<br />
[[de:Synaptics Touchpad Treiber]]<br />
[[Category:Input devices (English)]][[Category:HOWTOs (English)]]<br />
This article details the installation and configuration process of the '''''Synaptics input driver''''' for Synaptics (and ALPS) touchpads found on most notebooks.<br />
<br />
==Installation==<br />
<br />
The Synaptics driver is now bundled as ''xf86-input-synaptics'', and is available in the [[Official_Repositories|[extra] repository]]:<br />
<br />
# pacman -S xf86-input-synaptics<br />
<br />
== Configuration ==<br />
<br />
Configuration for the touchpad should done by an Xorg server configuration file. As of Xorg server 1.8 configuration by HAL policy is deprecated.<br />
<br />
=== Xorg method ===<br />
<br />
Edit ''/etc/X11/xorg.conf'' as root and add '''InputDevice "Touchpad" "SendCoreEvents"''' to the ''ServerLayout'':<br />
<br />
Section "ServerLayout"<br />
...<br />
InputDevice "USB Mouse" "CorePointer"<br />
'''''InputDevice "SynapticsTouchpad" "SendCoreEvents"<br />
EndSection<br />
<br />
Add '''Load "synaptics"''' to the ''Module'' section:<br />
Section "Module"<br />
...<br />
Load "glx"<br />
Load "freetype"<br />
'''''Load "synaptics"'''''<br />
...<br />
EndSection<br />
<br />
Lastly, add a new ''InputDevice'' section for the touchpad itself. For example:<br />
<br />
Section "InputDevice"<br />
Identifier "SynapticsTouchpad"<br />
Driver "synaptics"<br />
Option "AlwaysCore" "true" # send events to CorePointer<br />
#Option "Device" "/dev/input/mice"<br />
Option "Device" "/dev/psaux"<br />
Option "Protocol" "auto-dev"<br />
Option "SHMConfig" "false" # configurable at runtime? security risk<br />
Option "LeftEdge" "1700" # x coord left<br />
Option "RightEdge" "5300" # x coord right<br />
Option "TopEdge" "1700" # y coord top<br />
Option "BottomEdge" "4200" # y coord bottom<br />
Option "FingerLow" "25" # pressure below this level triggers release<br />
Option "FingerHigh" "30" # pressure above this level triggers touch<br />
Option "MaxTapTime" "180" # max time in ms for detecting tap<br />
'''Option "VertEdgeScroll" "true" # enable vertical scroll zone'''<br />
'''Option "HorizEdgeScroll" "true" # enable horizontal scroll zone'''<br />
Option "CornerCoasting" "true" # enable continuous scroll with finger in corner<br />
Option "CoastingSpeed" "0.30" # corner coasting speed<br />
Option "VertScrollDelta" "100" # edge-to-edge scroll distance of the vertical scroll<br />
Option "HorizScrollDelta" "100" # edge-to-edge scroll distance of the horizontal scroll<br />
Option "MinSpeed" "0.10" # speed factor for low pointer movement<br />
Option "MaxSpeed" "0.60" # maximum speed factor for fast pointer movement<br />
Option "AccelFactor" "0.0020" # acceleration factor for normal pointer movements<br />
Option "VertTwoFingerScroll" "true" # vertical scroll anywhere with two fingers<br />
Option "HorizTwoFingerScroll" "true" # horizontal scroll anywhere with two fingers<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "2"<br />
Option "TapButton3" "3"<br />
EndSection<br />
<br />
The '''bold''' lines are important because users must now explicitly enable the side and bottom scroll zones of the touchpad. If you already had an InputDevice section configured for the old touchpad driver, you'll still need to add these two lines if you wish to use the scroll zones.<br />
<br />
To list '''all''' options in {{Filename|xorg.conf}} format, and their current values use this line:<br />
<br />
synclient -l | awk '/=/{printf "Option \"%s\" \"%s\"\n",$1,$3}'<br />
<br />
Save, exit and restart X. The touchpad should now have working scroll zones. You can further tweak the ''InputDevice'' settings if desired. See [[#Advanced_Configuration | Advanced Configuration]] for more information.<br />
<br />
Note that Xorg will automatically load the '''evdev''' and '''psmouse''' kernel modules required by Synaptics, however you may also add them explicitly to the MODULES array in the /etc/rc.conf file if desired.<br />
<br />
The syntax is similar to the HAL method, for instance:<br />
<br />
<merge key="input.x11_options.RightEdge" type="string">5300</merge><br />
<br />
equates to this Xorg configuration line:<br />
<br />
Option "RightEdge" "5300"<br />
<br />
For more read the man page and look at [[#Fine-tuning_with_synclient]]<br />
<br />
=== HAL policy (deprecated in favor of udev, /etc/X11/xorg.conf/10-synaptics.conf) ===<br />
<br />
With [[Xorg input hotplugging|hotplugging]] (enabled by default) and HAL installed and running, your Synaptics should work "out-of-the-box".<br />
<br />
If it doesn't or you want to tweak the configuration, you will need to edit the appropriate HAL policy file (XML format).<br />
Note that in this case.<br />
<br />
Copy '''/usr/share/hal/fdi/policy/10osvendor/11-x11-synaptics.fdi''' into '''/etc/hal/fdi/policy/'''<br />
cp /usr/share/hal/fdi/policy/10osvendor/11-x11-synaptics.fdi /etc/hal/fdi/policy/<br />
<br />
Now you can modify the new file appending new options.<br />
<br />
Here's a simple template to begin with, covering the more common features:<br />
<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<deviceinfo version="0.2"><br />
<device><br />
<match key="info.product" contains="Synaptics TouchPad"><br />
<!-- <match key="info.product" contains="AlpsPS/2 ALPS GlidePoint"> #ALPS users may need to use this instead of the above --><br />
<merge key="input.x11_driver" type="string">synaptics</merge><br />
<merge key="input.x11_options.AlwaysCore" type="string">true</merge><br />
<merge key="input.x11_options.VertEdgeScroll" type="string">true</merge><br />
<merge key="input.x11_options.HorizEdgeScroll" type="string">true</merge><br />
<merge key="input.x11_options.TapButton1" type="string">1</merge><br />
<merge key="input.x11_options.TapButton2" type="string">2</merge><br />
<merge key="input.x11_options.TapButton3" type="string">3</merge><br />
<merge key="input.x11_options.protocol" type="string">event</merge><br />
<merge key="input.x11_options.touchpadoff" type="string">0</merge><br />
<merge key="input.x11_options.shmconfig" type="string">on</merge><br />
</match><br />
</device><br />
</deviceinfo><br />
<br />
{{Box Note| In the .fdi file, every type must be "string" instead of "float" or "int" as per xorg.conf.}}<br />
{{Box Note| You might need to run '''/etc/rc.d/hal restart''' in order for the changes to take place.}}<br />
<br />
Here is a complete {{Filename|11-x11-synaptics.fdi}} configuration example. Do not use this example blindly. It is best practice to work from the default values ({{Codeline|synclient -l}}) and work from there. For more read the man page and look at [[#Fine-tuning_with_synclient]]:<br />
<br />
<pre><?xml version="1.0" encoding="ISO-8859-1"?><br />
<deviceinfo version="0.2"><br />
<device><br />
<br />
<!-- Type --><br />
<match key="info.capabilities" contains="input.touchpad"><br />
<match key="info.product" contains="Synaptics TouchPad"><br />
<merge key="input.x11_driver" type="string">synaptics</merge><br />
</match><br />
<br />
<!-- Values --><br />
<br />
<!-- Enable --><br />
<merge key="input.x11_options.TouchpadOff" type="string">0</merge><br />
<br />
<!-- Run-time Configuration Allow --><br />
<merge key="input.x11_options.SHMConfig" type="string">on</merge><br />
<br />
<!-- Edge Limits --><br />
<merge key="input.x11_options.LeftEdge" type="string">1478</merge><br />
<merge key="input.x11_options.RightEdge" type="string">5640</merge><br />
<merge key="input.x11_options.TopEdge" type="string">1274</merge><br />
<merge key="input.x11_options.ButtonEdge" type="string">4752</merge><br />
<br />
<!-- Speed --><br />
<merge key="input.x11_options.MinSpeed" type="string">0.4</merge><br />
<merge key="input.x11_options.MaxSpeed" type="string">0.7</merge><br />
<merge key="input.x11_options.AccelFactor" type="string">0.00995223</merge><br />
<br />
<!-- Pressure --><br />
<merge key="input.x11_options.FingerLow" type="string">24</merge><br />
<merge key="input.x11_options.FingerHigh" type="string">29</merge><br />
<merge key="input.x11_options.FingerPress" type="string">255</merge><br />
<br />
<!-- Tapping --><br />
<!-- Disable --><br />
<merge key="input.x11_options.MaxTapTime" type="string">0</merge><br />
<!-- Detect --><br />
<merge key="input.x11_options.MaxTapMove" type="string">29</merge><br />
<merge key="input.x11_options.MaxDoubleTapTime" type="string">255</merge><br />
<merge key="input.x11_options.SingleTapTimeout" type="string">180</merge><br />
<merge key="input.x11_options.ClickTime" type="string">100</merge><br />
<merge key="input.x11_options.FastTaps" type="string">0</merge><br />
<!-- Buttons (number of fingers) --><br />
<merge key="input.x11_options.TapButton1" type="string">1</merge><br />
<merge key="input.x11_options.TapButton2" type="string">2</merge><br />
<merge key="input.x11_options.TapButton3" type="string">3</merge><br />
<!-- Tap Dragging --><br />
<merge key="input.x11_options.LockedDrags" type="string">0</merge><br />
<merge key="input.x11_options.LockedDragTimeout" type="string">5000</merge><br />
<!-- Tap Gesture Dragging --><br />
<merge key="input.x11_options.TapAndDragGesture" type="string">0</merge><br />
<!-- Corner Tap Buttons --><br />
<merge key="input.x11_options.RTCornerButton" type="string">0</merge><br />
<merge key="input.x11_options.RBCornerButton" type="string">0</merge><br />
<merge key="input.x11_options.LTCornerButton" type="string">0</merge><br />
<merge key="input.x11_options.LBCornerButton" type="string">0</merge><br />
<br />
<!-- Scrolling --><br />
<!-- Vertical (Right Edge)--><br />
<merge key="input.x11_options.VertEdgeScroll" type="string">true</merge><br />
<merge key="input.x11_options.VerteScrollDelta" type="string">100</merge><br />
<!-- Horizontal (Bottom Edge)--><br />
<merge key="input.x11_options.HorizEdgeScroll" type="string">false</merge><br />
<merge key="input.x11_options.HorizScrollDelta" type="string">100</merge><br />
<!-- Circular Scrolling --><br />
<merge key="input.x11_options.CircularScrolling" type="string">false</merge><br />
<merge key="input.x11_options.CircScrollDelta" type="string">0.1</merge><br />
<merge key="input.x11_options.CircScrollTrigger" type="string">0</merge><br />
<!-- Two Finger --><br />
<merge key="input.x11_options.VertTwoFingerScroll" type="string">false</merge><br />
<merge key="input.x11_options.HorizTwoFingerScroll" type="string">false</merge><br />
<!-- Corner Coasting --><br />
<merge key="input.x11_options.CornerCoasting" type="string">false</merge><br />
<merge key="input.x11_options.CoastingSpeed" type="string">0</merge><br />
<br />
<!-- Other --><br />
<!-- Kernel Event Protocol --><br />
<merge key="input.x11_options.GrabEventDevice" type="string">1</merge><br />
<!-- Edge Ignore Boundaries --><br />
<merge key="input.x11_options.AreaLeftEdge" type="string">0</merge><br />
<merge key="input.x11_options.AreaRightEdge" type="string">0</merge><br />
<merge key="input.x11_options.AreaTopEdge" type="string">0</merge><br />
<merge key="input.x11_options.AreaBottomEdge" type="string">0</merge><br />
<!-- Trackstick --><br />
<merge key="input.x11_options.TrackstickSpeed" type="string">40</merge><br />
<!-- Circular Trackpad --><br />
<merge key="input.x11_options.CircularPad" type="string">0</merge><br />
<!-- Trackpad w/ Scroll Buttons --><br />
<merge key="input.x11_options.UpDownScrolling" type="string">1</merge><br />
<merge key="input.x11_options.LeftRightScrolling" type="string">1</merge><br />
<merge key="input.x11_options.UpDownScrollRepeat" type="string">1</merge><br />
<merge key="input.x11_options.LeftRightScrollRepeat" type="string">1</merge><br />
<merge key="input.x11_options.ScrollButtonRepeat" type="string">100</merge><br />
<!-- Multi-function Buttons --><br />
<merge key="input.x11_options.ClickFinger1" type="string">1</merge><br />
<merge key="input.x11_options.ClickFinger2" type="string">1</merge><br />
<merge key="input.x11_options.ClickFinger3" type="string">1</merge><br />
<!-- Edge Movements (Pressure and Speed) --><br />
<merge key="input.x11_options.EdgeMotionMinZ" type="string">29</merge><br />
<merge key="input.x11_options.EdgeMotionMaxZ" type="string">159</merge><br />
<merge key="input.x11_options.EdgeMotionMinSpeed" type="string">1</merge><br />
<merge key="input.x11_options.EdgeMotionMaxSpeed" type="string">401</merge><br />
<merge key="input.x11_options.EdgeMotionUseAlways" type="string">0</merge><br />
<!-- Pressure Motion --><br />
<merge key="input.x11_options.PressureMotionMinZ" type="string">29</merge><br />
<merge key="input.x11_options.PressureMotionMaxZ" type="string">159</merge><br />
<merge key="input.x11_options.PressureMotionMinFactor" type="string">1</merge><br />
<merge key="input.x11_options.PressureMotionMaxFactor" type="string">1</merge><br />
<!-- Emulations --><br />
<merge key="input.x11_options.EmulateMidButtonTime" type="string">75</merge><br />
<merge key="input.x11_options.EmulateTwoFingerMinZ" type="string">280</merge><br />
<merge key="input.x11_options.EmulateTwoFingerMinW" type="string">7</merge><br />
<!-- Palm Detection --><br />
<merge key="input.x11_options.PalmDetect" type="string">0</merge><br />
<merge key="input.x11_options.PalmMinWidth" type="string">10</merge><br />
<merge key="input.x11_options.PalmMinZ" type="string">199</merge><br />
<!-- Guest Mouse --><br />
<merge key="input.x11_options.GuestMouseOff" type="string">0</merge><br />
<br />
</match><br />
</device><br />
</deviceinfo></pre><br />
<br />
=== udev ===<br />
Same as HAL, but settings go in /etc/X11/xorg.conf/10-synaptics.conf instead of /etc/hal/fdi/policy/11-x11-synaptics.fdi. See http://andreascarpino.it/2010/04/xorg-1-8-synaptics-touchpad-configuration/.<br />
<br />
=== Advanced policy configuration ===<br />
<br />
The Synaptics driver allows for a vast amount of options to be tweaked. Luckily, all of them are consistently named and well documented in Synaptic's manpage.<br />
<br />
man synaptics<br />
<br />
==== Other products ====<br />
<br />
* ALPS users may try the following if the above does not work:<br />
<br />
<match key="info.product" contains="AlpsPS/2 ALPS"><br />
<merge key="input.x11_driver" type="string">synaptics</merge><br />
</match><br />
<br />
* Apple users with MacBook (1,1 2,1 etc...)<br />
<br />
<match key="info.product" contains="appletouch"><br />
<merge key="input.x11_driver" type="string">synaptics</merge><br />
</match><br />
<br />
* Apple users with latest MacBook (5,1)<br />
<br />
<match key="info.product" contains="bcm5974"><br />
<merge key="input.x11_driver" type="string">synaptics</merge><br />
</match><br />
<br />
{{Box Note| You can find the exact information for your touchpad in /proc/bus/input/devices.}}<br />
<br />
Or, if you find HAL is not loading your settings, try this template (the "append" child is necessary for some setups):<br />
<br />
<pre><br />
<?xml version="1.0" encoding="ISO-8859-1"?><br />
<deviceinfo version="0.2"><br />
<device><br />
<match key="info.product" contains="SynPS/2 Synaptics TouchPad"><br />
<append key="info.capabilities" type="strlist">input.touchpad</append><br />
</match><br />
<match key="info.capabilities" contains="input.touchpad"><br />
<merge key="input.x11_driver" type="string">synaptics</merge><br />
[...]<br />
</match><br />
</device><br />
</deviceinfo><br />
</pre><br />
<br />
==== ALPS Touchpads ====<br />
<br />
For ALPS Touchpads, if the above configuration does not provide the desired results, try the following configuration instead:<br />
<br />
Section "ServerLayout"<br />
...<br />
InputDevice "USB Mouse" "CorePointer"<br />
InputDevice "Touchpad" "SendCoreEvents"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Touchpad"<br />
Driver "synaptics"<br />
Option "Device" "/dev/input/mouse0"<br />
Option "Protocol" "auto-dev"<br />
Option "LeftEdge" "130"<br />
Option "RightEdge" "840"<br />
Option "TopEdge" "130"<br />
Option "BottomEdge" "640"<br />
Option "FingerLow" "7"<br />
Option "FingerHigh" "8"<br />
Option "MaxTapTime" "180"<br />
Option "MaxTapMove" "110"<br />
Option "EmulateMidButtonTime" "75"<br />
Option "VertScrollDelta" "20"<br />
Option "HorizScrollDelta" "20"<br />
Option "MinSpeed" "0.25"<br />
Option "MaxSpeed" "0.50"<br />
Option "AccelFactor" "0.010"<br />
Option "EdgeMotionMinSpeed" "200"<br />
Option "EdgeMotionMaxSpeed" "200"<br />
Option "UpDownScrolling" "1"<br />
Option "CircularScrolling" "1"<br />
Option "CircScrollDelta" "0.1"<br />
Option "CircScrollTrigger" "2"<br />
Option "SHMConfig" "on"<br />
Option "Emulate3Buttons" "on"<br />
EndSection<br />
<br />
==Advanced Configuration==<br />
<br />
===Input device options===<br />
<br />
There are a number of arbitrary parameters that can be tweaked for Synaptics touchpads. The following is a brief list of some of these options--see '''man synaptics''' for full details:<br />
<br />
{| class="wikitable" <br />
|-align="left"<br />
!+Option+<br />
!width=400|+Description+<br />
!width=200|+Type+<br />
|-<br />
|'''Device'''<br />
|Input device location. See [[#Troubleshooting | Troubleshooting]] to find your device handler if it isn't /dev/input/mouse0<br />
|String<br />
|-<br />
|'''MinSpeed'''<br />
|Minimum cursor speed<br />
|Decimal(float)<br />
|-<br />
|'''MaxSpeed'''<br />
|Maximum cursor speed<br />
|Decimal(float)<br />
|-<br />
|'''AccelFactor'''<br />
|Cursor Acceleration Factor<br />
|Decimal(float)<br />
|-<br />
|'''HorizScrollDelta'''<br />
|Horizontal [edge] scrolling speed(lower means faster)<br />
|Integer<br />
|-<br />
|'''VertScrollDelta'''<br />
|Vertical [edge] scrolling speed(lower means faster)<br />
|Integer<br />
|-<br />
|'''SHMConfig'''<br />
|height=100|Activation of shared memory(must be enabled for real-time configuration or [Disable touchpad upon external mouse detection| udev-based disabling]<br />
|Boolean<br />
|}<br />
<br />
===Gsynaptics===<br />
<br />
Once the touchpad is configured, users can also install the '''gsynaptics''' package from [community] to provide a GUI-based configuration solution for the device (note that it depends on libgnomeui):<br />
# pacman -S gsynaptics<br />
<br />
'''''Note:''' The '''gsynaptics''' web page [http://gsynaptics.sourceforge.jp/] indicates that it is becoming obsolete and users should consider '''GPointingDeviceSettings''' [http://live.gnome.org/GPointingDeviceSettings], currently available in AUR and as source code.''<br />
<br />
With hotplugging enabled(default), append this the match section of your 99-x11-synaptics.fdi or 11-x11-synaptics.fdi:<br />
<merge key="input.x11_options.SHMConfig" type="string">on</merge><br />
<br />
=== Fine-tuning with synclient ===<br />
<br />
The synclient monitor can display pressure and placement on the touchpad in real-time, allowing further refinement of the default Synaptics settings. In order for synclient to work properly, the '''SHMConfig''' option must be set to '''on''' or '''true'''.<br />
<br />
You can start the Synaptics monitor with the following command:<br />
$ synclient -m 100<br />
Where -m activates the monitor and the following number specifies the update interval in milliseconds.<br />
<br />
This monitor provides information about the current state of your touchpad. For example, if you move the mouse with the touchpad, the x and y values in the monitor will change. Therewith you can easy figure out your touchpad's dimension which is defined in the LeftEdge-, RightEdge-, BottomEdge- and TopEdge-Options.<br />
<br />
The abbreviations for the parameters are as follow:<br />
<br />
{| class="wikitable"<br />
|- align="left"<br />
!width="200"|+Abbreviation+<br />
!width="400|+Description+<br />
|-<br />
|'''time'''<br />
|Time in seconds since the logging was started.<br />
|-<br />
|'''x, y'''<br />
|The x/y coordinates of the finger on the touchpad. The origin is in the upper left corner.<br />
|-<br />
|'''z'''<br />
|The pressure value. It represents the pressure you are using to navigate on your touchpad.<br />
|-<br />
|'''f'''<br />
|Number of fingers currently touching the touchpad.<br />
|-<br />
|'''w'''<br />
|Value that represents the finger width.<br />
|-<br />
|'''l,r,u,d,m,multi'''<br />
|Those values represent the state of the left, right, up, down, middle and multi buttons pressed where zero means not pressed and one means pressed.<br />
|-<br />
|'''gl,gm,gr'''<br />
|For touchpads which have a guest device, this are the associated button states for guest left, guest middle and guest right pressed (1) and not pressed (0).<br />
|-<br />
|'''gdx, gdy'''<br />
|x/y coordinates of the guest device.<br />
|}<br />
If a value constantly is zero, it implies that this option is not supported by your device.<br />
<br />
Now use {{Codeline|synclient}} to test new values (SHMConfig will first need to be enabled to allow this). For example, to adjust minimum pointer speed:<br />
<br />
synclient MinSpeed=0.5<br />
<br />
The changes will not be permanent, they will need to be put in your HAL policy file or {{Filename|xorg.conf}} to make them so.<br />
<br />
===Edge scrolling===<br />
<br />
To enable the scroll zones found along the edges of the touchpad, add one or both of the following options to the touchpad device section in /etc/X11/xorg.conf:<br />
<br />
Section "InputDevice"<br />
...<br />
Option "VertEdgeScroll" "true" #vertical scrolling when dragging along the right edge.<br />
Option "HorizEdgeScroll" "true" #horizontal scrolling when dragging along the bottom edge.<br />
...<br />
EndSection<br />
<br />
In ''/etc/hal/fdi/policy/11-x11-synaptics.fdi''(or if that doesn't work, ''/etc/hal/fdi/policy/99-x11-synaptics.fdi) for [[#Configuration_via_HAL_policies_.28hotplugging_enabled.29 | Hotplugging]]:<br />
<match key="info.product" contains="Synaptics TouchPad"><br />
...<br />
<merge key="input.x11_options.HorizEdgeScroll" type="string">1</merge><br />
<merge key="input.x11_options.VertEdgeScroll" type="string">1</merge><br />
...<br />
</match><br />
<br />
===Two-Finger scrolling===<br />
<br />
Recent Synaptics touchpads support two-finger scrolling. This allows you to use two fingers together anywhere on the touchpad, similar to the behaviour of Macbooks.<br />
<br />
If your hardware supports this feature, you can enable it by inserting the following lines into the touchpad device section of /etc/X11/xorg.conf:<br />
Section "InputDevice"<br />
...<br />
Option "VertTwoFingerScroll" "true" # vertical scroll anywhere with two fingers<br />
Option "HorizTwoFingerScroll" "true" # horizontal scroll anywhere with two fingers<br />
Option "EmulateTwoFingerMinZ" "120" # this may vary between different machines<br />
...<br />
EndSection<br />
<br />
''EmulateTwoFingerMinZ'' is only necessary for the ALPS Touchpad, which several Dell machines have. ([http://ubuntuforums.org/showthread.php?t=516798&page=2#19 from Ubuntu forums]) <br />
<br />
'''Firefox users:''' You might find the default behaviour of Firefox pretty annoying relating to the horizontal scrolling. Just see ''Firefox and special touchpad events'' below to find out how to disable it.<br />
<br />
In '''/etc/hal/fdi/policy/11-x11-synaptics.fdi'''(or '''/etc/hal/fdi/policy/99-x11-synaptics.fdi''') for [[#Configuration_via_HAL_policies_.28hotplugging_enabled.29 | hotplugging]]:<br />
<match key="info.product" contains="Synaptics TouchPad"><br />
...<br />
<merge key="input.x11_options.VertTwoFingerScroll" type="string">1</merge><br />
<merge key="input.x11_options.HorizTwoFingerScroll" type="string">1</merge><br />
<merge key="input.x11_options.EmulateTwoFingerMinZ" type="string">120</merge><br />
...<br />
</match><br />
<br />
Some users might need to modify the ''EmulateTwoFingerMinW'' parameter, as their touch pads sense two fingers as one wide finger. You can check which parameters you need to modify by running '''synclient -m 150''' -- when you touch two fingers to the touch pad, observe which parameters (z, w, or f) change. Those will determine the minimum threshold values you must set (if f changes, don't bother with ''EmulateTwoFingerMin[W,Z]'' since you do not need to emulate two fingers, your touch pad can simply sense two different fingers). Depending on your touchpad, these parameters can take relatively high values or ones close to zero.<br />
<br />
===Circular scrolling===<br />
<br />
Circular scrolling is a feature that Synaptics offers which closely resembles the behaviour of iPods. Instead of (or additional to) scrolling horizontally or vertically, you can scroll circularly. Some users find this faster and more precise.<br />
To enable circular scrolling, add the following options to the touchpad device section of '''/etc/X11/xorg.conf''':<br />
Section "InputDevice"<br />
...<br />
Option "CircularScrolling" "on"<br />
Option "CircScrollTrigger" "0"<br />
...<br />
EndSection<br />
<br />
In '''/etc/hal/fdi/policy/11-x11-synaptics.fdi';'(or '''/etc/hal/fdi/policy/99-x11-synaptics.fdi''') for [[#Configuration_via_HAL_policies_.28hotplugging_enabled.29 | Hotplugging]]:<br />
<match key="info.product" contains="Synaptics TouchPad"><br />
...<br />
<merge key="input.x11_options.CircularScrolling" type="string">on</merge><br />
<merge key="input.x11_options.CircScrollTrigger" type="string">0</merge><br />
...<br />
</match><br />
<br />
The option '''CircScrollTrigger''' may be one of the following values, determining which edge circular scrolling should start:<br />
0 All Edges<br />
1 Top Edge<br />
2 Top Right Corner<br />
3 Right Edge<br />
4 Bottom Right Corner<br />
5 Bottom Edge<br />
6 Bottom Left Corner<br />
7 Left Edge<br />
8 Top Left Corner<br />
<br />
Specifying something different from zero may be useful if you want to use circular scrolling in conjunction with horizontal and/or vertical scrolling. If you do so, the type of scrolling is determined by the edge you start from.<br />
<br />
To scroll fast, draw small circles in the center of your touchpad. To scroll slowly and more precise, draw large circles.<br />
<br />
===Software Toggle===<br />
<br />
You may find it useful to have a software toggle that will turn on or off your touchpad, esplicially if it's extremely sensitive and your doing a lot of typing. Please also see [[#Disable touchpad upon external mouse detection]] and [[#Stopping the mouse from clicking while typing]] as those may be better solutions, again a matter of choice. The advantage here is you have the control, while the other solutions have daemons determine when to turn off the trackpad.<br />
<br />
You will want to grab [[xbindkeys]] if you don't already have key binding software.<br />
<br />
Then save this script to something such as /sbin/trackpad-toggle.sh:<br />
<br />
#!/bin/bash<br />
<br />
if [ `synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }'` -eq 0 ]; then<br />
synclient TouchpadOff=1<br />
else<br />
synclient TouchpadOff=0<br />
fi<br />
<br />
Then finally add a key binding to use the script. It is best to call with xbindkeys like so (file ''~/.xbindkeysrc''):<br />
<br />
"/sbin/trackpad-toggle.sh"<br />
m:0x5 + c:65<br />
Control+Shift + space<br />
<br />
Now just (re)start xbindkeys and ctrl+Shift+Space will now toggle your trackpad !<br />
<br />
Of course you could easily use any other keybinding software, such as the ones provided by Xfce4 and Gnome.<br />
<br />
==Troubleshooting==<br />
<br />
===Touchpad not working properly in Gnome (No tap zones, scrolling etc.)===<br />
<br />
Settings in /etc/hal/fdi/policy/11-x11-synaptics.fdi are not respected by Gnome. Gnome uses its own inferior mouse control plugin in the gnome-settings-daemon. <br />
<br />
If you only need to enable tapping, edge scrolling or two finger scrolling, you can use the settings tool in ''System->Preferences->Mouse->Touchpad'' to enable this in Gnome, but this will not allow you to define touchpad size, tap zones, tap sensitivity, etc.<br />
<br />
If you need or want more control of the touchpad settings, you are out of luck using the built-in settings apps in ''System->Preferences->Mouse->Touchpad'', as it is only good for setting a fraction of the availibe options. There is no other way of controlling the gnome mouse plugin either (at least that I know of).If you need more control over the touchpad settings, the best solution is probably to disable the plugin alltogether. The system will then use the settings in /etc/hal/fdi/policy/11-x11-synaptics.fdi correctly.<br />
<br />
To disble the gnome settings daemons mouse plugin, you launch gconf-editor, navigate to apps/gnome_settings_daemon/plugins/mouse/ and un-tick the "activate" box. Changes takes affect after a restart of gdm.<br />
<br />
===Synaptics Special Ability===<br />
<br />
By default, Synaptics touchpads are able to detect the number of fingers on the touchpad; ALPS touchpads are not. If the touchpad is tapped with two fingers, it will emulate a middle click. If the touchpad is typed with three fingers, a right click will be emulated.<br />
<br />
===Disable touchpad upon external mouse detection===<br />
<br />
In assistance to [[udev]], it is possible to automatically disable the touchpad if an external mouse has been plugged in. To achieve this, add the following udev rule to '''/etc/udev/rules.d/01-touchpad.rules''':<br />
ACTION=="add", SUBSYSTEM=="input", ENV{ID_CLASS}="mouse", RUN+="/usr/bin/synclient TouchpadOff=1"<br />
ACTION=="remove", SUBSYSTEM=="input", ENV{ID_CLASS}="mouse", RUN+="/usr/bin/synclient TouchpadOff=0"<br />
<br />
SHMConfig must be enabled (see the '''Configuration''' section for details)<br />
<br />
===Cursor Jump===<br />
<br />
Some users have their cursor inexplicably ''jump'' around the screen. There currently no patch for this, but the developers are aware of the problem and are working on it.<br />
<br />
===Multitouch===<br />
<br />
Multitouch gesture like in Mac OS X will be in future version of the driver.<br />
<br />
===Touchpad device isn't located at /dev/input/mouse0===<br />
<br />
If that's the case, you can use this command to display information about your input devices:<br />
cat /proc/bus/input/devices<br />
Search for an input device which has the name "SynPS/2 Synaptics TouchPad". The "Handlers" section of the output specifies what device you need to specify.<br />
<br />
'''Example output:'''<br />
I: Bus=0011 Vendor=0002 Product=0007 Version=0000<br />
N: Name="SynPS/2 Synaptics TouchPad"<br />
P: Phys=isa0060/serio4/input0<br />
S: Sysfs=/class/input/input1<br />
H: Handlers=mouse0 event1<br />
B: EV=b<br />
B: KEY=6420 0 7000f 0<br />
<br />
In this case, the Handlers are mouse0 and event1, so /dev/input/mouse0 would be used.<br />
<br />
=== Disable Trackpad while Typing ===<br />
<br />
There are two approaches on how run this command depending on your setup. But first you will need to have SHMConfig enable in your HAL policy ({{Filename|/etc/hal/fdi/policy/11-x11-synaptics.fdi}}), or {{Filename|/etc/xorg.conf}}. Some users may need to specify touchpad preferences in {{Filename|/etc/hal/fdi/policy/99-x11-synaptics.fdi}} instead.<br />
<br />
==== Using {{Filename|.xinitrc}} ====<br />
<br />
To have the touchpad disabled automatically when you begin typing, add the following line to your .xinitrc before you run your window manager (if not using a login manager):<br />
<br />
syndaemon -i 2 &<br />
<br />
The '''-i 2''' switch sets the idle time to 2 seconds. The idle time specifies how many seconds to wait after the last key-press before enabling the touchpad again.<br />
<br />
If you wish, you can add the '''-t''' switch that tells the daemon not to disable mouse movement when typing and only disable tapping and scrolling:<br />
<br />
syndaemon -t -i 2 &<br />
<br />
More details are available in the man page:<br />
<br />
$ man syndaemon<br />
<br />
If you are using a login manager, you will need to specify the command where your DE allows you to do so.<br />
<br />
==== Using a Login Manager ====<br />
<br />
The "-d" option is necessary to start syndaemon as a background process for post Login instructions.<br />
<br />
'''For GNOME: (GDM)'''<br />
<br />
To start syndaemon you need to use Gnome's Startup Applications Preferences program. Login to Gnome and go to '''System > Preferences > Startup Applications'''. In the Startup Programs tab click the '''Add''' button. Name the Startup Program whatever you like and input any comments you like (or leave this field blank). In the command field add:<br />
<br />
syndaemon -i 2 -d<br />
<br />
When you're done click the Add button in the Add Startup Program dialogue. Make sure the check box next to the startup program you've created is checked, in the list of additional startup programs. Close the Startup Applications Preferences window and you're done.<br />
<br />
'''For KDE: (KDM)'''<br />
<br />
Goto '''System Settings > Advanced Tab > Autostart''', then click '''Add Program''', enter:<br />
<br />
syndaemon -i 2 -d<br />
<br />
Then check 'Run in terminal'.<br />
<br />
===Firefox and special touchpad events===<br />
<br />
By default, Firefox is set up to do special events upon tapping or scrolling certain parts of your touchpad.<br />
You can edit the settings of those actions by typing '''about:config''' in your Firefox address bar.<br />
To alter these options, double-click on the line in question, changing "true" to "false" and vise versa.<br />
<br />
To prevent Firefox from scrolling (backward/forward) through browser history and instead scroll through pages, edit these settings as shown:<br />
mousewheel.horizscroll.withnokey.action = 1<br />
mousewheel.horizscroll.withnokey.sysnumlines = true<br />
<br />
To prevent Firefox from redirecting you to URLs formed from your clipboard content upon tapping the upper-right corner of your touchpad (or middle mouse button), set the following option to "false":<br />
middlemouse.contentLoadURL = false<br />
<br />
===Opera: horizontal scrolling issues===<br />
<br />
Same as above.<br />
To fix it, go to Tools -> Preferences -> Advanced -> Shortcuts. There you edit the mouse preferences: Delete the entries with "Button 5" and "Button 6".<br />
<br />
===Scrolling and multiple actions with Synaptics on LG Laptops===<br />
<br />
These problems seem to be occurring on several models of LG laptops.<br />
Symptoms include: when pressing Mouse Button 1, Synaptics interprets it as ScrollUP and a regular button 1 click; same goes for button 2.<br />
<br />
The scrolling issue can be resolved by entering in xorg.conf:<br />
Option "UpDownScrolling" "0"<br />
<br />
NOTE that this will make Synaptics interpret one button push as three. There is a patch written by Oskar Sandberg[http://www.math.chalmers.se/~ossa/linux/lg_tx_express.html] that removes these clicks.<br />
<br />
Apparently, when trying to compile this against the latest version of Synaptics it fails. The solution to this is using the GIT repository for Synaptics[http://web.telia.com/~u89404340/touchpad/synaptics/.git] .<br />
<br />
There is also a package build file in the AUR to automate this: [http://aur.archlinux.org/packages.php?ID=15983].<br />
<br />
To build the package after downloading the tarball and unpacking it, execute:<br />
cd synaptics-git<br />
makepkg<br />
<br />
If you want it to be automatically installed after being built, just add '-i' after makepkg.<br />
<br />
===Other external mouse issues===<br />
<br />
First, make sure your section describing the external mouse contains this line (or that the line looks like this):<br />
<br />
Option "Device" "/dev/input/mice"<br />
<br />
If the "Device" line is different, change it to the above and try to restart X. If this doesn't solve your problem, make your '''touchpad''' the CorePointer in the "Server Layout" section:<br />
<br />
InputDevice "Touchpad" "CorePointer"<br />
<br />
and make your external device "SendCoreEvents":<br />
<br />
InputDevice "USB Mouse" "SendCoreEvents"<br />
<br />
finally add this to your external device's section:<br />
<br />
Option "SendCoreEvents" "true"<br />
<br />
If all of the above doesn't work for you, please check relevant bug trackers for possible bugs, or go through the forums to see if anyone has found a better solution.<br />
<br />
===Touchpad synchronization issues===<br />
<br />
Sometimes the cursor may freeze for several seconds or start acting on its own for no apparent reason. This behavior is accompanied by records in /var/log/messages.log<br />
<br />
psmouse.c: TouchPad at isa0060/serio1/input0 lost synchronization, throwing 3 bytes away<br />
<br />
This problem has no general solution, but there are several possible workarounds.<br />
*If you use CPU frequency scaling, avoid using the "ondemand" governor and use the "performance" governor when possible, as the touchpad may lose sync when the CPU frequency changes.<br />
*Avoid using an ACPI battery monitor.<br />
*Attempt to load psmouse with "proto=imps" option. To do that, add this line to your /etc/modprobe.conf:<br />
<br />
options psmouse proto=imps<br />
<br />
*Try another desktop environment. Some users report that this problem only occurs when using XFCE or GNOME, for whatever reason<br />
<br />
===Tapping issues===<br />
<br />
If you are not using [[Xorg input hotplugging]], you should know that Xorg v7.4 does not enable tapping by default. To enable it, add the following line to the touchpad's InputDevice section in <tt>/etc/X11/xorg.conf</tt>:<br />
<br />
Section "InputDevice"<br />
...<br />
Option "TapButton1" "''integer''"<br />
Option "TapButton2" "''integer''"<br />
Option "TapButton3" "''integer''"<br />
...<br />
EndSection<br />
The ''integer'' of option "TapButton1" means which mouse button is reported on a non-corner one-finger tap. Usually it is 1.<br />
The ''integer'' of option "TapButton2" means which mouse button is reported on a non-corner two-finger tap. Usually it is 2.<br />
The ''integer'' of option "TapButton3" means which mouse button is reported on a non-corner three-finger tap. Usually it is 3.<br />
<br />
===Delay between a button tap and the actual click===<br />
<br />
If you experience a delay between the tap on the touchpad and the actual click that is registered you need to enable FastTaps:<br />
<br />
If you're using input hotplugging(default behavior), change your 11-x11-synaptics.fdi(or 99-x11-synaptics.fdi, in some cases) so that it contains:<br />
<br />
<merge key="input.x11_options.FastTaps" type="string">1</merge><br />
<br />
If you're using xorg-server with disabled input hotplugging change xorg.conf so that you have:<br />
<br />
Section "InputDevice"<br />
Identifier "Synaptics Touchpad"<br />
Driver "synaptics"<br />
...<br />
Option "FastTaps" "1"<br />
...<br />
EndSection<br />
<br />
===SynPS/2 Synaptics TouchPad can't grab event device, errno=16===<br />
<br />
If you are using Xorg 7.4, you may get a warning like this from /var/log/Xorg.0.log, thais is because the driver will grab the event device for exclusive use when using the Linux 2.6 event protocol. When it fails, X will return this error message.<br />
<br />
Grabbing the event device means that no other user space or kernel space program sees the touchpad events. This is desirable if the X config file includes /dev/input/mice as an input device, but is undesirable if you want to monitor the device from user space.<br />
<br />
If you want to control it, add or modify the "GrabEventDevice" option in you touchpad section in xorg.conf:<br />
<br />
...<br />
Option "GrabEventDevice" "''boolean''"<br />
...<br />
<br />
This will come into effect when X is restarted, though you can also change it by using synclient. When changing this parameter with the synclient program, the change will not take effect until the Synaptics driver is disabled and re-enabled. This can be achieved by switching to a text console and then switching back to X.<br />
<br />
==External Resources==<br />
<br />
Synaptics TouchPad driver: [http://cgit.freedesktop.org/xorg/driver/xf86-input-synaptics/]<br />
<!-- vim: set ft=Wikipedia: --></div>VitaminJhttps://wiki.archlinux.org/index.php?title=Preload&diff=105976Preload2010-05-08T12:52:45Z<p>VitaminJ: Add link to readahead, a similar piece of software.</p>
<hr />
<div>'''preload''' is a program written by Behdad Esfahbod which runs<br />
as a [[daemon]] and records statistics about usage of programs using<br />
Markov chains; files of more frequently-used programs are, during a<br />
computer's spare time, loaded into memory. This results in faster<br />
startup times as less data needs to be fetched from disk. preload is<br />
often paired with [[prelink]].<br />
<br />
==Installation==<br />
preload is available through pacman. In Arch Linux, just issue the command:<br />
<br />
<pre># pacman -S preload</pre><br />
<br />
Start directly with<br />
<br />
<pre># /etc/rc.d/preload start</pre><br />
<br />
To start preload at system boot, add it to the DAEMONS section in [[rc.conf|/etc/rc.conf]]:<br />
<br />
<pre>DAEMONS =(... preload ...)</pre><br />
<br />
==Configuration==<br />
<br />
The configuration file is <code>/etc/preload.conf</code>, it contains<br />
default settings that should be suitable for regular<br />
users. Unfortunately the default settings do not cover applications<br />
that are installed in /opt, if you have applications there, add them<br />
using <code>mapprefix</code> and <code>exeprefix</code>. The<br />
<code>cycle</code> option lets you configure how often to ping the<br />
preload system to update its model of which applications and libraries<br />
to cache.<br />
<br />
==See also==<br />
* http://en.wikipedia.org/wiki/Preload_(software)<br />
* http://techthrob.com/2009/03/02/drastically-speed-up-your-linux-system-with-preload/<br />
* [[Readahead]]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Talk:Pm-utils&diff=101966Talk:Pm-utils2010-04-06T14:23:06Z<p>VitaminJ: </p>
<hr />
<div>Any way to get synaptics driver to function properly after such restart? -- dpc, 18 Jul 2008<br />
:I have only suspended-to-disk once, and I had to rmmod and modprobe appletouch, so maybe add the touchpad module to SUSPEND_MODULES? I'm just learning this as well. When I work out hibernation, I'll come back and fix this. -- thegnu, 10 Nov 08<br />
*A little elaboration of the relationship between pm-utils, uswsusp, and hibernate-script would be really useful to clear up confusion --[[User:VitaminJ|VitaminJ]] 10:23, 6 April 2010 (EDT)</div>VitaminJhttps://wiki.archlinux.org/index.php?title=File_recovery&diff=100640File recovery2010-03-19T22:25:17Z<p>VitaminJ: Add raw disk section, and recovering NTFS partitions.</p>
<hr />
<div>[[Category:HOWTOs (English)]]<br />
[[Category:Networking (English)]]<br />
<br />
==Preface/Introduction==<br />
===Page Overview===<br />
This article is meant to capture several file recovery or undelete options for [[Arch Linux]]. Please contribute to this page using the general format below and keeping it brief.<br />
===Special Notes===<br />
====Failing Drives====<br />
In the arena of data recovery, it is best to work on images of disks rather than the physical disks themselves. Generally, a failing drive's condition worsens over time. The goal ought to be to copy as much data as possible as early as possible, and to then abandon the disk. The dd_rescue utility (ddrescue in repos), unlike dd will repeatedly try to recover from errors, and will read the drive front to back, then back to front, attempting to salvage data. It keeps a log file so that you can pause and resume recovery without losing your progress.<br />
<br />
See [[Disk Cloning]].<br />
<br />
The image files created from a utility like ddrescue can then be mounted like a physical device and can be worked on safely. Always make a copy of the original image so that you can revert if things go sour!<br />
<br />
A tried and true method of improving failing drive reads is to keep it cold. A bit of time in the freezer is appropriate, but be careful to avoid bringing the drive from cold to warm too quickly, as condensation will form. Keeping the drive in the freezer with cables connected to the recovering PC works great.<br />
<br />
Do not attempt a filesystem check on a failing drive, as this will likely make the problem '''worse'''. Keep it read-only.<br />
====Backup Flash Media/Small Partitions====<br />
As an alternative to working with a 'live' partition (mounted or not), it is often preferable to work with an image provided that the filesystem in question isn't too large and that you have sufficient free HDD space to accommodate the image file. For example, flash memory devices like, thumb drives, digital cameras, portable music players, cellular phones, etc. <br />
<br />
Be sure to read the man pages for the utilities listed below to verify that they are capable of working with an image file.<br />
<br />
To make an image, one can use dd as follows:<br />
# dd if=/dev/target_partition of=/home/user/partition.image<br />
<br />
====Working with Digital Cameras====<br />
In order for some of the utils listed in the next section to work with flash media, one needs to have the device in question mounted as a block device (i.e. it is listed under /dev). Digital cameras operating in PTP (Picture Transfer Protocol) mode will not work in this regard. PTP cameras are transparently handled by libgphoto and/or libptp. Transparently as in, they don't get a block device. The alternative to PTP mode is USB Mass Storage (UMS) mode which may or may not be supported by your camera. Some cameras will have a menu item allowing the user to switch between the two modes; refer to your camera's user manual. If your camera does not support UMS mode and therefore cannot be accessed as a block device, your only alternative is to use a flash media reader and physically remove the media from your camera.<br />
<br />
==Foremost==<br />
===Description===<br />
'''Foremost''' is a console program to recover files based on their headers, footers, and internal data structures. This process is commonly referred to as data carving. Foremost can work on image files, such as those generated by dd, Safeback, Encase, etc, or directly on a drive. The headers and footers can be specified by a configuration file or you can use command line switches to specify built-in file types. These built-in types look at the data structures of a given file format allowing for a more reliable and faster recovery. <br />
===Installation===<br />
'''Foremost''' is available from the [[AUR]] in [http://aur.archlinux.org/packages.php?ID=2014 this page].<br />
===External Links===<br />
*Wiki: <br />
*Homepage: http://foremost.sourceforge.net<br />
<br />
==Photorec==<br />
===Description===<br />
'''Photorec''' is a complementary utility to '''TestDisk'''; both open-source data recovery utilities licensed under the terms of the [http://www.gnu.org/licenses/gpl.html GNU Public License] (GPL). '''Photorec''' is file data recovery software designed to recover lost files including video, documents and archives from Hard Disks and CDRom and lost pictures (thus, its 'Photo Recovery' name) from digital camera memory. PhotoRec ignores the filesystem and goes after the underlying data, so it will still work even if your media's filesystem has been severely damaged or re-formatted.<br />
<br />
===Installation===<br />
Both '''TestDisk''' and '''Photorec''' are available for Arch i686 and x64_86 in the same package.<br />
# pacman -S testdisk<br />
<br />
===External Links===<br />
*Wiki (Photorec): http://www.cgsecurity.org/wiki/PhotoRec<br />
*Homepage: http://www.cgsecurity.org/<br />
<br />
==Testdisk==<br />
===Description===<br />
'''TestDisk''', like '''Photorec''' are both open-source data recovery utilities licensed under the terms of the [http://www.gnu.org/licenses/gpl.html GNU Public License] (GPL). '''TestDisk''' is primarily designed to help recover lost partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software, certain types of viruses or human error (such as accidentally deleting a Partition Table).<br />
<br />
===Installation===<br />
Both '''TestDisk''' and '''Photorec''' are available for Arch i686 and x64_86 in the same package.<br />
# pacman -S testdisk<br />
<br />
===External Links===<br />
*Wiki (TestDisk): http://www.cgsecurity.org/wiki/TestDisk<br />
*Homepage: http://www.cgsecurity.org/<br />
<br />
==e2fsck==<br />
===Description===<br />
'''e2fsck''', is the ext2/ext3 filesystem checker included in the base install of Arch. e2fsck relies on a valid superblock. A superblock is a description of the entire filesystem's parameters. Because this data is so important, several copies of the superblock are distributed amongst the partition data. e2fsck can take an alternate superblock argument if the main (first) superblock is damaged (use the -b option).<br />
<br />
To determine where the superblocks are, run dumpe2fs -h on the affected, unmounted partition. Superblocks are spaced differently depending on the blocksize specified when the ext2/ext3 filesystem was created.<br />
<br />
An alternate method to determine superblocks is to use the -n option with mke2fs. Be '''sure''' to use the -n flag, which "causes mke2fs to not actually create a filesystem, but display what it would do if it were to create a filesystem. This can be used to determine the location of the backup superblocks for a particular filesystem."<br />
<br />
===Installation===<br />
'''e2fsck''' and '''dumpe2fs''' are included in the base Arch i686 and x64_86 install.<br />
<br />
===External Links===<br />
*e2fsck man page: http://phpunixman.sourceforge.net/index.php/man/e2fsck/8<br />
*dumpe2fs man page: http://phpunixman.sourceforge.net/index.php?parameter=dumpe2fs&mode=man<br />
<br />
==Working with Raw Disk Images==<br />
If you backed up a drive using ddrescue or dd, and you need to mount this image as a physical drive, then look no further!<br />
===Mount the Entire Disk===<br />
In progress.<br />
===Mounting Partitions===<br />
Before you can work with the partitions and filesystems in a raw disk image, you must know where things are inside the image. See the next section for this.<br />
====Getting Disk Geometry====<br />
After mounting the entire disk image as a loopback device, you can inspect it for it's drive layout.<br />
===Using QEMU to Repair NTFS===<br />
Say you have a disk image that contains one or more NTFS partitions, and you need to run Windows chkdsk to fix the filesystem. QEMU let's you use a raw dd or ddrescue image as a real hard disk inside a virtual machine.<br />
# qemu -hda /path/to/primary.img -hdb /path/to/damagedDisk.img</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Disk_cloning&diff=100638Disk cloning2010-03-19T22:16:15Z<p>VitaminJ: Add note about BS= matching HD cache</p>
<hr />
<div>[[Category:System recovery (English)]]<br />
[[Category:Utilities (English)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Disk cloning}}<br />
{{i18n_entry|Русский|Клонирование Диска}}<br />
{{i18n_entry|Türkçe|Disk Klonlama}}<br />
{{i18n_entry|Italiano|Disk cloning (Italiano)}}<br />
{{i18n_links_end}}<br />
<br />
Disk cloning is the process of making an image of a partition or an entire hard drive. This can be useful both for copying the drive to other computers and for backup/recovery purposes.<br />
<br />
===Using dd===<br />
The dd command is a simple, yet versatile and powerful tool. It can be used to copy from source to destination, block-by-block, regardless of their filesystem types or operating systems. A convenient method is to use dd from a live environment, as in a livecd.<br />
{{Warning|As with any command of this type, you should be very cautious when using it; it can destroy data. Remember the order of input file <nowiki>(if=) and output file (of=) and do not reverse them! Always ensure that the destination drive or partition (of=) is of equal or greater size than the source (if=).</nowiki>}}<br />
====Cloning a partition====<br />
From physical disk /dev/sda, partition 1, to physical disk /dev/sdb, partition 1.<br />
dd if=/dev/sda1 of=/dev/sdb1 bs=4096 conv=notrunc,noerror<br />
If output file '''''of''''' (sdb1 in the example) does not exist, dd will start at the beginning of the disk and create it. <br />
<br />
====Cloning an entire hard disk====<br />
From physical disk /dev/sda to physical disk /dev/sdb<br />
dd if=/dev/sda of=/dev/sdb bs=4096 conv=notrunc,noerror<br />
This will clone the entire drive, including MBR (and therefore bootloader), all partitions and data.<br />
*''notrunc'' or 'do not truncate' maintains data integrity by instructing dd not to truncate any data. <br />
*''noerror'' instructs dd to continue operation, ignoring all input errors. Default behavior for dd is to hault at any error. <br />
*''bs=4096'' sets the block size to 4k, an optimal size for hard disk read/write efficiency and therefore, cloning speed. <br />
<br />
====Backing up the MBR====<br />
<br />
The MBR is stored in the the first 512 bytes of the disk. It consist of 3 parts:<br />
#The first 446 bytes contain the boot loader.<br />
#The next 64 bytes contain the partition table (4 entries of 16 bytes each, one entry for each primary partition).<br />
#The last 2 bytes contain an identifier<br />
<br />
To save the MBR into the file "mbr.img":<br />
# dd if=/dev/hda of=/mnt/sda1/mbr.img bs=512 count=1<br />
<br />
To restore (be careful : this could destroy your existing partition table and with it access to all data on the disk):<br />
# dd if=/mnt/sda1/mbr.img of=/dev/hda<br />
<br />
If you only want to restore the boot loader, but not the primary partition table entries, just restore the first 446 bytes of the MBR: <br />
# dd if=/mnt/sda1/mbr.img of=/dev/hda bs=446 count=1. <br />
<br />
To restore only the partition table, one must use <br />
# dd if=/mnt/sda1/mbr.img of=/dev/hda bs=1 skip=446 count=64".<br />
<br />
You can also get the MBR from a full dd disk image.<br />
#dd if=/path/to/disk.img of=/mnt/sda1/mbr.img bs=512 count=1<br />
<br />
====Create disk image====<br />
1. Boot from a liveCD or liveUSB.<br />
<br />
2. Make sure no partitions are mounted from the source hard drive.<br />
<br />
3. Mount the external HD<br />
<br />
4. Backup the drive. <br />
# dd if=/dev/hda conv=sync,noerror bs=64K | gzip -c > /mnt/sda1/hda.img.gz<br />
<br />
5. Save extra information about the drive geometry necessary in order to interpret the partition table stored within the image. The most important of which is the cylinder size. <br />
# fdisk -l /dev/hda > /mnt/sda1/hda_fdisk.info<br />
<br />
'''NOTE:''' You may wish to use a block size (bs=) that is equal to the amount of cache on the HD you are backing up. For example, bs=8192K works for an 8MB cache. The 64K mentioned in this article is better than the default bs=512 bytes, but it will run faster with a larger bs=.<br />
<br />
====Restore system====<br />
<br />
To restore your system:<br />
# gunzip -c /mnt/sda1/hda.img.gz | dd of=/dev/hda<br />
===Using cp===<br />
The cp program can be used to clone a disk, one partition at a time. An advantage to using cp is that the filesystem type of the destination partition(s) may be the same or different than the source. For safety, perform the process from a live environment.<br />
<br />
The basic procedure from a live environment will be:<br />
* Create the new destination partition(s) (using fdisk, cfdisk or other tools available in the live environment.<br />
* Create a filesystem on each of the newly created partitions. Example:<br />
mkfs -t ext3 /dev/sdb1<br />
* Mount the source and destination partitions. Example:<br />
mount -t ext3 /dev/sda1 /mnt/source<br />
mount -t ext3 /dev/sdb1 /mnt/destination<br />
* Copy the files from the source partition to the destination <br />
cp -a /mnt/source /mnt/destination<br />
'''-a''': preserve permissions, never follow symbolic links and copy recursively <br />
* Change the mount points of the newly cloned partitions in /etc/fstab accordingly<br />
* Finally, install the GRUB bootloader if necessary. (See [[GRUB]])<br />
<br />
==Disk cloning software==<br />
===Disk cloning in Arch===<br />
The ncurses program [http://en.wikipedia.org/wiki/Partimage PartImage] is in the community repos. The interface is not exceptionally intuitive but it works. There are currently no GTK/QT based disk cloners for Linux. Another option is to use dd, a small CLI image/file creation utility. The wikipedia has a list of various version of dd, specifically oriented to this purpose [http://en.wikipedia.org/wiki/Dd_(Unix)#Recovery-oriented_variants_of_dd]. [http://www.garloff.de/kurt/linux/ddrescue/ dd_rescue] works efficiently with corrupt disks copying error free areas first and later retrying error areas.<br />
<br />
===Disk cloning outside of Arch===<br />
If you wish to backup or propagate your Arch install root, you are probably better off booting into something else and clone the partition from there. Some suggestions:<br />
<br />
* [http://partedmagic.com/wiki/PartedMagic.php PartedMagic] has a very nice live cd/usb with PartImage and other recovery tools.<br />
* [http://www.mondorescue.org/ Mindi] is a linux distribution specifically for disk clone backup. It comes with its own cloning program, Mondo Rescue.<br />
* [http://en.wikipedia.org/wiki/Acronis_True_Image Acronis True Image] is a commercial disk cloner for Windows. It allows you to create a live cd (from within Windows), so you do not need a working Windows install on the actual machine to use it.<br />
* [http://www.fsarchiver.org/Main_Page FSArchiver] allows you to save the contents of a file system to a compressed archive file. Can be found on the [http://www.sysresccd.org/Main_Page System Rescue CD].<br />
* [http://clonezilla.org/ Clonezilla] is an enhanced partition imager which can also restore entire disks as well as partitions.<br />
<br />
<br />
<br />
==External Links==<br />
* [http://en.wikipedia.org/wiki/List_of_disk_cloning_software Wikipedia entry on Disk cloning]<br />
* [http://prasetyams.net/2008/05/19/keeping-track-of-your-linuxs-evolution/ A simple method using an Arch cd and tar] (404 as of 2009-05-23)<br />
* [http://bbs.archlinux.org/viewtopic.php?id=4329 Arch Linux forum thread]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Disk_cloning&diff=100637Disk cloning2010-03-19T21:39:08Z<p>VitaminJ: Get MBR from dd image</p>
<hr />
<div>[[Category:System recovery (English)]]<br />
[[Category:Utilities (English)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Disk cloning}}<br />
{{i18n_entry|Русский|Клонирование Диска}}<br />
{{i18n_entry|Türkçe|Disk Klonlama}}<br />
{{i18n_entry|Italiano|Disk cloning (Italiano)}}<br />
{{i18n_links_end}}<br />
<br />
Disk cloning is the process of making an image of a partition or an entire hard drive. This can be useful both for copying the drive to other computers and for backup/recovery purposes.<br />
<br />
===Using dd===<br />
The dd command is a simple, yet versatile and powerful tool. It can be used to copy from source to destination, block-by-block, regardless of their filesystem types or operating systems. A convenient method is to use dd from a live environment, as in a livecd.<br />
{{Warning|As with any command of this type, you should be very cautious when using it; it can destroy data. Remember the order of input file <nowiki>(if=) and output file (of=) and do not reverse them! Always ensure that the destination drive or partition (of=) is of equal or greater size than the source (if=).</nowiki>}}<br />
====Cloning a partition====<br />
From physical disk /dev/sda, partition 1, to physical disk /dev/sdb, partition 1.<br />
dd if=/dev/sda1 of=/dev/sdb1 bs=4096 conv=notrunc,noerror<br />
If output file '''''of''''' (sdb1 in the example) does not exist, dd will start at the beginning of the disk and create it. <br />
<br />
====Cloning an entire hard disk====<br />
From physical disk /dev/sda to physical disk /dev/sdb<br />
dd if=/dev/sda of=/dev/sdb bs=4096 conv=notrunc,noerror<br />
This will clone the entire drive, including MBR (and therefore bootloader), all partitions and data.<br />
*''notrunc'' or 'do not truncate' maintains data integrity by instructing dd not to truncate any data. <br />
*''noerror'' instructs dd to continue operation, ignoring all input errors. Default behavior for dd is to hault at any error. <br />
*''bs=4096'' sets the block size to 4k, an optimal size for hard disk read/write efficiency and therefore, cloning speed. <br />
<br />
====Backing up the MBR====<br />
<br />
The MBR is stored in the the first 512 bytes of the disk. It consist of 3 parts:<br />
#The first 446 bytes contain the boot loader.<br />
#The next 64 bytes contain the partition table (4 entries of 16 bytes each, one entry for each primary partition).<br />
#The last 2 bytes contain an identifier<br />
<br />
To save the MBR into the file "mbr.img":<br />
# dd if=/dev/hda of=/mnt/sda1/mbr.img bs=512 count=1<br />
<br />
To restore (be careful : this could destroy your existing partition table and with it access to all data on the disk):<br />
# dd if=/mnt/sda1/mbr.img of=/dev/hda<br />
<br />
If you only want to restore the boot loader, but not the primary partition table entries, just restore the first 446 bytes of the MBR: <br />
# dd if=/mnt/sda1/mbr.img of=/dev/hda bs=446 count=1. <br />
<br />
To restore only the partition table, one must use <br />
# dd if=/mnt/sda1/mbr.img of=/dev/hda bs=1 skip=446 count=64".<br />
<br />
You can also get the MBR from a full dd disk image.<br />
#dd if=/path/to/disk.img of=/mnt/sda1/mbr.img bs=512 count=1<br />
<br />
====Create disk image====<br />
<br />
1) Boot from a liveCD or liveUSB.<br />
<br />
2) Make sure no partitions are mounted from the source hard drive.<br />
<br />
3) Mount the external HD<br />
<br />
4) Backup the drive. <br />
# dd if=/dev/hda conv=sync,noerror bs=64K | gzip -c > /mnt/sda1/hda.img.gz<br />
<br />
5) Save extra information about the drive geometry necessary in order to interpret the partition table stored within the image. The most important of which is the cylinder size. <br />
# fdisk -l /dev/hda > /mnt/sda1/hda_fdisk.info<br />
<br />
====Restore system====<br />
<br />
To restore your system:<br />
# gunzip -c /mnt/sda1/hda.img.gz | dd of=/dev/hda<br />
===Using cp===<br />
The cp program can be used to clone a disk, one partition at a time. An advantage to using cp is that the filesystem type of the destination partition(s) may be the same or different than the source. For safety, perform the process from a live environment.<br />
<br />
The basic procedure from a live environment will be:<br />
* Create the new destination partition(s) (using fdisk, cfdisk or other tools available in the live environment.<br />
* Create a filesystem on each of the newly created partitions. Example:<br />
mkfs -t ext3 /dev/sdb1<br />
* Mount the source and destination partitions. Example:<br />
mount -t ext3 /dev/sda1 /mnt/source<br />
mount -t ext3 /dev/sdb1 /mnt/destination<br />
* Copy the files from the source partition to the destination <br />
cp -a /mnt/source /mnt/destination<br />
'''-a''': preserve permissions, never follow symbolic links and copy recursively <br />
* Change the mount points of the newly cloned partitions in /etc/fstab accordingly<br />
* Finally, install the GRUB bootloader if necessary. (See [[GRUB]])<br />
<br />
==Disk cloning software==<br />
===Disk cloning in Arch===<br />
The ncurses program [http://en.wikipedia.org/wiki/Partimage PartImage] is in the community repos. The interface is not exceptionally intuitive but it works. There are currently no GTK/QT based disk cloners for Linux. Another option is to use dd, a small CLI image/file creation utility. The wikipedia has a list of various version of dd, specifically oriented to this purpose [http://en.wikipedia.org/wiki/Dd_(Unix)#Recovery-oriented_variants_of_dd]. [http://www.garloff.de/kurt/linux/ddrescue/ dd_rescue] works efficiently with corrupt disks copying error free areas first and later retrying error areas.<br />
<br />
===Disk cloning outside of Arch===<br />
If you wish to backup or propagate your Arch install root, you are probably better off booting into something else and clone the partition from there. Some suggestions:<br />
<br />
* [http://partedmagic.com/wiki/PartedMagic.php PartedMagic] has a very nice live cd/usb with PartImage and other recovery tools.<br />
* [http://www.mondorescue.org/ Mindi] is a linux distribution specifically for disk clone backup. It comes with its own cloning program, Mondo Rescue.<br />
* [http://en.wikipedia.org/wiki/Acronis_True_Image Acronis True Image] is a commercial disk cloner for Windows. It allows you to create a live cd (from within Windows), so you do not need a working Windows install on the actual machine to use it.<br />
* [http://www.fsarchiver.org/Main_Page FSArchiver] allows you to save the contents of a file system to a compressed archive file. Can be found on the [http://www.sysresccd.org/Main_Page System Rescue CD].<br />
* [http://clonezilla.org/ Clonezilla] is an enhanced partition imager which can also restore entire disks as well as partitions.<br />
<br />
<br />
<br />
==External Links==<br />
* [http://en.wikipedia.org/wiki/List_of_disk_cloning_software Wikipedia entry on Disk cloning]<br />
* [http://prasetyams.net/2008/05/19/keeping-track-of-your-linuxs-evolution/ A simple method using an Arch cd and tar] (404 as of 2009-05-23)<br />
* [http://bbs.archlinux.org/viewtopic.php?id=4329 Arch Linux forum thread]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Redmine_setup&diff=93630Redmine setup2010-01-26T00:19:50Z<p>VitaminJ: Cleanup separation between MySQL and SQLite</p>
<hr />
<div>[[Category:Development (English)]][[Category:HOWTOs (English)]]<br />
== Introduction ==<br />
This article explains how to install Redmine, an open-source web-based project management and bug-tracking tool, on Arch Linux. For this article, MySQL(with C bindings provided by the 'mysql' gem) are used.<br />
<br />
== Preparation ==<br />
== Package and Gem version Overview ==<br />
The following packages are used at the time of this [re]writing:<br />
<pre><br />
ruby 1.8 <- the PKGBUILD should edited to include 'rails=2.3.5' in the Provides array(more below)<br />
rubygems 1.8<br />
mysql 5.1.42<br />
apache 2.2.14<br />
redmine-mysql-git-20100124<br />
<br />
(gems)<br />
rake 0.8.3<br />
rack 1.0.1<br />
rails 2.3.5<br />
mysql 2.8.1<br />
</pre><br />
<br />
== Ruby 1.8 Environment ==<br />
As Redmine doesn't support ruby 1.9, we need to use the older 1.8 from AUR instead. Remove the "ruby" package(if you have it installed), so that it doesn't conflict, and retrieve and build the packages w any way you're comfortable with.<br />
<pre><br />
pacman -R ruby<br />
yaourt -S ruby1.8<br />
yaourt -S rubygems1.8<br />
<br />
# ruby1.8 installs ruby-1.8 executable. link it to "ruby":<br />
cd /usr/bin<br />
ln -s /usr/bin/ruby-1.8 /usr/bin/ruby<br />
<br />
# (optional) link gem-1.8 to gem<br />
ln -s /usr/biin/gem-1.8 /usr/bin/gem<br />
<br />
# and retrieve the gems<br />
gem install rake -v=0.8.3<br />
gem install rack -v=1.0.1<br />
gem install rails -v=2.3.5<br />
</pre><br />
<br />
== Installing Databases ==<br />
Redmine can work with MySQL 4.1 or higher, PortageSQL 8 or SQLite 3.<br />
<br />
=== MySQL ===<br />
Install MySQL:<br />
pacman -S mysql<br />
For full installation and configuration tutorial see [[MySQL]].<br />
Install the MySQL gem:<br />
gem install mysql -v=2.8.1<br />
<br />
Start MySQL:<br />
sudo /etc/rc.d/mysqld start<br />
<br />
Create database and user for redmine to use:<br />
<pre><br />
mysql -u root -p<br />
create database redmine character set utf8;<br />
create user 'redmine'@'localhost' identified by 'YOUR_PASSWORD';<br />
grant all privileges on redmine.* to 'redmine'@'localhost';<br />
</pre><br />
=== SQLite3 ===<br />
Install SQLite<br />
pacman -S sqlite3<br />
<br />
SQLite is actually not a standalone application like most databases. Instead it is a C library that is linked to by the executable that is using it. Therefore, you need to point to the SQLite source to install the ruby gem.<br />
gem install sqlite3-ruby --with-sqlite3-include=/usr/include --with-sqlite3-lib=/usr/lib<br />
<br />
== Configure Redmine to Talk to your DB ==<br />
'''For MySQL'''<br />
<pre><br />
production:<br />
adapter: mysql<br />
database: redmine<br />
host: localhost<br />
username: redmine<br />
password: YOUR_PASSWORD<br />
encoding: utf8<br />
</pre><br />
'''For SQLite'''<br />
<pre><br />
production:<br />
adapter: sqlite3<br />
dbfile: db/redmine.db<br />
</pre><br />
If you used a different database name or username in section [[Redmine_setup#Database_Preparation]] make sure to change them here as well.<br />
== Create the Default Redmine DB Structure ==<br />
Run the following command inside redmine root directory:<br />
<pre><br />
rake db:migrate RAILS_ENV=production<br />
</pre><br />
<br />
This will create the database tables and the following admin account:<br />
<pre><br />
Username: admin<br />
Password: admin<br />
</pre><br />
<br />
Now we need to populate the database with default information. Run the following:<br />
<pre><br />
rake redmine:load_deafault_data RAILS_ENV=production<br />
</pre><br />
<br />
== Running Redmine ==<br />
=== Using WEBrick Server ===<br />
Run the WEBrick server:<br />
<pre><br />
scripts/server -e production<br />
</pre><br />
<br />
Now navigate to:<br />
<pre><br />
http://MY_HOSTNAME_OR_IP:3000/<br />
</pre><br />
<br />
If everything went fine, you should be able to see the main page of Redmine.<br />
You should login with default admin account and configure your new redmine. Don't forget to change admin's password.<br />
<br />
=== Using Apache Web Server(CGI) ===<br />
Install apache according to [[Apache]].<br />
<br />
Make sure that Redmine works fine with the WEBrick server.<br />
Copy redmine directory content to /srv/http/ (or any other directory you use for your server):<br />
<pre><br />
sudo mkdir /srv/http/redmine/<br />
sudo cp -r * /srv/http/redmine/<br />
</pre><br />
(The last command assumes you are inside /opt/redmine directory).<br />
<br />
'''Note:''' All other commands assume that you are inside the /srv/http/redmine/ folder (or any other folder you decided to use for your server).<br />
<br />
Copy ''dispatch.cgi.example'' file:<br />
<pre><br />
cp public/dispatch.cgi.example public/dispatch.cgi<br />
</pre><br />
<br />
Give ''dispatch.cgi'' execute permission:<br />
<pre><br />
chmod 775 public/dispatch.cgi<br />
</pre><br />
<br />
Uncomment the following line from ''config/environment.rb'':<br />
<pre><br />
ENV['RAILS_ENV'] ||= 'production'<br />
</pre><br />
<br />
Edit ''/etc/httpd/conf/httpd.conf'' by adding the following:<br />
<pre><br />
<VirtualHost *:80><br />
ServerName YOUR-DOMAIN<br />
ServerAdmin webmaster@<YOUR-DOMAIN>.com<br />
DocumentRoot /srv/http/redmine/public/<br />
ErrorLog logs/redmine_error_log<br />
<br />
<Directory "/srv/http/redmine/public/"><br />
Options Indexes ExecCGI FollowSymLinks<br />
Order allow,deny<br />
Allow from all<br />
AllowOverride all<br />
</Directory><br />
</VirtualHost><br />
</pre><br />
<br />
Give the ''http'' user and group the ability to read/write the following folders:<br />
<pre><br />
chown -R http.http files log tmp vendor<br />
</pre><br />
<br />
Restart apache:<br />
<pre><br />
sudo /etc/rc.d/httpd restart<br />
</pre><br />
<br />
Surf to your server and check if it works.<br />
Notice that most likely it will work slower then with WEBrick server, so if there is not special need to run redmine on apache I personally suggest to use WEBrick Server.<br />
<br />
=== Apache w/ Phusion Passenger ===<br />
The CGI method described earlier is a bit slower than WEBrick server, so here I am going to describe another method by installing apache module called Phusion Passenger (also known as mod rails) similar to python module you probably used when installed [[Trac]].<br />
The basic idea was borrowed from [http://blog.samsonis.me/2009/06/redmine-on-archlinux/ Samson's Weblog].<br />
<br />
==== Module Setup ====<br />
<pre><br />
# install passenger<br />
gem install passenger<br />
<br />
# install the apache2 module<br />
passenger-install-apache2-module<br />
</pre><br />
This will guide you through the module compilation and installation.<br />
'''Note the settings it will show you in the end. They are important.'''<br />
<br />
==== Apache Configuration ====<br />
<br />
<pre><br />
# using ''/srv/http'' as the server root dir, make a symbolic link to the redmine/public dir<br />
ln -s /path/to/redmine-0.8.5/public /srv/http/redmine<br />
</pre><br />
'''Important:''' Make sure you make a link to the '''public''' directory of redmine!<br />
<br />
Now edit '''/etc/httpd/conf/httpd.conf''''' and add the following (again, make sure you use the directories that ''passenger-install-apache2-module'' gave you):<br />
<pre><br />
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/ext/apache2/mod_passenger.so<br />
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5<br />
PassengerRuby /usr/lib/ruby<br />
</pre><br />
<br />
And add this:<br />
<pre><br />
<VirtualHost *:80><br />
# server DocumentRoot, address, and admin email<br />
<br />
RailsBaseURI /redmine #<- We add this, if you named your symbolic link differently write it here<br />
</VirtualHost><br />
</pre><br />
<br />
'''NOTE''': you need to restart Apache(if it was running) for the changes to take effect<br />
<br />
Verify that everything is setup correctly by going to http://MY-SERVER-IP-ADDRESS/redmine.<br />
<nowiki>Insert non-formatted text here</nowiki><br />
<br />
== Resources ==<br />
* [http://blog.samsonis.me/2009/06/redmine-on-archlinux/ Samson's Weblog describing installation of Redmine on Arch Linux]<br />
* [http://www.redmine.org/wiki/redmine/RedmineInstall Official Redmine Installation]<br />
* [http://www.redmine.org/wiki/1/HowTo_configure_Apache_to_run_Redmine Configuring Apache to run Redmine]<br />
* [http://www.redmine.org/boards/2/topics/2768 Installing Redmine with SQLite]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Redmine_setup&diff=93629Redmine setup2010-01-26T00:15:45Z<p>VitaminJ: MySQL and SQLite broken into sections</p>
<hr />
<div>[[Category:Development (English)]][[Category:HOWTOs (English)]]<br />
== Introduction ==<br />
This article explains how to install Redmine, an open-source web-based project management and bug-tracking tool, on Arch Linux. For this article, MySQL(with C bindings provided by the 'mysql' gem) are used.<br />
<br />
== Preparation ==<br />
== Package and Gem version Overview ==<br />
The following packages are used at the time of this [re]writing:<br />
<pre><br />
ruby 1.8 <- the PKGBUILD should edited to include 'rails=2.3.5' in the Provides array(more below)<br />
rubygems 1.8<br />
mysql 5.1.42<br />
apache 2.2.14<br />
redmine-mysql-git-20100124<br />
<br />
(gems)<br />
rake 0.8.3<br />
rack 1.0.1<br />
rails 2.3.5<br />
mysql 2.8.1<br />
</pre><br />
<br />
== Ruby 1.8 Environment ==<br />
As Redmine doesn't support ruby 1.9, we need to use the older 1.8 from AUR instead. Remove the "ruby" package(if you have it installed), so that it doesn't conflict, and retrieve and build the packages w any way you're comfortable with.<br />
<pre><br />
pacman -R ruby<br />
yaourt -S ruby1.8<br />
yaourt -S rubygems1.8<br />
<br />
# ruby1.8 installs ruby-1.8 executable. link it to "ruby":<br />
cd /usr/bin<br />
ln -s /usr/bin/ruby-1.8 /usr/bin/ruby<br />
<br />
# (optional) link gem-1.8 to gem<br />
ln -s /usr/biin/gem-1.8 /usr/bin/gem<br />
<br />
# and retrieve the gems<br />
gem install rake -v=0.8.3<br />
gem install rack -v=1.0.1<br />
gem install rails -v=2.3.5<br />
</pre><br />
<br />
=== Database Preparation ===<br />
Redmine can work with MySQL 4.1 or higher, PortageSQL 8 or SQLite 3.<br />
==== MySQL ====<br />
Install the MySQL gem:<br />
gem install mysql -v=2.8.1<br />
<br />
Install MySQL by typing:<br />
pacman -S mysql<br />
For full installation and configuration tutorial see [[MySQL]].<br />
<br />
Start MySQL:<br />
sudo /etc/rc.d/mysqld start<br />
<br />
Create database and user for redmine to use:<br />
<pre><br />
mysql -u root -p<br />
create database redmine character set utf8;<br />
create user 'redmine'@'localhost' identified by 'YOUR_PASSWORD';<br />
grant all privileges on redmine.* to 'redmine'@'localhost';<br />
</pre><br />
==== SQLite3 ====<br />
Install SQLite<br />
pacman -S sqlite3<br />
<br />
SQLite is actually not a standalone application like most databases. Instead it is a C library that is linked to by the executable that is using it. Therefore, you need to point to the SQLite source to install the ruby gem.<br />
gem install sqlite3-ruby --with-sqlite3-include=/usr/include --with-sqlite3-lib=/usr/lib<br />
<br />
'''For MySQL'''<br />
<pre><br />
production:<br />
adapter: mysql<br />
database: redmine<br />
host: localhost<br />
username: redmine<br />
password: YOUR_PASSWORD<br />
encoding: utf8<br />
</pre><br />
'''For SQLite'''<br />
<pre><br />
production:<br />
adapter: sqlite3<br />
dbfile: db/redmine.db<br />
</pre><br />
If you used a different database name or username in section [[Redmine_setup#Database_Preparation]] make sure to change them here as well.<br />
== Create the Database Structure ==<br />
Run the following command inside redmine root directory:<br />
<pre><br />
rake db:migrate RAILS_ENV=production<br />
</pre><br />
<br />
This will create the database tables and the following admin account:<br />
<pre><br />
Username: admin<br />
Password: admin<br />
</pre><br />
<br />
Now we need to populate the database with default information. Run the following:<br />
<pre><br />
rake redmine:load_deafault_data RAILS_ENV=production<br />
</pre><br />
<br />
== Running Redmine ==<br />
=== Using WEBrick Server ===<br />
Run the WEBrick server:<br />
<pre><br />
scripts/server -e production<br />
</pre><br />
<br />
Now navigate to:<br />
<pre><br />
http://MY_HOSTNAME_OR_IP:3000/<br />
</pre><br />
<br />
If everything went fine, you should be able to see the main page of Redmine.<br />
You should login with default admin account and configure your new redmine. Don't forget to change admin's password.<br />
<br />
=== Using Apache Web Server(CGI) ===<br />
Install apache according to [[Apache]].<br />
<br />
Make sure that Redmine works fine with the WEBrick server.<br />
Copy redmine directory content to /srv/http/ (or any other directory you use for your server):<br />
<pre><br />
sudo mkdir /srv/http/redmine/<br />
sudo cp -r * /srv/http/redmine/<br />
</pre><br />
(The last command assumes you are inside /opt/redmine directory).<br />
<br />
'''Note:''' All other commands assume that you are inside the /srv/http/redmine/ folder (or any other folder you decided to use for your server).<br />
<br />
Copy ''dispatch.cgi.example'' file:<br />
<pre><br />
cp public/dispatch.cgi.example public/dispatch.cgi<br />
</pre><br />
<br />
Give ''dispatch.cgi'' execute permission:<br />
<pre><br />
chmod 775 public/dispatch.cgi<br />
</pre><br />
<br />
Uncomment the following line from ''config/environment.rb'':<br />
<pre><br />
ENV['RAILS_ENV'] ||= 'production'<br />
</pre><br />
<br />
Edit ''/etc/httpd/conf/httpd.conf'' by adding the following:<br />
<pre><br />
<VirtualHost *:80><br />
ServerName YOUR-DOMAIN<br />
ServerAdmin webmaster@<YOUR-DOMAIN>.com<br />
DocumentRoot /srv/http/redmine/public/<br />
ErrorLog logs/redmine_error_log<br />
<br />
<Directory "/srv/http/redmine/public/"><br />
Options Indexes ExecCGI FollowSymLinks<br />
Order allow,deny<br />
Allow from all<br />
AllowOverride all<br />
</Directory><br />
</VirtualHost><br />
</pre><br />
<br />
Give the ''http'' user and group the ability to read/write the following folders:<br />
<pre><br />
chown -R http.http files log tmp vendor<br />
</pre><br />
<br />
Restart apache:<br />
<pre><br />
sudo /etc/rc.d/httpd restart<br />
</pre><br />
<br />
Surf to your server and check if it works.<br />
Notice that most likely it will work slower then with WEBrick server, so if there is not special need to run redmine on apache I personally suggest to use WEBrick Server.<br />
<br />
=== Apache w/ Phusion Passenger ===<br />
The CGI method described earlier is a bit slower than WEBrick server, so here I am going to describe another method by installing apache module called Phusion Passenger (also known as mod rails) similar to python module you probably used when installed [[Trac]].<br />
The basic idea was borrowed from [http://blog.samsonis.me/2009/06/redmine-on-archlinux/ Samson's Weblog].<br />
<br />
==== Module Setup ====<br />
<pre><br />
# install passenger<br />
gem install passenger<br />
<br />
# install the apache2 module<br />
passenger-install-apache2-module<br />
</pre><br />
This will guide you through the module compilation and installation.<br />
'''Note the settings it will show you in the end. They are important.'''<br />
<br />
==== Apache Configuration ====<br />
<br />
<pre><br />
# using ''/srv/http'' as the server root dir, make a symbolic link to the redmine/public dir<br />
ln -s /path/to/redmine-0.8.5/public /srv/http/redmine<br />
</pre><br />
'''Important:''' Make sure you make a link to the '''public''' directory of redmine!<br />
<br />
Now edit '''/etc/httpd/conf/httpd.conf''''' and add the following (again, make sure you use the directories that ''passenger-install-apache2-module'' gave you):<br />
<pre><br />
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/ext/apache2/mod_passenger.so<br />
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5<br />
PassengerRuby /usr/lib/ruby<br />
</pre><br />
<br />
And add this:<br />
<pre><br />
<VirtualHost *:80><br />
# server DocumentRoot, address, and admin email<br />
<br />
RailsBaseURI /redmine #<- We add this, if you named your symbolic link differently write it here<br />
</VirtualHost><br />
</pre><br />
<br />
'''NOTE''': you need to restart Apache(if it was running) for the changes to take effect<br />
<br />
Verify that everything is setup correctly by going to http://MY-SERVER-IP-ADDRESS/redmine.<br />
<nowiki>Insert non-formatted text here</nowiki><br />
<br />
== Resources ==<br />
* [http://blog.samsonis.me/2009/06/redmine-on-archlinux/ Samson's Weblog describing installation of Redmine on Arch Linux]<br />
* [http://www.redmine.org/wiki/redmine/RedmineInstall Official Redmine Installation]<br />
* [http://www.redmine.org/wiki/1/HowTo_configure_Apache_to_run_Redmine Configuring Apache to run Redmine]<br />
* [http://www.redmine.org/boards/2/topics/2768 Installing Redmine with SQLite]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Redmine_setup&diff=93628Redmine setup2010-01-26T00:12:14Z<p>VitaminJ: Move .yml configuration details further down</p>
<hr />
<div>[[Category:Development (English)]][[Category:HOWTOs (English)]]<br />
== Introduction ==<br />
This article explains how to install Redmine, an open-source web-based project management and bug-tracking tool, on Arch Linux. For this article, MySQL(with C bindings provided by the 'mysql' gem) are used.<br />
<br />
== Preparation ==<br />
== Package and Gem version Overview ==<br />
The following packages are used at the time of this [re]writing:<br />
<pre><br />
ruby 1.8 <- the PKGBUILD should edited to include 'rails=2.3.5' in the Provides array(more below)<br />
rubygems 1.8<br />
mysql 5.1.42<br />
apache 2.2.14<br />
redmine-mysql-git-20100124<br />
<br />
(gems)<br />
rake 0.8.3<br />
rack 1.0.1<br />
rails 2.3.5<br />
mysql 2.8.1<br />
</pre><br />
<br />
== Ruby 1.8 Environment ==<br />
As Redmine doesn't support ruby 1.9, we need to use the older 1.8 from AUR instead. Remove the "ruby" package(if you have it installed), so that it doesn't conflict, and retrieve and build the packages w any way you're comfortable with.<br />
<pre><br />
pacman -R ruby<br />
yaourt -S ruby1.8<br />
yaourt -S rubygems1.8<br />
<br />
# ruby1.8 installs ruby-1.8 executable. link it to "ruby":<br />
cd /usr/bin<br />
ln -s /usr/bin/ruby-1.8 /usr/bin/ruby<br />
<br />
# (optional) link gem-1.8 to gem<br />
ln -s /usr/biin/gem-1.8 /usr/bin/gem<br />
<br />
# and retrieve the gems<br />
gem install rake -v=0.8.3<br />
gem install rack -v=1.0.1<br />
gem install rails -v=2.3.5<br />
</pre><br />
<br />
=== Database Preparation ===<br />
Redmine can work with MySQL 4.1 or higher, PortageSQL 8 or SQLite 3.<br />
==== MySQL ====<br />
Install the MySQL gem:<br />
gem install mysql -v=2.8.1<br />
<br />
Install MySQL by typing:<br />
pacman -S mysql<br />
For full installation and configuration tutorial see [[MySQL]].<br />
<br />
Start MySQL:<br />
sudo /etc/rc.d/mysqld start<br />
<br />
Create database and user for redmine to use:<br />
<pre><br />
mysql -u root -p<br />
create database redmine character set utf8;<br />
create user 'redmine'@'localhost' identified by 'YOUR_PASSWORD';<br />
grant all privileges on redmine.* to 'redmine'@'localhost';<br />
</pre><br />
==== SQLite3 ====<br />
Install SQLite<br />
pacman -S sqlite3<br />
<br />
SQLite is actually not a standalone application like most databases. Instead it is a C library that is linked to by the executable that is using it. Therefore, you need to point to the SQLite source to install the ruby gem.<br />
gem install sqlite3-ruby --with-sqlite3-include=/usr/include --with-sqlite3-lib=/usr/lib<br />
<br />
== Configuring Redmine ==<br />
<pre><br />
# change to the redmine root dir<br />
cd /opt/redmine<br />
<br />
# copy example database configuration file<br />
cp config/database.yml.example config/database.yml<br />
</pre><br />
<br />
Edit the database file for production environment:<br />
<pre><br />
vi config/database.yml<br />
</pre><br />
<br />
Example:<br />
<pre><br />
production:<br />
adapter: mysql<br />
database: redmine<br />
host: localhost<br />
username: redmine<br />
password: YOUR_PASSWORD<br />
encoding: utf8<br />
</pre><br />
<br />
If you used a different database name or username in section [[Redmine_setup#Database_Preparation]] make sure to change them here as well.<br />
<br />
To create the database structure, run the following command inside redmine root directory:<br />
<pre><br />
rake db:migrate RAILS_ENV=production<br />
</pre><br />
<br />
This will create the database tables and the following admin account:<br />
<pre><br />
Username: admin<br />
Password: admin<br />
</pre><br />
<br />
Now we need to populate the database with default information. Run the following:<br />
<pre><br />
rake redmine:load_deafault_data RAILS_ENV=production<br />
</pre><br />
<br />
== Running Redmine ==<br />
=== Using WEBrick Server ===<br />
Run the WEBrick server:<br />
<pre><br />
scripts/server -e production<br />
</pre><br />
<br />
Now navigate to:<br />
<pre><br />
http://MY_HOSTNAME_OR_IP:3000/<br />
</pre><br />
<br />
If everything went fine, you should be able to see the main page of Redmine.<br />
You should login with default admin account and configure your new redmine. Don't forget to change admin's password.<br />
<br />
=== Using Apache Web Server(CGI) ===<br />
Install apache according to [[Apache]].<br />
<br />
Make sure that Redmine works fine with the WEBrick server.<br />
Copy redmine directory content to /srv/http/ (or any other directory you use for your server):<br />
<pre><br />
sudo mkdir /srv/http/redmine/<br />
sudo cp -r * /srv/http/redmine/<br />
</pre><br />
(The last command assumes you are inside /opt/redmine directory).<br />
<br />
'''Note:''' All other commands assume that you are inside the /srv/http/redmine/ folder (or any other folder you decided to use for your server).<br />
<br />
Copy ''dispatch.cgi.example'' file:<br />
<pre><br />
cp public/dispatch.cgi.example public/dispatch.cgi<br />
</pre><br />
<br />
Give ''dispatch.cgi'' execute permission:<br />
<pre><br />
chmod 775 public/dispatch.cgi<br />
</pre><br />
<br />
Uncomment the following line from ''config/environment.rb'':<br />
<pre><br />
ENV['RAILS_ENV'] ||= 'production'<br />
</pre><br />
<br />
Edit ''/etc/httpd/conf/httpd.conf'' by adding the following:<br />
<pre><br />
<VirtualHost *:80><br />
ServerName YOUR-DOMAIN<br />
ServerAdmin webmaster@<YOUR-DOMAIN>.com<br />
DocumentRoot /srv/http/redmine/public/<br />
ErrorLog logs/redmine_error_log<br />
<br />
<Directory "/srv/http/redmine/public/"><br />
Options Indexes ExecCGI FollowSymLinks<br />
Order allow,deny<br />
Allow from all<br />
AllowOverride all<br />
</Directory><br />
</VirtualHost><br />
</pre><br />
<br />
Give the ''http'' user and group the ability to read/write the following folders:<br />
<pre><br />
chown -R http.http files log tmp vendor<br />
</pre><br />
<br />
Restart apache:<br />
<pre><br />
sudo /etc/rc.d/httpd restart<br />
</pre><br />
<br />
Surf to your server and check if it works.<br />
Notice that most likely it will work slower then with WEBrick server, so if there is not special need to run redmine on apache I personally suggest to use WEBrick Server.<br />
<br />
=== Apache w/ Phusion Passenger ===<br />
The CGI method described earlier is a bit slower than WEBrick server, so here I am going to describe another method by installing apache module called Phusion Passenger (also known as mod rails) similar to python module you probably used when installed [[Trac]].<br />
The basic idea was borrowed from [http://blog.samsonis.me/2009/06/redmine-on-archlinux/ Samson's Weblog].<br />
<br />
==== Module Setup ====<br />
<pre><br />
# install passenger<br />
gem install passenger<br />
<br />
# install the apache2 module<br />
passenger-install-apache2-module<br />
</pre><br />
This will guide you through the module compilation and installation.<br />
'''Note the settings it will show you in the end. They are important.'''<br />
<br />
==== Apache Configuration ====<br />
<br />
<pre><br />
# using ''/srv/http'' as the server root dir, make a symbolic link to the redmine/public dir<br />
ln -s /path/to/redmine-0.8.5/public /srv/http/redmine<br />
</pre><br />
'''Important:''' Make sure you make a link to the '''public''' directory of redmine!<br />
<br />
Now edit '''/etc/httpd/conf/httpd.conf''''' and add the following (again, make sure you use the directories that ''passenger-install-apache2-module'' gave you):<br />
<pre><br />
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/ext/apache2/mod_passenger.so<br />
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5<br />
PassengerRuby /usr/lib/ruby<br />
</pre><br />
<br />
And add this:<br />
<pre><br />
<VirtualHost *:80><br />
# server DocumentRoot, address, and admin email<br />
<br />
RailsBaseURI /redmine #<- We add this, if you named your symbolic link differently write it here<br />
</VirtualHost><br />
</pre><br />
<br />
'''NOTE''': you need to restart Apache(if it was running) for the changes to take effect<br />
<br />
Verify that everything is setup correctly by going to http://MY-SERVER-IP-ADDRESS/redmine.<br />
<nowiki>Insert non-formatted text here</nowiki><br />
<br />
== Resources ==<br />
* [http://blog.samsonis.me/2009/06/redmine-on-archlinux/ Samson's Weblog describing installation of Redmine on Arch Linux]<br />
* [http://www.redmine.org/wiki/redmine/RedmineInstall Official Redmine Installation]<br />
* [http://www.redmine.org/wiki/1/HowTo_configure_Apache_to_run_Redmine Configuring Apache to run Redmine]<br />
* [http://www.redmine.org/boards/2/topics/2768 Installing Redmine with SQLite]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Redmine_setup&diff=93627Redmine setup2010-01-26T00:10:51Z<p>VitaminJ: SQLite3 resource</p>
<hr />
<div>[[Category:Development (English)]][[Category:HOWTOs (English)]]<br />
== Introduction ==<br />
This article explains how to install Redmine, an open-source web-based project management and bug-tracking tool, on Arch Linux. For this article, MySQL(with C bindings provided by the 'mysql' gem) are used.<br />
<br />
== Preparation ==<br />
== Package and Gem version Overview ==<br />
The following packages are used at the time of this [re]writing:<br />
<pre><br />
ruby 1.8 <- the PKGBUILD should edited to include 'rails=2.3.5' in the Provides array(more below)<br />
rubygems 1.8<br />
mysql 5.1.42<br />
apache 2.2.14<br />
redmine-mysql-git-20100124<br />
<br />
(gems)<br />
rake 0.8.3<br />
rack 1.0.1<br />
rails 2.3.5<br />
mysql 2.8.1<br />
</pre><br />
<br />
== Ruby 1.8 Environment ==<br />
As Redmine doesn't support ruby 1.9, we need to use the older 1.8 from AUR instead. Remove the "ruby" package(if you have it installed), so that it doesn't conflict, and retrieve and build the packages w any way you're comfortable with.<br />
<pre><br />
pacman -R ruby<br />
yaourt -S ruby1.8<br />
yaourt -S rubygems1.8<br />
<br />
# ruby1.8 installs ruby-1.8 executable. link it to "ruby":<br />
cd /usr/bin<br />
ln -s /usr/bin/ruby-1.8 /usr/bin/ruby<br />
<br />
# (optional) link gem-1.8 to gem<br />
ln -s /usr/biin/gem-1.8 /usr/bin/gem<br />
<br />
# and retrieve the gems<br />
gem install rake -v=0.8.3<br />
gem install rack -v=1.0.1<br />
gem install rails -v=2.3.5<br />
</pre><br />
<br />
=== Database Preparation ===<br />
Redmine can work with MySQL 4.1 or higher, PortageSQL 8 or SQLite 3.<br />
==== MySQL ====<br />
Install the MySQL gem:<br />
gem install mysql -v=2.8.1<br />
<br />
Install MySQL by typing:<br />
pacman -S mysql<br />
For full installation and configuration tutorial see [[MySQL]].<br />
<br />
Start MySQL:<br />
sudo /etc/rc.d/mysqld start<br />
<br />
Create database and user for redmine to use:<br />
<pre><br />
mysql -u root -p<br />
create database redmine character set utf8;<br />
create user 'redmine'@'localhost' identified by 'YOUR_PASSWORD';<br />
grant all privileges on redmine.* to 'redmine'@'localhost';<br />
</pre><br />
==== SQLite3 ====<br />
Install SQLite<br />
pacman -S sqlite3<br />
<br />
SQLite is actually not a standalone application like most databases. Instead it is a C library that is linked to by the executable that is using it. Therefore, you need to point to the SQLite source to install the ruby gem.<br />
gem install sqlite3-ruby --with-sqlite3-include=/usr/include --with-sqlite3-lib=/usr/lib<br />
<br />
Modify database.yml<br />
<pre><br />
production:<br />
adapter: sqlite3<br />
dbfile: db/redmine.db<br />
</pre><br />
<br />
Create the databases:<br />
rake db:migrate RAILS_ENV="production" <br />
rake redmine:load_default_data RAILS_ENV="production"<br />
<br />
== Configuring Redmine ==<br />
<pre><br />
# change to the redmine root dir<br />
cd /opt/redmine<br />
<br />
# copy example database configuration file<br />
cp config/database.yml.example config/database.yml<br />
</pre><br />
<br />
Edit the database file for production environment:<br />
<pre><br />
vi config/database.yml<br />
</pre><br />
<br />
Example:<br />
<pre><br />
production:<br />
adapter: mysql<br />
database: redmine<br />
host: localhost<br />
username: redmine<br />
password: YOUR_PASSWORD<br />
encoding: utf8<br />
</pre><br />
<br />
If you used a different database name or username in section [[Redmine_setup#Database_Preparation]] make sure to change them here as well.<br />
<br />
To create the database structure, run the following command inside redmine root directory:<br />
<pre><br />
rake db:migrate RAILS_ENV=production<br />
</pre><br />
<br />
This will create the database tables and the following admin account:<br />
<pre><br />
Username: admin<br />
Password: admin<br />
</pre><br />
<br />
Now we need to populate the database with default information. Run the following:<br />
<pre><br />
rake redmine:load_deafault_data RAILS_ENV=production<br />
</pre><br />
<br />
== Running Redmine ==<br />
=== Using WEBrick Server ===<br />
Run the WEBrick server:<br />
<pre><br />
scripts/server -e production<br />
</pre><br />
<br />
Now navigate to:<br />
<pre><br />
http://MY_HOSTNAME_OR_IP:3000/<br />
</pre><br />
<br />
If everything went fine, you should be able to see the main page of Redmine.<br />
You should login with default admin account and configure your new redmine. Don't forget to change admin's password.<br />
<br />
=== Using Apache Web Server(CGI) ===<br />
Install apache according to [[Apache]].<br />
<br />
Make sure that Redmine works fine with the WEBrick server.<br />
Copy redmine directory content to /srv/http/ (or any other directory you use for your server):<br />
<pre><br />
sudo mkdir /srv/http/redmine/<br />
sudo cp -r * /srv/http/redmine/<br />
</pre><br />
(The last command assumes you are inside /opt/redmine directory).<br />
<br />
'''Note:''' All other commands assume that you are inside the /srv/http/redmine/ folder (or any other folder you decided to use for your server).<br />
<br />
Copy ''dispatch.cgi.example'' file:<br />
<pre><br />
cp public/dispatch.cgi.example public/dispatch.cgi<br />
</pre><br />
<br />
Give ''dispatch.cgi'' execute permission:<br />
<pre><br />
chmod 775 public/dispatch.cgi<br />
</pre><br />
<br />
Uncomment the following line from ''config/environment.rb'':<br />
<pre><br />
ENV['RAILS_ENV'] ||= 'production'<br />
</pre><br />
<br />
Edit ''/etc/httpd/conf/httpd.conf'' by adding the following:<br />
<pre><br />
<VirtualHost *:80><br />
ServerName YOUR-DOMAIN<br />
ServerAdmin webmaster@<YOUR-DOMAIN>.com<br />
DocumentRoot /srv/http/redmine/public/<br />
ErrorLog logs/redmine_error_log<br />
<br />
<Directory "/srv/http/redmine/public/"><br />
Options Indexes ExecCGI FollowSymLinks<br />
Order allow,deny<br />
Allow from all<br />
AllowOverride all<br />
</Directory><br />
</VirtualHost><br />
</pre><br />
<br />
Give the ''http'' user and group the ability to read/write the following folders:<br />
<pre><br />
chown -R http.http files log tmp vendor<br />
</pre><br />
<br />
Restart apache:<br />
<pre><br />
sudo /etc/rc.d/httpd restart<br />
</pre><br />
<br />
Surf to your server and check if it works.<br />
Notice that most likely it will work slower then with WEBrick server, so if there is not special need to run redmine on apache I personally suggest to use WEBrick Server.<br />
<br />
=== Apache w/ Phusion Passenger ===<br />
The CGI method described earlier is a bit slower than WEBrick server, so here I am going to describe another method by installing apache module called Phusion Passenger (also known as mod rails) similar to python module you probably used when installed [[Trac]].<br />
The basic idea was borrowed from [http://blog.samsonis.me/2009/06/redmine-on-archlinux/ Samson's Weblog].<br />
<br />
==== Module Setup ====<br />
<pre><br />
# install passenger<br />
gem install passenger<br />
<br />
# install the apache2 module<br />
passenger-install-apache2-module<br />
</pre><br />
This will guide you through the module compilation and installation.<br />
'''Note the settings it will show you in the end. They are important.'''<br />
<br />
==== Apache Configuration ====<br />
<br />
<pre><br />
# using ''/srv/http'' as the server root dir, make a symbolic link to the redmine/public dir<br />
ln -s /path/to/redmine-0.8.5/public /srv/http/redmine<br />
</pre><br />
'''Important:''' Make sure you make a link to the '''public''' directory of redmine!<br />
<br />
Now edit '''/etc/httpd/conf/httpd.conf''''' and add the following (again, make sure you use the directories that ''passenger-install-apache2-module'' gave you):<br />
<pre><br />
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/ext/apache2/mod_passenger.so<br />
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5<br />
PassengerRuby /usr/lib/ruby<br />
</pre><br />
<br />
And add this:<br />
<pre><br />
<VirtualHost *:80><br />
# server DocumentRoot, address, and admin email<br />
<br />
RailsBaseURI /redmine #<- We add this, if you named your symbolic link differently write it here<br />
</VirtualHost><br />
</pre><br />
<br />
'''NOTE''': you need to restart Apache(if it was running) for the changes to take effect<br />
<br />
Verify that everything is setup correctly by going to http://MY-SERVER-IP-ADDRESS/redmine.<br />
<nowiki>Insert non-formatted text here</nowiki><br />
<br />
== Resources ==<br />
* [http://blog.samsonis.me/2009/06/redmine-on-archlinux/ Samson's Weblog describing installation of Redmine on Arch Linux]<br />
* [http://www.redmine.org/wiki/redmine/RedmineInstall Official Redmine Installation]<br />
* [http://www.redmine.org/wiki/1/HowTo_configure_Apache_to_run_Redmine Configuring Apache to run Redmine]<br />
* [http://www.redmine.org/boards/2/topics/2768 Installing Redmine with SQLite]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Redmine_setup&diff=93626Redmine setup2010-01-26T00:05:21Z<p>VitaminJ: SQLite3 additions</p>
<hr />
<div>[[Category:Development (English)]][[Category:HOWTOs (English)]]<br />
== Introduction ==<br />
This article explains how to install Redmine, an open-source web-based project management and bug-tracking tool, on Arch Linux. For this article, MySQL(with C bindings provided by the 'mysql' gem) are used.<br />
<br />
== Preparation ==<br />
== Package and Gem version Overview ==<br />
The following packages are used at the time of this [re]writing:<br />
<pre><br />
ruby 1.8 <- the PKGBUILD should edited to include 'rails=2.3.5' in the Provides array(more below)<br />
rubygems 1.8<br />
mysql 5.1.42<br />
apache 2.2.14<br />
redmine-mysql-git-20100124<br />
<br />
(gems)<br />
rake 0.8.3<br />
rack 1.0.1<br />
rails 2.3.5<br />
mysql 2.8.1<br />
</pre><br />
<br />
== Ruby 1.8 Environment ==<br />
As Redmine doesn't support ruby 1.9, we need to use the older 1.8 from AUR instead. Remove the "ruby" package(if you have it installed), so that it doesn't conflict, and retrieve and build the packages w any way you're comfortable with.<br />
<pre><br />
pacman -R ruby<br />
yaourt -S ruby1.8<br />
yaourt -S rubygems1.8<br />
<br />
# ruby1.8 installs ruby-1.8 executable. link it to "ruby":<br />
cd /usr/bin<br />
ln -s /usr/bin/ruby-1.8 /usr/bin/ruby<br />
<br />
# (optional) link gem-1.8 to gem<br />
ln -s /usr/biin/gem-1.8 /usr/bin/gem<br />
<br />
# and retrieve the gems<br />
gem install rake -v=0.8.3<br />
gem install rack -v=1.0.1<br />
gem install rails -v=2.3.5<br />
</pre><br />
<br />
=== Database Preparation ===<br />
Redmine can work with MySQL 4.1 or higher, PortageSQL 8 or SQLite 3.<br />
==== MySQL ====<br />
Install the MySQL gem:<br />
gem install mysql -v=2.8.1<br />
<br />
Install MySQL by typing:<br />
pacman -S mysql<br />
For full installation and configuration tutorial see [[MySQL]].<br />
<br />
Start MySQL:<br />
sudo /etc/rc.d/mysqld start<br />
<br />
Create database and user for redmine to use:<br />
<pre><br />
mysql -u root -p<br />
create database redmine character set utf8;<br />
create user 'redmine'@'localhost' identified by 'YOUR_PASSWORD';<br />
grant all privileges on redmine.* to 'redmine'@'localhost';<br />
</pre><br />
==== SQLite3 ====<br />
Install SQLite<br />
pacman -S sqlite3<br />
<br />
SQLite is actually not a standalone application like most databases. Instead it is a C library that is linked to by the executable that is using it. Therefore, you need to point to the SQLite source to install the ruby gem.<br />
gem install sqlite3-ruby --with-sqlite3-include=/usr/include --with-sqlite3-lib=/usr/lib<br />
<br />
Modify database.yml<br />
<pre><br />
production:<br />
adapter: sqlite3<br />
dbfile: db/redmine.db<br />
</pre><br />
<br />
Create the databases:<br />
rake db:migrate RAILS_ENV="production" <br />
rake redmine:load_default_data RAILS_ENV="production"<br />
<br />
== Configuring Redmine ==<br />
<pre><br />
# change to the redmine root dir<br />
cd /opt/redmine<br />
<br />
# copy example database configuration file<br />
cp config/database.yml.example config/database.yml<br />
</pre><br />
<br />
Edit the database file for production environment:<br />
<pre><br />
vi config/database.yml<br />
</pre><br />
<br />
Example:<br />
<pre><br />
production:<br />
adapter: mysql<br />
database: redmine<br />
host: localhost<br />
username: redmine<br />
password: YOUR_PASSWORD<br />
encoding: utf8<br />
</pre><br />
<br />
If you used a different database name or username in section [[Redmine_setup#Database_Preparation]] make sure to change them here as well.<br />
<br />
To create the database structure, run the following command inside redmine root directory:<br />
<pre><br />
rake db:migrate RAILS_ENV=production<br />
</pre><br />
<br />
This will create the database tables and the following admin account:<br />
<pre><br />
Username: admin<br />
Password: admin<br />
</pre><br />
<br />
Now we need to populate the database with default information. Run the following:<br />
<pre><br />
rake redmine:load_deafault_data RAILS_ENV=production<br />
</pre><br />
<br />
== Running Redmine ==<br />
=== Using WEBrick Server ===<br />
Run the WEBrick server:<br />
<pre><br />
scripts/server -e production<br />
</pre><br />
<br />
Now navigate to:<br />
<pre><br />
http://MY_HOSTNAME_OR_IP:3000/<br />
</pre><br />
<br />
If everything went fine, you should be able to see the main page of Redmine.<br />
You should login with default admin account and configure your new redmine. Don't forget to change admin's password.<br />
<br />
=== Using Apache Web Server(CGI) ===<br />
Install apache according to [[Apache]].<br />
<br />
Make sure that Redmine works fine with the WEBrick server.<br />
Copy redmine directory content to /srv/http/ (or any other directory you use for your server):<br />
<pre><br />
sudo mkdir /srv/http/redmine/<br />
sudo cp -r * /srv/http/redmine/<br />
</pre><br />
(The last command assumes you are inside /opt/redmine directory).<br />
<br />
'''Note:''' All other commands assume that you are inside the /srv/http/redmine/ folder (or any other folder you decided to use for your server).<br />
<br />
Copy ''dispatch.cgi.example'' file:<br />
<pre><br />
cp public/dispatch.cgi.example public/dispatch.cgi<br />
</pre><br />
<br />
Give ''dispatch.cgi'' execute permission:<br />
<pre><br />
chmod 775 public/dispatch.cgi<br />
</pre><br />
<br />
Uncomment the following line from ''config/environment.rb'':<br />
<pre><br />
ENV['RAILS_ENV'] ||= 'production'<br />
</pre><br />
<br />
Edit ''/etc/httpd/conf/httpd.conf'' by adding the following:<br />
<pre><br />
<VirtualHost *:80><br />
ServerName YOUR-DOMAIN<br />
ServerAdmin webmaster@<YOUR-DOMAIN>.com<br />
DocumentRoot /srv/http/redmine/public/<br />
ErrorLog logs/redmine_error_log<br />
<br />
<Directory "/srv/http/redmine/public/"><br />
Options Indexes ExecCGI FollowSymLinks<br />
Order allow,deny<br />
Allow from all<br />
AllowOverride all<br />
</Directory><br />
</VirtualHost><br />
</pre><br />
<br />
Give the ''http'' user and group the ability to read/write the following folders:<br />
<pre><br />
chown -R http.http files log tmp vendor<br />
</pre><br />
<br />
Restart apache:<br />
<pre><br />
sudo /etc/rc.d/httpd restart<br />
</pre><br />
<br />
Surf to your server and check if it works.<br />
Notice that most likely it will work slower then with WEBrick server, so if there is not special need to run redmine on apache I personally suggest to use WEBrick Server.<br />
<br />
=== Apache w/ Phusion Passenger ===<br />
The CGI method described earlier is a bit slower than WEBrick server, so here I am going to describe another method by installing apache module called Phusion Passenger (also known as mod rails) similar to python module you probably used when installed [[Trac]].<br />
The basic idea was borrowed from [http://blog.samsonis.me/2009/06/redmine-on-archlinux/ Samson's Weblog].<br />
<br />
==== Module Setup ====<br />
<pre><br />
# install passenger<br />
gem install passenger<br />
<br />
# install the apache2 module<br />
passenger-install-apache2-module<br />
</pre><br />
This will guide you through the module compilation and installation.<br />
'''Note the settings it will show you in the end. They are important.'''<br />
<br />
==== Apache Configuration ====<br />
<br />
<pre><br />
# using ''/srv/http'' as the server root dir, make a symbolic link to the redmine/public dir<br />
ln -s /path/to/redmine-0.8.5/public /srv/http/redmine<br />
</pre><br />
'''Important:''' Make sure you make a link to the '''public''' directory of redmine!<br />
<br />
Now edit '''/etc/httpd/conf/httpd.conf''''' and add the following (again, make sure you use the directories that ''passenger-install-apache2-module'' gave you):<br />
<pre><br />
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/ext/apache2/mod_passenger.so<br />
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5<br />
PassengerRuby /usr/lib/ruby<br />
</pre><br />
<br />
And add this:<br />
<pre><br />
<VirtualHost *:80><br />
# server DocumentRoot, address, and admin email<br />
<br />
RailsBaseURI /redmine #<- We add this, if you named your symbolic link differently write it here<br />
</VirtualHost><br />
</pre><br />
<br />
'''NOTE''': you need to restart Apache(if it was running) for the changes to take effect<br />
<br />
Verify that everything is setup correctly by going to http://MY-SERVER-IP-ADDRESS/redmine.<br />
<nowiki>Insert non-formatted text here</nowiki><br />
<br />
== Resources ==<br />
* [http://blog.samsonis.me/2009/06/redmine-on-archlinux/ Samson's Weblog describing installation of Redmine on Arch Linux]<br />
* [http://www.redmine.org/wiki/redmine/RedmineInstall Official Redmine Installation]<br />
* [http://www.redmine.org/wiki/1/HowTo_configure_Apache_to_run_Redmine Configuring Apache to run Redmine]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=VirtualBox&diff=92958VirtualBox2010-01-21T19:50:35Z<p>VitaminJ: Rebuild the vboxdrv Module on v3.0</p>
<hr />
<div>[[Category:Emulators (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|:VirtualBox}}<br />
{{i18n_entry|Italiano|:VirtualBox (Italiano)}}<br />
{{i18n_entry|简体中文|:VirtualBox (简体中文)}}<br />
{{i18n_entry|Русский|VirtualBox (Русский)}}<br />
{{i18n_entry|Español|VirtualBox (Español)}}<br />
{{i18n_entry|Português|VirtualBox (Português)}}<br />
{{i18n_links_end}}<br />
<br />
[http://www.virtualbox.org VirtualBox] is a virtual pc emulator like vmware. It has many of the features vmware has, as well as some of its own. It is in constant development and new features are implemented all the time. eg. version 2.2 introduced OpenGL 3D acceleration support for Linux and Solaris guests. It has a nice GUI interface (Qt and/or SDL) or command line tools for managing virtual machines. Headless operation is also supported. Running iTunes under VirtualBox is the only way (currently) to sync iPod Touch/iPhone firmware 3.0+.<br />
<br />
==Editions==<br />
VirtualBox is available in two editions: VirtualBox (OSE) and VirtualBox (Personal Use and Evaluation License (PUEL))<br />
<br />
===VirtualBox (OSE)===<br />
VirtualBox (OSE) is the open source version of VirtualBox, which can be found in the community repository. It lacks some features such as USB device support and the built-in RDP server. <br />
<br />
===VirtualBox (PUEL)===<br />
VirtualBox PUEL is a binary-only version (free for personal use). There are several available from the AUR, but the most popular PKGBUILD was written and is maintained by thotypous. You can download it from the [http://aur.archlinux.org/packages.php?ID=9753 AUR at this link] or directly from the <br />
[http://www.virtualbox.org/wiki/Downloads VirtualBox] website. The PUEL edition offers the following advantages:<br />
<br />
*'''Remote Display Protocol (RDP) Server''' - a complete RDP server on top of the virtual hardware, allowing users to connect to a virtual machine remotely using any RDP compatible client<br />
<br />
*'''USB support''' - a virtual USB controller which allows USB 1.1 and USB 2.0 devices to be passed through to virtual machines<br />
<br />
*'''USB over RDP''' - a combination of the RDP server and USB support, allowing users to make USB devices available to virtual machines running remotely<br />
<br />
*'''iSCSI initiator''' - a builtin iSCSI initiator making it possible to use iSCSI targets as virtual disks without the guest requiring support for iSCSI<br />
<br />
==Installation==<br />
<br />
===Install VirtualBox (OSE)===<br />
VirtualBox (OSE) is available from the community repository:<br />
# pacman -S virtualbox-ose<br />
<br />
{{Note | This package is not in x86_64 Repositories. See the link to the PKGBUILD by thotypous in the AUR above if you are running Arch x86_64 and want to use VirtualBox.}}<br />
<br />
This will select by default <tt>virtualbox-ose</tt> and <tt>virtualbox-modules</tt> packages. Once installed, a desktop entry can be located in ''Applications &rarr; System Tools &rarr; VirtualBox OSE''<br />
<br />
Now, add the desired username to the '''vboxusers''' group:<br />
# gpasswd -a USERNAME vboxusers<br />
<br />
{{Note | You must logout/login in order for this change to take effect.}}<br />
<br />
Lastly, edit {{Filename|/etc/rc.conf}} as root and add '''vboxdrv''' to the MODULES array in order to load the VirtualBox drivers at startup. For example:<br />
MODULES=(loop '''vboxdrv''' fuse ...)<br />
<br />
To load the module manually, run the following in a terminal as root: <br />
# modprobe vboxdrv<br />
<br />
===Install VirtualBox PUEL (virtualbox_bin)===<br />
VirtualBox PUEL is available from the [http://aur.archlinux.org/packages.php?ID=9753 AUR: virtualbox_bin].<br />
<br />
Download the tarball from the above page. As a normal user, unpack, change directory, and {{Codeline|makepkg}}:<br />
# tar -xzf virtualbox_bin.tar.gz<br />
# cd virtualbox_bin<br />
# makepkg<br />
This will create a .pkg.tar.gz file in the virtualbox_bin directory.<br />
Then, as root:<br />
# pacman -U PACKAGE-NAME.pkg.tar.gz<br />
This will compile the vboxdrv kernel modules and install VirtualBox in {{Filename|/opt/VirtualBox}}, and add the vboxusers group.<br />
<br />
Now, add the desired username to the '''vboxusers''' group:<br />
# gpasswd -a USERNAME vboxusers<br />
<br />
{{Note | You must logout/login in order for this change to take effect.}}<br />
<br />
Lastly, edit {{Filename|/etc/rc.conf}} as root and add '''vboxdrv''' to the MODULES array in order to load the VirtualBox drivers at startup. For example:<br />
MODULES=(loop '''vboxdrv''' fuse ...)<br />
<br />
To load the module manually, run the following in a terminal as root: <br />
# modprobe vboxdrv<br />
<br />
====Install required QT libraries====<br />
Currently, VirtualBox relies on QT4 for its graphical interface. If you require a GUI, ensure you have QT4 installed:<br />
# pacman -S qt<br />
<br />
===Install VirtualBox 2.1 (another alternative)===<br />
VirtualBox.run install can be done using the All Distributions package from the [http://www.virtualbox.org/wiki/Linux_Downloads Linux section] of the VirtualBox Website.<br />
<br />
Make sure the Qt 4.3.0 and SDL 1.2.7 or higher packages are installed:<br />
# pacman -Sy qt sdl <br />
<br />
Download the appropriate architecture file i386/AMD64. In a terminal window, browse to the download folder and as root run:<br />
# sh VirtualBox-2.XXXX-Linux_ARCH.run<br />
<br />
This will install the package to the /opt/VirtualBox-2.XXX folder.<br />
<br />
After installation, a desktop entry can be located in ''Applications &rarr; System Tools &rarr; Sun xVM VirtualBox''<br />
<br />
Now, add the desired username to the '''vboxusers''' group:<br />
# gpasswd -a USERNAME vboxusers<br />
<br />
Lastly, edit {{Filename|/etc/rc.conf}} as root and add '''vboxdrv''' to the MODULES array in order to load the VirtualBox drivers at startup.<br />
<br />
Start the VirtualBox GUI either with the command:<br />
# VirtualBox <br />
<br />
or using the ''Applications'' desktop entry. In version 2.1.x, an installation wizard should start and take you through the process of setting up a virtual machine. Otherwise, use the help menu to get started. '''Continue reading to see the more advanced options and setups...'''<br />
<br />
==Configuration==<br />
After having installed VirtualBox on our system and added ourselves in the vboxusers group, you can start configuring our system in order to make all the features of VirtualBox available to us. Create a new virtual machine using the wizard provided by the GUI and then click settings in order to edit the virtual machine settings.<br />
<br />
===Keyboard and mouse between the host and the guest===<br />
*To capture the keyboard and mouse, click the mouse inside the Virtual Machine display.<br />
*To uncapture, press Ctrl-Alt-Delete.<br />
<br />
If [[Xorg]] freezes mouse and keyboard you will have to disable the [[Xorg#Input_hotplugging_with_xorg-server_1.5| new hot plugging feature of Xorg 1.5]] by adding in {{Filename|/etc/X11/xorg.conf}}:<br />
Section "ServerFlags"<br />
. . .<br />
Option "AutoAddDevices" "False"<br />
. . .<br />
EndSection<br />
<br />
This is needed for Linux guests in a Mac OS X or Windows host. Also needed for Linux hosts (tested with Arch64 host and Arch64 guest).<br />
<br />
Also, mouse pointer integration does not work out of the box. To fix it, make sure you have the following sections in your {{Filename|xorg.conf}}:<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "vboxmouse"<br />
Option "Protocol" "auto"<br />
Option "Device" "/dev/input/mice"<br />
Option "ZAxisMapping" "4 5 6 7"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "X.org Configured"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Mouse0" "CorePointer"<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
EndSection<br />
<br />
When generating your {{Filename|xorg.conf}} with {{Codeline|"X -configure"}}, you will end up with an InputDevice section that uses the {{Codeline|mouse}} driver. After installing the Guest Additions, you should replace {{Codeline|mouse}} with {{Codeline|vboxmouse}} and then restart X or reboot your VM.<br />
<br />
===Getting network in the guest machine to work===<br />
First, get network working in the guest machine. Click the network tab. The not attached option means you will have "Network cable unplugged" or similar error in the guest computer.<br />
<br />
====Using NAT network====<br />
This is the simplest way to get network. Select NAT network and it should be ready to use. Then, the guest operating system can be automatically configured by using DHCP.<br />
<br />
The NAT IP address on the first card is 10.0.2.0, 10.0.3.0 on the second and so on.<br />
<br />
Also in VirtualBox 2.2.0+ NAT network DHCP clients will not configure your nameserver (DNS server for windows guests) you will have to manually configure the nameserver(DNS server)<br />
<br />
====Using host interface networking (the VirtualBox way)====<br />
Since VirtuaBox 2.1.0 it has a native support for host interface networking. Just add '''vboxnetflt''' to your MODULES section in {{Filename|[[rc.conf]]}} and choose ''Host Interface Networking'' (or ''Bridged adapter'' in [http://forums.virtualbox.org/viewtopic.php?f=1&t=16447 2.2]) in the virtual machine configuration.<br />
<br />
'''Note''': DHCP broadcasting does not seem to work properly under this way. Set up your guest networking with static IP assignment.<br />
<br />
====Using host interface networking (the Arch way)====<br />
You are going to just edit these files and reboot:<br />
<br />
* {{Filename|/etc/conf.d/bridges}}<br />
* {{Filename|/etc/rc.conf}}<br />
* {{Filename|/etc/vbox/interfaces}}<br />
<br />
Edit:<br />
'''{{Filename|/etc/conf.d/bridges}}'''<br />
bridge_br0="eth0 vbox0" # Put any interfaces you need.<br />
BRIDGE_INTERFACES=(br0)<br />
<br />
'''{{Filename|/etc/rc.conf}}'''<br />
<br />
First add the bridge module to your MODULES line<br />
MODULES=( <your other modules> '''bridge''')<br />
<br />
Then, in your NETWORKING section, make the following changes:<br />
eth0="eth0 up"<br />
br0="dhcp" # Maybe you have some static configuration; change to fit<br />
INTERFACES=(eth0 br0)<br />
<br />
'''Note''' by gpan:<br />
<br />
'''{{Filename|/etc/rc.conf}}'''<br />
<br />
First add the vboxdrv (and vboxnetflt in case of 2.1.0 version) module to your MODULES line:<br />
MODULES=( <your other modules> vboxdrv vboxnetflt )<br />
<br />
'''Note''' by vit:<br />
<br />
'''{{Filename|/etc/rc.conf}}'''<br />
<br />
In my case it did not work untill adding vboxnetadp to modules.<br />
<br />
Next, you should edit your {{Filename|/etc/udev/rules.d/60-vboxdrv.rules}} and type:<br />
KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="vboxusers", MODE="0660"<br />
<br />
Save it and exit.<br />
<br />
Then open terminal and type:<br />
# pacman -S bridge-utils uml_utilities<br />
<br />
Create a new bridge with this command:<br />
# brctl addbr br0<br />
<br />
'''{{Filename|/etc/vbox/interfaces}}'''<br />
<br />
(You can set up more interfaces if you want. Sky is the limit!):<br />
vbox0 your_user br0 # Be sure that your user is in the vboxusers group.<br />
<br />
Reboot.<br />
<br />
{{Note | Remember to set up your virtual machine with proper network configuration.}}<br />
{{Note | If you have any issue, make sure that you have the bridge-utils package installed and vboxnet daemon loaded.}}<br />
<br />
====Using host interface networking (generic)====<br />
This way is a bit harder, but it allows you to see the VirtualMachine as a "real" computer on your local network. You need to get bridge-utils <br />
<br />
# pacman -S bridge-utils uml_utilities<br />
<br />
'''Note''' by Sp1d3rmxn:<br />
:You also need to have the TUN module loaded... in {{Filename|[[rc.conf]]}} add {{Codeline|"tun"}} (without the quotes) to your MODULES section. For testing this out right now without rebooting you can load the module from the command line by {{Codeline|"modprobe tun"}}.<br />
:<br />
:Then you MUST set these permissions otherwise you will never get VBox to init the interface. The command is {{Codeline|"chmod 666 /dev/net/tun"}} (without the quotes).<br />
<br />
:Now proceed with the rest as it is written below.<br />
<br />
'''Note'''<br />
:As said by Sp1d3rmxn, set these permissions, but, instead of using the command, set them in {{Filename|/etc/udev/rules.d/60-vboxdrv.rules}}, which will apply them on boot:<br />
KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="vboxusers", MODE="0660"<br />
KERNEL=="tun", OWNER="root", GROUP="vboxusers", MODE="0660"<br />
<br />
<br />
'''1.''' Create a new bridge with this command:<br />
# brctl addbr br0<br />
<br />
'''2.''' If you are not using DHCP, run ifconfig and note down the network configuration of your existing network interface (e.g. eth0), which will need to be copied to the bridge.<br />
<br />
{{Note|You will need this settings so make sure you do not lose them.}}<br />
<br />
'''3.''' Switch your physical network adapter to "promiscuous" mode so that it will accept Ethernet frames for MAC addresses other than its own (replace {{Codeline|eth0}} with your network interface):<br />
# ifconfig eth0 0.0.0.0 promisc <br />
<br />
{{Note | You will lose network connectivity on eth0 at this point.}}<br />
<br />
'''4.''' Add your network adapter to the bridge:<br />
# brctl addif br0 eth0<br />
<br />
'''5.''' Transfer the network configuration previously used with your physical ethernet adapter to the new bridge. If you are using DHCP, this should work:<br />
# dhclient br0<br />
<br />
'''Note''' by Sp1d3rmxn:<br />
:Use {{Codeline|"dhcpcd -t 30 -h yourhostname br0 &"}} instead of the above<br />
<br />
Otherwise, run {{Codeline|"ifconfig br0 x.x.x.x netmask x.x.x.x"}} and use the values that you noted down previously.<br />
<br />
'''6.''' To create a permanent host interface called vbox0 (all host interfaces created in this way must be called vbox followed by a number) and add it to the network bridge created above, use the following command:<br />
VBoxAddIF vbox0 vboxuser br0<br />
<br />
Replace {{Codeline|vboxuser}} with the name of the user who is supposed to be able to use the new interface.<br />
<br />
{{Note | VboxAddIF is located in /opt/VirtualBox-VERSION OF VIRTUALBOX/VBoxAddIF}}<br />
<br />
Alternatively, you can [http://mychael.gotdns.com/blog/2007/05/31/virtualbox-bridging/ setup VirtualBox networking] through your {{Filename|/etc/rc.conf}} to enable a bridged connection.<br />
<br />
====Using host interface networking with a wireless device====<br />
Bridging as described above will not work with a wireless device. Using [http://aur.archlinux.org/packages.php?ID=16356 parprouted] however it can be accomplished.<br />
<br />
# Install parprouted and iproute<br />
# {{Codeline|# ln -s /usr/sbin/ip /sbin/ip}}<br />
# Make sure IP fowarding is enabled: {{Codeline|# sysctl net.ipv4.ip_forward&#61;1}}, and/or edit {{Filename|/etc/sysctl.conf}}.<br />
# {{Codeline|# VBoxTunctl -b -u <user>}}, to create the tap device<br />
# {{Codeline|# ip link set tap0 up; ip addr add 192.168.0.X/24 dev tap0}}, needs to be a manually set IP on the same network your wireless device is.<br />
# {{Codeline|# parprouted wlan0 tap0}}<br />
<br />
===Getting USB to work in the guest machine===<br />
(Only available in the PUEL edition)<br />
<br />
{{Note|As of VirtualBox>2.2.4 this is no longer necessary to mount a usb filesystem.}}<br />
<br />
First in order to make USB available for use to the virtual machine you must add this line to your {{Filename|/etc/fstab}}:<br />
none /proc/bus/usb usbfs auto,busgid=108,busmode=0775,devgid=108,devmode=0664 0 0<br />
<br />
Then tell mount to reread {{Filename|/etc/fstab}}:<br />
# mount -a<br />
<br />
{{Codeline|108}} is is the id of the group which should be allowed to access USB-devices. Change it to the id of your vboxusers group. You can get the id by running:<br />
$ grep vboxusers /etc/group<br />
<br />
Restart Virtualbox and click the USB tab in the settings of the virtual machine and select which devices are available to your pc on boot. If you wish your virtual machine to use device that you have just plugged in (assuming the virtual machine has booted already), go to the VirtualMachine screen go to ''Devices &rarr; USB Devices'' and select the device you wish to plug in the virtual PC.<br />
<br />
'''Note''' by bjimba:<br />
<br />
Recent versions of VirtualBox, as noted above, do not require usbfs, however you will need the HAL daemon running if you do not use usbfs. See the [[HAL]] wiki page for details.<br />
<br />
===Installing Guest Additions===<br />
For VirtualBox (OSE) version 1.6.2=>, read:<br><br />
[[VirtualBox-HowTo]]<br />
<br />
The Guest Additions make the shared folders feature available, as well as better video (3D available in version 2.1+) and mouse drivers. You will have mouse integration, thus no need to release the mouse after using it in the guest and one can also enable a bidirectional clipboard.<br />
<br />
{{Note | The instructions immediately below are for an Archlinux guest on an Archlinux host.}}<br />
<br />
After you booted the virtual machine, go to menu ''Devices &rarr; Install Guest Additions...'' Once you have clicked it, VirtualBox loads an ISO into the current CD-ROM, so you will not see anything happen yet ;).<br />
<br />
You will require gcc and make if you do not already have them so install them typing the following as root:<br />
# pacman -S gcc make <br />
<br />
If you are running arch in VirtualBox install the kernel headers<br />
# pacman -S kernel26-headers<br />
<br />
Then do the following as root:<br />
# mount /media/cdrom<br />
for i686 systems (32 bit):<br />
# sh /media/cdrom/VBoxLinuxAdditions-x86.run<br />
for x86-64 systems (64 bit):<br />
# sh /media/cdrom/VBoxLinuxAdditions-amd64.run<br />
<br />
It will build and install the kernel modules, install the Xorg drivers and create init scripts. It will most probably print out errors about init scripts and run levels and what not. Ignore them. You will find {{Filename|rc.vboxadd}} in /etc/rc.d which will load them on demand. To have the Guest Additions loaded at boot time, just add those to the DAEMONS array in {{Filename|/etc/rc.conf}} eg.:<br />
DAEMONS=(syslog-ng network netfs crond alsa '''rc.vboxadd''')<br />
<br />
Another option is to install one of these packages:<br />
# pacman -S virtualbox-additions<br />
or<br />
# pacman -S virtualbox-ose-additions<br />
<br />
You will then have an ISO to mount as a loop device. Remember to load the loop kernel module before:<br />
# modprobe loop<br />
# mount /usr/lib/virtualbox/additions/VBoxGuestAdditions.iso /media/cdrom -o loop<br />
<br />
Then execute {{Filename|VBoxLinuxAdditions.run}} as before. Before adding {{Filename|rc.vboxadd}} to DAEMONS check {{Filename|/etc/rc.local}} for commands to load the vboxadd daemons put by the installation script.<br />
<br />
'''Windows Guests'''<br />
<br />
After installing Windows (XP etc.) on your virtual machine, simply select ''Devices &rarr; Install Guest Additions...''<br />
<br />
This will mount the iso image and windows should then automatically launch the guest additions installer. Follow the instructions to the end.<br />
<br />
===Sharing folders between the host and the guest===<br />
For VirtualBox (OSE) version 1.6.2=>, read [[VirtualBox-HowTo]].<br />
<br />
In the settings of the virtual machine go to shared folders tab and add the folders you want to share.<br />
<br />
*NOTE: You need to install Guest Additions in order to use this feature.<br />
In a Linux host, ''Devices &rarr; Install Guest Additions''<br />
Yes (when asked to download the CD image)<br />
Mount (when asked to register and mount)<br />
<br />
In a Linux host, create one folder for sharing files.<br />
<br />
In a Windows guest, starting with VirtualBox 1.5.0, shared folders are browseable and are therefore visible in Windows Explorer. Open Windows Explorer and look for it under ''My Networking Places &rarr; Entire Network &rarr; VirtualBox Shared Folders''.<br />
<br />
Alternatively, on the Windows command line, you can also use the following:<br />
net use x: \\VBOXSVR\sharename<br />
<br />
While {{Codeline|VBOXSVR}} is a fixed name, replace {{Codeline|x:}} with the drive letter that you want to use for the share, and sharename with the share name specified with VBoxManage.<br />
<br />
In a Windows guest, to improve loading and saving files (e.g. MS Office) by VirtualBox Shared Folders edit ''c:\windows\system32\drivers\etc\hosts'' as below:<br />
127.0.0.1 localhost vboxsvr<br />
<br />
In a Linux guest, use the following command:<br />
# mount -t vboxsf [-o OPTIONS] sharename mountpoint<br />
<br />
Replace {{Codeline|sharename}} with the share name specified with VBoxManage, and mountpoint with the path where you want the share to be mounted (e.g. /mnt/share). The usual mount rules apply, that is, create this directory first if it does not exist yet.<br />
<br />
Beyond the standard options supplied by the mount command, the following are available:<br />
iocharset=CHARSET<br />
to set the character set used for I/O operations (utf8 by default) and<br />
convertcp=CHARSET<br />
to specify the character set used for the shared folder name (utf8 by default).<br />
<br />
===Getting audio to work in the guest machine===<br />
<br />
In the machine settings, go to the audio tab and select the correct driver according to your sound system (ALSA, OSS or PulseAudio).<br />
<br />
===Setting up the RAM and Video Memory for the virtual PC===<br />
<br />
You can change the default values by going to ''Settings &rarr; General''.<br />
<br />
===Setting up CD-ROM for the Virtual PC===<br />
<br />
You can change the default values by going to ''Settings &rarr; CD/DVD-ROM''.<br />
<br />
Check mount CD/DVD drive and select one of the following options.<br />
<br />
'''Note:''' If no CD-ROM drive is detected, make sure the HAL daemon is running. To start it, run the following command as root:<br />
# /etc/rc.d/hal start<br />
<br />
===Enabling D3D acceleration in Windows Guests===<br />
Recent versions of Virtualbox have support for accelerating OpenGL inside guests. This can be enabled with a simple checkbox in the machine's settings, right below where video ram is set, and installing the Virtualbox guest additions. However, most Windows games use Direct3D (part of DirectX), not OpenGL, and are thus not helped by this method. However, it is possible to gain accelerated Direct3D in your Windows guests by borrowing the d3d libraries from Wine, which translate d3d calls into OpenGL, which is then accelerated. <br />
<br />
After enabling OpenGL acceleration as described above, go to http://www.nongnu.org/wined3d/ in your Windows guest and grab the "Latest version (Installer):". Reboot the guest into safe mode (press F8 before the Windows screen appears but after the Virtualbox screen disappears), and install wined3d, accepting the defaults during the install. (You may check the box for DirectX 10 support if you like, dont touch anything else.) Reboot back to normal mode and you should have accelerated Direct3D. <br />
<br />
{{Note | This hack may or may not work for some games depending on what hardware checks they make and what parts of D3D they use.}}<br />
{{Note | This has only been tried on Windows XP and Windows 7 RC guests AFAIK, and does not work on the Windows 7 guest. If you have experience with this on a different windows version, please add that data here.}}<br />
<br />
==Start VirtualBox==<br />
To start Virtualbox, run the following command in a terminal:<br />
$ VirtualBox<br />
<br />
Or in KDE menu, select: <System><Sun Virtualbox><br />
<br />
==Virtualized OS Setup==<br />
Virtualbox needs to be setup to virtualize another operating system.<br />
<br />
===Test a LiveCD/DVD===<br />
Click the 'New' button to create a new virtual environment. Name it appropriately and select Operating System type and version. Select base memory size (note: most operating systems will need at least 512MB to function properly). Create a new hard disk image (a hard disk image is a file that will contain the operating system's filesystem and files).<br />
<br />
When the new image has been created, click 'Settings', then CD/DVD-ROM, check 'Mount CD/DVD Drive' then select an ISO image.<br />
<br />
==Maintenance==<br />
<br />
===Rebuild the vboxdrv Module===<br />
Note that any time your kernel version changes (due to upgrade, recompile, etc.) you must also rebuild the VirtualBox kernel. To do this, on virtualbox_bin from AUR '''or''' on versions earlier than 2.1, run the following command:<br />
# vbox_build_module<br />
This binary will be located in one of the following locations: <tt>/sbin</tt>, <tt>/bin</tt>, or <tt>/usr/bin</tt>.<br />
{{Note|If you are using one of the Virtualbox PKGBUILD's from the AUR, you will also need to update your modules via this method. In most cases, users of x86_64 will need to use one of the PKBUILDS of Virtualbox since the official repos only have support for the i686 architecture.}}<br />
<br />
On versions 2.1+, update the kernel module by running the following command:<br />
# /etc/rc.d/rc.vboxdrv setup<br />
<br />
After rebuilding the module, do not forget to load it with<br />
# modprobe vboxdrv<br />
<br />
On VirtualBox v3.1.2 and possibly later /etc/rc.d/rc.vboxdrv does not exist.<br />
<br />
Install ''kernel26-headers''. This is difference than the kernel-headers package<br />
<br />
As root, run:<br />
# KERN_DIR=/usr/src/<your kernel directory> KERN_INCL=/usr/include vbox_build_module}}<br />
<br />
''vboxdrv'' and ''vboxnetflt'' should be in the MODULES=() section of your /etc/rc.conf<br />
<br />
===Compact a Disk Image===<br />
See [http://my.opera.com/locksley90/blog/2008/06/01/how-to-compact-a-virtualbox-virtual-disk-image-vdi How to compact a VirtualBox virtual disk image (VDI)]<br />
<br />
===Windows Xp and Nokia phones===<br />
To get working Windows XP and Nokia phones with Pc Suite mode, Virtualbox needs two simple steps:<br />
<br />
'''1.''' Add a rule to udev with {{Filename|/etc/udev/rules.d/40-permissions.rules}}:<br />
LABEL="usb_serial_start"<br />
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", \<br />
GROUP="usbfs", MODE="0660", GROUP="dialout"<br />
LABEL="usb_serial_end"<br />
<br />
'''2.''' Create the group usbfs and add its user to it<br />
$ sudo groupadd usbfs<br />
$ sudo usermod -a -G usbfs $USER<br />
<br />
After a logout, connect a Nokia phone with PC Suite mode and start Windows XP to test new rule.<br />
<br />
==Migrating From Another VM==<br />
The <code>qemu-img</code> program can be used to convert images from one format to another, or add compression or encryption to an image. <br />
# pacman -S qemu<br />
<br />
===Converting from QEMU images===<br />
To convert a QEMU image for use with VirtualBox, first convert it to ''raw'' format, then use VirtualBox's conversion utility to convert and compact it in its native format.<br />
$ qemu-img convert -O raw test.qcow2 test.raw<br />
$ VBoxManage modifyvdi /full/path/to/test.vdi compact<br />
<br />
===Converting from VMware images ===<br />
Do <br />
$ qemu-img convert image.vmdk image.bin<br />
$ VBoxManage convertdd image.bin image.vdi<br />
<br />
This may not be needed anymore with recent virtualbox versions (to be confirmed)<br />
<br />
==Tips and Tricks==<br />
<br />
===Sending a CTRL+ALT+F1 to the Guest===<br />
If your guest O/S is a Linux distro, and you want to open a new tty text shell or exit X via typing {{Keypress|Ctrl}}+{{Keypress|Alt}}+{{Keypress|F1}}, you can easily send this command to the guest O/S simply by hitting your 'Host Key' (usually the {{Keypress|Ctrl}} in the Right side of your keyboard) + {{Keypress|F1}} or {{Keypress|F2}}, etc.<br />
<br />
===Speeding up HDD Access for the Guest===<br />
Enabling the SATA(AHCI) controller within Virtualbox can speed up Host disk operations. This is available though Settings>Hard Disks in current versions of Virtual Box.<br />
<br />
===Starting VMs at System Boot on Headless Servers===<br />
exec /bin/su PREFERRED_USER -l -c "/bin/bash --login -c \"VBoxHeadless -startvm {UUID}\" >/dev/null 2>&1"<br />
Where PREFERRED_USER is the user profile that contains the VM definitions and .vdi files. This will start the VM with a RDP server running on port 3389.<br />
To determine the available VMs for a user:<br />
su PREFERRED_USER -c "VBoxManage list vms"<br />
To suspend the VM:<br />
su PREFERRED_USER -c "VBoxManage controlvm {UUID} savestate"<br />
<br />
===Accessing Server on VM from Host===<br />
To access apache on a VM from the Host machine ONLY, simply execute the following lines on the Host:<br />
$ VBoxManage setextradata GuestName "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/HostPort" 8888<br />
$ VBoxManage setextradata GuestName "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/GuestPort" 80<br />
$ VBoxManage setextradata GuestName "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/Protocol" TCP<br />
Where 8888 is the port the host should listen on and 80 is the port the VM will send Apache's signal on. <br />
To use a port lower than 1024 on the host machine changes need to be made to the firewall on the host machine. This can also be set up to work with SSH, etc.. by changing "Apache" to whatever service and using different ports. <br />
<br />
Note: "pcnet" refers to the network card of the VM. If you use an Intel card in your VM settings change "pcnet" to "e1000"<br />
<br />
*from [http://mydebian.blogdns.org/?p=111 ]<br />
<br />
It might also be necessary to allow connections from the outside to the server in your VM. E.g. if the guest OS is Arch, you may want to add the line <br />
httpd: ALL<br />
to your /etc/hosts.allow file.<br />
<br />
==Running Arch Linux as a guest==<br />
To install guest additions with support for Xorg follow these steps:<br />
{{Note|Run these steps as root}}<br />
$ pacman -S xorg<br />
{{Note|install entire group (is everything actually required?)}}<br />
$ pacman -S kernel26-headers gcc make<br />
$ mount and install VirtualBox guest additions<br />
$ X -configure<br />
$ change the mouse driver from "mouse" to "vboxmouse" in /root/xorg.conf.new<br />
$ mv /root/xorg.conf.new /etc/X11/xorg.conf<br />
$ add hal to DAEMONS in rc.conf<br />
{{Note|It is not required to add rc.vboxadd to DAEMONS because it is added to /etc/rc.local automatically}}<br />
{{Note|Run these steps while logged into your user account}}<br />
$ add /usr/bin/VBoxClient-all to the top of ~/.xinitrc (even if ~/.xinitrc does not exist)<br />
<br />
==External Links==<br />
* [http://download.virtualbox.org/virtualbox/2.0.6/UserManual.pdf VirtualBox 2.0.6 User Manual]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Talk:System_backup&diff=92673Talk:System backup2010-01-18T22:33:10Z<p>VitaminJ: GRUB and rsync permissions</p>
<hr />
<div>== Suggestions ==<br />
<br />
Page title does not use [[ArchWiki_Tutorial_(English)#Adding_a_new_page|naming guidelines]]. Also, a forward slash between two words defines an either/or option (e.g. Backup for full/partial configurations) which I don't think is meant to be the case here.<br />
<br />
--[[User:Gen2ly|Gen2ly]] 06:16, 12 December 2009 (EST)<br />
<br />
:The slash was supposed to be a subpage. It looks like that's disabled in this wiki for article namespace (as it is in Wikipedia) so I'll just change it. [[User:Time|Time]] 07:05, 12 December 2009 (EST)<br />
<br />
:''Full System Backup with rsync''? If not, go ahead and change it. [[User:Time|Time]] 07:14, 12 December 2009 (EST)<br />
<br />
:: Just got a chance to read the article, nice work.<br />
:: --[[User:Gen2ly|Gen2ly]] 14:32, 13 December 2009 (EST)<br />
<br />
<br />
Thanks [[User:Time]] for taking the time to rewrite this :) It looks good and it's more generic now, also thanks for keeping the link to the original forum post.<br />
<br />
* I vote for moving this page back to its initial title (Full system backup with rsync) since it can't be merged with [[Rsync]].<br />
<br />
[[User:Wooptoo|Wooptoo]] 13:26, 23 December 2009 (EST)<br />
<br />
===Restore title===<br />
I cannot move it back to the same title without admin intervention. They have to delete the redirect first. Sorry for changing the name in the first place; I didn't realize subsections worked only for user pages. [[User:Pwd|pwd]] 13:27, 23 December 2009 (EST)<br />
:Oops! Sorry; didn't realize that was the cause of the hold-up. I've removed the redirect. -- [[User:Pointone|pointone]] 13:34, 23 December 2009 (EST)<br />
<br />
::Moved the page even though I don't like the title. I really don't think the naming scheme suits it; should be ''Full system backup with rsync'', in my opinion. <small>[[User:Pwd|pwd]]</small> 14:10, 23 December 2009 (EST)<br />
<br />
== Comments ==<br />
<br />
Thanks! Neat method for a sync-type backup! The only question I have is what happens if you {{Codeline|dd}} the boot sector (first 512 bytes) instead of running GRUB? --[[User:VitaminJ|VitaminJ]] 22:18, 11 November 2009 (EST)<br />
<br />
---- <br />
<br />
I don't know if it works with <code>dd</code>, since the partitioning scheme can be different on the two harddrives.<br />
<br />
* I vote for merging this with [[rsync]].<br />
* I second the vote.<br />
<br />
[[User:Wooptoo|Wooptoo]] 07:14, 2 December 2009 (EST)<br />
--[[User:Keiichi|Keiichi]] 20:59, 2 December 2009 (EST)<br />
----<br />
Yep, I think you are right, I think that GRUB hardcodes the path to menu.lst in the GRUB boot program, so if you change around disks it won't work.<br />
<br />
As an alternative, an article on using tar instead might be useful because rsync may improperly preserves permissions across filesystems. For example if you backup from ext3 to XFS, and try to restore back to ext3.</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Synchronization_and_backup_programs&diff=83216Synchronization and backup programs2009-11-12T04:13:24Z<p>VitaminJ: Cleanup, caps</p>
<hr />
<div>== Intro ==<br />
<br />
This wiki page contains information about various backup programs. It's a good idea to ''have'' regular backups of important data, most notably configuration files (<tt>/etc/*</tt>) and local pacman database (usually <tt>/var/lib/pacman/local/*</tt>).<br />
<br />
Few words to end the introduction: before you start trying programs out, try to think about your needs, e.g. consider the following questions:<br />
* What backup medium do I have available?<br />
** cd / dvd<br />
** remote server (With what access? Ssh? Can I install some software on it (necessary for e.g. rsync-based solutions)?)<br />
** external harddrive<br />
* How often do I plan to backup?<br />
** daily?<br />
** weekly?<br />
** less often?<br />
* What goodies do I expect from the backup solution?<br />
** compression? (what algorithms?)<br />
** encryption? (gpg or something more straightforward?)<br />
* Most importantly: how do I plan to restore backups if needed?<br />
<br />
All right, enough with this, let's see some options!<br />
<br />
== Incremental backups ==<br />
<br />
The point with these is that they remember what has been backed up during the last run, and back up only what has changed. Great if you back up often.<br />
<br />
=== Rsync-type backups ===<br />
The main characteristic of this type of backups is that they maintain a copy of the directory you want to keep a backup of, in a traditional "mirror" fashion.<br />
<br />
Certain rsync-type packages also do snapshot backups by storing files which describe the how the contents of files and folders changed from the last backup (the so-called 'diffs'). Hence, they are inherently incremental, but usually they don't have compression/encryption. On the other hand, a working copy of everything is immediately available, no decompression/decryption needed. Finally the way it works makes it hard to burn backups to cd/dvd..<br />
<br />
===== CLI =====<br />
*[http://www.samba.org/rsync/ rsync] (in extra repo)<br />
**rsync almost always makes a mirror of the source<br />
**Impossible to restore a backup before the most recent backup<br />
**Win32 version available<br />
*[http://www.nongnu.org/rdiff-backup/ rdiff-backup] (in community repo)<br />
**Stores most recent backup as regular files<br />
**To revert to older versions, you apply the diff files to recreate the older versions<br />
**It is truly granularly incremental (delta backup), it only stores changes to a file; will not create a new copy of a file upon change<br />
**Win32 version available<br />
*[http://www.rsnapshot.org rsnapshot] (in community repo) <br />
**Does not store diffs, instead it copies entire files if they have changed<br />
**Creates hard links between a series of backed-up trees (snapshots)<br />
**It is incremental in that the size of the backup is only the original backup size plus the size of all files that have changed since the last backup.<br />
**Destination filesystem must support hard links<br />
**Win32 version available<br />
*[http://safekeep.sourceforge.net/ SafeKeep] (in AUR)<br />
**Enhancement to rdiff-backup<br />
**Integrates with Linux LVM and databases to create consistent backups<br />
**Bandwidth throttling<br />
* [http://www.scottlu.com/Content/Link-Backup.html Link-Backup] ([http://aur.archlinux.org/packages.php?ID=16929 AUR] may be patched with additional features) is similar to rsync based scripts, but does not use rsync<br />
** Creates hard links between a series of backed-up trees (snapshots)<br />
** Intelligently handles renames, moves, and duplicate files without additional storage or transfer<br />
** dstdir/.catalog is a catalog of all unique file instances; backup trees hard-link to the catalog<br />
** If a backup tree would be identical to the previous backup tree, it won't be needlessly created<br />
** Transfer occurs over standard I/O locally or remotely between a client and server instance of this script<br />
** It copies itself to the server; it does not need to be installed on the server<br />
** Remote backups rely on SSH<br />
** It resumes stopped backups; it can even be told to run for n minutes<br />
<br />
===== GUI =====<br />
*[http://backintime.le-web.org/ Back In Time] (in AUR)<br />
**Creates hard links between a series of backed-up trees (snapshots)<br />
**Inspired by FlyBack and TimeVault<br />
**Really is just a front-end to rsync, diff, cp<br />
**A new snapshot is created only if something changed since the last snapshot<br />
*[http://www.flyback-project.org/ FlyBack] (in AUR)<br />
**A clone of Apple's Mac OS X Time Machine software<br />
*[http://areca.sourceforge.net/ Areca Backup] (in AUR)<br />
**Written in Java<br />
**Primarily archive-based (ZIP), but will do file-based backup as well<br />
**Claims delta backup supported (stores only changes)<br />
*[https://wiki.ubuntu.com/TimeVault TimeVault] (in AUR)<br />
**Creates hard links between a series of backed-up trees (snapshots)<br />
**Imitates Windows Volume Shadow Copy feature in that it integrates with Nautilus to provide a "Previous Versions" tab in the Properties dialog.<br />
<br />
=== Not rsync-based ===<br />
<br />
They tend to create (big) archive files (like tar.bz2), and (of course) keep track of what's been archived. Now creating tar.bz2 or tar.gz archives has the advantage that you can extract the backups with just tar/bzip2/gzip, so you don't need to have the backup program around.<br />
<br />
* [[Backup with arch-backup|arch-backup]] (in community repo); [http://code.google.com/p/archlinux-stuff/ website]); trivial backup scripts with simple configuration:<br />
** compression method can be configured<br />
** possible to specify more directories to backup<br />
<br />
* [[Backup with hdup|hdup]] (in extra repo; [http://miek.nl/projects/hdup2/ website]; it's no longer developed, the author develops rdup now (below); but it's still a decent one):<br />
** creates tar.gz or tar.bz2 archives<br />
** supports gpg encryption<br />
** supports pushing over ssh<br />
** possible to specify more directories to backup<br />
<br />
* [http://miek.nl/projects/rdup rdup] (in [http://aur.archlinux.org/packages.php?ID=3728 AUR]) successor to hdup: the program *just determines* which files have changed since the last backup. It's completely up to you what do you want to do with that list. Some helper scripts are supplied, and with them it supports:<br />
** creating tar.gz archives '''or''' rsync-type copy<br />
** encryption (gpg and usual strong (eg. blowfish)), also applies for rsync-type copy<br />
** compression (also for rsync-type copy)<br />
<br />
* [http://www.nongnu.org/duplicity/ duplicity] (in community repo) is similar to hdup, supports tarring and encrypting. But:<br />
** the files backed up are "randomly" distributed between encrypted tar archives, which makes it harder to recover a particular file<br />
** you can backup just one directory at a time (while with hdup you can specify as many as you want in one backup profile)<br />
<br />
* [http://dar.linux.free.fr/ dar] (in community repo): <br />
** it uses its own format for archives (so you need to have it around when you want to restore)<br />
** supports splitting backups into more files by size<br />
** makefile-type config files, some custom scripts are available along with it<br />
** supports basic encryption (not gpg; but also strong, but you need to supply a password every time)<br />
** some gui tools for inspecting backups are also available (kdar, in [http://aur.archlinux.org/packages.php?ID=7586 AUR], but current dar needs beta version)<br />
** a script suitable for running from cron is [http://sarab.sourceforge.net/ sarab] (in [http://aur.archlinux.org/packages.php?ID=17044 AUR]): supports pretty much any backup scheme (Towers of Hanoi, Grandfather-Father-Son, etc..)<br />
<br />
* [http://sourceforge.net/projects/backerupper/ backerupper] (in [http://aur.archlinux.org/packages.php?ID=17441 AUR]) Backerupper is a simple program for backing up selected directories over a local network. Its main intended purpose is backing up a user's personal data.<br />
** GUI based<br />
** creating tar.gz archives<br />
** possible to define : backup frequency, backup time, Max copies<br />
<br />
* [http://trac.manent-backup.com/ Manent] (in [http://aur.archlinux.org/packages.php?ID=19241 AUR]) is an algorithmically strong backup and archival program. It's Python based and has the following features:<br />
** Efficient backup to anything that looks like a storage<br />
** Works well over a slow and unreliable network<br />
** Offers online access to the contents of the backup<br />
** Backed up storage is completely encrypted<br />
** Several computers can use the same storage for backup, automatically sharing data<br />
** Not reliant on timestamps of the remote system to detect changes<br />
** Cross-platform support for Unicode file names<br />
<br />
=== Cloud backups ===<br />
<br />
* [http://www.getdropbox.com Dropbox] (in [http://aur.archlinux.org/packages.php?ID=19615 AUR] with Gnome support, and also [http://aur.archlinux.org/packages.php?ID=23363 AUR] without Gnome dependencies). <br />
** A daemon monitors a specified directory, and uploads incremental changes to Dropbox.com. <br />
** Changes automatically show up on your other computers. <br />
** Includes file sharing and a public directory. <br />
** You can recover deleted files. <br />
** Community written add-ons. <br />
** Free accounts have 2GB storage.<br />
<br />
* [http://www.jungledisk.com/ Jungle Disk] (in [http://aur.archlinux.org/packages.php?ID=15015 AUR])<br />
** Automatic backups to Amazon's servers.<br />
** Not free, but very low prices.<br />
<br />
== Not incremental backups ==<br />
* [http://k7z.sourceforge.net/ Q7Z] (in [http://aur.archlinux.org/packages.php?ID=12822 AUR]) is a P7Zip GUI for Linux, which attempts to simplify data compression and backup. It can create the following archive types: 7z, BZip2, Zip, GZip, Tar. Use Q7Z if you want to:<br />
** Update existing archives quickly<br />
** Backup multiple folders to a storage location<br />
** Create or extract protected archives<br />
** Lessen effort by using archiving profiles and lists<br />
* "Just copy everything into one big archive, but support writing to cd/dvd"-type: [http://www2.backup-manager.org/ backup-manager] (in [http://aur.archlinux.org/packages.php?ID=4351 AUR])<br />
* [[Partclone]] -- back up and restore only the used blocks of a partition<br />
* filesystem-backup -- simple bash script (was originally a MySQL backup script) that creates a rolling 7 days, rolling 4 weeks and static monthly backups in tar format. Good for servers without a GUI. Available in repo: http://repo.falconn.nl/any/<br />
* [http://clonezilla.org/ Clonezilla]<br />
**Boots from live CD, USB flash drive, or PXE server<br />
**Uses Partimage, ntfsclone, partclone, and dd, <br />
**Compatability with many file systems (ext2, ext3, ext4, reiserfs, xfs, jfs of GNU/Linux, FAT, NTFS, and HFS+)<br />
**Multicasting server to restore to many machines at once<br />
**If file system is supported , only used blocks in harddisk are saved and restored. For unsupported file system, sector-to-sector copy is done<br />
* [http://www.partimage.org/Main_Page Partimage]<br />
<br />
== Versioning systems ==<br />
<br />
These are traditionally used for keeping track of software development; but if you want to have a simple way to manage your config files in one directory, it might be a good solution.<br />
<br />
* [http://www.selenic.com/mercurial/wiki/ mercurial] or [http://git.or.cz/ git] (both in extra repo)<br />
* [http://eigenclass.org/hiki/gibak-backup-system-introduction gibak]: a backup system based on git. it also supports binary diffs (for binaries, e-books, pictures, multimedia files, etc). on the homepage there is a short usage advice. it is meant to backup only the $HOME directory. one could also backup other directories (like /etc) by changing the $HOME variable to point to that directory (though i don't really recommend this). gibak is handy for people who are familiar with git. it uses .gitignore to filter files and one can use the git commands to restore files, browse through logs, diffs, etc. if one needs a gui, it is also possible to use gitk or qgit to browse through commits or do whatever these interfaces support. get it from AUR: http://aur.archlinux.org/packages.php?ID=18318.<br />
== Articles ==<br />
<br />
* [http://www.halfgaar.net/backing-up-unix Backing up Linux and other Unix(-like) systems]<br />
<br />
[[Category:Backup (English)]]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Hdup&diff=83213Hdup2009-11-12T03:57:44Z<p>VitaminJ: Link to rdup</p>
<hr />
<div>[[Category:System recovery (English)]]<br />
[[Category:HOWTOs (English)]]<br />
== Intro ==<br />
This wiki page contains a guide on how to set up [http://www.miek.nl/projects/hdup2/hdup.html hdup], "The little, spiffy, backup tool". (Don't be discouraged by the fact that on its website it says "Unmaintained!". It's mature program, and that warning means only that its author, Miek Gieben, develops and uses a similar program ([http://www.miek.nl/projects/rdup/index.html rdup]), which is a bit more difficult to use.) Although {{Filename|hdup}} it's a command line program, it's easy to set up, so don't be afraid.<br />
<br />
=== Features ===<br />
* archives are tar.bz2 (or tar.gz)<br />
* incremental backups (monthly-weekly-daily scheme)<br />
* backups over ssh<br />
* encrypted backups (mcrypt, gpg)<br />
<br />
=== Other backup programs ===<br />
See the general wiki article about [[backup programs]].<br />
<br />
== Installing/running/restoring ==<br />
<br />
=== Installing and setting hdup up ===<br />
<br />
* hdup is in [extra] repo, so you can install it via pacman:<br />
pacman -S hdup<br />
* We need to edit the configuration file '''/etc/hdup/hdup.conf'''. There's one supplied, so you can just edit that one; or you can use the minimal one listed here:<br />
[global]<br />
# to which dir the archives will be written<br />
archive dir = /vol/backup<br />
# chown the archives to this user<br />
user = <yourusername><br />
<br />
[my-comp]<br />
# what to backup, separate with ,.<br />
# For directories add closing slash, like /home/<br />
dir = /home/,/var/abs/local/<br />
# don't include theses directories<br />
exclude = lost\+found/, /proc/, /dev/, /sys/<br />
* You '''need to modify''' at least the following options:<br />
** '''archive dir''': that's where the backups will be written to<br />
** '''user''': created archives will be chowned to this user; you can just use your username. This is needed since hdup needs to be run as root.<br />
** '''dir''': that's the list of directories whose contents you want to back up).<br />
<br />
The rest of the comments about the config file can be skipped on the first<br />
reading. They describe various other options you can use if the hdup.conf file:<br />
* You can have more than one ''profile'' (the one used above is named '''my-comp'''). This means that you can have a couple of independent backup schemes. For instance, you might want to have another one for your webpages:<br />
[my-webpages]<br />
dir = /var/www/<br />
* To have a simple means of excluding some directories, use the '''nobackup''' option. It specifies the filename, which if it exists in a directory, then that directory is excluded from backing up.<br />
nobackup = .nobackup<br />
This can be used for example to exclude backing up of opera cache, by creating and empty .nobackup file in the cache directory:<br />
touch ~/.opera/cache4/.nobackup<br />
* You can specify the compression algorithm used:<br />
compression = bzip<br />
compression level = 6<br />
* hdup refuses to restore backups to / by default, since it can be dangerous. To override this, use<br />
# allow restoring to /<br />
force = yes<br />
<br />
=== Running hdup ===<br />
<br />
Let's first explain the monthly-weekly-daily scheme of backups. The 'monthly'<br />
archives contain all the data you specify to backup. The 'weekly' archives<br />
contain only those files, which have changed from the last 'monthly' backup.<br />
Finally, 'daily' contain only those which have changed from the last 'weekly'<br />
backup.<br />
<br />
Of course, 'monthly', 'weekly' and 'daily' are just names, you don't need to<br />
perform backups in these intervals. But you cannot perform a 'weekly', unless<br />
you have at least one 'monthly', etc.<br />
<br />
So, how does hdup implement this scheme?<br />
<br />
As root, you can run hdup with the command like<br />
hdup monthly my-comp<br />
This creates a directory 'my-comp' in the directory you specified in the config file (/vol/backup), and inside it two other directories: 'etc' and (current date) '2008-02-23'. The 'etc' one contains some hdup's files, and the '2008-02-23' one will have a big .tar.bz2 archive in it. That's your backup.<br />
<br />
After some time after 'monthly' backup, you decide you want to backup again. Now you can run hdup as<br />
hdup weekly my-comp<br />
and hdup will archive only what has changed from the 'monthly', and the archive will be put into another dir named after current date in /vol/backup/my-comp.<br />
<br />
It should be clear now how the backing up works. Note that if hdup cannot find a 'monthly' and you ask it to do a 'weekly', it will complain. See the tips section.<br />
<br />
=== Restoring backups ===<br />
<br />
To restore, you need to have all 'parent' archives (ie. if you want to restore a weekly backup, you also need to have its 'monthly' available). The command for restoring is<br />
hdup restore my-comp 2008-01-31 /somedir<br />
With this, hdup will try to restore things as they've been up to the date specified, and it will unpack to the directory /somedir. You can force it to unpack right away to / (see 'force' option above), but be very careful with this!<br />
<br />
Note that the backups are just .tar.bz2 archives, so if you need a particular file from a particular date, just use any archive manager (or tar and bzip2) to open the archive and copy the needed file over.<br />
<br />
=== More goodies: encryption and ssh ===<br />
<br />
If you've got here, let me remind you that '''man hdup''' and '''man hdup.conf''' are your friends!<br />
<br />
* For gpg encryption, you want to add something like<br />
algorithm = gpg<br />
key = <your gpg key identifier><br />
either to [global] (then it's going to be used for all profiles), or just to a profile part. The archives will then be encrypted with your public key (so you can only decrypt them with your secret key). Note that you can decrypt them manually with<br />
gpg -d <archive file><br />
in case you need it.<br />
<br />
* For other encryption (e.g. mcrypt), just add<br />
algorithm = mcrypt<br />
In this case, hdup will ask for a password both when archiving and restoring.<br />
<br />
==== Backing up over SSH ====<br />
<br />
To backup your local machine (say, laptop) to remote machine (your server) you need to install hdup to both machines.<br />
<br />
On the remote machine you need to have following settings in [global]<br />
archive dir = /backup/path/on/remote<br />
allow remote = yes<br />
<br />
And make a same host entry to the remote hdup.conf than you have in the local hdup.conf.<br />
<br />
So if you have <br />
[my-comp]<br />
dir = /home/<br />
exclude = lost\+found ...<br />
<br />
Add to the remote hdup.conf<br />
[my-comp]<br />
Nothing else is needed, just the [host] entry<br />
<br />
Now you can backup your laptop to your server using following command<br />
hdup monthly my-comp @username@myserver.com<br />
<br />
=== Tips ===<br />
<br />
* You can of course burn the archives to cd/dvd with any burning software you like. The only thing to remember here is that the 'parent' archive is needed when you're doing a 'child' backup (like you need 'monthly' for 'weekly'). However, if you're tight on space, this can be achieved by mounting the cd/dvd with 'parent' backup, and soft linking its directory into /vol/backup, so that hdup can find it there.<br />
<br />
== Troubleshooting ==<br />
<br />
On Debian Etch, I had to add the ''-P'' option when running ''hdup''. This solved the following error:<br />
<br />
/bin/tar: /opt/backup/debian/etc/filelist: file name read contains null</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Synchronization_and_backup_programs&diff=83212Synchronization and backup programs2009-11-12T03:54:48Z<p>VitaminJ: Forgot SafeKeep!</p>
<hr />
<div>== Intro ==<br />
<br />
This wiki page contains information about various backup programs. It's a good idea to ''have'' regular backups of important data, most notably configuration files (<tt>/etc/*</tt>) and local pacman database (usually <tt>/var/lib/pacman/local/*</tt>).<br />
<br />
Few words to end the introduction: before you start trying programs out, try to think about your needs, e.g. consider the following questions:<br />
* What backup medium do I have available?<br />
** cd / dvd<br />
** remote server (With what access? Ssh? Can I install some software on it (necessary for e.g. rsync-based solutions)?)<br />
** external harddrive<br />
* How often do I plan to backup?<br />
** daily?<br />
** weekly?<br />
** less often?<br />
* What goodies do I expect from the backup solution?<br />
** compression? (what algorithms?)<br />
** encryption? (gpg or something more straightforward?)<br />
* Most importantly: how do I plan to restore backups if needed?<br />
<br />
All right, enough with this, let's see some options!<br />
<br />
== Incremental backups ==<br />
<br />
The point with these is that they remember what has been backed up during the last run, and back up only what has changed. Great if you back up often.<br />
<br />
=== Rsync-type backups ===<br />
The main characteristic of this type of backups is that they maintain a copy of the directory you want to keep a backup of, in a traditional "mirror" fashion.<br />
<br />
Certain rsync-type packages also do snapshot backups by storing files which describe the how the contents of files and folders changed from the last backup (the so-called 'diffs'). Hence, they are inherently incremental, but usually they don't have compression/encryption. On the other hand, a working copy of everything is immediately available, no decompression/decryption needed. Finally the way it works makes it hard to burn backups to cd/dvd..<br />
<br />
===== CLI =====<br />
*[http://www.samba.org/rsync/ rsync] (in extra repo)<br />
**rsync almost always makes a mirror of the source<br />
**Impossible to restore a backup before the most recent backup<br />
**Win32 version available<br />
*[http://www.nongnu.org/rdiff-backup/ rdiff-backup] (in community repo)<br />
**Stores most recent backup as regular files<br />
**To revert to older versions, you apply the diff files to recreate the older versions<br />
**It is truly granularly incremental (delta backup), it only stores changes to a file; will not create a new copy of a file upon change<br />
**Win32 version available<br />
*[http://www.rsnapshot.org rsnapshot] (in community repo) <br />
**Does not store diffs, instead it copies entire files if they have changed<br />
**Creates hard links between a series of backed-up trees (snapshots)<br />
**It is incremental in that the size of the backup is only the original backup size plus the size of all files that have changed since the last backup.<br />
**Destination filesystem must support hard links<br />
**Win32 version available<br />
*[http://safekeep.sourceforge.net/ SafeKeep] (in AUR)<br />
**Enhancement to rdiff-backup<br />
**Integrates with Linux LVM and databases to create consistent backups<br />
**Bandwidth throttling<br />
* [http://www.scottlu.com/Content/Link-Backup.html Link-Backup] ([http://aur.archlinux.org/packages.php?ID=16929 AUR] may be patched with additional features) is similar to rsync based scripts, but does not use rsync<br />
** Creates hard links between a series of backed-up trees (snapshots)<br />
** Intelligently handles renames, moves, and duplicate files without additional storage or transfer<br />
** dstdir/.catalog is a catalog of all unique file instances; backup trees hard-link to the catalog<br />
** If a backup tree would be identical to the previous backup tree, it won't be needlessly created<br />
** Transfer occurs over standard I/O locally or remotely between a client and server instance of this script<br />
** It copies itself to the server; it does not need to be installed on the server<br />
** Remote backups rely on SSH<br />
** It resumes stopped backups; it can even be told to run for n minutes<br />
<br />
===== GUI =====<br />
*[http://backintime.le-web.org/ Back In Time] (in AUR)<br />
**Creates hard links between a series of backed-up trees (snapshots)<br />
**Inspired by FlyBack and TimeVault<br />
**Really is just a front-end to rsync, diff, cp<br />
**A new snapshot is created only if something changed since the last snapshot<br />
*[http://www.flyback-project.org/ FlyBack] (in AUR)<br />
**A clone of Apple's Mac OS X Time Machine software<br />
*[http://areca.sourceforge.net/ Areca Backup] (in AUR)<br />
**Written in Java<br />
**Primarily archive-based (ZIP), but will do file-based backup as well<br />
**Claims delta backup supported (stores only changes)<br />
*[https://wiki.ubuntu.com/TimeVault TimeVault] (in AUR)<br />
**Creates hard links between a series of backed-up trees (snapshots)<br />
**Imitates Windows Volume Shadow Copy feature in that it integrates with Nautilus to provide a "Previous Versions" tab in the Properties dialog.<br />
<br />
=== Not rsync-based ===<br />
<br />
They tend to create (big) archive files (like tar.bz2), and (of course) keep track of what's been archived. Now creating tar.bz2 or tar.gz archives has the advantage that you can extract the backups with just tar/bzip2/gzip, so you don't need to have the backup program around.<br />
<br />
* [[Backup with arch-backup|arch-backup]] (in community repo); [http://code.google.com/p/archlinux-stuff/ website]); trivial backup scripts with simple configuration:<br />
** compression method can be configured<br />
** possible to specify more directories to backup<br />
<br />
* [[Backup with hdup|hdup]] (in extra repo; [http://miek.nl/projects/hdup2/ website]; it's no longer developed, the author develops rdup now (below); but it's still a decent one):<br />
** creates tar.gz or tar.bz2 archives<br />
** supports gpg encryption<br />
** supports pushing over ssh<br />
** possible to specify more directories to backup<br />
<br />
* [http://miek.nl/projects/rdup rdup] (in [http://aur.archlinux.org/packages.php?ID=3728 AUR]) successor to hdup: the program *just determines* which files have changed since the last backup. It's completely up to you what do you want to do with that list. Some helper scripts are supplied, and with them it supports:<br />
** creating tar.gz archives '''or''' rsync-type copy<br />
** encryption (gpg and usual strong (eg. blowfish)), also applies for rsync-type copy<br />
** compression (also for rsync-type copy)<br />
<br />
* [http://www.nongnu.org/duplicity/ duplicity] (in community repo) is similar to hdup, supports tarring and encrypting. But:<br />
** the files backed up are "randomly" distributed between encrypted tar archives, which makes it harder to recover a particular file<br />
** you can backup just one directory at a time (while with hdup you can specify as many as you want in one backup profile)<br />
<br />
* [http://dar.linux.free.fr/ dar] (in community repo): <br />
** it uses its own format for archives (so you need to have it around when you want to restore)<br />
** supports splitting backups into more files by size<br />
** makefile-type config files, some custom scripts are available along with it<br />
** supports basic encryption (not gpg; but also strong, but you need to supply a password every time)<br />
** some gui tools for inspecting backups are also available (kdar, in [http://aur.archlinux.org/packages.php?ID=7586 AUR], but current dar needs beta version)<br />
** a script suitable for running from cron is [http://sarab.sourceforge.net/ sarab] (in [http://aur.archlinux.org/packages.php?ID=17044 AUR]): supports pretty much any backup scheme (Towers of Hanoi, Grandfather-Father-Son, etc..)<br />
<br />
* [http://sourceforge.net/projects/backerupper/ backerupper] (in [http://aur.archlinux.org/packages.php?ID=17441 AUR]) Backerupper is a simple program for backing up selected directories over a local network. Its main intended purpose is backing up a user's personal data.<br />
** GUI based<br />
** creating tar.gz archives<br />
** possible to define : backup frequency, backup time, Max copies<br />
<br />
* [http://trac.manent-backup.com/ Manent] (in [http://aur.archlinux.org/packages.php?ID=19241 AUR]) is an algorithmically strong backup and archival program. It's Python based and has the following features:<br />
** Efficient backup to anything that looks like a storage<br />
** Works well over a slow and unreliable network<br />
** Offers online access to the contents of the backup<br />
** Backed up storage is completely encrypted<br />
** Several computers can use the same storage for backup, automatically sharing data<br />
** Not reliant on timestamps of the remote system to detect changes<br />
** Cross-platform support for Unicode file names<br />
<br />
=== Cloud backups ===<br />
<br />
* [http://www.getdropbox.com Dropbox] (in [http://aur.archlinux.org/packages.php?ID=19615 AUR] with Gnome support, and also [http://aur.archlinux.org/packages.php?ID=23363 AUR] without Gnome dependencies). <br />
** A daemon monitors a specified directory, and uploads incremental changes to Dropbox.com. <br />
** Changes automatically show up on your other computers. <br />
** Includes file sharing and a public directory. <br />
** You can recover deleted files. <br />
** Community written add-ons. <br />
** Free accounts have 2GB storage.<br />
<br />
* [http://www.jungledisk.com/ Jungle Disk] (in [http://aur.archlinux.org/packages.php?ID=15015 AUR])<br />
** Automatic backups to Amazon's servers.<br />
** Not free, but very low prices.<br />
<br />
== Not incremental backups ==<br />
<br />
* [http://k7z.sourceforge.net/ Q7Z] (in [http://aur.archlinux.org/packages.php?ID=12822 AUR]) is a P7Zip GUI for Linux, which attempts to simplify data compression and backup. It can create the following archive types: 7z, BZip2, Zip, GZip, Tar. Use Q7Z if you want to:<br />
** Update existing archives quickly<br />
** Backup multiple folders to a storage location<br />
** Create or extract protected archives<br />
** Lessen effort by using archiving profiles and lists<br />
<br />
* "Just copy everything into one big archive, but support writing to cd/dvd"-type: [http://www2.backup-manager.org/ backup-manager] (in [http://aur.archlinux.org/packages.php?ID=4351 AUR])<br />
<br />
* [[Partclone]] -- back up and restore only the used blocks of a partition<br />
<br />
* filesystem-backup -- simple bash script (was originally a MySQL backup script) that creates a rolling 7 days, rolling 4 weeks and static monthly backups in tar format. Good for servers without a GUI. Available in repo: http://repo.falconn.nl/any/<br />
<br />
* [http://clonezilla.org/ Clonezilla] boots from live CD and USB flash drive images, to make backup images of hard drives and partitions, as well as copy drives and partitions from one to another. It uses Partimage, ntfsclone, partclone, and dd, which allows for compatability with many file systems (ext2, ext3, ext4 supported in testing branch, reiserfs, xfs, jfs, FAT, NTFS, and HFS+). It will also backup over a network and there is a server edition.<br />
<br />
== Versioning systems ==<br />
<br />
These are traditionally used for keeping track of software development; but if you want to have a simple way to manage your config files in one directory, it might be a good solution.<br />
<br />
* [http://www.selenic.com/mercurial/wiki/ mercurial] or [http://git.or.cz/ git] (both in extra repo)<br />
* [http://eigenclass.org/hiki/gibak-backup-system-introduction gibak]: a backup system based on git. it also supports binary diffs (for binaries, e-books, pictures, multimedia files, etc). on the homepage there is a short usage advice. it is meant to backup only the $HOME directory. one could also backup other directories (like /etc) by changing the $HOME variable to point to that directory (though i don't really recommend this). gibak is handy for people who are familiar with git. it uses .gitignore to filter files and one can use the git commands to restore files, browse through logs, diffs, etc. if one needs a gui, it is also possible to use gitk or qgit to browse through commits or do whatever these interfaces support. get it from AUR: http://aur.archlinux.org/packages.php?ID=18318.<br />
== Articles ==<br />
<br />
* [http://www.halfgaar.net/backing-up-unix Backing up Linux and other Unix(-like) systems]<br />
<br />
[[Category:Backup (English)]]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Synchronization_and_backup_programs&diff=83211Synchronization and backup programs2009-11-12T03:50:35Z<p>VitaminJ: Add descriptions for backup packages and clarify what they do, capitalization fixes</p>
<hr />
<div>== Intro ==<br />
<br />
This wiki page contains information about various backup programs. It's a good idea to ''have'' regular backups of important data, most notably configuration files (<tt>/etc/*</tt>) and local pacman database (usually <tt>/var/lib/pacman/local/*</tt>).<br />
<br />
Few words to end the introduction: before you start trying programs out, try to think about your needs, e.g. consider the following questions:<br />
* What backup medium do I have available?<br />
** cd / dvd<br />
** remote server (With what access? Ssh? Can I install some software on it (necessary for e.g. rsync-based solutions)?)<br />
** external harddrive<br />
* How often do I plan to backup?<br />
** daily?<br />
** weekly?<br />
** less often?<br />
* What goodies do I expect from the backup solution?<br />
** compression? (what algorithms?)<br />
** encryption? (gpg or something more straightforward?)<br />
* Most importantly: how do I plan to restore backups if needed?<br />
<br />
All right, enough with this, let's see some options!<br />
<br />
== Incremental backups ==<br />
<br />
The point with these is that they remember what has been backed up during the last run, and back up only what has changed. Great if you back up often.<br />
<br />
=== Rsync-type backups ===<br />
The main characteristic of this type of backups is that they maintain a copy of the directory you want to keep a backup of, in a traditional "mirror" fashion.<br />
<br />
Certain rsync-type packages also do snapshot backups by storing files which describe the how the contents of files and folders changed from the last backup (the so-called 'diffs'). Hence, they are inherently incremental, but usually they don't have compression/encryption. On the other hand, a working copy of everything is immediately available, no decompression/decryption needed. Finally the way it works makes it hard to burn backups to cd/dvd..<br />
<br />
===== CLI =====<br />
*[http://www.samba.org/rsync/ rsync] (in extra repo)<br />
**rsync almost always makes a mirror of the source<br />
**Impossible to restore a backup before the most recent backup<br />
**Win32 version available<br />
*[http://www.nongnu.org/rdiff-backup/ rdiff-backup] (in community repo)<br />
**Stores most recent backup as regular files<br />
**To revert to older versions, you apply the diff files to recreate the older versions<br />
**It is truly granularly incremental (delta backup), it only stores changes to a file; will not create a new copy of a file upon change<br />
**Win32 version available<br />
*[http://www.rsnapshot.org rsnapshot] (in community repo) <br />
**Does not store diffs, instead it copies entire files if they have changed<br />
**Creates hard links between a series of backed-up trees (snapshots)<br />
**It is incremental in that the size of the backup is only the original backup size plus the size of all files that have changed since the last backup.<br />
**Destination filesystem must support hard links<br />
**Win32 version available<br />
*[http://safekeep.sourceforge.net/ safekeep] (in AUR)<br />
* [http://www.scottlu.com/Content/Link-Backup.html Link-Backup] ([http://aur.archlinux.org/packages.php?ID=16929 AUR] may be patched with additional features) is similar to rsync based scripts, but does not use rsync<br />
** Creates hard links between a series of backed-up trees (snapshots)<br />
** Intelligently handles renames, moves, and duplicate files without additional storage or transfer<br />
** dstdir/.catalog is a catalog of all unique file instances; backup trees hard-link to the catalog<br />
** If a backup tree would be identical to the previous backup tree, it won't be needlessly created<br />
** Transfer occurs over standard I/O locally or remotely between a client and server instance of this script<br />
** It copies itself to the server; it does not need to be installed on the server<br />
** Remote backups rely on SSH<br />
** It resumes stopped backups; it can even be told to run for n minutes<br />
<br />
===== GUI =====<br />
*[http://backintime.le-web.org/ Back In Time] (in AUR)<br />
**Creates hard links between a series of backed-up trees (snapshots)<br />
**Inspired by FlyBack and TimeVault<br />
**Really is just a front-end to rsync, diff, cp<br />
**A new snapshot is created only if something changed since the last snapshot<br />
*[http://www.flyback-project.org/ FlyBack] (in AUR)<br />
**A clone of Apple's Mac OS X Time Machine software<br />
*[http://areca.sourceforge.net/ Areca Backup] (in AUR)<br />
**Written in Java<br />
**Primarily archive-based (ZIP), but will do file-based backup as well<br />
**Claims delta backup supported (stores only changes)<br />
*[https://wiki.ubuntu.com/TimeVault TimeVault] (in AUR)<br />
**Creates hard links between a series of backed-up trees (snapshots)<br />
**Imitates Windows Volume Shadow Copy feature in that it integrates with Nautilus to provide a "Previous Versions" tab in the Properties dialog.<br />
<br />
=== Not rsync-based ===<br />
<br />
They tend to create (big) archive files (like tar.bz2), and (of course) keep track of what's been archived. Now creating tar.bz2 or tar.gz archives has the advantage that you can extract the backups with just tar/bzip2/gzip, so you don't need to have the backup program around.<br />
<br />
* [[Backup with arch-backup|arch-backup]] (in community repo); [http://code.google.com/p/archlinux-stuff/ website]); trivial backup scripts with simple configuration:<br />
** compression method can be configured<br />
** possible to specify more directories to backup<br />
<br />
* [[Backup with hdup|hdup]] (in extra repo; [http://miek.nl/projects/hdup2/ website]; it's no longer developed, the author develops rdup now (below); but it's still a decent one):<br />
** creates tar.gz or tar.bz2 archives<br />
** supports gpg encryption<br />
** supports pushing over ssh<br />
** possible to specify more directories to backup<br />
<br />
* [http://miek.nl/projects/rdup rdup] (in [http://aur.archlinux.org/packages.php?ID=3728 AUR]) successor to hdup: the program *just determines* which files have changed since the last backup. It's completely up to you what do you want to do with that list. Some helper scripts are supplied, and with them it supports:<br />
** creating tar.gz archives '''or''' rsync-type copy<br />
** encryption (gpg and usual strong (eg. blowfish)), also applies for rsync-type copy<br />
** compression (also for rsync-type copy)<br />
<br />
* [http://www.nongnu.org/duplicity/ duplicity] (in community repo) is similar to hdup, supports tarring and encrypting. But:<br />
** the files backed up are "randomly" distributed between encrypted tar archives, which makes it harder to recover a particular file<br />
** you can backup just one directory at a time (while with hdup you can specify as many as you want in one backup profile)<br />
<br />
* [http://dar.linux.free.fr/ dar] (in community repo): <br />
** it uses its own format for archives (so you need to have it around when you want to restore)<br />
** supports splitting backups into more files by size<br />
** makefile-type config files, some custom scripts are available along with it<br />
** supports basic encryption (not gpg; but also strong, but you need to supply a password every time)<br />
** some gui tools for inspecting backups are also available (kdar, in [http://aur.archlinux.org/packages.php?ID=7586 AUR], but current dar needs beta version)<br />
** a script suitable for running from cron is [http://sarab.sourceforge.net/ sarab] (in [http://aur.archlinux.org/packages.php?ID=17044 AUR]): supports pretty much any backup scheme (Towers of Hanoi, Grandfather-Father-Son, etc..)<br />
<br />
* [http://sourceforge.net/projects/backerupper/ backerupper] (in [http://aur.archlinux.org/packages.php?ID=17441 AUR]) Backerupper is a simple program for backing up selected directories over a local network. Its main intended purpose is backing up a user's personal data.<br />
** GUI based<br />
** creating tar.gz archives<br />
** possible to define : backup frequency, backup time, Max copies<br />
<br />
* [http://trac.manent-backup.com/ Manent] (in [http://aur.archlinux.org/packages.php?ID=19241 AUR]) is an algorithmically strong backup and archival program. It's Python based and has the following features:<br />
** Efficient backup to anything that looks like a storage<br />
** Works well over a slow and unreliable network<br />
** Offers online access to the contents of the backup<br />
** Backed up storage is completely encrypted<br />
** Several computers can use the same storage for backup, automatically sharing data<br />
** Not reliant on timestamps of the remote system to detect changes<br />
** Cross-platform support for Unicode file names<br />
<br />
=== Cloud backups ===<br />
<br />
* [http://www.getdropbox.com Dropbox] (in [http://aur.archlinux.org/packages.php?ID=19615 AUR] with Gnome support, and also [http://aur.archlinux.org/packages.php?ID=23363 AUR] without Gnome dependencies). <br />
** A daemon monitors a specified directory, and uploads incremental changes to Dropbox.com. <br />
** Changes automatically show up on your other computers. <br />
** Includes file sharing and a public directory. <br />
** You can recover deleted files. <br />
** Community written add-ons. <br />
** Free accounts have 2GB storage.<br />
<br />
* [http://www.jungledisk.com/ Jungle Disk] (in [http://aur.archlinux.org/packages.php?ID=15015 AUR])<br />
** Automatic backups to Amazon's servers.<br />
** Not free, but very low prices.<br />
<br />
== Not incremental backups ==<br />
<br />
* [http://k7z.sourceforge.net/ Q7Z] (in [http://aur.archlinux.org/packages.php?ID=12822 AUR]) is a P7Zip GUI for Linux, which attempts to simplify data compression and backup. It can create the following archive types: 7z, BZip2, Zip, GZip, Tar. Use Q7Z if you want to:<br />
** Update existing archives quickly<br />
** Backup multiple folders to a storage location<br />
** Create or extract protected archives<br />
** Lessen effort by using archiving profiles and lists<br />
<br />
* "Just copy everything into one big archive, but support writing to cd/dvd"-type: [http://www2.backup-manager.org/ backup-manager] (in [http://aur.archlinux.org/packages.php?ID=4351 AUR])<br />
<br />
* [[Partclone]] -- back up and restore only the used blocks of a partition<br />
<br />
* filesystem-backup -- simple bash script (was originally a MySQL backup script) that creates a rolling 7 days, rolling 4 weeks and static monthly backups in tar format. Good for servers without a GUI. Available in repo: http://repo.falconn.nl/any/<br />
<br />
* [http://clonezilla.org/ Clonezilla] boots from live CD and USB flash drive images, to make backup images of hard drives and partitions, as well as copy drives and partitions from one to another. It uses Partimage, ntfsclone, partclone, and dd, which allows for compatability with many file systems (ext2, ext3, ext4 supported in testing branch, reiserfs, xfs, jfs, FAT, NTFS, and HFS+). It will also backup over a network and there is a server edition.<br />
<br />
== Versioning systems ==<br />
<br />
These are traditionally used for keeping track of software development; but if you want to have a simple way to manage your config files in one directory, it might be a good solution.<br />
<br />
* [http://www.selenic.com/mercurial/wiki/ mercurial] or [http://git.or.cz/ git] (both in extra repo)<br />
* [http://eigenclass.org/hiki/gibak-backup-system-introduction gibak]: a backup system based on git. it also supports binary diffs (for binaries, e-books, pictures, multimedia files, etc). on the homepage there is a short usage advice. it is meant to backup only the $HOME directory. one could also backup other directories (like /etc) by changing the $HOME variable to point to that directory (though i don't really recommend this). gibak is handy for people who are familiar with git. it uses .gitignore to filter files and one can use the git commands to restore files, browse through logs, diffs, etc. if one needs a gui, it is also possible to use gitk or qgit to browse through commits or do whatever these interfaces support. get it from AUR: http://aur.archlinux.org/packages.php?ID=18318.<br />
== Articles ==<br />
<br />
* [http://www.halfgaar.net/backing-up-unix Backing up Linux and other Unix(-like) systems]<br />
<br />
[[Category:Backup (English)]]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Talk:System_backup&diff=83199Talk:System backup2009-11-12T03:18:51Z<p>VitaminJ: Feedback</p>
<hr />
<div>Thanks! Neat method for a sync-type backup! The only question I have is what happens if you {{Codeline|dd}} the boot sector (first 512 bytes) instead of running GRUB? --[[User:VitaminJ|VitaminJ]] 22:18, 11 November 2009 (EST)</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Apache_HTTP_Server&diff=83109Apache HTTP Server2009-11-11T18:06:11Z<p>VitaminJ: Adding http user, searching for existing in /etc/passwd</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
[[Category:Web Server (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|LAMP}}<br />
{{i18n_entry|Español|LAMP (Español)}}<br />
{{i18n_entry|Italiano|LAMP (Italiano)}}<br />
{{i18n_entry|Türkçe|LAMP_(Türkçe)}}<br />
{{i18n_entry|Русский|LAMP (russian)}}<br />
{{i18n_entry|Česky|LAMP_(Česky)}}<br />
{{i18n_entry|简体中文|LAMP(简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
== Introduction ==<br />
This document describes how to set up the Apache web server on an Arch Linux system. It also tells how to optionally install PHP and MySQL and integrate these in the Apache server. This combination is commonly referred to as LAMP (Linux Apache MySQL PHP).<br />
<br />
If you only need a web server for development and testing, [[Xampp]] might be a better and easier option.<br />
<br />
== Installation ==<br />
# pacman -S apache php php-apache mysql<br />
<br />
This document assumes you will install Apache, PHP and MySQL together. If desired however, you may install Apache, PHP, and MySQL separately and simply refer to the relevant sections below.<br />
{{Box Note | New default user and group: Instead of group "nobody" apache now runs as user/group "http" by default. You might want to adjust your httpd.conf according to this change, though you may still run httpd as nobody.}}<br />
<br />
== Configuration ==<br />
=== Apache ===<br />
For security reasons, as soon as Apache is started by the root user (directly or via startup scripts) it switches to the UID/GID specified in {{filename|/etc/httpd/conf/httpd.conf}}<br />
* Check for the existence of the http user by looking for ''http'' in the output of the following command:<br />
# cat /etc/shadow<br />
* Create the system user http if it does not exist already<br />
# useradd -d /srv/http -r -s /bin/false -U http<br />
This creates the http user with home directory {{filename|/srv/http/}}, as a system account (-r), with a bogus shell (-s {{filename|/bin/false}}) and creates a group with the same name (-U).<br />
* Add this line to {{Filename|/etc/hosts}} (If the file doesn't exist, create it.):<br />
127.0.0.1 localhost.localdomain localhost<br />
'''Note:''' If you want a different hostname, append it to the end:<br />
127.0.0.1 localhost.localdomain localhost myhostname<br />
<br />
* Edit {{Filename|/etc/[[rc.conf]]}}: If you set a hostname, the {{Codeline|HOSTNAME}} variable should be the same; otherwise, use {{Codeline|"localhost"}}:<br />
#<br />
# Networking<br />
#<br />
HOSTNAME="localhost"<br />
<br />
* Make sure the hostname appears in /etc/hosts or apache will fail to start. Alternatively, you can<br />
edit {{Filename|/etc/httpd/conf/httpd.conf}} as root and comment the following module:<br />
LoadModule unique_id_module modules/mod_unique_id.so<br />
It should now appear as:<br />
#LoadModule unique_id_module modules/mod_unique_id.so<br />
<br />
<br />
* Run the following in a terminal as root to start the HTTP server:<br />
# /etc/rc.d/httpd start<br />
<br />
* Apache should now be running. Test by visiting http://localhost/ in a web browser. It should display a simple Apache test page.<br />
<br />
* To start Apache automatically at boot, edit {{Filename|/etc/rc.conf}} as root and add the '''httpd''' daemon:<br />
DAEMONS=(... '''httpd''' ...)<br />
'''Or''' add this line to {{Filename|/etc/rc.local}}:<br />
/etc/rc.d/httpd start<br />
<br />
* If you want to use user directories (i.e. <tt>~/public_html</tt> on the machine is accessed as <tt>http://localhost/~user/</tt>) to be available on the web, uncomment the following lines in {{Filename|/etc/httpd/conf/extra/httpd-userdir.conf}}:<br />
UserDir public_html<br />
and<br />
<Directory /home/*/public_html><br />
AllowOverride FileInfo AuthConfig Limit Indexes<br />
Options MultiViews Indexes SymLinksIfOwnerMatch ExecCGI<br />
<Limit GET POST OPTIONS PROPFIND><br />
Order allow,deny<br />
Allow from all<br />
</Limit><br />
<LimitExcept GET POST OPTIONS PROPFIND><br />
Order deny,allow<br />
Deny from all<br />
</LimitExcept><br />
</Directory><br />
<br />
You must make sure that your home directory permissions are set properly so that Apache can get there. Your home directory and <tt>~/public_html/</tt> must be executable for others ("rest of the world"). This seems to be enough:<br />
$ chmod o+x ~<br />
$ chmod o+x ~/public_html<br />
<br />
There may be some other, more-secure ways of setting the permissions by creating a special group and allowing only Apache and you to enter there... You know how paranoid you are.<br />
<br />
==== Advanced Options====<br />
<br />
These options in {{Filename|/etc/httpd/conf/httpd.conf}} might be interesting for you:<br />
<br />
# Listen 80<br />
This is the port Apache will listen to. For Internet-access with router, you have to forward the port.<br />
<br />
# ServerAdmin sample@sample.com<br />
This is the admin's email-address which can be found on error-pages e.g.<br />
<br />
# DocumentRoot "/srv/http"<br />
This is the directory where you should put your web pages. Change it, if you want to, but don't forget to change the<br />
<br />
<Directory "/srv/http"><br />
to whatever you changed your DocumentRoot to, or you will likely get a 403 error (lack of privileges) when you try to access the new document root. Don't forget to change the Deny from all line, otherwise you will get 403 error too.<br />
<br />
=== PHP ===<br />
PHP is practically available out of the box now.<br />
<br />
* Add these lines in {{Filename|/etc/httpd/conf/httpd.conf}}:<br />
'''NOTE:''' Place them at the end of "LoadModule" list or bottom of the file.<br />
LoadModule php5_module modules/libphp5.so<br />
Include /etc/httpd/conf/extra/php5_module.conf<br />
<br />
'''NOTE:''' If you do not see {{Filename|libphp.so}} in the Apache modules directory, you may have forgotten to install the ''php-apache'' package.<br />
<br />
* If your {{Codeline|DocumentRoot}} is outside of <tt>/home/</tt>, add it to {{Codeline|open_basedir}} in {{Filename|/etc/php/php.ini}} as such:<br />
open_basedir = /home/:/tmp/:/usr/share/pear/:/path/to/documentroot<br />
'''NOTE''' Should not be necessary anymore (18.08.2009)<br />
Suggestion - Add your document root as follows: this is the default<br />
open_basedir = /srv/http:/home/:/tmp/:/usr/share/pear/<br />
<br />
* Restart the Apache service to make changes take effect (as root):<br />
# /etc/rc.d/httpd restart<br />
<br />
* Test PHP with a simple, but very informative script:<br />
<?php<br />
phpinfo();<br />
?><br />
<br />
Save this file as {{Filename|test.php}} and copy to <tt>/srv/http/</tt> or to <tt>~/public_html</tt> if you permitted such a configuration.<!-- Also, remember to make it executable ({{Codeline|chmod o+x test.php}}).--><br />
<br />
* Test PHP: http://localhost/test.php or http://localhost/~myname/test.php<br />
<br />
'''NOTE:''' If the php instruction is not executed (you see : <html>...</html>), add this to your {{Filename|/etc/httpd/conf/httpd.conf}}:<br />
AddType application/x-httpd-php .php<br />
AddType application/x-httpd-php-source .phps<br />
<br />
==== Advanced options ====<br />
* Remember to add a file handler for .phtml if you need it in {{Filename|/etc/httpd/conf/extra/php5_module.conf}}:<br />
DirectoryIndex index.php index.phtml index.html<br />
<br />
* If you want the libGD module, install php-gd package and uncomment in {{Filename|/etc/php/php.ini}}:<br />
;extension=gd.so<br />
to<br />
extension=gd.so<br />
<br />
Pay attention to which extension you uncomment, as this extension is sometimes mentioned in an explanatory comment before the actual line you want to uncomment.<br />
{{Note | PHP-gd requires libpng, libjpeg, and freetype2}}<br />
* If you want to display errors to debug your php code, change this line of {{Filename|/etc/php/php.ini}}:<br />
display_errors = Off<br />
to<br />
display_errors = On<br />
<br />
* If you want the mcrypt module, install php-mcrypt package and uncomment in {{Filename|/etc/php/php.ini}}:<br />
;extension=mcrypt.so<br />
to<br />
extension=mcrypt.so<br />
<br />
=== MySQL ===<br />
* Configure MySQL as described at the [[MySQL]] wiki.<br />
<br />
* Edit {{Filename|/etc/php/php.ini}} (this is in <tt>/usr/etc</tt> on older systems) to uncomment the following line (''By removing {{Codeline|;}}''):<br />
;extension=mysql.so<br />
<br />
* Caution: Some users have reported typos on this line. Please make sure that it reads {{Codeline|;extension&#61;mysql.so}} and not {{Codeline|;extension&#61;msql.so}}.<br />
<br />
* You can add minor privileged users for your web scripts by editing the tables found in the <tt>mysql</tt> database. You have to restart MySQL for changes to take effect. Don't forget to check the {{Codeline|mysql/users}} table. If there's a second entry for root and your hostname is left with no password set, everybody from your host probably could gain full access. Perhaps see next section for these jobs.<br />
<br />
* Run in terminal (as root):<br />
# /etc/rc.d/mysqld start<br />
<br />
* You may also need to restart Apache. Run in terminal (as root):<br />
# /etc/rc.d/httpd restart<br />
<br />
* MySQL should now be running. Set the root password and test it by running<br />
# mysqladmin -u root password ''password''<br />
# mysql -u root -p<br />
<br />
Type ''exit'' to exit from the CLI MySQL client<br />
<br />
* Edit {{Filename|/etc/rc.conf}} (to start MySQL at boot):<br />
DAEMONS=(... '''mysqld''' ...)<br />
'''Or''' add this line to {{Filename|rc.local}}:<br />
/etc/rc.d/mysqld start<br />
<br />
* You can get the {{Codeline|"error no. 2013: Lost Connection to mysql server during query"}} message instantly whenever you try to connect to the MySQL daemon by TCP/IP. This is the TCP wrappers system (tcpd), which uses the <tt>hosts_access(5)</tt> system to allow or disallow connections.<br />
<br />
* If you're running into this problem, be sure to add this to your {{Filename|/etc/hosts.allow}} file:<br />
# mysqld : ALL : ALLOW<br />
# mysqld-max : ALL : ALLOW<br />
# and similar for the other MySQL daemons.<br />
<br />
* Notes: The examples above are the simplest case, telling tcpd to allow connections from anywhere. You may wish to use a more-appropriate choice of permissible sources instead of ALL. Just make sure that localhost and the IP address (numeric or DNS) of the interface by which you connect are specified.<br />
<br />
* You might also need to edit {{Filename|/etc/my.cnf}} and comment out the {{Codeline|skip-networking}} line as such:<br />
skip-networking<br />
to<br />
#skip-networking<br />
<br />
Note: You may want to install [http://wiki.archlinux.org/index.php/PhpMyAdmin phpmyadmin] to work with your databases.<br />
<br />
== More Resources ==<br />
* [[MySQL]] - Arch wiki article for MySQL<br />
* [[Xampp]] - Self contained web-server that supports PHP, Perl, and MySQL<br />
* http://www.apache.org/<br />
* http://www.php.net/<br />
* http://www.mysql.com/</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Apache_HTTP_Server&diff=83108Apache HTTP Server2009-11-11T17:47:42Z<p>VitaminJ: libphp5.so not found?</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
[[Category:Web Server (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|LAMP}}<br />
{{i18n_entry|Español|LAMP (Español)}}<br />
{{i18n_entry|Italiano|LAMP (Italiano)}}<br />
{{i18n_entry|Türkçe|LAMP_(Türkçe)}}<br />
{{i18n_entry|Русский|LAMP (russian)}}<br />
{{i18n_entry|Česky|LAMP_(Česky)}}<br />
{{i18n_entry|简体中文|LAMP(简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
== Introduction ==<br />
This document describes how to set up the Apache web server on an Arch Linux system. It also tells how to optionally install PHP and MySQL and integrate these in the Apache server. This combination is commonly referred to as LAMP (Linux Apache MySQL PHP).<br />
<br />
If you only need a web server for development and testing, [[Xampp]] might be a better and easier option.<br />
<br />
== Installation ==<br />
# pacman -S apache php php-apache mysql<br />
<br />
This document assumes you will install Apache, PHP and MySQL together. If desired however, you may install Apache, PHP, and MySQL separately and simply refer to the relevant sections below.<br />
{{Box Note | New default user and group: Instead of group "nobody" apache now runs as user/group "http" by default. You might want to adjust your httpd.conf according to this change, though you may still run httpd as nobody.}}<br />
<br />
== Configuration ==<br />
=== Apache ===<br />
* Create the user http (this account may already exist):<br />
# useradd http<br />
* Add this line to {{Filename|/etc/hosts}} (If the file doesn't exist, create it.):<br />
127.0.0.1 localhost.localdomain localhost<br />
'''Note:''' If you want a different hostname, append it to the end:<br />
127.0.0.1 localhost.localdomain localhost myhostname<br />
<br />
* Edit {{Filename|/etc/[[rc.conf]]}}: If you set a hostname, the {{Codeline|HOSTNAME}} variable should be the same; otherwise, use {{Codeline|"localhost"}}:<br />
#<br />
# Networking<br />
#<br />
HOSTNAME="localhost"<br />
<br />
* Make sure the hostname appears in /etc/hosts or apache will fail to start. Alternatively, you can<br />
edit {{Filename|/etc/httpd/conf/httpd.conf}} as root and comment the following module:<br />
LoadModule unique_id_module modules/mod_unique_id.so<br />
It should now appear as:<br />
#LoadModule unique_id_module modules/mod_unique_id.so<br />
<br />
<br />
* Run the following in a terminal as root to start the HTTP server:<br />
# /etc/rc.d/httpd start<br />
<br />
* Apache should now be running. Test by visiting http://localhost/ in a web browser. It should display a simple Apache test page.<br />
<br />
* To start Apache automatically at boot, edit {{Filename|/etc/rc.conf}} as root and add the '''httpd''' daemon:<br />
DAEMONS=(... '''httpd''' ...)<br />
'''Or''' add this line to {{Filename|/etc/rc.local}}:<br />
/etc/rc.d/httpd start<br />
<br />
* If you want to use user directories (i.e. <tt>~/public_html</tt> on the machine is accessed as <tt>http://localhost/~user/</tt>) to be available on the web, uncomment the following lines in {{Filename|/etc/httpd/conf/extra/httpd-userdir.conf}}:<br />
UserDir public_html<br />
and<br />
<Directory /home/*/public_html><br />
AllowOverride FileInfo AuthConfig Limit Indexes<br />
Options MultiViews Indexes SymLinksIfOwnerMatch ExecCGI<br />
<Limit GET POST OPTIONS PROPFIND><br />
Order allow,deny<br />
Allow from all<br />
</Limit><br />
<LimitExcept GET POST OPTIONS PROPFIND><br />
Order deny,allow<br />
Deny from all<br />
</LimitExcept><br />
</Directory><br />
<br />
You must make sure that your home directory permissions are set properly so that Apache can get there. Your home directory and <tt>~/public_html/</tt> must be executable for others ("rest of the world"). This seems to be enough:<br />
$ chmod o+x ~<br />
$ chmod o+x ~/public_html<br />
<br />
There may be some other, more-secure ways of setting the permissions by creating a special group and allowing only Apache and you to enter there... You know how paranoid you are.<br />
<br />
==== Advanced Options====<br />
<br />
These options in {{Filename|/etc/httpd/conf/httpd.conf}} might be interesting for you:<br />
<br />
# Listen 80<br />
This is the port Apache will listen to. For Internet-access with router, you have to forward the port.<br />
<br />
# ServerAdmin sample@sample.com<br />
This is the admin's email-address which can be found on error-pages e.g.<br />
<br />
# DocumentRoot "/srv/http"<br />
This is the directory where you should put your web pages. Change it, if you want to, but don't forget to change the<br />
<br />
<Directory "/srv/http"><br />
to whatever you changed your DocumentRoot to, or you will likely get a 403 error (lack of privileges) when you try to access the new document root. Don't forget to change the Deny from all line, otherwise you will get 403 error too.<br />
<br />
=== PHP ===<br />
PHP is practically available out of the box now.<br />
<br />
* Add these lines in {{Filename|/etc/httpd/conf/httpd.conf}}:<br />
'''NOTE:''' Place them at the end of "LoadModule" list or bottom of the file.<br />
LoadModule php5_module modules/libphp5.so<br />
Include /etc/httpd/conf/extra/php5_module.conf<br />
<br />
'''NOTE:''' If you do not see {{Filename|libphp.so}} in the Apache modules directory, you may have forgotten to install the ''php-apache'' package.<br />
<br />
* If your {{Codeline|DocumentRoot}} is outside of <tt>/home/</tt>, add it to {{Codeline|open_basedir}} in {{Filename|/etc/php/php.ini}} as such:<br />
open_basedir = /home/:/tmp/:/usr/share/pear/:/path/to/documentroot<br />
'''NOTE''' Should not be necessary anymore (18.08.2009)<br />
Suggestion - Add your document root as follows: this is the default<br />
open_basedir = /srv/http:/home/:/tmp/:/usr/share/pear/<br />
<br />
* Restart the Apache service to make changes take effect (as root):<br />
# /etc/rc.d/httpd restart<br />
<br />
* Test PHP with a simple, but very informative script:<br />
<?php<br />
phpinfo();<br />
?><br />
<br />
Save this file as {{Filename|test.php}} and copy to <tt>/srv/http/</tt> or to <tt>~/public_html</tt> if you permitted such a configuration.<!-- Also, remember to make it executable ({{Codeline|chmod o+x test.php}}).--><br />
<br />
* Test PHP: http://localhost/test.php or http://localhost/~myname/test.php<br />
<br />
'''NOTE:''' If the php instruction is not executed (you see : <html>...</html>), add this to your {{Filename|/etc/httpd/conf/httpd.conf}}:<br />
AddType application/x-httpd-php .php<br />
AddType application/x-httpd-php-source .phps<br />
<br />
==== Advanced options ====<br />
* Remember to add a file handler for .phtml if you need it in {{Filename|/etc/httpd/conf/extra/php5_module.conf}}:<br />
DirectoryIndex index.php index.phtml index.html<br />
<br />
* If you want the libGD module, install php-gd package and uncomment in {{Filename|/etc/php/php.ini}}:<br />
;extension=gd.so<br />
to<br />
extension=gd.so<br />
<br />
Pay attention to which extension you uncomment, as this extension is sometimes mentioned in an explanatory comment before the actual line you want to uncomment.<br />
{{Note | PHP-gd requires libpng, libjpeg, and freetype2}}<br />
* If you want to display errors to debug your php code, change this line of {{Filename|/etc/php/php.ini}}:<br />
display_errors = Off<br />
to<br />
display_errors = On<br />
<br />
* If you want the mcrypt module, install php-mcrypt package and uncomment in {{Filename|/etc/php/php.ini}}:<br />
;extension=mcrypt.so<br />
to<br />
extension=mcrypt.so<br />
<br />
=== MySQL ===<br />
* Configure MySQL as described at the [[MySQL]] wiki.<br />
<br />
* Edit {{Filename|/etc/php/php.ini}} (this is in <tt>/usr/etc</tt> on older systems) to uncomment the following line (''By removing {{Codeline|;}}''):<br />
;extension=mysql.so<br />
<br />
* Caution: Some users have reported typos on this line. Please make sure that it reads {{Codeline|;extension&#61;mysql.so}} and not {{Codeline|;extension&#61;msql.so}}.<br />
<br />
* You can add minor privileged users for your web scripts by editing the tables found in the <tt>mysql</tt> database. You have to restart MySQL for changes to take effect. Don't forget to check the {{Codeline|mysql/users}} table. If there's a second entry for root and your hostname is left with no password set, everybody from your host probably could gain full access. Perhaps see next section for these jobs.<br />
<br />
* Run in terminal (as root):<br />
# /etc/rc.d/mysqld start<br />
<br />
* You may also need to restart Apache. Run in terminal (as root):<br />
# /etc/rc.d/httpd restart<br />
<br />
* MySQL should now be running. Set the root password and test it by running<br />
# mysqladmin -u root password ''password''<br />
# mysql -u root -p<br />
<br />
Type ''exit'' to exit from the CLI MySQL client<br />
<br />
* Edit {{Filename|/etc/rc.conf}} (to start MySQL at boot):<br />
DAEMONS=(... '''mysqld''' ...)<br />
'''Or''' add this line to {{Filename|rc.local}}:<br />
/etc/rc.d/mysqld start<br />
<br />
* You can get the {{Codeline|"error no. 2013: Lost Connection to mysql server during query"}} message instantly whenever you try to connect to the MySQL daemon by TCP/IP. This is the TCP wrappers system (tcpd), which uses the <tt>hosts_access(5)</tt> system to allow or disallow connections.<br />
<br />
* If you're running into this problem, be sure to add this to your {{Filename|/etc/hosts.allow}} file:<br />
# mysqld : ALL : ALLOW<br />
# mysqld-max : ALL : ALLOW<br />
# and similar for the other MySQL daemons.<br />
<br />
* Notes: The examples above are the simplest case, telling tcpd to allow connections from anywhere. You may wish to use a more-appropriate choice of permissible sources instead of ALL. Just make sure that localhost and the IP address (numeric or DNS) of the interface by which you connect are specified.<br />
<br />
* You might also need to edit {{Filename|/etc/my.cnf}} and comment out the {{Codeline|skip-networking}} line as such:<br />
skip-networking<br />
to<br />
#skip-networking<br />
<br />
Note: You may want to install [http://wiki.archlinux.org/index.php/PhpMyAdmin phpmyadmin] to work with your databases.<br />
<br />
== More Resources ==<br />
* [[MySQL]] - Arch wiki article for MySQL<br />
* [[Xampp]] - Self contained web-server that supports PHP, Perl, and MySQL<br />
* http://www.apache.org/<br />
* http://www.php.net/<br />
* http://www.mysql.com/</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Thunar_Volume_Manager&diff=76833Thunar Volume Manager2009-10-01T01:36:16Z<p>VitaminJ: Volume management and builtin features</p>
<hr />
<div>[[Category:File systems (English)]]<br />
[[Category:HOWTOs (English)]]<br />
[[Category:Automount]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|Español|AutoFS HowTo (Español)}}<br />
{{i18n_links_end}}<br />
<br />
== Introduction ==<br />
Thunar, a lightweight file manager intended for XFCE desktop environment, can automatically detect, mount and open media, such as USB devices or CDs.<br />
<br />
== Features ==<br />
* Small and fast<br />
* Easily add shortcuts to your most-used folders<br />
* Free space indicator<br />
* Thumbnail previews for many filetypes<br />
* Live filesystem updates (if libnotify is installed)<br />
* Custom actions (add your own routines accessible via right-click)<br />
* Mass renaming engine<br />
* Custom file selection<br />
* Built in volume management<br />
<br />
==Requirements and Installation==<br />
* Thunar (XFCE is optional)<br />
* Dbus<br />
* Hal<br />
<br />
==Volume Management==<br />
Thunar natively supports reading available block devices on the system using HAL. That means that you can plug in a USB drive, and a greyed out icon of it will appear on the shortcuts pane.<br />
<br />
Double-click to mount and open, or right-click to mount.<br />
<br />
Extended functionality is available by using the "thunar-volman" plugin, which can be installed through pacman:<br />
# pacman -S thunar-volman<br />
<br />
Namely, it allows you to configure drives to always automount and open for viewing, and allows autorun. It can also be configured to execute certain actions when cameras and audio players are connected. <br />
After installing the plugin:<br />
# Launch Thunar and go to Preferences<br />
# Under the 'Advanced' tab, check 'Enable Volume Management'<br />
# Click configure and make desired changes (see below for an example)<br />
Here's an example setting for making Amarok play an audio CD.<br />
Multimedia - Audio CDs: <code>amarok --cdplay %d</code><br />
<br />
'''Note:''' Having Hal and Dbus running is essential, otherwise the volume manager will not detect anything. This may seem obvious, but several people have been confused as to why it is't working, when the issue is related to dbus or hal not running. Please see the wiki entry on [[HAL]] and [[Daemons]] for more information.<br />
<br />
== Tips & Tricks ==<br />
<br />
=== Eliminate conflicts ===<br />
If you have hal and autofs running at the same time, you will have a lock in hal-mtab. To avoid this, use only one of them.</div>VitaminJhttps://wiki.archlinux.org/index.php?title=VirtualBox&diff=76693VirtualBox2009-09-27T18:14:43Z<p>VitaminJ: Starting headless VMs at startup...needs revision, I'm not a shell programmer</p>
<hr />
<div>[[Category:Emulators (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|:VirtualBox}}<br />
{{i18n_entry|Italiano|:VirtualBox (Italiano)}}<br />
{{i18n_entry|简体中文|:VirtualBox (简体中文)}}<br />
{{i18n_entry|Русский|VirtualBox (Русский)}}<br />
{{i18n_entry|Español|VirtualBox (Español)}}<br />
{{i18n_entry|Português|VirtualBox (Português)}}<br />
{{i18n_links_end}}<br />
<br />
== What is VirtualBox ==<br />
[http://www.virtualbox.org VirtualBox] is a virtual pc emulator like vmware. It has many of the features vmware has, as well as some of its own. It is in constant development and new features are implemented all the time. eg. version 2.2 introduced OpenGL 3D acceleration support for Linux and Solaris guests. It has a nice GUI interface (Qt and/or SDL) or command line tools for managing virtual machines. Headless operation is also supported. Running iTunes under VirtualBox is the only way (currently) to sync iPod Touch/iPhone firmware 3.0+.<br />
<br />
=== Editions ===<br />
VirtualBox is available in two editions: VirtualBox (OSE) and VirtualBox (Personal Use and Evaluation License (PUEL))<br />
<br />
==== VirtualBox (OSE) ====<br />
VirtualBox (OSE) is the open source version of VirtualBox, which can be found in the community repository. It lacks some features such as USB device support and the built-in RDP server. <br />
<br />
==== VirtualBox (PUEL) ====<br />
VirtualBox PUEL is a binary-only version (free for personal use). There are several available from the AUR, but the most popular PKGBUILD was written and is maintained by thotypous. You can download it from the [http://aur.archlinux.org/packages.php?ID=9753 AUR at this link] or directly from the <br />
[http://www.virtualbox.org/wiki/Downloads VirtualBox] website. The PUEL edition offers the following advantages:<br />
<br />
*'''Remote Display Protocol (RDP) Server''' - a complete RDP server on top of the virtual hardware, allowing users to connect to a virtual machine remotely using any RDP compatible client<br />
<br />
*'''USB support''' - a virtual USB controller which allows USB 1.1 and USB 2.0 devices to be passed through to virtual machines<br />
<br />
*'''USB over RDP''' - a combination of the RDP server and USB support, allowing users to make USB devices available to virtual machines running remotely<br />
<br />
*'''iSCSI initiator''' - a builtin iSCSI initiator making it possible to use iSCSI targets as virtual disks without the guest requiring support for iSCSI<br />
<br />
== Installation ==<br />
<br />
=== Install VirtualBox (OSE) ===<br />
VirtualBox (OSE) is available from the community repository:<br />
# pacman -S virtualbox-ose<br />
<br />
{{Note | This package is not in x86_64 Repositories. See the link to the PKGBUILD by thotypous in the AUR above if you are running Arch x86_64 and want to use VirtualBox.}}<br />
<br />
This will select by default <tt>virtualbox-ose</tt> and <tt>virtualbox-modules</tt> packages. Once installed, a desktop entry can be located in ''Applications &rarr; System Tools &rarr; VirtualBox OSE''<br />
<br />
Now, add the desired username to the '''vboxusers''' group:<br />
# gpasswd -a USERNAME vboxusers<br />
<br />
{{Note | You must logout/login in order for this change to take effect.}}<br />
<br />
Lastly, edit {{Filename|/etc/rc.conf}} as root and add '''vboxdrv''' to the MODULES array in order to load the VirtualBox drivers at startup. For example:<br />
MODULES=(loop '''vboxdrv''' fuse ...)<br />
<br />
To load the module manually, run the following in a terminal as root: <br />
# modprobe vboxdrv<br />
<br />
=== Install VirtualBox PUEL (virtualbox_bin) ===<br />
VirtualBox PUEL is available from the [http://aur.archlinux.org/packages.php?ID=9753 AUR: virtualbox_bin].<br />
<br />
Download the tarball from the above page. As a normal user, unpack, change directory, and {{Codeline|makepkg}}:<br />
# tar -xzf virtualbox_bin.tar.gz<br />
# cd virtualbox_bin<br />
# makepkg<br />
This will create a .pkg.tar.gz file in the virtualbox_bin directory.<br />
Then, as root:<br />
# pacman -U PACKAGE-NAME.pkg.tar.gz<br />
This will compile the vboxdrv kernel modules and install VirtualBox in {{Filename|/opt/VirtualBox}}, and add the vboxusers group.<br />
<br />
'''However, there's an alternative way to install the virtualbox_bin package:'''<br />
This method adds a non-standard pacman source, and downloads a precompiled binary package. Please understand the risks associated with trusting binary distribution sources.<br />
<br />
Firstly, add as root the following into {{Filename|/etc/pacman.conf}}:<br />
[archlinuxfr]<br />
Server = <nowiki>http://repo.archlinux.fr/i686</nowiki><br />
or<br />
[archlinuxfr]<br />
Server = <nowiki>http://repo.archlinux.fr/x86_64</nowiki><br />
depending on your CPU's architecture.<br />
<br />
Now you can can install directly via:<br />
# pacman -Sy virtualbox_bin<br />
<br />
<br />
Now, add the desired username to the '''vboxusers''' group:<br />
# gpasswd -a USERNAME vboxusers<br />
<br />
{{Note | You must logout/login in order for this change to take effect.}}<br />
<br />
Lastly, edit {{Filename|/etc/rc.conf}} as root and add '''vboxdrv''' to the MODULES array in order to load the VirtualBox drivers at startup. For example:<br />
MODULES=(loop '''vboxdrv''' fuse ...)<br />
<br />
To load the module manually, run the following in a terminal as root: <br />
# modprobe vboxdrv<br />
<br />
==== Install required QT libraries ====<br />
Currently, VirtualBox relies on QT4 for its graphical interface. If you require a GUI, ensure you have QT4 installed:<br />
# pacman -S qt<br />
<br />
=== Install VirtualBox 2.1 (another alternative) ===<br />
VirtualBox.run install can be done using the All Distributions package from the [http://www.virtualbox.org/wiki/Linux_Downloads Linux section] of the VirtualBox Website.<br />
<br />
Make sure the Qt 4.3.0 and SDL 1.2.7 or higher packages are installed:<br />
# pacman -Sy qt sdl <br />
<br />
Download the appropriate architecture file i386/AMD64. In a terminal window, browse to the download folder and as root run:<br />
# sh VirtualBox-2.XXXX-Linux_ARCH.run<br />
<br />
This will install the package to the /opt/VirtualBox-2.XXX folder.<br />
<br />
After installation, a desktop entry can be located in ''Applications &rarr; System Tools &rarr; Sun xVM VirtualBox''<br />
<br />
Now, add the desired username to the '''vboxusers''' group:<br />
# gpasswd -a USERNAME vboxusers<br />
<br />
Lastly, edit {{Filename|/etc/rc.conf}} as root and add '''vboxdrv''' to the MODULES array in order to load the VirtualBox drivers at startup.<br />
<br />
Start the VirtualBox GUI either with the command:<br />
# VirtualBox <br />
<br />
or using the ''Applications'' desktop entry. In version 2.1.x, an installation wizard should start and take you through the process of setting up a virtual machine. Otherwise, use the help menu to get started. '''Continue reading to see the more advanced options and setups...'''<br />
<br />
== Configuration ==<br />
After we have installed VirtualBox on our system and added ourselves in the vboxusers group we can start configuring our system in order to make all the features of VirtualBox available to us. Create a new virtual machine using the wizard provided by the GUI and then click settings in order to edit the virtual machine settings.<br />
<br />
=== Keyboard and mouse between the host and the guest ===<br />
*To capture the keyboard and mouse, click the mouse inside the Virtual Machine display.<br />
*To uncapture, press Ctrl-Alt-Delete.<br />
<br />
If [[Xorg]] freezes mouse and keyboard you will have to disable the [[Xorg#Input_hotplugging_with_xorg-server_1.5| new hot plugging feature of Xorg 1.5]] by adding in {{Filename|/etc/X11/xorg.conf}}:<br />
<br />
Section "ServerLayout"<br />
. . .<br />
Option "AutoAddDevices" "False"<br />
. . .<br />
EndSection<br />
<br />
This is needed for Linux guests in a Mac OS X or Windows host. Also needed for Linux hosts (tested with Arch64 host and Arch64 guest).<br />
<br />
Also, mouse pointer integration doesn't work out of the box. To fix it, make sure you have the following sections in your {{Filename|xorg.conf}}:<br />
<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "vboxmouse"<br />
Option "Protocol" "auto"<br />
Option "Device" "/dev/input/mice"<br />
Option "ZAxisMapping" "4 5 6 7"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "X.org Configured"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Mouse0" "CorePointer"<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
EndSection<br />
<br />
When generating your {{Filename|xorg.conf}} with {{Codeline|"X -configure"}}, you'll end up with an InputDevice section that uses the {{Codeline|mouse}} driver. After installing the Guest Additions, you should replace {{Codeline|mouse}} with {{Codeline|vboxmouse}} and then restart X or reboot your VM.<br />
<br />
=== Getting network in the guest machine to work ===<br />
First let's get network working in the guest machine. Click the network tab. The not attached option means you'll have "Network cable unplugged" or similar error in the guest computer.<br />
<br />
==== Using NAT network ====<br />
This is the simplest way to get network. Select NAT network and it should be ready to use. Then, the guest operating system can be automatically configured by using DHCP.<br />
<br />
The NAT IP address on the first card is 10.0.2.0, 10.0.3.0 on the second and so on.<br />
<br />
Also in VirtualBox 2.2.0+ NAT network DHCP clients will not configure your nameserver (DNS server for windows guests) you will have to manually configure the nameserver(DNS server)<br />
<br />
==== Using host interface networking (the VirtualBox way) ====<br />
Since VirtuaBox 2.1.0 it has a native support for host interface networking. Just add '''vboxnetflt''' to your MODULES section in {{Filename|[[rc.conf]]}} and choose ''Host Interface Networking'' (or ''Bridged adapter'' in [http://forums.virtualbox.org/viewtopic.php?f=1&t=16447 2.2]) in the virtual machine configuration.<br />
<br />
'''Note''': DHCP broadcasting doesn't seem to work properly under this way. Set up your guest networking with static IP assignment.<br />
<br />
==== Using host interface networking (the Arch way) ====<br />
You are going to just edit these files and reboot:<br />
<br />
* {{Filename|/etc/conf.d/bridges}}<br />
* {{Filename|/etc/rc.conf}}<br />
* {{Filename|/etc/vbox/interfaces}}<br />
<br />
Ready? Let's go!<br />
<br />
'''{{Filename|/etc/conf.d/bridges}}'''<br />
bridge_br0="eth0 vbox0" # Put any interfaces you need.<br />
BRIDGE_INTERFACES=(br0)<br />
<br />
'''{{Filename|/etc/rc.conf}}'''<br />
<br />
First add the bridge module to your MODULES line<br />
MODULES=( <your other modules> '''bridge''')<br />
<br />
Then, in your NETWORKING section, make the following changes:<br />
br0="dhcp" # Maybe you have some static configuration... I use DHCP.<br />
INTERFACES=(eth0 br0)<br />
<br />
'''Note''' by gpan:<br />
<br />
'''{{Filename|/etc/rc.conf}}'''<br />
<br />
First add the vboxdrv (and [[vboxnetflt]] in case of 2.1.0 version) module to your MODULES line:<br />
MODULES=( <your other modules> vboxdrv vboxnetflt )<br />
<br />
'''Note''' by vit:<br />
<br />
'''{{Filename|/etc/rc.conf}}'''<br />
<br />
In my case it didn't work untill adding vboxnetadp to modules.<br />
<br />
Next, you should edit your {{Filename|/etc/udev/rules.d/60-vboxdrv.rules}} and type:<br />
KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="vboxusers", MODE="0660"<br />
<br />
Save it and exit.<br />
<br />
Then open terminal and type:<br />
# pacman -S bridge-utils uml_utilities<br />
<br />
Create a new bridge with this command:<br />
# brctl addbr br0<br />
<br />
'''{{Filename|/etc/vbox/interfaces}}'''<br />
<br />
(You can set up more interfaces if you want. Sky is the limit!):<br />
vbox0 your_user br0 # Be sure that your user is in the vboxusers group.<br />
<br />
Reboot and enjoy!<br />
<br />
{{Note | Remember to set up your virtual machine with proper network configuration.}}<br />
{{Note | If you have any issue, make sure that you have the bridge-utils package installed and vboxnet daemon loaded.}}<br />
<br />
==== Using host interface networking (generic) ====<br />
This way is a bit harder, but it allows you to see the VirtualMachine as a "real" computer on your local network. You need to get bridge-utils <br />
<br />
# pacman -S bridge-utils uml_utilities<br />
<br />
'''Note''' by Sp1d3rmxn:<br />
:You also need to have the TUN module loaded... in {{Filename|[[rc.conf]]}} add {{Codeline|"tun"}} (without the quotes) to your MODULES section. For testing this out right now without rebooting you can load the module from the command line by {{Codeline|"modprobe tun"}}.<br />
:<br />
:Then you MUST set these permissions otherwise you'll never get VBox to init the interface. The command is {{Codeline|"chmod 666 /dev/net/tun"}} (without the quotes).<br />
<br />
:Now proceed with the rest as it's written below.<br />
<br />
'''Note'''<br />
:As said by Sp1d3rmxn, we must set these permissions, but, instead of using the <br />
:command, we can set them in {{Filename|/etc/udev/rules.d/60-vboxdrv.rules}}, which will set them <br />
:on boot:<br />
KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="vboxusers", MODE="0660"<br />
KERNEL=="tun", OWNER="root", GROUP="vboxusers", MODE="0660"<br />
<br />
<br />
'''1.''' Create a new bridge with this command:<br />
# brctl addbr br0<br />
<br />
'''2.''' If you are not using DHCP, run ifconfig and note down the network configuration of your existing network interface (e.g. eth0), which we will need to copy to the bridge in a minute.<br />
<br />
{{Note | You will need this settings so make sure you don't lose them!!!}}<br />
<br />
'''3.''' Switch your physical network adapter to "promiscuous" mode so that it will accept Ethernet frames for MAC addresses other than its own (replace {{Codeline|eth0}} with your network interface):<br />
# ifconfig eth0 0.0.0.0 promisc <br />
<br />
{{Note | You will lose network connectivity on eth0 at this point.}}<br />
<br />
'''4.''' Add your network adapter to the bridge:<br />
# brctl addif br0 eth0<br />
<br />
'''5.''' Transfer the network configuration previously used with your physical ethernet adapter to the new bridge. If you are using DHCP, this should work:<br />
# dhclient br0<br />
<br />
'''Note''' by Sp1d3rmxn:<br />
:Use {{Codeline|"dhcpcd -t 30 -h yourhostname br0 &"}} instead of the above<br />
<br />
Otherwise, run {{Codeline|"ifconfig br0 x.x.x.x netmask x.x.x.x"}} and use the values that you noted down previously.<br />
<br />
'''6.''' To create a permanent host interface called vbox0 (all host interfaces created in this way must be called vbox followed by a number) and add it to the network bridge created above, use the following command:<br />
VBoxAddIF vbox0 vboxuser br0<br />
<br />
Replace {{Codeline|vboxuser}} with the name of the user who is supposed to be able to use the new interface.<br />
<br />
{{Note | VboxAddIF is located in /opt/VirtualBox-VERSION OF VIRTUALBOX/VBoxAddIF}}<br />
<br />
Alternatively, you can [http://mychael.gotdns.com/blog/2007/05/31/virtualbox-bridging/ setup VirtualBox networking] through your {{Filename|/etc/rc.conf}} to enable a bridged connection.<br />
<br />
==== Using host interface networking with a wireless device ====<br />
Bridging as described above won't work with a wireless device. Using [http://aur.archlinux.org/packages.php?ID=16356 parprouted] however it can be accomplished.<br />
<br />
# Install parprouted and iproute<br />
# {{Codeline|# ln -s /usr/sbin/ip /sbin/ip}}<br />
# Make sure IP fowarding is enabled: {{Codeline|# sysctl net.ipv4.ip_forward&#61;1}}, and/or edit {{Filename|/etc/sysctl.conf}}.<br />
# {{Codeline|# VBoxTunctl -b -u <user>}}, to create the tap device<br />
# {{Codeline|# ip link set tap0 up; ip addr add 192.168.0.X/24 dev tap0}}, needs to be a manually set IP on the same network your wireless device is.<br />
# {{Codeline|# parprouted wlan0 tap0}}<br />
<br />
=== Getting USB to work in the guest machine ===<br />
(Only available in the PUEL edition)<br />
<br />
{{Note|As of VirtualBox>2.2.4 this is no longer necessary to mount a usb filesystem.}}<br />
<br />
First in order to make USB available for use to the virtual machine you must add this line to your {{Filename|/etc/fstab}}:<br />
none /proc/bus/usb usbfs auto,busgid=108,busmode=0775,devgid=108,devmode=0664 0 0<br />
<br />
{{Codeline|108}} is is the id of the group which should be allowed to access USB-devices. Change it to the id of your vboxusers group. You can get the id by running:<br />
$ grep vboxusers /etc/group<br />
<br />
If you don't mind a security hole change devmode from 664 to 666.<br />
<br />
Remount /proc/bus/usb:<br />
# mount -o remount /proc/bus/usb/<br />
<br />
Restart Virtualbox and click the USB tab in the settings of the virtual machine and select which devices are available to your pc on boot. If you wish your virtual machine to use device that you have just plugged in (assuming the virtual machine has booted already), go to the VirtualMachine screen go to ''Devices &rarr; USB Devices'' and select the device you wish to plug in the virtual PC.<br />
<br />
'''Note''' by bjimba:<br />
<br />
Recent versions of VirtualBox, as noted above, do not require usbfs, however you will need the HAL daemon running if you do not use usbfs. See the [[HAL]] wiki page for details.<br />
<br />
<br />
=== Installing Guest Additions ===<br />
For VirtualBox (OSE) version 1.6.2 =>, read:<br><br />
[[VirtualBox-HowTo]]<br />
<br />
The Guest Additions make the shared folders feature available, as well as better video (3D available in version 2.1+) and mouse drivers. You will have mouse integration, thus no need to release the mouse after using it in the guest and one can also enable a bidirectional clipboard.<br />
<br />
{{Note | The instructions immediately below are for an Archlinux guest on an Archlinux host.}}<br />
<br />
After you booted the virtual machine, go to menu ''Devices &rarr; Install Guest Additions...'' Once you've clicked it, VirtualBox loads an ISO into the current CD-ROM, so you won't see anything happen yet ;).<br />
<br />
You will require gcc and make if you don't already have them so install them typing the following as root:<br />
# pacman -S gcc make<br />
<br />
Then do the following as root:<br />
# mount /media/cdrom<br />
for i686 systems (32 bit):<br />
# sh /media/cdrom/VBoxLinuxAdditions-x86.run<br />
for x86-64 systems (64 bit):<br />
# sh /media/cdrom/VBoxLinuxAdditions-amd64.run<br />
<br />
<br />
It will build and install the kernel modules, install the Xorg drivers and create init scripts. It will most probably print out errors about init scripts and run levels and what not. Ignore them. You will find {{Filename|rc.vboxadd}} in /etc/rc.d which will load them on demand. To have the Guest Additions loaded at boot time, just add those to the DAEMONS array in {{Filename|/etc/rc.conf}} eg.:<br />
<br />
DAEMONS=(syslog-ng network netfs crond alsa '''rc.vboxadd''')<br />
<br />
Another option is to install one of these packages:<br />
# pacman -S virtualbox-additions<br />
or<br />
# pacman -S virtualbox-ose-additions<br />
<br />
You will then have an ISO to mount as a loop device. Remember to load the loop kernel module before:<br />
# modprobe loop<br />
# mount /usr/lib/virtualbox/additions/VBoxGuestAdditions.iso /media/cdrom -o loop<br />
<br />
Then execute {{Filename|VBoxLinuxAdditions.run}} as before. Before adding {{Filename|rc.vboxadd}} to DAEMONS check {{Filename|/etc/rc.local}} for commands to load the vboxadd daemons put by the installation script.<br />
<br />
'''Windows Guests'''<br />
<br />
After installing Windows (XP etc.) on your virtual machine, simply select ''Devices &rarr; Install Guest Additions...''<br />
<br />
This will mount the iso image and windows should then automatically launch the guest additions installer. Follow the instructions to the end.<br />
<br />
=== Sharing folders between the host and the guest ===<br />
For VirtualBox (OSE) version 1.6.2 =>, read [[VirtualBox-HowTo]].<br />
<br />
In the settings of the virtual machine go to shared folders tab and add the folders you want to share.<br />
<br />
*NOTE: You need to install Guest Additions in order to use this feature.<br />
In a Linux host, ''Devices &rarr; Install Guest Additions''<br />
Yes (when asked to download the CD image)<br />
Mount (when asked to register and mount)<br />
<br />
In a Linux host, create one folder for sharing files.<br />
<br />
In a Windows guest, starting with VirtualBox 1.5.0, shared folders are browseable and are therefore visible in Windows Explorer. Open Windows Explorer and look for it under ''My Networking Places &rarr; Entire Network &rarr; VirtualBox Shared Folders''.<br />
<br />
Alternatively, on the Windows command line, you can also use the following:<br />
net use x: \\VBOXSVR\sharename<br />
<br />
While {{Codeline|VBOXSVR}} is a fixed name, replace {{Codeline|x:}} with the drive letter that you want to use for the share, and sharename with the share name specified with VBoxManage.<br />
<br />
In a Linux guest, use the following command:<br />
# mount -t vboxsf [-o OPTIONS] sharename mountpoint<br />
<br />
Replace {{Codeline|sharename}} with the share name specified with VBoxManage, and mountpoint with the path where you want the share to be mounted (e.g. /mnt/share). The usual mount rules apply, that is, create this directory first if it does not exist yet.<br />
<br />
Beyond the standard options supplied by the mount command, the following are available:<br />
iocharset=CHARSET<br />
to set the character set used for I/O operations (utf8 by default) and<br />
convertcp=CHARSET<br />
to specify the character set used for the shared folder name (utf8 by default).<br />
<br />
=== Getting audio to work in the guest machine ===<br />
<br />
In the machine settings, go to the audio tab and select the correct driver according to your sound system (ALSA, OSS or PulseAudio).<br />
<br />
=== Setting up the RAM and Video Memory for the virtual PC ===<br />
<br />
You can change the default values by going to ''Settings &rarr; General''.<br />
<br />
=== Setting up CD-ROM for the Virtual PC ===<br />
<br />
You can change the default values by going to ''Settings &rarr; CD/DVD-ROM''.<br />
<br />
Check mount CD/DVD drive and select one of the following options.<br />
<br />
'''Note:''' If no CD-ROM drive is detected, make sure the HAL daemon is running. To start it, run the following command as root:<br />
# /etc/rc.d/hal start<br />
<br />
=== Enabling D3D acceleration in Windows Guests ===<br />
<br />
Recent versions of Virtualbox have support for accelerating OpenGL inside guests. This can be enabled with a simple checkbox in the machine's settings, right below where video ram is set, and installing the Virtualbox guest additions. However, most Windows games use Direct3D (part of DirectX), not OpenGL, and are thus not helped by this method. However, it is possible to gain accelerated Direct3D in your Windows guests by borrowing the d3d libraries from Wine, which translate d3d calls into OpenGL, which is then accelerated. <br />
<br />
After enabling OpenGL acceleration as described above, go to http://www.nongnu.org/wined3d/ in your Windows guest and grab the "Latest version (Installer):". Reboot the guest into safe mode (press F8 before the Windows screen appears but after the Virtualbox screen disappears), and install wined3d, accepting the defaults during the install. (You may check the box for DirectX 10 support if you like, dont touch anything else.) Reboot back to normal mode and you should have accelerated Direct3D. <br />
<br />
{{Note | This hack may or may not work for some games depending on what hardware checks they make and what parts of D3D they use.}}<br />
{{Note | This has only been tried on Windows XP and Windows 7 RC guests AFAIK, and does not work on the Windows 7 guest. If you have experience with this on a different windows version, please add that data here.}}<br />
<br />
== Start VirtualBox ==<br />
<br />
To start Virtualbox, run the following command in a terminal:<br />
$ VirtualBox<br />
<br />
Or in KDE menu, select: <System><Sun Virtualbox><br />
<br />
== Virtualized OS Setup ==<br />
<br />
Virtualbox needs to be setup to virtualize another operating system.<br />
<br />
=== Test a LiveCD/DVD ===<br />
<br />
Click the 'New' button to create a new virtual environment. Name it appropriately and select Operating System type and version. Select base memory size (note: most operating systems will need at least 512MB to function properly). Create a new hard disk image (a hard disk image is a file that will contain the operating system's filesystem and files).<br />
<br />
When the new image has been created, click 'Settings', then CD/DVD-ROM, check 'Mount CD/DVD Drive' then select an ISO image.<br />
<br />
== Maintenance ==<br />
<br />
=== Rebuild the vboxdrv Module ===<br />
Note that any time your kernel version changes (due to upgrade, recompile, etc.) you must also rebuild the VirtualBox kernel. To do this, on virtualbox_bin from AUR '''or''' on versions earlier than 2.1, run the following command:<br />
# vbox_build_module<br />
This binary will be located in one of the following locations: <tt>/sbin</tt>, <tt>/bin</tt>, or <tt>/usr/bin</tt>.<br />
{{Note|If you are using one of the Virtualbox PKGBUILD's from the AUR, you will also need to update your modules via this method. In most cases, users of x86_64 will need to use one of the PKBUILDS of Virtualbox since the official repos only have support for the i686 architecture.}}<br />
<br />
On versions 2.1+, update the kernel module by running the following command:<br />
# /etc/rc.d/rc.vboxdrv setup<br />
<br />
After rebuilding the module, don't forget to load it with<br />
# modprobe vboxdrv<br />
<br />
=== Compact a Disk Image ===<br />
See [http://my.opera.com/locksley90/blog/2008/06/01/how-to-compact-a-virtualbox-virtual-disk-image-vdi How to compact a VirtualBox virtual disk image (VDI)]<br />
<br />
=== Windows Xp and Nokia phones ===<br />
To get working Windows XP and Nokia phones with Pc Suite mode, Virtualbox needs two simple steps:<br />
<br />
'''1.''' Add a rule to udev with {{Filename|/etc/udev/rules.d/40-permissions.rules}}:<br />
LABEL="usb_serial_start"<br />
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", \<br />
GROUP="usbfs", MODE="0660", GROUP="dialout"<br />
LABEL="usb_serial_end"<br />
<br />
'''2.''' Create the group usbfs and add its user to it<br />
$ sudo groupadd usbfs<br />
$ sudo usermod -a -G usbfs $USER<br />
<br />
After a logout, connect a Nokia phone with PC Suite mode and start Windows XP to test new rule.<br />
<br />
== Migrating From Another VM ==<br />
<br />
The <code>qemu-img</code> program can be used to convert images from one format to another, or add compression or encryption to an image. <br />
<br />
# pacman -S qemu<br />
<br />
=== Converting from QEMU images ===<br />
<br />
To convert a QEMU image for use with VirtualBox, first convert it to ''raw'' format, then use VirtualBox's conversion utility to convert and compact it in its native format.<br />
<br />
$ qemu-img convert -O raw test.qcow2 test.raw<br />
$ VBoxManage modifyvdi /full/path/to/test.vdi compact<br />
<br />
=== Converting from VMware images ===<br />
Do <br />
<br />
$ qemu-img convert image.vmdk image.bin<br />
$ VBoxManage convertdd image.bin image.vdi<br />
<br />
This may not be needed anymore with recent virtualbox versions (to be confirmed)<br />
<br />
== Tips and Tricks ==<br />
=== Sending a CTRL+ALT+F1 to the Guest ===<br />
If your guest O/S is a Linux distro, and you want to open a new tty text shell or exit X via typing {{Keypress|Ctrl}}+{{Keypress|Alt}}+{{Keypress|F1}}, you can easily send this command to the guest O/S simply by hitting your 'Host Key' (usually the {{Keypress|Ctrl}} in the Right side of your keyboard) + {{Keypress|F1}} or {{Keypress|F2}}, etc.<br />
<br />
=== Speeding up HDD Access for the Guest ===<br />
Enabling the SATA(AHCI) controller within Virtualbox can speed up Host disk operations. This is available though Settings>Hard Disks in current versions of Virtual Box.<br />
<br />
=== Starting VMs at System Boot on Headless Servers ===<br />
exec /bin/su PREFERRED_USER -l -c "/bin/bash --login -c \"VBoxHeadless -startvm {UUID}\" >/dev/null 2>&1"<br />
Where PREFERRED_USER is the user profile that contains the VM definitions and .vdi files. This will start the VM with a RDP server running on port 3389.<br />
To determine the available VMs for a user:<br />
su PREFERRED_USER -c "VBoxManage list vms"<br />
To suspend the VM:<br />
su PREFERRED_USER -c "VBoxManage controlvm {UUID} savestate"<br />
<br />
== External Resources ==<br />
* [http://download.virtualbox.org/virtualbox/2.0.6/UserManual.pdf VirtualBox 2.0.6 User Manual]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=NFSv3&diff=76646NFSv32009-09-26T23:46:20Z<p>VitaminJ: Full paths must be used, as a new user to NFS this wasn't obvious to me, coming from rsync-style.</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Nfs}}<br />
{{i18n_entry|Italiano|Nfs (Italiano)}}<br />
{{i18n_entry|Русский|Nfs_(Russian)}}<br />
{{i18n_entry|Česky|Nfs_(Česky)}}<br />
{{i18n_entry|简体中文|Nfs (简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
{{Note|nfs-utils has been upgraded since 2009-06-23, and NFS4 support is now implemented. You'd better refer to the ''[http://www.archlinux.org/news/452/ news]''.}}<br />
{{Note|portmap has been replaced by rpcbind.}}<br />
<br />
==Goal==<br />
The goal of this article is to assist in setting up an nfs-server for sharing files over a network. <br />
<br />
'''Note: for NFSv4, see [[NFSv4]]'''<br />
<br />
==Required packages==<br />
Required packages for both the server and the client are minimal.<br><br />
You'll only need to install:<br />
*core/rpcbind (or core/portmap which was replaced)<br />
*core/nfs-utils <br />
<br />
As the packages are in the [core] repository, they will be included by default in new Arch installations.<br />
<br />
==Setting up the server==<br />
You can now edit your configuration and start the daemons. You need to be root to execute the following commands.<br />
<br />
===Files===<br />
====/etc/exports====<br />
This file (/etc/exports) defines the various shares on the nfs server, and their permissions.<br><br />
A few examples:<br />
<pre><br />
/files *(ro,sync) ; Read-only access to anyone<br />
/files 192.168.0.100(rw,sync) ; Read-write access to a client on 192.168.0.100<br />
/files 192.168.1.1/24(rw,sync) ; Read-write access to all clients from 192.168.1.1 to 192.168.1.255<br />
</pre><br />
If you make changes to /etc/exports after starting the daemons, you can make them effective by issuing the following command:<br />
<pre><br />
exportfs -r<br />
</pre><br />
<br />
If you decide to make your NFS share public and writable, you can use the all_squash option in combination with anonuid and the anongid option.<br />
For example, to set the privileges for the user nobody in the group nobody, you can do the following:<br />
<pre><br />
; Read-write access to a client on 192.168.0.100, with rw access for the user 99 with gid 99<br />
/files 192.168.0.100(rw,sync,all_squash,anonuid=99,anongid=99))<br />
</pre><br />
<br />
This also means, that if you want write access to this directory, nobody.nobody must be the owner of the share directory:<br />
<pre><br />
chown -R nobody.nobody /files<br />
</pre><br />
<br />
Full details on the exports file are provided by the exports man page.<br />
<br />
====/etc/conf.d/nfs====<br />
'''Note:''' This file is replaced by "/etc/conf.d/nfs-common" & "/etc/conf.d/nfs-server".<br />
<br />
Edit this file to pass appropriate run-time options to nfsd, mountd, statd, and sm-notify. The default Arch NFS init scripts require the --no-notify option for statd, as follows:<br />
STATD_OPTS="--no-notify"<br />
Others may be left at the provided defaults, or changed according to your requirements. Please refer to the relevant man pages for full details.<br />
<br />
====/etc/hosts.allow====<br />
To allow network access to the nfs server you should edit /etc/hosts.allow.<br><br />
The following example opens these services to anyone:<br />
<pre><br />
nfsd: ALL<br />
rpcbind: ALL<br />
mountd:ALL<br />
</pre><br />
This is a very insecure way of allowing host access. To get better control over who is allowed to access the daemons hosts.deny should be everyone, and hosts.allow should specifically allow certain people.<br />
In this example, 192.168.0.101 should be the IP address of the person(s) allowed to access it. The numbers after the '/' is not a netmask!<br />
<pre><br />
nfsd: 192.168.0.101/255.255.255.255<br />
rpcbind: 192.168.0.101/255.255.255.255<br />
mountd: 192.168.0.101/255.255.255.255<br />
</pre><br />
<br />
This examples enables access for anyone on that network<br />
<pre><br />
nfsd: 192.168.0.0/255.255.255.0<br />
rpcbind: 192.168.0.0/255.255.255.0<br />
mountd: 192.168.0.0/255.255.255.0<br />
</pre><br />
For finer control, read the hosts_access(5) man page.<br />
<br />
===Daemons===<br />
You can now start the server with the following commands:<br />
<pre><br />
/etc/rc.d/rpcbind start (or: /etc/rc.d/portmap start)<br />
/etc/rc.d/nfs-common start (or: /etc/rc.d/nfslock start)<br />
/etc/rc.d/nfs-server start (or: /etc/rc.d/nfsd start)<br />
</pre><br />
Please note that they must be started in that order.<br><br />
To start the server at boot time, add these daemons to the DAEMONS array in /etc/rc.conf.<br />
<br />
==Setting up the client==<br />
===Files===<br />
====/etc/conf.d/nfs====<br />
Edit this file to pass appropriate run-time options to statd - the remaining options are for server use only. Do NOT use the --no-notify option on the client side, unless you are fully aware of the consequences of doing so.<br />
<br />
Please refer to the statd man page for full details.<br />
<br />
====/etc/hosts.allow====<br />
You'll need to allow rpcbind for the server's ip<br />
rpcbind: 192.168.0.100/255.255.255.255<br />
<br />
===Daemons===<br />
Start the portmap and nfslock daemons:<br />
/etc/rc.d/rpcbind start (or: /etc/rc.d/portmap start)<br />
/etc/rc.d/nfs-common start (or: /etc/rc.d/nfslock start)<br />
Please note that they must be started in that order OR start only ''nfs-common'', as ''rpcbind'' will be started as a dependency.<br><br />
To start the daemons at boot time, add them to the DAEMONS array in /etc/rc.conf.<br><br />
<br />
Then just mount as normal:<br />
mount server:/files /files<br />
<br />
'''NOTE:''' Unlike CIFS shares or [[rsync]], NFS exports must be called by the full path on the server. Example: if /home/fred/music is defined in /etc/exports on server ELROND, you must call<br />
mount ELROND:/home/fred/music /mnt/point<br />
instead of just using<br />
mount ELROND:music /mnt/point<br />
or you will get ''mount.nfs: access denied by server while mounting''<br />
<br />
===Auto-mount on boot===<br />
If you want to mount on boot, make sure network, rpcbind (portmap), nfs-common (nfslock) and netfs are in the DAEMONS array in /etc/rc.conf. Make sure the order is this one. It's better not to put any '@' in front of them (although you could safely use @netfs). For instance :<br />
DAEMONS=(... network rpcbind nfs-common @netfs ...)<br />
or<br />
DAEMONS=(... network portmap nfslock @netfs ...)<br />
<br />
Add an appropriate line in '''/etc/fstab''', for example:<br />
server:/files /files nfs defaults 0 0<br />
<br />
If you wish to specify a packet size for read and write packets, specify them in your fstab entry. The values listed below are the defaults if none are specified:<br />
<br />
server:/files /files nfs rsize=32768,wsize=32768 0 0<br />
<br />
Read the nfs man page for further information, including all available mount options.<br />
<br />
==Troubleshooting==<br />
===Unreliable performance, slow data transfer, and/or high load when using NFS and gigabit===<br />
This is a result of the default packetsize used by NFS, which causes significant fragmentation on gigabit networks. You can modify this behavior by the rsize and wsize mount parameters. Using rsize=32768,wsize=32768 should suffice. Please note that this problem does not occur on 100Mb networks, due to the lower packet transfer speed.<br />
<br />
Note: Default value for NFS4 is 32768. Maximum is 65536. Increase from default in increments of 1024 until maximum transfer rate is achieved.<br />
<br />
===Portmap daemon fails to start at boot===<br />
Make sure you place portmap BEFORE netfs in the daemons array in /etc/rc.conf .<br />
<br />
===Nfsd fails to start with "nfssvc: No such device"===<br />
Make sure the nfs and nfsd modules are loaded in the kernel.<br />
<br />
===Nfsd seems to work, but I can't connect from MacOS X clients===<br />
When trying to connect from a MacOS X client, you'll see that everything is ok at logs, but MacOS X refuses to mount your NFS share. You have to add <tt>insecure</tt> option to your share and re-run <tt>exportfs -r</tt>.<br />
<br />
==Links & References==<br />
* See also [[Avahi]], a Zeroconf implementation which allows automatic discovery of NFS shares.<br />
* HOWTO: [[Diskless network boot NFS root]]<br />
* [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/nfs_perf.htm Very helpful]<br />
* If you are setting up the Archlinux NFS server for use by Windows clients through Microsoft's SFU, you will save a lot of time and hair-scratching by looking at [http://bbs.archlinux.org/viewtopic.php?pid=523934#p523934 this forum post] first !</div>VitaminJhttps://wiki.archlinux.org/index.php?title=File_recovery&diff=76293File recovery2009-09-23T04:24:47Z<p>VitaminJ: e2fsck section</p>
<hr />
<div>[[Category:HOWTOs (English)]]<br />
[[Category:Networking (English)]]<br />
<br />
==Preface/Introduction==<br />
===Page Overview===<br />
This article is meant to capture several file recovery or undelete options for Arch/Linux. Please contribute to this page using the general format below and keeping it brief.<br />
===Special Notes===<br />
====Failing Drives====<br />
In the arena of data recovery, it is best to work on images of disks rather than the physical disks themselves. Generally, a failing drive's condition worsens over time. The goal ought to be to copy as much data as possible as early as possible, and to then abandon the disk. The dd_rescue utility (ddrescue in repos), unlike dd will repeatedly try to recover from errors, and will read the drive front to back, then back to front, attempting to salvage data. It keeps a log file so that you can pause and resume recovery without losing your progress.<br />
<br />
See [[disk cloning]].<br />
<br />
The image files created from a utility like ddrescue can then be mounted like a physical device and can be worked on safely. Always make a copy of the original image so that you can revert if things go sour!<br />
<br />
A tried and true method of improving failing drive reads is to keep it cold. A bit of time in the freezer is appropriate, but be careful to avoid bringing the drive from cold to warm too quickly, as condensation will form. Keeping the drive in the freezer with cables connected to the recovering PC works great.<br />
<br />
Do not attempt a filesystem check on a failing drive, as this will likely make the problem '''worse'''. Keep it read-only.<br />
====Backup Flash Media/Small Partitions====<br />
As an alternative to working with a 'live' partition (mounted or not), it is often preferable to work with an image provided that the filesystem in question isn't too large and that you have sufficient free HDD space to accommodate the image file. For example, flash memory devices like, thumb drives, digital cameras, portable music players, cellular phones, etc. <br />
<br />
Be sure to read the man pages for the utilities listed below to verify that they are capable of working with an image file.<br />
<br />
To make an image, one can use dd as follows:<br />
# dd if=/dev/target_partition of=/home/user/partition.image<br />
<br />
====Working with Digital Cameras====<br />
In order for some of the utils listed in the next section to work with flash media, one needs to have the device in question mounted as a block device (i.e. it is listed under /dev). Digital cameras operating in PTP (Picture Transfer Protocol) mode will not work in this regard. PTP cameras are transparently handled by libgphoto and/or libptp. Transparently as in, they don't get a block device. The alternative to PTP mode is USB Mass Storage (UMS) mode which may or may not be supported by your camera. Some cameras will have a menu item allowing the user to switch between the two modes; refer to your camera's user manual. If your camera does not support UMS mode and therefore cannot be accessed as a block device, your only alternative is to use a flash media reader and physically remove the media from your camera.<br />
<br />
==Foremost==<br />
===Description===<br />
'''Foremost''' is a console program to recover files based on their headers, footers, and internal data structures. This process is commonly referred to as data carving. Foremost can work on image files, such as those generated by dd, Safeback, Encase, etc, or directly on a drive. The headers and footers can be specified by a configuration file or you can use command line switches to specify built-in file types. These built-in types look at the data structures of a given file format allowing for a more reliable and faster recovery. <br />
===Installation===<br />
'''Foremost''' is available from the [[http://wiki.archlinux.org/index.php/AUR AUR]] in [[http://aur.archlinux.org/packages.php?ID=2014 this page]].<br />
===External Links===<br />
*Wiki: <br />
*Homepage: http://foremost.sourceforge.net<br />
<br />
==Photorec==<br />
===Description===<br />
'''Photorec''' is a complementary utility to '''TestDisk'''; both open-source data recovery utilities licensed under the terms of the [[http://www.gnu.org/licenses/gpl.html GNU Public License]] (GPL). '''Photorec''' is file data recovery software designed to recover lost files including video, documents and archives from Hard Disks and CDRom and lost pictures (thus, its 'Photo Recovery' name) from digital camera memory. PhotoRec ignores the filesystem and goes after the underlying data, so it will still work even if your media's filesystem has been severely damaged or re-formatted.<br />
<br />
===Installation===<br />
Both '''TestDisk''' and '''Photorec''' are available for Arch i686 and x64_86 in the same package.<br />
# pacman -S testdisk<br />
<br />
===External Links===<br />
*Wiki (Photorec): http://www.cgsecurity.org/wiki/PhotoRec<br />
*Homepage: http://www.cgsecurity.org/<br />
<br />
==Testdisk==<br />
===Description===<br />
'''TestDisk''', like '''Photorec''' are both open-source data recovery utilities licensed under the terms of the [[http://www.gnu.org/licenses/gpl.html GNU Public License]] (GPL). '''TestDisk''' is primarily designed to help recover lost partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software, certain types of viruses or human error (such as accidentally deleting a Partition Table).<br />
<br />
===Installation===<br />
Both '''TestDisk''' and '''Photorec''' are available for Arch i686 and x64_86 in the same package.<br />
# pacman -S testdisk<br />
<br />
===External Links===<br />
*Wiki (TestDisk): http://www.cgsecurity.org/wiki/TestDisk<br />
*Homepage: http://www.cgsecurity.org/<br />
<br />
==e2fsck==<br />
===Description===<br />
'''e2fsck''', is the ext2/ext3 filesystem checker included in the base install of Arch. e2fsck relies on a valid superblock. A superblock is a description of the entire filesystem's parameters. Because this data is so important, several copies of the superblock are distributed amongst the partition data. e2fsck can take an alternate superblock argument if the main (first) superblock is damaged (use the -b option).<br />
<br />
To determine where the superblocks are, run dumpe2fs -h on the affected, unmounted partition. Superblocks are spaced differently depending on the blocksize specified when the ext2/ext3 filesystem was created.<br />
<br />
An alternate method to determine superblocks is to use the -n option with mke2fs. Be '''sure''' to use the -n flag, which "causes mke2fs to not actually create a filesystem, but display what it would do if it were to create a filesystem. This can be used to determine the location of the backup superblocks for a particular filesystem."<br />
<br />
===Installation===<br />
'''e2fsck''' and '''dumpe2fs''' are included in the base Arch i686 and x64_86 install.<br />
<br />
===External Links===<br />
*e2fsck man page: http://phpunixman.sourceforge.net/index.php/man/e2fsck/8<br />
*dumpe2fs man page: http://phpunixman.sourceforge.net/index.php?parameter=dumpe2fs&mode=man</div>VitaminJhttps://wiki.archlinux.org/index.php?title=File_recovery&diff=76292File recovery2009-09-23T03:53:34Z<p>VitaminJ: Section about failing disks, link to disk cloning article</p>
<hr />
<div>[[Category:HOWTOs (English)]]<br />
[[Category:Networking (English)]]<br />
<br />
==Preface/Introduction==<br />
===Page Overview===<br />
This article is meant to capture several file recovery or undelete options for Arch/Linux. Please contribute to this page using the general format below and keeping it brief.<br />
===Special Notes===<br />
====Failing Drives====<br />
In the arena of data recovery, it is best to work on images of disks rather than the physical disks themselves. Generally, a failing drive's condition worsens over time. The goal ought to be to copy as much data as possible as early as possible, and to then abandon the disk. The dd_rescue utility (ddrescue in repos), unlike dd will repeatedly try to recover from errors, and will read the drive front to back, then back to front, attempting to salvage data. It keeps a log file so that you can pause and resume recovery without losing your progress.<br />
<br />
See [[disk cloning]].<br />
<br />
The image files created from a utility like ddrescue can then be mounted like a physical device and can be worked on safely. Always make a copy of the original image so that you can revert if things go sour!<br />
<br />
A tried and true method of improving failing drive reads is to keep it cold. A bit of time in the freezer is appropriate, but be careful to avoid bringing the drive from cold to warm too quickly, as condensation will form. Keeping the drive in the freezer with cables connected to the recovering PC works great.<br />
<br />
Do not attempt a filesystem check on a failing drive, as this will likely make the problem '''worse'''. Keep it read-only.<br />
====Backup Flash Media/Small Partitions====<br />
As an alternative to working with a 'live' partition (mounted or not), it is often preferable to work with an image provided that the filesystem in question isn't too large and that you have sufficient free HDD space to accommodate the image file. For example, flash memory devices like, thumb drives, digital cameras, portable music players, cellular phones, etc. <br />
<br />
Be sure to read the man pages for the utilities listed below to verify that they are capable of working with an image file.<br />
<br />
To make an image, one can use dd as follows:<br />
# dd if=/dev/target_partition of=/home/user/partition.image<br />
<br />
====Working with Digital Cameras====<br />
In order for some of the utils listed in the next section to work with flash media, one needs to have the device in question mounted as a block device (i.e. it is listed under /dev). Digital cameras operating in PTP (Picture Transfer Protocol) mode will not work in this regard. PTP cameras are transparently handled by libgphoto and/or libptp. Transparently as in, they don't get a block device. The alternative to PTP mode is USB Mass Storage (UMS) mode which may or may not be supported by your camera. Some cameras will have a menu item allowing the user to switch between the two modes; refer to your camera's user manual. If your camera does not support UMS mode and therefore cannot be accessed as a block device, your only alternative is to use a flash media reader and physically remove the media from your camera.<br />
<br />
==Foremost==<br />
===Description===<br />
'''Foremost''' is a console program to recover files based on their headers, footers, and internal data structures. This process is commonly referred to as data carving. Foremost can work on image files, such as those generated by dd, Safeback, Encase, etc, or directly on a drive. The headers and footers can be specified by a configuration file or you can use command line switches to specify built-in file types. These built-in types look at the data structures of a given file format allowing for a more reliable and faster recovery. <br />
===Installation===<br />
'''Foremost''' is available from the [[http://wiki.archlinux.org/index.php/AUR AUR]] in [[http://aur.archlinux.org/packages.php?ID=2014 this page]].<br />
===External Links===<br />
*Wiki: <br />
*Homepage: http://foremost.sourceforge.net<br />
<br />
==Photorec==<br />
===Description===<br />
'''Photorec''' is a complementary utility to '''TestDisk'''; both open-source data recovery utilities licensed under the terms of the [[http://www.gnu.org/licenses/gpl.html GNU Public License]] (GPL). '''Photorec''' is file data recovery software designed to recover lost files including video, documents and archives from Hard Disks and CDRom and lost pictures (thus, its 'Photo Recovery' name) from digital camera memory. PhotoRec ignores the filesystem and goes after the underlying data, so it will still work even if your media's filesystem has been severely damaged or re-formatted.<br />
<br />
===Installation===<br />
Both '''TestDisk''' and '''Photorec''' are available for Arch i686 and x64_86 in the same package.<br />
# pacman -S testdisk<br />
<br />
===External Links===<br />
*Wiki (Photorec): http://www.cgsecurity.org/wiki/PhotoRec<br />
*Homepage: http://www.cgsecurity.org/<br />
<br />
==Testdisk==<br />
===Description===<br />
'''TestDisk''', like '''Photorec''' are both open-source data recovery utilities licensed under the terms of the [[http://www.gnu.org/licenses/gpl.html GNU Public License]] (GPL). '''TestDisk''' is primarily designed to help recover lost partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software, certain types of viruses or human error (such as accidentally deleting a Partition Table).<br />
<br />
===Installation===<br />
Both '''TestDisk''' and '''Photorec''' are available for Arch i686 and x64_86 in the same package.<br />
# pacman -S testdisk<br />
<br />
===External Links===<br />
*Wiki (TestDisk): http://www.cgsecurity.org/wiki/TestDisk<br />
*Homepage: http://www.cgsecurity.org/</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Disable_PC_speaker_beep&diff=74562Disable PC speaker beep2009-08-25T05:38:23Z<p>VitaminJ: Clarify getting ALSA setting working</p>
<hr />
<div>[[Category:Sound (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Disable the PC speaker beep}}<br />
{{i18n_entry|Česky|Zakázání PC repráčku}}<br />
{{i18n_entry|Русский|Отключение PC Speaker}}<br />
{{i18n_entry|Українська|Вимкнути PC Speaker}}<br />
{{i18n_entry|简体中文|禁用喇叭 (简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
= Globally =<br />
* You can completely disable the PC speaker module at startup by adding <code>!pcspkr</code> to the <code>MODULES</code> array in <code>/etc/rc.conf</code>:<br />
MODULES=( ... !pcspkr ... )<br />
<br />
* If <code>lsmod | grep snd-pcsp</code> returns something, add <code>!snd-pcsp</code>:<br />
MODULES=( ... !snd-pcsp ... )<br />
<br />
In [http://bbs.archlinux.org/viewtopic.php?pid=557665#p557665 this] forum thread, it's recommended to add both to your <code>/etc/rc.conf</code>.<br />
<br />
= Locally =<br />
==In X==<br />
$ xset -b<br />
You can add this command to a startup file, such as <code>~/.xinitrc</code>, to disable it every time X starts.<br />
==In Console==<br />
$ setterm -blength 0<br />
Similarly you can add it to <code>~/.bashrc</code>.<br />
<br />
* Another way is to add this line to <code>~/.inputrc</code>:<br />
set bell-style none<br />
==Using ALSA==<br />
* Try muting the PC Speaker:<br />
$ amixer set 'PC Speaker' 0% mute<br />
For certain sound cards, it is the PC Beep:<br />
$ amixer set 'PC Beep' 0% mute<br />
You can also use alsamixer for a console GUI<br />
$ alsamixer<br />
Scroll to PC beep and press 'M' to mute. Save your alsa settings:<br />
# alsactl store<br />
<br />
In order for this method to work, you must add '''alsa''' to the list of daemons in ''/etc/rc.conf''<br />
<br />
Have a look at these '''man pages''' for further information: ''xset(1), setterm(1), readline(3)''<br />
<br />
= Forum Posts =<br />
[http://bbs.archlinux.org/viewtopic.php?id=75472 system beep is incredibly loud and shrill]<br />
[http://bbs.archlinux.org/viewtopic.php?pid=557665 (SOLVED) System Beep]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Disable_PC_speaker_beep&diff=74556Disable PC speaker beep2009-08-25T02:18:32Z<p>VitaminJ: Headings in Local</p>
<hr />
<div>[[Category:Sound (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Disable the PC speaker beep}}<br />
{{i18n_entry|Česky|Zakázání PC repráčku}}<br />
{{i18n_entry|Русский|Отключение PC Speaker}}<br />
{{i18n_entry|Українська|Вимкнути PC Speaker}}<br />
{{i18n_entry|简体中文|禁用喇叭 (简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
= Globally =<br />
* You can completely disable the PC speaker module at startup by adding <code>!pcspkr</code> to the <code>MODULES</code> array in <code>/etc/rc.conf</code>:<br />
MODULES=( ... !pcspkr ... )<br />
<br />
* If <code>lsmod | grep snd-pcsp</code> returns something, add <code>!snd-pcsp</code>:<br />
MODULES=( ... !snd-pcsp ... )<br />
<br />
In [http://bbs.archlinux.org/viewtopic.php?pid=557665#p557665 this] forum thread, it's recommended to add both to your <code>/etc/rc.conf</code>.<br />
<br />
= Locally =<br />
==In X==<br />
$ xset -b<br />
You can add this command to a startup file, such as <code>~/.xinitrc</code>, to disable it every time X starts.<br />
==In Console==<br />
$ setterm -blength 0<br />
Similarly you can add it to <code>~/.bashrc</code>.<br />
<br />
* Another way is to add this line to <code>~/.inputrc</code>:<br />
set bell-style none<br />
==Using ALSA==<br />
* Try muting the PC Speaker:<br />
$ amixer set 'PC Speaker' 0% mute<br />
For certain sound cards, it is the PC Beep:<br />
$ amixer set 'PC Beep' 0% mute<br />
You can also use alsamixer for a console GUI<br />
$ alsamixer<br />
Scroll to PC beep and press 'M' to mute. Save your alsa settings:<br />
# alsactl store<br />
<br />
Have a look at these '''man pages''' for further information: ''xset(1), setterm(1), readline(3)''<br />
<br />
= Forum Posts =<br />
[http://bbs.archlinux.org/viewtopic.php?id=75472 system beep is incredibly loud and shrill]<br />
[http://bbs.archlinux.org/viewtopic.php?pid=557665 (SOLVED) System Beep]</div>VitaminJhttps://wiki.archlinux.org/index.php?title=Disable_PC_speaker_beep&diff=74555Disable PC speaker beep2009-08-25T02:16:53Z<p>VitaminJ: Add forum post links</p>
<hr />
<div>[[Category:Sound (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Disable the PC speaker beep}}<br />
{{i18n_entry|Česky|Zakázání PC repráčku}}<br />
{{i18n_entry|Русский|Отключение PC Speaker}}<br />
{{i18n_entry|Українська|Вимкнути PC Speaker}}<br />
{{i18n_entry|简体中文|禁用喇叭 (简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
= Globally =<br />
* You can completely disable the PC speaker module at startup by adding <code>!pcspkr</code> to the <code>MODULES</code> array in <code>/etc/rc.conf</code>:<br />
MODULES=( ... !pcspkr ... )<br />
<br />
* If <code>lsmod | grep snd-pcsp</code> returns something, add <code>!snd-pcsp</code>:<br />
MODULES=( ... !snd-pcsp ... )<br />
<br />
In [http://bbs.archlinux.org/viewtopic.php?pid=557665#p557665 this] forum thread, it's recommended to add both to your <code>/etc/rc.conf</code>.<br />
<br />
= Locally =<br />
* To disable the annoying PC speaker beep in X:<br />
$ xset -b<br />
You can add this command to a startup file, such as <code>~/.xinitrc</code>, to disable it every time X starts.<br />
<br />
* To disable it in console:<br />
$ setterm -blength 0<br />
Similarly you can add it to <code>~/.bashrc</code>.<br />
<br />
* Another way is to add this line to <code>~/.inputrc</code>:<br />
set bell-style none<br />
<br />
* ALSA users can also try muting the PC Speaker:<br />
$ amixer set 'PC Speaker' 0% mute<br />
For certain sound cards, it is the PC Beep:<br />
$ amixer set 'PC Beep' 0% mute<br />
You can also use alsamixer for a console GUI<br />
$ alsamixer<br />
Scroll to PC beep and press 'M' to mute. Save your alsa settings:<br />
# alsactl store<br />
<br />
Have a look at these '''man pages''' for further information: ''xset(1), setterm(1), readline(3)''<br />
<br />
== Forum Posts ==<br />
[http://bbs.archlinux.org/viewtopic.php?id=75472 system beep is incredibly loud and shrill]<br />
[http://bbs.archlinux.org/viewtopic.php?pid=557665 (SOLVED) System Beep]</div>VitaminJ