https://wiki.archlinux.org/api.php?action=feedcontributions&user=Martius&feedformat=atomArchWiki - User contributions [en]2024-03-29T00:10:28ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Bluetooth_headset&diff=381268Bluetooth headset2015-07-07T20:48:36Z<p>Martius: /* Connecting works, but I cannot play sound */ missing chown of client.conf</p>
<hr />
<div>[[Category:Sound]]<br />
[[Category:Bluetooth]]<br />
[[ja:Bluetooth ヘッドセット]]<br />
[[ru:Bluetooth headset]]<br />
{{Related articles start}}<br />
{{Related|Bluetooth}}<br />
{{Related|Bluez4}}<br />
{{Related articles end}}<br />
<br />
Currently, Arch Linux supports the A2DP profile (Audio Sink) for remote audio playback with the default installation. <br />
<br />
{{Tip|1=<br />
* The most recent version of [[Bluez]] does not support the Headset/Handsfree profiles (see [https://bugs.freedesktop.org/show_bug.cgi?id=73325 this bug report] for example). This means that microphone input will not work, and also no sound output on headsets that do not support the A2DP profile. For using a headset with the Headset/Handsfree profiles, you will need to jump down to the legacy methods which require using [[AUR]] to fetch alternative packages.<br />
* Bluez5 is only supported by [[PulseAudio]] and not by [[ALSA]]. If you do not want to use PulseAudio, you need to install an older Bluez version from the AUR.}}<br />
<br />
== Headset via Bluez5/PulseAudio ==<br />
<br />
PulseAudio 5.x supports A2DP per default.<br />
Make sure the following packages are [[install]]ed: {{Pkg|pulseaudio-alsa}}, {{Pkg|pulseaudio-bluetooth}}, {{Pkg|bluez}}, {{Pkg|bluez-libs}}, {{Pkg|bluez-utils}}, {{Pkg|bluez-firmware}}. Without {{Pkg|pulseaudio-bluetooth}} you won't be able to connect after the next pairing and you won't get any usable error messages.<br />
<br />
Start the Bluetooth system:<br />
<br />
# systemctl start bluetooth<br />
<br />
Now we can use the ''bluetoothctl'' command line utility to pair and connect. For troubleshooting and more detailed explanations of ''bluetoothctl'' see the [[Bluetooth]] article. Run<br />
<br />
# bluetoothctl<br />
<br />
to be greeted by its internal command prompt. Then enter:<br />
<br />
# power on<br />
# agent on<br />
# default-agent<br />
# scan on<br />
<br />
Now make sure that your headset is in pairing mode. It should be discovered shortly. For example,<br />
[NEW] Device 00:1D:43:6D:03:26 Lasmex LBT10<br />
shows a device that calls itself "Lasmex LBT10" and has MAC address ''00:1D:43:6D:03:26''. We will now use that MAC address to initiate the pairing:<br />
<br />
# pair 00:1D:43:6D:03:26<br />
<br />
After pairing, you also need to explicitly connect the device (every time?):<br />
<br />
# connect 00:1D:43:6D:03:26<br />
<br />
If everything works correctly, you now have a separate output device in [[PulseAudio]].<br />
{{Note|The device may be off by default. Select it's audio profile (''OFF'', A2DP, HFP) in the "Configuration" tab of {{Pkg|pavucontrol}}.}}<br />
You can now redirect any audio through that device using the "Playback" and "Recording" tabs of {{Pkg|pavucontrol}}.<br />
<br />
You can now disable scanning again and exit the program:<br />
# scan off<br />
# exit<br />
<br />
=== Troubleshooting ===<br />
<br />
Many users report frustration with getting A2DP/Bluetooth Headsets to work. <br />
<br />
==== Selected audio profile, but headset inactive and audio cannot be redirected ====<br />
<br />
Deceptively, this menu is available before the device has been connected; annoyingly it will have no effect. The menu seems to be created as soon as the receiver recognizes the device.<br />
<br />
Make sure to run bluetoothctl (with sudo/as root) and connect the device manually. There may be configuration options to remove the need to do this each time, but neither pairing nor trusting induce automatic connecting for me.<br />
<br />
==== Pairing fails with AuthenticationFailed ====<br />
<br />
If pairing fails, you can try [https://stackoverflow.com/questions/12888589/linux-command-line-howto-accept-pairing-for-bluetooth-device-without-pin disabling SSPMode] with:<br />
# hciconfig hci0 sspmode 0<br />
<br />
==== Pairing works, but connecting does not ====<br />
<br />
You might see the following error in ''bluetoothctl'':<br />
<br />
[bluetooth]# connect 00:1D:43:6D:03:26<br />
Attempting to connect to 00:1D:43:6D:03:26<br />
Failed to connect: org.bluez.Error.Failed<br />
<br />
To further investigate, have a look at the log via one of the following commands:<br />
<br />
# systemctl status bluetooth<br />
# journalctl -n 20<br />
<br />
You might see a message like this:<br />
<br />
bluetoothd[5556]: a2dp-sink profile connect failed for 00:1D:43:6D:03:26: Protocol not available<br />
<br />
The problem in this case is that PulseAudio is not catching up. A common solution to this problem is to restart PulseAudio. Note that it is perfectly fine to run ''bluetoothctl'' as root while PulseAudio runs as user. After restarting PulseAudio, retry to connect. It is not necessary to repeat the pairing.<br />
<br />
If restarting PulseAudio does not work, you need to load module-bluetooth-discover.<br />
<br />
# pactl load-module module-bluetooth-discover<br />
<br />
The same load-module command can be added to {{ic|/etc/pulse/default.pa}}.<br />
<br />
If that still does not work, or you are using PulseAudio's system-wide mode, also load the following PulseAudio modules (again these can be loaded via your default.pa or system.pa):<br />
<br />
module-bluetooth-policy<br />
module-bluez5-device<br />
module-bluez5-discover<br />
<br />
To have your headset auto connect you need to enable PulseAudio's switch-on-connect module. Add the following:<br />
{{hc|/etc/pulse/default.pa|<br />
# automatically switch to newly-connected devices<br />
load-module module-switch-on-connect<br />
}}<br />
<br />
You then need to tell ''bluetoothctl'' to trust your Bluetooth headset, or you will see errors like this:<br />
bluetoothd[487]: Authentication attempt without agent<br />
bluetoothd[487]: Access denied: org.bluez.Error.Rejected<br />
<br />
[bluetooth]# trust 00:1D:43:6D:03:26<br />
<br />
After a reboot, your Bluetooth adapter will not power on by default. You need to add a udev rule to power it on:<br />
{{hc|/etc/udev/rules.d/10-local.rules|2=<br />
# Set bluetooth power up<br />
ACTION=="add", SUBSYSTEM=="bluetooth", KERNEL=="hci[0-9]*", RUN+="/usr/bin/hciconfig %k up"<br />
}}<br />
<br />
==== Connecting works, but I cannot play sound ====<br />
<br />
Make sure that you see the following messages in your system log:<br />
<br />
bluetoothd[5556]: Endpoint registered: sender=:1.83 path=/MediaEndpoint/A2DPSource<br />
bluetoothd[5556]: Endpoint registered: sender=:1.83 path=/MediaEndpoint/A2DPSink<br />
<br />
If you see a message similar to this, you can go on and investigate your PulseAudio configuration. Otherwise, go back and ensure the connection is successful.<br />
<br />
If you use Gnome (or even only GDM), GDM starts its instance of pulseaudio which "captures" your bluetooth device connection. The following solution work<br />
<br />
$ ps aux | grep pulse<br />
gdm 1371 0.0 0.4 98180 4776 ? S<sl Jun13 0:00 /usr/bin/pulseaudio --start --log-target=syslog<br />
<br />
In this case, you can prevent gdm to start pulseaudio by creating or updating a configuration file:<br />
<br />
# touch /var/lib/gdm/.pulse/client.conf<br />
# chown gdm:gdm /var/lib/gdm/.pulse/client.conf <br />
# echo 'autospawn = no' >> /var/lib/gdm/.pulse/client.conf<br />
# echo 'daemon-binary = /bin/true' >> /var/lib/gdm/.pulse/client.conf<br />
<br />
It will fix the problem at the next reboot, for the first time, you can kill gdm's pulseaudio instance manually.<br />
<br />
==== UUIDs has unsupported type ====<br />
<br />
During pairing you might see this output in ''bluetoothctl'':<br />
<br />
[CHG] Device 00:1D:43:6D:03:26 UUIDs has unsupported type<br />
<br />
This message is a very common one and can be ignored.<br />
<br />
== Legacy method: ALSA-BTSCO ==<br />
<br />
{{Out of date|Instructions rely on [[bluez4]].}}<br />
<br />
It is much easier to set up your bluetooth headset today, with bluez >= 3.16. You may want to try the out-of-box python script in [http://fosswire.com/2008/01/11/a2dp-stereo-linux/ this blog] (you need edit the script to work with gconftool-2). There is also a piece of equivalent bash script [http://lymanrb.blogspot.com/2008/05/linux.html here].<br />
<br />
You need your headset's bdaddr. It is of the form ''12:34:56:78:9A:BC''. Either find it in the documentation of your headset, on the headset itself or with the '''hcitool scan''' command.<br />
<br />
Install {{AUR|btsco}}.<br />
<br />
To load the kernel module, type:<br />
# modprobe snd-bt-sco<br />
There will now be an extra audio device. Use {{ic|alsamixer -cN}} (where N is most likely 1) to set the volume. You can access the device with any alsa-capable application by choosing the device ''BT headset'', or with any OSS application by using {{ic|/dev/dspN}} as the audio device.<br />
<br />
But to actually get any sound, you have to connect your headset to the computer first.<br />
<br />
=== Connecting the headset ===<br />
<br />
If you connect your headset for the first time, read the section about pairing first. To connect to your headset to the computer, use the command<br />
$ btsco -f <bdaddr><br />
for example<br />
$ btsco -f 12:34:56:78:9A:BC<br />
<br />
==== Pairing the headset with your computer ====<br />
<br />
The first time you connect the headset, you have to pair it with the computer. To do this, you need your headset's PIN. Depending on your headset you may have to reset the headset and repeat the pairing everytime you used the headset with another bluetooth device.<br />
<br />
There are two ways to pair your headset with the computer:<br />
<br />
===== Using ''bluez-gnome'' =====<br />
<br />
{{Out of date|Package does no longer exist in the repositories.}}<br />
<br />
Install the ''bluez-gnome'' package from the community repository. Then start the '''bt-applet''' program. Once you try to connect to the headset, a window will open and ask for the PIN.<br />
<br />
===== Using ''passkey-agent'' =====<br />
<br />
Before connecting to the headset, enter the command<br />
$ passkey-agent --default <pin><br />
where ''<pin>'' is your headset's PIN. Then try to connect to the headset.<br />
<br />
=== Headset and ALSA Devices ===<br />
<br />
1. First if you have not already, [[pacman|install]] {{Pkg|bluez}} from the [[official repositories]].<br />
<br />
2. Scan for your device<br />
$ hcitool (-i <optional hci#>***) scan<br />
<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 />
<br />
4. Make sure your {{ic|/etc/bluetooth/audio.conf}} allows A2DP Audio Sinks. Place this line just bellow the [General] heading:<br />
Enable=Source,Sink,Media,Socket<br />
<br />
5. Add this to your {{ic|/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 />
6. Check to see if it has been added to alsa devices<br />
$ aplay -L<br />
<br />
7. 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 />
{{Tip|To find hci# for a usb dongle, type in <br />
$ hcitool dev<br />
}}<br />
<br />
=== Headset's multimedia buttons ===<br />
<br />
In order to get your bluetooth headset's multimedia buttons (play, pause, next, previous) working you need to create {{ic|/etc/modules-load.d/uinput.conf}} containing {{ic|uinput}}.<br />
<br />
== Legacy method: PulseAudio ==<br />
<br />
{{Out of date|Instructions rely on [[bluez4]] (references to {{ic|/etc/bluetooth/audio.conf}} and ''bluez-simple-agent'').}}<br />
<br />
This one is much easier and more elegant. PulseAudio will seamlessly switch between output devices when the headset is turned on. If you have ALSA as the sound server, you need the following packages installed:<br />
{{Pkg|pulseaudio}} and {{Pkg|pulseaudio-alsa}}.<br />
<br />
Now, to configure the audio output to use bluetooth, just install {{Pkg|pavucontrol}} and run it to configure the audio output:<br />
$ pavucontrol<br />
Make sure to take a look at the [[PulseAudio]] wiki entry for setting up PulseAudio, especially if you are running KDE.<br />
<br />
=== Troubleshooting ===<br />
<br />
==== Audio sink fails ====<br />
<br />
Bluetooth headset is connected, but ALSA/PulseAudio fails to pick up the connected device. You will get "Audio sink fails".<br />
According to [http://wiki.gentoo.org/wiki/Bluetooth_Headset gentoo wiki], you have to verify than in {{ic|/etc/bluetooth/audio.conf}} there is {{ic|<nowiki>Enable=Socket</nowiki>}} under the {{ic|[General]}} section heading.<br />
<br />
Just do a {{ic|# systemctl restart bluetooth}} to apply it.<br />
<br />
==== Page timeout issue ====<br />
<br />
If you receive this error whilst trying to pair your headset with your system using bluez-simple-agent, then you can try to restart your system and use the graphical bluez applet of your desktop environment.<br />
<br />
== Legacy documentation: ALSA, bluez5 and PulseAudio method ==<br />
<br />
{{Accuracy|Describes two different methods, see the [[Talk:Bluetooth_Headset#bluez5_method:_overcomplicated_instructions|talk page]] for details.|Talk:Bluetooth_Headset#bluez5_method:_overcomplicated_instructions}}<br />
<br />
[[ALSA]], [[bluez|bluez5]], and [[PulseAudio]] work together to allow a wireless [[Bluetooth]] headset to play audio. The following method works with a Lenovo T61p laptop and SoundBot SB220 wireless bluetooth headset. The required software stack is extensive and failure to include all components can produce errors which are difficult to understand. The following list of software packages might not be the minimum required set and needs to be examined more closely.<br />
<br />
Bluez5 has a regression causing HSP/HFP Telephone profile to not be available. This regression is documented in the [http://www.freedesktop.org/wiki/Software/PulseAudio/Notes/5.0/ draft release notes for Pulseaudio 5.0] which say (in "Notes for packagers"): "PulseAudio now supports BlueZ 5, but only the A2DP profile. BlueZ 4 is still the only way to make HSP/HFP work." ([https://fedoraproject.org/wiki/Common_F20_bugs#bluez5-profile from here])<br />
<br />
=== Install Software Packages ===<br />
<br />
The core software components are [[ALSA]], Bluez5, [[PulseAudio]]. However there are additional libraries which are required. As well as a player which can play audio files. The following section lists the software packages installed in order to connect the headset and play audio over the headset.<br />
<br />
==== Install ALSA and associated libraries ====<br />
<br />
[[ALSA]] works with the linux kernel to provide audio services to user mode software. The following packages are used with the [[Bluetooth]] headset: {{Pkg|alsa-utils}}, {{Pkg|alsa-plugins}}, {{Pkg|alsa-tools}}.<br />
<br />
==== Install Bluez5 ====<br />
<br />
Bluez5 is the latest [[Bluetooth]] stack. It is required for [[PulseAudio]] to interface with wireless headsets. Required packages: {{Pkg|bluez}}, {{Pkg|bluez-utils}}, {{Pkg|bluez-libs}}.<br />
<br />
==== Install Audacious ====<br />
<br />
[[Audacious]] is a program which plays audio files. It can work directly with [[ALSA]] or with [[PulseAudio]]. Required packages: {{Pkg|audacious}}, {{Pkg|audacious-plugins}}.<br />
<br />
=== Procedure ===<br />
<br />
Once the required packages are installed, use this procedure to play audio with a bluetooth headset. The high level overview of the procedure is to pair the headset, connect the headset, configure the player and pulse audio controller and then play audio.<br />
<br />
Start the bluetooth service as root:<br />
# systemctl start bluetooth<br />
<br />
Verify Bluetooth is started<br />
# systemctl status bluetooth<br />
bluetooth.service - Bluetooth service<br />
Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; disabled)<br />
Active: active (running) since Sat 2013-12-07 12:31:14 PST; 12s ago<br />
Docs: man:bluetoothd(8)<br />
Main PID: 3136 (bluetoothd)<br />
Status: "Running"<br />
CGroup: /system.slice/bluetooth.service<br />
└─3136 /usr/lib/bluetooth/bluetoothd<br />
<br />
Dec 07 12:31:14 t61p systemd[1]: Starting Bluetooth service...<br />
Dec 07 12:31:14 t61p bluetoothd[3136]: Bluetooth daemon 5.11<br />
Dec 07 12:31:14 t61p systemd[1]: Started Bluetooth service.<br />
Dec 07 12:31:14 t61p bluetoothd[3136]: Starting SDP server<br />
Dec 07 12:31:14 t61p bluetoothd[3136]: Bluetooth management interface 1.3 i...ed<br />
Hint: Some lines were ellipsized, use -l to show in full.<br />
<br />
Start the PulseAudio daemon. This must be done after X windows is started and as a normal user.<br />
$ pulseaudio -D<br />
<br />
Verify the PulseAudio daemon is running.<br />
$ pulseaudio --check -v<br />
I: [pulseaudio] main.c: Daemon running as PID 3186<br />
<br />
Start up bluetoothctl as root and pair and connect your headset. As a regular user, bluetoothctl will pair but not connect. Perhaps this is related to the config file (shown below) which is setup for what appears to be the root user.<br />
Note: the procedure shown below is for an initial pair and connect of the headphone. If the headset is already paired, then the procedure below can be shortened to: power on, agent on, default-agent, connect <mac address>. The mac address can be seen from the devices command output.<br />
<br />
$ bluetoothctl <br />
[NEW] Controller 00:1E:4C:F4:98:5B t61p-0 [default]<br />
[NEW] Device 00:1A:7D:12:36:B9 SoundBot SB220<br />
[bluetooth]# show<br />
Controller 00:1E:4C:F4:98:5B<br />
Name: t61p<br />
Alias: t61p-0<br />
Class: 0x000000<br />
Powered: no<br />
Discoverable: no<br />
Pairable: yes<br />
UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)<br />
UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)<br />
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)<br />
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)<br />
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)<br />
UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb)<br />
UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)<br />
Modalias: usb:v1D6Bp0246d050B<br />
Discovering: no<br />
[bluetooth]# power on<br />
[CHG] Controller 00:1E:4C:F4:98:5B Class: 0x0c010c<br />
Changing power on succeeded<br />
[CHG] Controller 00:1E:4C:F4:98:5B Powered: yes<br />
[bluetooth]# agent on<br />
Agent registered<br />
[bluetooth]# default-agent<br />
Default agent request successful<br />
<br />
<power on your headset in pairing mode. Eventually you will see what appears to be a mac address.><br />
[bluetooth]# scan on<br />
Discovery started<br />
[CHG] Controller 00:1E:4C:F4:98:5B Discovering: yes<br />
[CHG] Device 00:1A:7D:12:36:B9 RSSI: -61<br />
[bluetooth]# pair 00:1A:7D:12:36:B9<br />
Attempting to pair with 00:1A:7D:12:36:B9<br />
[CHG] Device 00:1A:7D:12:36:B9 Connected: yes<br />
[CHG] Device 00:1A:7D:12:36:B9 UUIDs has unsupported type<br />
[CHG] Device 00:1A:7D:12:36:B9 Paired: yes<br />
Pairing successful<br />
[bluetooth]# connect 00:1A:7D:12:36:B9<br />
[CHG] Device 00:1A:7D:12:36:B9 Connected: yes<br />
Connection successful<br />
[bluetooth]# info 00:1A:7D:12:36:B9<br />
Device 00:1A:7D:12:36:B9<br />
Name: SoundBot SB220<br />
Alias: SoundBot SB220<br />
Class: 0x240404<br />
Icon: audio-card<br />
Paired: yes<br />
Trusted: no<br />
Blocked: no<br />
Connected: yes<br />
LegacyPairing: yes<br />
UUID: Headset (00001108-0000-1000-8000-00805f9b34fb)<br />
UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)<br />
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)<br />
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)<br />
UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb)<br />
<br />
Start up alsamixer, for simplicity un-mute all your outputs. Oddly enough some can be muted though. The ones I had muted during playback were:<br />
* Headphones<br />
* SPIDF<br />
<br />
Start up audacious. Use the menu to select PulseAudio as your output. Somewhere I read that bluez5 requires pulseaudio-git and this jives with my experience.<br />
<br />
Start up pavucontrol in a terminal. In the Outputs tab select the bluetooth headset.<br />
<br />
[http://netskink.blogspot.com/2013/12/pulseaudio-pavucontrol-and-audacious.html screenshot of application settings]<br />
<br />
==== Miscellaneous configuration files ====<br />
<br />
For reference, these settings were also done.<br />
<br />
===== ALSA /etc/asound.conf =====<br />
<br />
The settings shown at the top of this page was used, but the additional modification for Intel laptop sound cards.<br />
<br />
{{bc|<nowiki><br />
pcm.btheadset {<br />
type plug<br />
slave {<br />
pcm {<br />
type bluetooth<br />
device 00:1A:7D:12:36:B9<br />
profile "auto"<br />
}<br />
}<br />
hint {<br />
show on<br />
description "BT Headset"<br />
}<br />
}<br />
ctl.btheadset {<br />
type bluetooth<br />
}<br />
options snd-hda-intel model=laptop<br />
</nowiki>}}<br />
<br />
===== /etc/dbus-1/system.d/bluetooth.conf =====<br />
<br />
The settings here seem to be enabled for root only. See the policy user="root" section. However, if a regular user is specified here, the system fails to start. Someone with more knowledge could explain why.<br />
<br />
{{hc|/etc/dbus-1/system.d/bluetooth.conf|<nowiki><br />
<!-- This configuration file specifies the required security policies for Bluetooth core daemon to work. --><br />
<br />
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"<br />
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"><br />
<busconfig><br />
<br />
<!-- ../system.conf have denied everything, so we just punch some holes --><br />
<br />
<policy user="root"><br />
<allow own="org.bluez"/><br />
<allow send_destination="org.bluez"/><br />
<allow send_interface="org.bluez.Agent1"/><br />
<allow send_interface="org.bluez.MediaEndpoint1"/><br />
<allow send_interface="org.bluez.MediaPlayer1"/><br />
<allow send_interface="org.bluez.ThermometerWatcher1"/><br />
<allow send_interface="org.bluez.AlertAgent1"/><br />
<allow send_interface="org.bluez.Profile1"/><br />
<allow send_interface="org.bluez.HeartRateWatcher1"/><br />
<allow send_interface="org.bluez.CyclingSpeedWatcher1"/><br />
</policy><br />
<br />
<policy at_console="true"><br />
<allow send_destination="org.bluez"/><br />
</policy><br />
<br />
<!-- allow users of lp group (printing subsystem) to communicate with bluetoothd --><br />
<policy group="lp"><br />
<allow send_destination="org.bluez"/><br />
</policy><br />
<br />
<policy context="default"><br />
<deny send_destination="org.bluez"/><br />
</policy><br />
<br />
</busconfig><br />
</nowiki>}}<br />
<br />
===== Tested applications =====<br />
<br />
As noted above this will work easily with audacious. YouTube videos with Chromium and Flash Player will work on some videos. If the video has ads it will not work, but if the video does not have ads it will work. Just make sure that after audacious is working with Bluetooth headset, start Chromium, and navigate to YouTube. Find a video without leading ads, and it should play the audio. If the settings icon has the a menu with two drop-down combo boxes for Speed and Quality it will play.<br />
<br />
== Switch between HSV and A2DP setting ==<br />
<br />
This can easily be achieved by the following command where 2 needs to be changed with the correct device number.<br />
<br />
pacmd set-card-profile 2 a2dp_sink<br />
<br />
=== A2DP not working with PulseAudio ===<br />
<br />
If PulseAudio fails when changing the profile to A2DP with bluez 4.1+ and PulseAudio 3.0+, you can try disabling the Socket interface from {{ic|/etc/bluetooth/audio.conf}} by removing the line {{ic|1=Enable=Socket}} and adding line {{ic|1=Disable=Socket}}.<br />
<br />
== Tested headsets ==<br />
<br />
{| class="wikitable"<br />
! Model<br />
! Version<br />
! Comments<br />
! Compatible<br />
|-<br />
| '''Philips SHB9150'''<br />
| bluez5, pulseaudio 5<br />
| Pause and resume does not work. With at least mpv and Banshee hitting the pause button stops audio output but does not pause the player.<br />
| {{R|Limited}}<br />
|-<br />
| '''Philips SHB9100'''<br />
| <br />
| Pause and resume is flaky. See [https://bbs.archlinux.org/viewtopic.php?pid=1315428#p1315428] for the underlying issue and a temporary solution to improve audio quality.<br />
| {{R|Limited}}<br />
|-<br />
| '''Philips SHB7000'''<br />
| <br />
| Pause and resume is flaky.<br />
| {{R|Limited}}<br />
|-<br />
| '''Philips SHB5500BK/00'''<br />
| bluez 5.28, PulseAudio 6.0<br />
| Pause and resume is not working.<br />
| {{R|Limited}}<br />
|-<br />
| '''Parrot Zik'''<br />
| <br />
| Firmware 1.04. The microphone is detected, but does not work. Sometimes it lags (but does not stutter); usually this is not noticeable unless playing games, in which case you may switch to a wired connection.<br />
| {{R|Limited}}<br />
|-<br />
| '''Sony DR-BT50'''<br />
| bluez{4,5}<br />
| Works for a2dp, see [http://vlsd.blogspot.com/2013/11/bluetooth-headphones-and-arch-linux.html]). Adapter: D-Link DBT-120 USB dongle.<br />
| {{Yes}}<br />
|-<br />
| '''Sony SBH50'''<br />
| bluez5<br />
| Works for a2dp, Adapter: Broadcom Bluetooth 2.1 Device (Vendor=0a5c ProdID=219b Rev=03.43). Requires the {{ic|btusb}} [[modprobe|module]].<br />
| {{Yes}}<br />
|-<br />
| '''Sony MDR-XB950BT'''<br />
| pulseaudio<br />
| Tested a2dp. Adapter: Grand-X BT40G. Doesn't auto-connect, need to connect manually. Other functionality works fine.<br />
| {{R|Limited}}<br />
|-<br />
| '''Sony MUC-M1BT1'''<br />
| bluez5, {{AUR|pulseaudio-git}}<br />
| Both A2DP & HSP/HFP work fine.<br />
| {{Yes}}<br />
|-<br />
| '''SoundBot SB220'''<br />
| bluez5, {{AUR|pulseaudio-git}}<br />
| <br />
| {{Yes}}<br />
|-<br />
| '''Auna Air 300'''<br />
| bluez5, pulseaudio-git<br />
| For some reason, a few restarts were required, and eventually it just started working.<br />
| {{R|Limited}}<br />
|-<br />
| '''Sennheiser MM 400-X'''<br />
| bluez5, pulseaudio 4.0-6<br />
| <br />
| {{Yes}}<br />
|-<br />
| '''Sennheiser MM 550-X Travel'''<br />
| bluez 5.27-1, pulseaudio 5.0-1<br />
| Next/Previous buttons work out-of-the-box, Play/Pause does not<br />
| {{Yes}}<br />
|-<br />
| '''Audionic BlueBeats (B-777)'''<br />
| bluez5, pulseaudio 4.0-6<br />
| <br />
| {{Yes}}<br />
|-<br />
| '''Logitech Wireless Headset'''<br />
| bluez 5.14, pulseaudio-git<br />
| part number PN 981-000381, advertised for use with iPad<br />
| {{Yes}}<br />
|-<br />
| '''HMDX Jam Classic Bluetooth'''<br />
| bluez, pulseaudio-git<br />
| <br />
| {{Yes}}<br />
|-<br />
| '''PT-810'''<br />
| bluez 5.14, pulseaudio-git<br />
| Generic USB-Powered Bluetooth Audio Receiver with 3.5mm headset jack and a2dp profile. Widely available as "USB Bluetooth Receiver." IDs as PT-810.<br />
| {{Yes}}<br />
|-<br />
| '''Philips SHB4000WT'''<br />
| bluez5<br />
| A2DP works, HDP distorted.<br />
| {{Yes}}<br />
|-<br />
| '''Philips AEA2000/12'''<br />
| bluez5<br />
| <br />
| {{Yes}}<br />
|-<br />
| '''Nokia BH-104'''<br />
| bluez4<br />
| <br />
| {{Yes}}<br />
|-<br />
| '''Creative AirwaveHD'''<br />
| bluez 5.23<br />
| Bluetooth adapter Atheros Communications usb: 0cf3:0036<br />
| {{Yes}}<br />
|-<br />
| '''Creative HITZ WP380'''<br />
| bluez 5.27, pulseaudio 5.0-1<br />
| A2DP Profile only. Buttons work (Play, Pause, Prev, Next). Volume buttons are hardware-only. Auto-connect works but you should include the bluetooth module in "pulseaudio" to switch to it automatically. Clear HD Music Audio (This device support APTx codec but it isn't supported in linux yet). You may have some latency problems which needs pulseaudio restart.<br />
| {{Yes}}<br />
|-<br />
| '''deleyCON Bluetooth Headset'''<br />
| bluez 5.23<br />
| Adapter: CSL - USB nano Bluetooth-Adapter V4.0. Tested a2dp profile. Untested microphone. Does not auto-connect (even when paired and trusted), must connect manually. Play/pause button mutes/unmutes the headphones, not the playback. Playback fwd/bwd buttons do not work (nothing visible with ''xev'').<br />
| {{R|Limited}}<br />
|-<br />
| '''UE BOOM'''<br />
| bluez 5.27, pulseaudio-git 5.99<br />
| Update to latest UE BOOM fw 1.3.58. Sound latency in video solved by configuring pavucontrol. Works with UE BOOM x2.<br />
| {{Yes}}<br />
|-<br />
| '''LG HBS-730'''<br />
| bluez 5.30, pulseaudio 6.0<br />
| Works out of box with A2DP profile.<br />
| {{Yes}}<br />
|-<br />
| '''Beats Studio Wireless'''<br />
| bluez 5.28, pulseaudio 6.0<br />
| Works out of box. Not tested multimedia buttons.<br />
| {{Yes}}<br />
|-<br />
| '''AKG Y45BT'''<br />
| bluez 5.30, pulseaudio 6.0<br />
| Pause and resume does not work. Needs {{ic|1=Enable=Socket}} in {{ic|/etc/bluetooth/audio.conf}} and {{ic|load-module module-bluetooth-discover}} in {{ic|/etc/pulse/default.pa}}.<br />
| {{Yes}}<br />
|-<br />
| '''Bluedio Turbine'''<br />
| bluez5, pulseaudio 6.0<br />
| HSP/HFP work fine, A2DP not tested<br />
| {{Yes}}<br />
|-<br />
| '''Sony SBH20'''<br />
| bluez 5.30, pulseaudio 6.0<br />
| Works out of box with A2DP profile.<br />
| {{Yes}}<br />
|-<br />
| '''Nokia BH-111'''<br />
| bluez 5.30, pulseaudio 6.0<br />
| Works with both HSP/HFP and A2DP. Buttons work in certain apps.<br />
| {{Yes}}<br />
|-<br />
| '''Sony MDR-ZX330BT'''<br />
| bluez 5.31, pulseaudio 6.0<br />
| Works out of box (HSP/HFP and A2DP). Buttons work in certain apps.<br />
| {{Yes}}<br />
|}<br />
<br />
== See also ==<br />
<br />
<br />
Using the same device on Windows and Linux without pairing the device over and over again<br />
<br />
* [http://ubuntuforums.org/showthread.php?p=9363229#post9363229 Dual booting with a Bluetooth keyboard]</div>Martiushttps://wiki.archlinux.org/index.php?title=Bluetooth_headset&diff=381267Bluetooth headset2015-07-07T20:47:39Z<p>Martius: /* Connecting works, but I cannot play sound */ added the case where gdm starts its own pulseaudio instance.</p>
<hr />
<div>[[Category:Sound]]<br />
[[Category:Bluetooth]]<br />
[[ja:Bluetooth ヘッドセット]]<br />
[[ru:Bluetooth headset]]<br />
{{Related articles start}}<br />
{{Related|Bluetooth}}<br />
{{Related|Bluez4}}<br />
{{Related articles end}}<br />
<br />
Currently, Arch Linux supports the A2DP profile (Audio Sink) for remote audio playback with the default installation. <br />
<br />
{{Tip|1=<br />
* The most recent version of [[Bluez]] does not support the Headset/Handsfree profiles (see [https://bugs.freedesktop.org/show_bug.cgi?id=73325 this bug report] for example). This means that microphone input will not work, and also no sound output on headsets that do not support the A2DP profile. For using a headset with the Headset/Handsfree profiles, you will need to jump down to the legacy methods which require using [[AUR]] to fetch alternative packages.<br />
* Bluez5 is only supported by [[PulseAudio]] and not by [[ALSA]]. If you do not want to use PulseAudio, you need to install an older Bluez version from the AUR.}}<br />
<br />
== Headset via Bluez5/PulseAudio ==<br />
<br />
PulseAudio 5.x supports A2DP per default.<br />
Make sure the following packages are [[install]]ed: {{Pkg|pulseaudio-alsa}}, {{Pkg|pulseaudio-bluetooth}}, {{Pkg|bluez}}, {{Pkg|bluez-libs}}, {{Pkg|bluez-utils}}, {{Pkg|bluez-firmware}}. Without {{Pkg|pulseaudio-bluetooth}} you won't be able to connect after the next pairing and you won't get any usable error messages.<br />
<br />
Start the Bluetooth system:<br />
<br />
# systemctl start bluetooth<br />
<br />
Now we can use the ''bluetoothctl'' command line utility to pair and connect. For troubleshooting and more detailed explanations of ''bluetoothctl'' see the [[Bluetooth]] article. Run<br />
<br />
# bluetoothctl<br />
<br />
to be greeted by its internal command prompt. Then enter:<br />
<br />
# power on<br />
# agent on<br />
# default-agent<br />
# scan on<br />
<br />
Now make sure that your headset is in pairing mode. It should be discovered shortly. For example,<br />
[NEW] Device 00:1D:43:6D:03:26 Lasmex LBT10<br />
shows a device that calls itself "Lasmex LBT10" and has MAC address ''00:1D:43:6D:03:26''. We will now use that MAC address to initiate the pairing:<br />
<br />
# pair 00:1D:43:6D:03:26<br />
<br />
After pairing, you also need to explicitly connect the device (every time?):<br />
<br />
# connect 00:1D:43:6D:03:26<br />
<br />
If everything works correctly, you now have a separate output device in [[PulseAudio]].<br />
{{Note|The device may be off by default. Select it's audio profile (''OFF'', A2DP, HFP) in the "Configuration" tab of {{Pkg|pavucontrol}}.}}<br />
You can now redirect any audio through that device using the "Playback" and "Recording" tabs of {{Pkg|pavucontrol}}.<br />
<br />
You can now disable scanning again and exit the program:<br />
# scan off<br />
# exit<br />
<br />
=== Troubleshooting ===<br />
<br />
Many users report frustration with getting A2DP/Bluetooth Headsets to work. <br />
<br />
==== Selected audio profile, but headset inactive and audio cannot be redirected ====<br />
<br />
Deceptively, this menu is available before the device has been connected; annoyingly it will have no effect. The menu seems to be created as soon as the receiver recognizes the device.<br />
<br />
Make sure to run bluetoothctl (with sudo/as root) and connect the device manually. There may be configuration options to remove the need to do this each time, but neither pairing nor trusting induce automatic connecting for me.<br />
<br />
==== Pairing fails with AuthenticationFailed ====<br />
<br />
If pairing fails, you can try [https://stackoverflow.com/questions/12888589/linux-command-line-howto-accept-pairing-for-bluetooth-device-without-pin disabling SSPMode] with:<br />
# hciconfig hci0 sspmode 0<br />
<br />
==== Pairing works, but connecting does not ====<br />
<br />
You might see the following error in ''bluetoothctl'':<br />
<br />
[bluetooth]# connect 00:1D:43:6D:03:26<br />
Attempting to connect to 00:1D:43:6D:03:26<br />
Failed to connect: org.bluez.Error.Failed<br />
<br />
To further investigate, have a look at the log via one of the following commands:<br />
<br />
# systemctl status bluetooth<br />
# journalctl -n 20<br />
<br />
You might see a message like this:<br />
<br />
bluetoothd[5556]: a2dp-sink profile connect failed for 00:1D:43:6D:03:26: Protocol not available<br />
<br />
The problem in this case is that PulseAudio is not catching up. A common solution to this problem is to restart PulseAudio. Note that it is perfectly fine to run ''bluetoothctl'' as root while PulseAudio runs as user. After restarting PulseAudio, retry to connect. It is not necessary to repeat the pairing.<br />
<br />
If restarting PulseAudio does not work, you need to load module-bluetooth-discover.<br />
<br />
# pactl load-module module-bluetooth-discover<br />
<br />
The same load-module command can be added to {{ic|/etc/pulse/default.pa}}.<br />
<br />
If that still does not work, or you are using PulseAudio's system-wide mode, also load the following PulseAudio modules (again these can be loaded via your default.pa or system.pa):<br />
<br />
module-bluetooth-policy<br />
module-bluez5-device<br />
module-bluez5-discover<br />
<br />
To have your headset auto connect you need to enable PulseAudio's switch-on-connect module. Add the following:<br />
{{hc|/etc/pulse/default.pa|<br />
# automatically switch to newly-connected devices<br />
load-module module-switch-on-connect<br />
}}<br />
<br />
You then need to tell ''bluetoothctl'' to trust your Bluetooth headset, or you will see errors like this:<br />
bluetoothd[487]: Authentication attempt without agent<br />
bluetoothd[487]: Access denied: org.bluez.Error.Rejected<br />
<br />
[bluetooth]# trust 00:1D:43:6D:03:26<br />
<br />
After a reboot, your Bluetooth adapter will not power on by default. You need to add a udev rule to power it on:<br />
{{hc|/etc/udev/rules.d/10-local.rules|2=<br />
# Set bluetooth power up<br />
ACTION=="add", SUBSYSTEM=="bluetooth", KERNEL=="hci[0-9]*", RUN+="/usr/bin/hciconfig %k up"<br />
}}<br />
<br />
==== Connecting works, but I cannot play sound ====<br />
<br />
Make sure that you see the following messages in your system log:<br />
<br />
bluetoothd[5556]: Endpoint registered: sender=:1.83 path=/MediaEndpoint/A2DPSource<br />
bluetoothd[5556]: Endpoint registered: sender=:1.83 path=/MediaEndpoint/A2DPSink<br />
<br />
If you see a message similar to this, you can go on and investigate your PulseAudio configuration. Otherwise, go back and ensure the connection is successful.<br />
<br />
If you use Gnome (or even only GDM), GDM starts its instance of pulseaudio which "captures" your bluetooth device connection. The following solution work<br />
<br />
$ ps aux | grep pulse<br />
gdm 1371 0.0 0.4 98180 4776 ? S<sl Jun13 0:00 /usr/bin/pulseaudio --start --log-target=syslog<br />
<br />
In this case, you can prevent gdm to start pulseaudio by creating or updating a configuration file:<br />
<br />
# touch /var/lib/gdm/.pulse/client.conf<br />
# echo 'autospawn = no' >> /var/lib/gdm/.pulse/client.conf<br />
# echo 'daemon-binary = /bin/true' >> /var/lib/gdm/.pulse/client.conf<br />
<br />
It will fix the problem at the next reboot, for the first time, you can kill gdm's pulseaudio instance manually.<br />
<br />
==== UUIDs has unsupported type ====<br />
<br />
During pairing you might see this output in ''bluetoothctl'':<br />
<br />
[CHG] Device 00:1D:43:6D:03:26 UUIDs has unsupported type<br />
<br />
This message is a very common one and can be ignored.<br />
<br />
== Legacy method: ALSA-BTSCO ==<br />
<br />
{{Out of date|Instructions rely on [[bluez4]].}}<br />
<br />
It is much easier to set up your bluetooth headset today, with bluez >= 3.16. You may want to try the out-of-box python script in [http://fosswire.com/2008/01/11/a2dp-stereo-linux/ this blog] (you need edit the script to work with gconftool-2). There is also a piece of equivalent bash script [http://lymanrb.blogspot.com/2008/05/linux.html here].<br />
<br />
You need your headset's bdaddr. It is of the form ''12:34:56:78:9A:BC''. Either find it in the documentation of your headset, on the headset itself or with the '''hcitool scan''' command.<br />
<br />
Install {{AUR|btsco}}.<br />
<br />
To load the kernel module, type:<br />
# modprobe snd-bt-sco<br />
There will now be an extra audio device. Use {{ic|alsamixer -cN}} (where N is most likely 1) to set the volume. You can access the device with any alsa-capable application by choosing the device ''BT headset'', or with any OSS application by using {{ic|/dev/dspN}} as the audio device.<br />
<br />
But to actually get any sound, you have to connect your headset to the computer first.<br />
<br />
=== Connecting the headset ===<br />
<br />
If you connect your headset for the first time, read the section about pairing first. To connect to your headset to the computer, use the command<br />
$ btsco -f <bdaddr><br />
for example<br />
$ btsco -f 12:34:56:78:9A:BC<br />
<br />
==== Pairing the headset with your computer ====<br />
<br />
The first time you connect the headset, you have to pair it with the computer. To do this, you need your headset's PIN. Depending on your headset you may have to reset the headset and repeat the pairing everytime you used the headset with another bluetooth device.<br />
<br />
There are two ways to pair your headset with the computer:<br />
<br />
===== Using ''bluez-gnome'' =====<br />
<br />
{{Out of date|Package does no longer exist in the repositories.}}<br />
<br />
Install the ''bluez-gnome'' package from the community repository. Then start the '''bt-applet''' program. Once you try to connect to the headset, a window will open and ask for the PIN.<br />
<br />
===== Using ''passkey-agent'' =====<br />
<br />
Before connecting to the headset, enter the command<br />
$ passkey-agent --default <pin><br />
where ''<pin>'' is your headset's PIN. Then try to connect to the headset.<br />
<br />
=== Headset and ALSA Devices ===<br />
<br />
1. First if you have not already, [[pacman|install]] {{Pkg|bluez}} from the [[official repositories]].<br />
<br />
2. Scan for your device<br />
$ hcitool (-i <optional hci#>***) scan<br />
<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 />
<br />
4. Make sure your {{ic|/etc/bluetooth/audio.conf}} allows A2DP Audio Sinks. Place this line just bellow the [General] heading:<br />
Enable=Source,Sink,Media,Socket<br />
<br />
5. Add this to your {{ic|/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 />
6. Check to see if it has been added to alsa devices<br />
$ aplay -L<br />
<br />
7. 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 />
{{Tip|To find hci# for a usb dongle, type in <br />
$ hcitool dev<br />
}}<br />
<br />
=== Headset's multimedia buttons ===<br />
<br />
In order to get your bluetooth headset's multimedia buttons (play, pause, next, previous) working you need to create {{ic|/etc/modules-load.d/uinput.conf}} containing {{ic|uinput}}.<br />
<br />
== Legacy method: PulseAudio ==<br />
<br />
{{Out of date|Instructions rely on [[bluez4]] (references to {{ic|/etc/bluetooth/audio.conf}} and ''bluez-simple-agent'').}}<br />
<br />
This one is much easier and more elegant. PulseAudio will seamlessly switch between output devices when the headset is turned on. If you have ALSA as the sound server, you need the following packages installed:<br />
{{Pkg|pulseaudio}} and {{Pkg|pulseaudio-alsa}}.<br />
<br />
Now, to configure the audio output to use bluetooth, just install {{Pkg|pavucontrol}} and run it to configure the audio output:<br />
$ pavucontrol<br />
Make sure to take a look at the [[PulseAudio]] wiki entry for setting up PulseAudio, especially if you are running KDE.<br />
<br />
=== Troubleshooting ===<br />
<br />
==== Audio sink fails ====<br />
<br />
Bluetooth headset is connected, but ALSA/PulseAudio fails to pick up the connected device. You will get "Audio sink fails".<br />
According to [http://wiki.gentoo.org/wiki/Bluetooth_Headset gentoo wiki], you have to verify than in {{ic|/etc/bluetooth/audio.conf}} there is {{ic|<nowiki>Enable=Socket</nowiki>}} under the {{ic|[General]}} section heading.<br />
<br />
Just do a {{ic|# systemctl restart bluetooth}} to apply it.<br />
<br />
==== Page timeout issue ====<br />
<br />
If you receive this error whilst trying to pair your headset with your system using bluez-simple-agent, then you can try to restart your system and use the graphical bluez applet of your desktop environment.<br />
<br />
== Legacy documentation: ALSA, bluez5 and PulseAudio method ==<br />
<br />
{{Accuracy|Describes two different methods, see the [[Talk:Bluetooth_Headset#bluez5_method:_overcomplicated_instructions|talk page]] for details.|Talk:Bluetooth_Headset#bluez5_method:_overcomplicated_instructions}}<br />
<br />
[[ALSA]], [[bluez|bluez5]], and [[PulseAudio]] work together to allow a wireless [[Bluetooth]] headset to play audio. The following method works with a Lenovo T61p laptop and SoundBot SB220 wireless bluetooth headset. The required software stack is extensive and failure to include all components can produce errors which are difficult to understand. The following list of software packages might not be the minimum required set and needs to be examined more closely.<br />
<br />
Bluez5 has a regression causing HSP/HFP Telephone profile to not be available. This regression is documented in the [http://www.freedesktop.org/wiki/Software/PulseAudio/Notes/5.0/ draft release notes for Pulseaudio 5.0] which say (in "Notes for packagers"): "PulseAudio now supports BlueZ 5, but only the A2DP profile. BlueZ 4 is still the only way to make HSP/HFP work." ([https://fedoraproject.org/wiki/Common_F20_bugs#bluez5-profile from here])<br />
<br />
=== Install Software Packages ===<br />
<br />
The core software components are [[ALSA]], Bluez5, [[PulseAudio]]. However there are additional libraries which are required. As well as a player which can play audio files. The following section lists the software packages installed in order to connect the headset and play audio over the headset.<br />
<br />
==== Install ALSA and associated libraries ====<br />
<br />
[[ALSA]] works with the linux kernel to provide audio services to user mode software. The following packages are used with the [[Bluetooth]] headset: {{Pkg|alsa-utils}}, {{Pkg|alsa-plugins}}, {{Pkg|alsa-tools}}.<br />
<br />
==== Install Bluez5 ====<br />
<br />
Bluez5 is the latest [[Bluetooth]] stack. It is required for [[PulseAudio]] to interface with wireless headsets. Required packages: {{Pkg|bluez}}, {{Pkg|bluez-utils}}, {{Pkg|bluez-libs}}.<br />
<br />
==== Install Audacious ====<br />
<br />
[[Audacious]] is a program which plays audio files. It can work directly with [[ALSA]] or with [[PulseAudio]]. Required packages: {{Pkg|audacious}}, {{Pkg|audacious-plugins}}.<br />
<br />
=== Procedure ===<br />
<br />
Once the required packages are installed, use this procedure to play audio with a bluetooth headset. The high level overview of the procedure is to pair the headset, connect the headset, configure the player and pulse audio controller and then play audio.<br />
<br />
Start the bluetooth service as root:<br />
# systemctl start bluetooth<br />
<br />
Verify Bluetooth is started<br />
# systemctl status bluetooth<br />
bluetooth.service - Bluetooth service<br />
Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; disabled)<br />
Active: active (running) since Sat 2013-12-07 12:31:14 PST; 12s ago<br />
Docs: man:bluetoothd(8)<br />
Main PID: 3136 (bluetoothd)<br />
Status: "Running"<br />
CGroup: /system.slice/bluetooth.service<br />
└─3136 /usr/lib/bluetooth/bluetoothd<br />
<br />
Dec 07 12:31:14 t61p systemd[1]: Starting Bluetooth service...<br />
Dec 07 12:31:14 t61p bluetoothd[3136]: Bluetooth daemon 5.11<br />
Dec 07 12:31:14 t61p systemd[1]: Started Bluetooth service.<br />
Dec 07 12:31:14 t61p bluetoothd[3136]: Starting SDP server<br />
Dec 07 12:31:14 t61p bluetoothd[3136]: Bluetooth management interface 1.3 i...ed<br />
Hint: Some lines were ellipsized, use -l to show in full.<br />
<br />
Start the PulseAudio daemon. This must be done after X windows is started and as a normal user.<br />
$ pulseaudio -D<br />
<br />
Verify the PulseAudio daemon is running.<br />
$ pulseaudio --check -v<br />
I: [pulseaudio] main.c: Daemon running as PID 3186<br />
<br />
Start up bluetoothctl as root and pair and connect your headset. As a regular user, bluetoothctl will pair but not connect. Perhaps this is related to the config file (shown below) which is setup for what appears to be the root user.<br />
Note: the procedure shown below is for an initial pair and connect of the headphone. If the headset is already paired, then the procedure below can be shortened to: power on, agent on, default-agent, connect <mac address>. The mac address can be seen from the devices command output.<br />
<br />
$ bluetoothctl <br />
[NEW] Controller 00:1E:4C:F4:98:5B t61p-0 [default]<br />
[NEW] Device 00:1A:7D:12:36:B9 SoundBot SB220<br />
[bluetooth]# show<br />
Controller 00:1E:4C:F4:98:5B<br />
Name: t61p<br />
Alias: t61p-0<br />
Class: 0x000000<br />
Powered: no<br />
Discoverable: no<br />
Pairable: yes<br />
UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)<br />
UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)<br />
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)<br />
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)<br />
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)<br />
UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb)<br />
UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)<br />
Modalias: usb:v1D6Bp0246d050B<br />
Discovering: no<br />
[bluetooth]# power on<br />
[CHG] Controller 00:1E:4C:F4:98:5B Class: 0x0c010c<br />
Changing power on succeeded<br />
[CHG] Controller 00:1E:4C:F4:98:5B Powered: yes<br />
[bluetooth]# agent on<br />
Agent registered<br />
[bluetooth]# default-agent<br />
Default agent request successful<br />
<br />
<power on your headset in pairing mode. Eventually you will see what appears to be a mac address.><br />
[bluetooth]# scan on<br />
Discovery started<br />
[CHG] Controller 00:1E:4C:F4:98:5B Discovering: yes<br />
[CHG] Device 00:1A:7D:12:36:B9 RSSI: -61<br />
[bluetooth]# pair 00:1A:7D:12:36:B9<br />
Attempting to pair with 00:1A:7D:12:36:B9<br />
[CHG] Device 00:1A:7D:12:36:B9 Connected: yes<br />
[CHG] Device 00:1A:7D:12:36:B9 UUIDs has unsupported type<br />
[CHG] Device 00:1A:7D:12:36:B9 Paired: yes<br />
Pairing successful<br />
[bluetooth]# connect 00:1A:7D:12:36:B9<br />
[CHG] Device 00:1A:7D:12:36:B9 Connected: yes<br />
Connection successful<br />
[bluetooth]# info 00:1A:7D:12:36:B9<br />
Device 00:1A:7D:12:36:B9<br />
Name: SoundBot SB220<br />
Alias: SoundBot SB220<br />
Class: 0x240404<br />
Icon: audio-card<br />
Paired: yes<br />
Trusted: no<br />
Blocked: no<br />
Connected: yes<br />
LegacyPairing: yes<br />
UUID: Headset (00001108-0000-1000-8000-00805f9b34fb)<br />
UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)<br />
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)<br />
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)<br />
UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb)<br />
<br />
Start up alsamixer, for simplicity un-mute all your outputs. Oddly enough some can be muted though. The ones I had muted during playback were:<br />
* Headphones<br />
* SPIDF<br />
<br />
Start up audacious. Use the menu to select PulseAudio as your output. Somewhere I read that bluez5 requires pulseaudio-git and this jives with my experience.<br />
<br />
Start up pavucontrol in a terminal. In the Outputs tab select the bluetooth headset.<br />
<br />
[http://netskink.blogspot.com/2013/12/pulseaudio-pavucontrol-and-audacious.html screenshot of application settings]<br />
<br />
==== Miscellaneous configuration files ====<br />
<br />
For reference, these settings were also done.<br />
<br />
===== ALSA /etc/asound.conf =====<br />
<br />
The settings shown at the top of this page was used, but the additional modification for Intel laptop sound cards.<br />
<br />
{{bc|<nowiki><br />
pcm.btheadset {<br />
type plug<br />
slave {<br />
pcm {<br />
type bluetooth<br />
device 00:1A:7D:12:36:B9<br />
profile "auto"<br />
}<br />
}<br />
hint {<br />
show on<br />
description "BT Headset"<br />
}<br />
}<br />
ctl.btheadset {<br />
type bluetooth<br />
}<br />
options snd-hda-intel model=laptop<br />
</nowiki>}}<br />
<br />
===== /etc/dbus-1/system.d/bluetooth.conf =====<br />
<br />
The settings here seem to be enabled for root only. See the policy user="root" section. However, if a regular user is specified here, the system fails to start. Someone with more knowledge could explain why.<br />
<br />
{{hc|/etc/dbus-1/system.d/bluetooth.conf|<nowiki><br />
<!-- This configuration file specifies the required security policies for Bluetooth core daemon to work. --><br />
<br />
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"<br />
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"><br />
<busconfig><br />
<br />
<!-- ../system.conf have denied everything, so we just punch some holes --><br />
<br />
<policy user="root"><br />
<allow own="org.bluez"/><br />
<allow send_destination="org.bluez"/><br />
<allow send_interface="org.bluez.Agent1"/><br />
<allow send_interface="org.bluez.MediaEndpoint1"/><br />
<allow send_interface="org.bluez.MediaPlayer1"/><br />
<allow send_interface="org.bluez.ThermometerWatcher1"/><br />
<allow send_interface="org.bluez.AlertAgent1"/><br />
<allow send_interface="org.bluez.Profile1"/><br />
<allow send_interface="org.bluez.HeartRateWatcher1"/><br />
<allow send_interface="org.bluez.CyclingSpeedWatcher1"/><br />
</policy><br />
<br />
<policy at_console="true"><br />
<allow send_destination="org.bluez"/><br />
</policy><br />
<br />
<!-- allow users of lp group (printing subsystem) to communicate with bluetoothd --><br />
<policy group="lp"><br />
<allow send_destination="org.bluez"/><br />
</policy><br />
<br />
<policy context="default"><br />
<deny send_destination="org.bluez"/><br />
</policy><br />
<br />
</busconfig><br />
</nowiki>}}<br />
<br />
===== Tested applications =====<br />
<br />
As noted above this will work easily with audacious. YouTube videos with Chromium and Flash Player will work on some videos. If the video has ads it will not work, but if the video does not have ads it will work. Just make sure that after audacious is working with Bluetooth headset, start Chromium, and navigate to YouTube. Find a video without leading ads, and it should play the audio. If the settings icon has the a menu with two drop-down combo boxes for Speed and Quality it will play.<br />
<br />
== Switch between HSV and A2DP setting ==<br />
<br />
This can easily be achieved by the following command where 2 needs to be changed with the correct device number.<br />
<br />
pacmd set-card-profile 2 a2dp_sink<br />
<br />
=== A2DP not working with PulseAudio ===<br />
<br />
If PulseAudio fails when changing the profile to A2DP with bluez 4.1+ and PulseAudio 3.0+, you can try disabling the Socket interface from {{ic|/etc/bluetooth/audio.conf}} by removing the line {{ic|1=Enable=Socket}} and adding line {{ic|1=Disable=Socket}}.<br />
<br />
== Tested headsets ==<br />
<br />
{| class="wikitable"<br />
! Model<br />
! Version<br />
! Comments<br />
! Compatible<br />
|-<br />
| '''Philips SHB9150'''<br />
| bluez5, pulseaudio 5<br />
| Pause and resume does not work. With at least mpv and Banshee hitting the pause button stops audio output but does not pause the player.<br />
| {{R|Limited}}<br />
|-<br />
| '''Philips SHB9100'''<br />
| <br />
| Pause and resume is flaky. See [https://bbs.archlinux.org/viewtopic.php?pid=1315428#p1315428] for the underlying issue and a temporary solution to improve audio quality.<br />
| {{R|Limited}}<br />
|-<br />
| '''Philips SHB7000'''<br />
| <br />
| Pause and resume is flaky.<br />
| {{R|Limited}}<br />
|-<br />
| '''Philips SHB5500BK/00'''<br />
| bluez 5.28, PulseAudio 6.0<br />
| Pause and resume is not working.<br />
| {{R|Limited}}<br />
|-<br />
| '''Parrot Zik'''<br />
| <br />
| Firmware 1.04. The microphone is detected, but does not work. Sometimes it lags (but does not stutter); usually this is not noticeable unless playing games, in which case you may switch to a wired connection.<br />
| {{R|Limited}}<br />
|-<br />
| '''Sony DR-BT50'''<br />
| bluez{4,5}<br />
| Works for a2dp, see [http://vlsd.blogspot.com/2013/11/bluetooth-headphones-and-arch-linux.html]). Adapter: D-Link DBT-120 USB dongle.<br />
| {{Yes}}<br />
|-<br />
| '''Sony SBH50'''<br />
| bluez5<br />
| Works for a2dp, Adapter: Broadcom Bluetooth 2.1 Device (Vendor=0a5c ProdID=219b Rev=03.43). Requires the {{ic|btusb}} [[modprobe|module]].<br />
| {{Yes}}<br />
|-<br />
| '''Sony MDR-XB950BT'''<br />
| pulseaudio<br />
| Tested a2dp. Adapter: Grand-X BT40G. Doesn't auto-connect, need to connect manually. Other functionality works fine.<br />
| {{R|Limited}}<br />
|-<br />
| '''Sony MUC-M1BT1'''<br />
| bluez5, {{AUR|pulseaudio-git}}<br />
| Both A2DP & HSP/HFP work fine.<br />
| {{Yes}}<br />
|-<br />
| '''SoundBot SB220'''<br />
| bluez5, {{AUR|pulseaudio-git}}<br />
| <br />
| {{Yes}}<br />
|-<br />
| '''Auna Air 300'''<br />
| bluez5, pulseaudio-git<br />
| For some reason, a few restarts were required, and eventually it just started working.<br />
| {{R|Limited}}<br />
|-<br />
| '''Sennheiser MM 400-X'''<br />
| bluez5, pulseaudio 4.0-6<br />
| <br />
| {{Yes}}<br />
|-<br />
| '''Sennheiser MM 550-X Travel'''<br />
| bluez 5.27-1, pulseaudio 5.0-1<br />
| Next/Previous buttons work out-of-the-box, Play/Pause does not<br />
| {{Yes}}<br />
|-<br />
| '''Audionic BlueBeats (B-777)'''<br />
| bluez5, pulseaudio 4.0-6<br />
| <br />
| {{Yes}}<br />
|-<br />
| '''Logitech Wireless Headset'''<br />
| bluez 5.14, pulseaudio-git<br />
| part number PN 981-000381, advertised for use with iPad<br />
| {{Yes}}<br />
|-<br />
| '''HMDX Jam Classic Bluetooth'''<br />
| bluez, pulseaudio-git<br />
| <br />
| {{Yes}}<br />
|-<br />
| '''PT-810'''<br />
| bluez 5.14, pulseaudio-git<br />
| Generic USB-Powered Bluetooth Audio Receiver with 3.5mm headset jack and a2dp profile. Widely available as "USB Bluetooth Receiver." IDs as PT-810.<br />
| {{Yes}}<br />
|-<br />
| '''Philips SHB4000WT'''<br />
| bluez5<br />
| A2DP works, HDP distorted.<br />
| {{Yes}}<br />
|-<br />
| '''Philips AEA2000/12'''<br />
| bluez5<br />
| <br />
| {{Yes}}<br />
|-<br />
| '''Nokia BH-104'''<br />
| bluez4<br />
| <br />
| {{Yes}}<br />
|-<br />
| '''Creative AirwaveHD'''<br />
| bluez 5.23<br />
| Bluetooth adapter Atheros Communications usb: 0cf3:0036<br />
| {{Yes}}<br />
|-<br />
| '''Creative HITZ WP380'''<br />
| bluez 5.27, pulseaudio 5.0-1<br />
| A2DP Profile only. Buttons work (Play, Pause, Prev, Next). Volume buttons are hardware-only. Auto-connect works but you should include the bluetooth module in "pulseaudio" to switch to it automatically. Clear HD Music Audio (This device support APTx codec but it isn't supported in linux yet). You may have some latency problems which needs pulseaudio restart.<br />
| {{Yes}}<br />
|-<br />
| '''deleyCON Bluetooth Headset'''<br />
| bluez 5.23<br />
| Adapter: CSL - USB nano Bluetooth-Adapter V4.0. Tested a2dp profile. Untested microphone. Does not auto-connect (even when paired and trusted), must connect manually. Play/pause button mutes/unmutes the headphones, not the playback. Playback fwd/bwd buttons do not work (nothing visible with ''xev'').<br />
| {{R|Limited}}<br />
|-<br />
| '''UE BOOM'''<br />
| bluez 5.27, pulseaudio-git 5.99<br />
| Update to latest UE BOOM fw 1.3.58. Sound latency in video solved by configuring pavucontrol. Works with UE BOOM x2.<br />
| {{Yes}}<br />
|-<br />
| '''LG HBS-730'''<br />
| bluez 5.30, pulseaudio 6.0<br />
| Works out of box with A2DP profile.<br />
| {{Yes}}<br />
|-<br />
| '''Beats Studio Wireless'''<br />
| bluez 5.28, pulseaudio 6.0<br />
| Works out of box. Not tested multimedia buttons.<br />
| {{Yes}}<br />
|-<br />
| '''AKG Y45BT'''<br />
| bluez 5.30, pulseaudio 6.0<br />
| Pause and resume does not work. Needs {{ic|1=Enable=Socket}} in {{ic|/etc/bluetooth/audio.conf}} and {{ic|load-module module-bluetooth-discover}} in {{ic|/etc/pulse/default.pa}}.<br />
| {{Yes}}<br />
|-<br />
| '''Bluedio Turbine'''<br />
| bluez5, pulseaudio 6.0<br />
| HSP/HFP work fine, A2DP not tested<br />
| {{Yes}}<br />
|-<br />
| '''Sony SBH20'''<br />
| bluez 5.30, pulseaudio 6.0<br />
| Works out of box with A2DP profile.<br />
| {{Yes}}<br />
|-<br />
| '''Nokia BH-111'''<br />
| bluez 5.30, pulseaudio 6.0<br />
| Works with both HSP/HFP and A2DP. Buttons work in certain apps.<br />
| {{Yes}}<br />
|-<br />
| '''Sony MDR-ZX330BT'''<br />
| bluez 5.31, pulseaudio 6.0<br />
| Works out of box (HSP/HFP and A2DP). Buttons work in certain apps.<br />
| {{Yes}}<br />
|}<br />
<br />
== See also ==<br />
<br />
<br />
Using the same device on Windows and Linux without pairing the device over and over again<br />
<br />
* [http://ubuntuforums.org/showthread.php?p=9363229#post9363229 Dual booting with a Bluetooth keyboard]</div>Martiushttps://wiki.archlinux.org/index.php?title=Autofs&diff=303474Autofs2014-03-07T11:48:48Z<p>Martius: /* NFS network mounts */ a simple clarification on how NFS shares discovery works</p>
<hr />
<div>[[Category:File systems]]<br />
[[es:Autofs]]<br />
[[it:Autofs]]<br />
[[ru:Autofs]]<br />
[[uk:Autofs]]<br />
[[zh-CN:Autofs]]<br />
This document outlines the procedure needed to set up AutoFS, a package that provides support for automounting removable media or network shares when they are inserted or accessed.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] the {{Pkg|autofs}} package from the [[official repositories]].<br />
<br />
{{Note|You no longer need to load {{ic|autofs4}} module.}}<br />
<br />
== Configuration ==<br />
<br />
AutoFS uses template files for configuration which are located in {{ic|/etc/autofs}} The main template is called {{ic|auto.master}}, which can point to one or more other templates for specific media types.<br />
<br />
* Open the file {{ic|/etc/autofs/auto.master}} with your favorite editor, you will see something similar to this:<br />
<br />
{{hc|/etc/autofs/auto.master|2=<br />
#/media /etc/autofs/auto.media<br />
<br />
}}<br />
<br />
The first value on each line determines the base directory under which all the media in a template are mounted, the second value is which template to use. The default base path is {{ic|/media}}, but you can change this to any other location you prefer. For instance:<br />
<br />
{{hc|/etc/autofs/auto.master|2=<br />
/media/misc /etc/autofs/auto.misc --timeout=5<br />
/media/net /etc/autofs/auto.net --timeout=60<br />
<br />
}}<br />
{{Note|Make sure there is an empty line on the end of template files (press {{ic|ENTER}} after last word). If there is no correct EOF (end of file) line, the AutoFS daemon won't properly load.}}<br />
<br />
The optional parameter {{ic|timeout}} sets the amount of seconds after which to unmount directories.<br />
<br />
The base directory will be created if it does not exist on your system. The base directory will be mounted on to load the dynamically loaded media, which means any content in the base directory will not be accessible while autofs is on. This procedure is however non-destructive, so if you accidentally automount into a live directory you can just change the location in {{ic|auto.master}} and restart AutoFS to regain the original contents.<br />
<br />
If you still want to automount to a target non-empty directory and want to have the original files available even after the dynamically loaded directories are mounted, you can use autofs to mount them to another directory (e.g. /var/autofs/net) and create soft links.<br />
<br />
# ln -s /var/autofs/net/share_name /media/share_name<br />
<br />
Alternatively, you can have autofs mount your media to a specific folder, rather than inside a common folder.<br />
<br />
{{hc|/etc/autofs/auto.master|2=<br />
/- /etc/autofs/auto.template<br />
}}<br />
{{hc|/etc/autofs/auto.template|2=<br />
/path/to/folder -options :/device/path<br />
/home/user/usbstick -fstype=auto,async,nodev,nosuid,umask=000 :/dev/sdb1<br />
}}<br />
{{Note|This can cause problems with resources getting locked if the connection to the share is lost. When trying to access the folder, programs will get locked into waiting for a response, and either the connection has to be restored or the process has to be forcibly killed before unmounting is possible. To mitigate this, only use if you will always be connected to the share, and don't use your home folder or other commonly used folders lest your file browser reads ahead into the disconnected folder}}<br />
<br />
* Open the file {{ic|/etc/nsswitch.conf}} and add an entry for automount:<br />
automount: files<br />
<br />
* When you are done configuring your templates (see below), launch the AutoFS daemon as root:<br />
# systemctl start autofs<br />
<br />
To start the daemon on boot:<br />
# systemctl enable autofs<br />
<br />
Devices are now automatically mounted when they are accessed, they will remain mounted as long as you access them.<br />
<br />
=== Removable media ===<br />
<br />
* Open {{ic|/etc/autofs/auto.misc}} to add, remove or edit miscellaneous devices. For instance:<br />
<br />
{{hc|/etc/autofs/auto.misc|<nowiki><br />
#kernel -ro ftp.kernel.org:/pub/linux<br />
#boot -fstype=ext2 :/dev/hda1<br />
usbstick -fstype=auto,async,nodev,nosuid,umask=000 :/dev/sdb1<br />
cdrom -fstype=iso9660,ro :/dev/cdrom<br />
#floppy -fstype=auto :/dev/fd0<br />
</nowiki>}}<br />
<br />
If you have a CD/DVD combo-drive you can change the {{ic|cdrom}} line with {{ic|-fstype<nowiki>=</nowiki>auto}} to have the media type autodetected.<br />
<br />
=== NFS network mounts ===<br />
<br />
AutoFS provides a new way of automatically discovering and mounting [[NFS]]-shares on remote servers (the AutoFS network template in {{ic|/etc/autofs/auto.net}} has been removed in autofs5). To enable automagic discovery and mounting of network shares from all accessible servers without any further configuration, you'll need to add the following to the {{ic|/etc/autofs/auto.master}} file:<br />
<br />
/net -hosts --timeout=60<br />
<br />
'''Each host name needs to be resolveable, e.g. the name an IP address in {{ic|/etc/hosts}} or via [[Wikipedia:Domain_Name_System|DNS]] and please make sure you have at least {{Pkg|nfs-common}} installed and working. You also have to enable RPC (systemctl start|enable rpcbind) to browse shared Folders.'''<br />
<br />
For instance, if you have a remote server ''fileserver'' (the name of the directory is the hostname of the server) with an NFS share named ''/home/share'', you can just access the share by typing:<br />
<br />
# cd /net/fileserver/home/share<br />
<br />
{{Note|Please note that ''ghosting'', i.e. automatically creating directory placeholders before mounting shares is enabled by default, although AutoFS installation notes claim to remove that option from {{ic|/etc/conf.d/autofs}} in order to start the AutoFS daemon.}}<br />
<br />
The {{ic|-hosts}} option uses a similar mechanism as the {{ic|showmount}} command to detect remote shares. You can see the exported shares by typing:<br />
<br />
# showmount <servername> -e <br />
<br />
Replacing ''<servername>'' with the name of your own server.<br />
<br />
=== Samba ===<br />
<br />
The Arch package does not provide any [[Samba]] or CIFS templates/scripts (23.07.2009), but the following should work for single shares:<br />
<br />
add the following to {{ic|/etc/autofs/auto.master}}<br />
/media/[my_server] /etc/autofs/auto.[my_server]<br />
and then create a file {{ic|/etc/autofs/auto.[my_server]}}<br />
[any_name] -fstype=cifs,[other_options] ://[remote_server]/[remote_share_name]<br />
<br />
You can specify a user name and password to use with the share in the other_options section<br />
[any_name] -fstype=cifs,username=[username],password=[password],[other_options] ://[remote_server]/[remote_share_name]<br />
<br />
{{Note|Escape &#36;, and other characters, with a backslash when neccessary.}}<br />
<br />
=== FTP and SSH (with FUSE) ===<br />
<br />
Remote FTP and [[SSH]] servers can be accessed seamlessly with AutoFS using [[Wikipedia:Filesystem in Userspace|FUSE]], a virtual file system layer. <br />
<br />
==== Remote FTP ====<br />
<br />
First, install the {{Pkg|curlftpfs}} package.<br />
Load the '''fuse''' module:<br />
<br />
# modprobe fuse<br />
<br />
Create a {{ic|/etc/modules-load.d/fuse.conf}} file containg {{ic|fuse}} to load it on each system boot.<br />
<br />
Next, add a new entry for FTP servers in {{ic|/etc/autofs/auto.master}}:<br />
<br />
/media/ftp /etc/autofs/auto.ftp --timeout=60<br />
<br />
Create the file {{ic|/etc/autofs/auto.ftp}} and add a server using the {{ic|ftp://myuser:mypassword@host:port/path}} format:<br />
<br />
servername -fstype=curl,rw,allow_other,nodev,nonempty,noatime :ftp\://myuser\:mypassword\@remoteserver<br />
<br />
{{Note| Your passwords are plainly visible for anyone that can run {{ic|df}} (only for mounted servers) or view the file {{ic|/etc/autofs/auto.ftp}}.}}<br />
If you want slightly more security you can create the file {{ic|~root/.netrc}} and add the passwords there. <br />
Passwords are still plain text, but you can have mode 600, and {{ic|df}} command will not show them (mounted or not).<br />
This method is also less sensitive to special characters (that else must be escaped) in the passwords. The format is:<br />
<br />
machine remoteserver <br />
login myuser<br />
password mypassword<br />
<br />
The line in {{ic|/etc/autofs/auto.ftp}} looks like this without user and password:<br />
<br />
servername -fstype=curl,allow_other :ftp\://remoteserver<br />
<br />
Create the file {{ic|/sbin/mount.curl}} with this code:<br />
<br />
{{hc|/sbin/mount.curl|<nowiki><br />
#! /bin/sh<br />
curlftpfs $1 $2 -o $5,disable_eprt<br />
</nowiki>}}<br />
<br />
Create the file {{ic|/sbin/umount.curl}} with this code:<br />
<br />
{{hc|/sbin/umount.curl|<nowiki><br />
#! /bin/sh<br />
fusermount -u $1<br />
</nowiki>}}<br />
<br />
Set the permissions for both files:<br />
<br />
# chmod 755 /sbin/mount.curl<br />
# chmod 755 /sbin/umount.curl<br />
<br />
After a restart your new FTP server should be accessible through {{ic|/media/ftp/servername}}.<br />
<br />
==== Remote SSH ====<br />
<br />
These are basic instructions to access a remote filesystem over [[SSH]] with AutoFS. <br />
<br />
{{Note|The example below does not use an ssh-passphrase to simplify the installation procedure, please note that this may be a security risk in case your local system gets compromised.}}<br />
<br />
Install the {{Pkg|sshfs}} package.<br />
<br />
Load the {{ic|fuse}} module:<br />
<br />
# modprobe fuse<br />
<br />
Create a {{ic|/etc/modules-load.d/fuse.conf}} file containg {{ic|fuse}} to load it on each system boot if you have not one yet.<br />
<br />
Install {{Pkg|openssh}}.<br />
<br />
Generate an [[Using SSH Keys|SSH keypair]]:<br />
# ssh-keygen -t dsa<br />
<br />
When the generator ask for a passphrase, just press {{ic|ENTER}}. Using SSH keys without a passphrase is less secure, yet running AutoFS together with passphrases poses some additional difficulties which are not (yet) covered in this article. <br />
<br />
Next, copy the public key to the remote SSH server:<br />
# ssh-copy-id -i /home/username/.ssh/id_dsa.pub username@remotehost<br />
<br />
See that you can login to the remote server without entering a password:<br />
# ssh -i /home/username/.ssh/id_dsa username@remotehost<br />
<br />
{{Note|The above command is needed to add the remote server to the root's list of {{ic|known_hosts}}. Alternatively, hosts can be added to {{ic|/etc/ssh/ssh_known_hosts}}.}}<br />
<br />
Create a new entry for SSH servers in {{ic|/etc/autofs/auto.master}}:<br />
/media/ssh /etc/autofs/auto.ssh --timeout=60<br />
<br />
Create the file {{ic|/etc/autofs/auto.ssh}} and add an SSH server:<br />
{{hc|/etc/autofs/auto.ssh|2=<br />
servername -fstype=fuse,rw,allow_other,IdentityFile=/home/username/.ssh/id_dsa :sshfs\#username@host\:/<br />
}}<br />
<br />
After a restart your SSH server should be accessible through {{ic|/media/ssh/servername}}.<br />
<br />
== MTP ==<br />
<br />
Media Transfer Protocol ([[MTP]]) is used in some Android devices.<br />
<br />
Install the {{Pkg|mtpfs}} package.<br />
<br />
Create a new entry for MTP Device in {{ic|/etc/autofs/auto.misc}}:<br />
android -fstype=fuse,allow_other,umask=000 :mtpfs<br />
<br />
== Troubleshooting and tweaks ==<br />
<br />
This section contains a few solutions for common issues with AutoFS.<br />
<br />
=== Using NIS ===<br />
<br />
Version 5.0.5 of AutoFS has more advanced support for [[NIS]]. To use AutoFS together with NIS, add {{ic|yp:}} in front of the template names in {{ic|/etc/autofs/auto.master}}:<br />
<br />
/home yp:auto_home --timeout=60 <br />
/sbtn yp:auto_sbtn --timeout=60<br />
+auto.master<br />
<br />
On earlier versions of NIS (before 5.0.4), you should add {{ic|nis}} to {{ic|/etc/nsswitch.conf}}:<br />
automount: files nis<br />
<br />
=== Optional parameters ===<br />
<br />
You can set parameters like {{ic|timeout}} systemwide for all AutoFS media in {{ic|/etc/conf.d/autofs}}:<br />
<br />
* Open the {{ic|/etc/conf.d/autofs}} file and edit the {{ic|daemonoptions}} line:<br />
daemonoptions='--timeout=5'<br />
<br />
* To enable logging (default is no logging at all), add {{ic|--verbose}} to the {{ic|daemonoptions}} line in {{ic|/etc/conf.d/autofs}} e.g.:<br />
daemonoptions='--verbose --timeout=5'<br />
<br />
After restarting the {{ic|autofs}} daemon, verbose output is visible in {{ic|/var/log/daemon.log}}.<br />
<br />
=== Identify multiple devices ===<br />
<br />
If you use multiple USB drives/sticks and want to easily tell them apart, you can use AutoFS to set up the mount points and [[Udev]] to create distinct names for your USB drives. See [[udev#Setting static device names]] for instructions on setting up Udev rules.<br />
<br />
=== AutoFS permissions ===<br />
<br />
If AutoFS isn't working for you, make sure that the permissions of the templates files are correct, otherwise AutoFS will not start. This may happen if you backed up your configuration files in a manner which did not preserve file modes. Here are what the modes should be on the configuration files:<br />
<br />
*0644 - /etc/autofs/auto.master<br />
*0644 - /etc/autofs/auto.media<br />
*0644 - /etc/autofs/auto.misc<br />
*0644 - /etc/conf.d/autofs<br />
<br />
In general, scripts (like previous {{ic|auto.net}}) should have executable ({{ic|chown a+x filename}}) bits set and lists of mounts shouldn't.<br />
<br />
If you are getting errors in {{ic|/var/log/daemon.log}} similar to this, you have a permissions problem:<br />
<br />
May 7 19:44:16 peterix automount[15218]: lookup(program): lookup for petr failed<br />
May 7 19:44:16 peterix automount[15218]: failed to mount /media/cifs/petr<br />
<br />
=== fusermount problems ===<br />
With certain versions of util-linux, you may not be able to unmount a fuse file system drive mounted by autofs, even if you use the "user=" option. See the discussion here:<br />
http://fuse.996288.n3.nabble.com/Cannot-umount-as-non-root-user-anymore-tp689p697.html<br />
<br />
== Alternatives to AutoFS ==<br />
<br />
* [[Systemd]] can automount filesystems upon demand; see [[Systemd#Automount|here]] for the description and the article on [[Sshfs#On_demand|sshfs]] for an example.<br />
* [[Thunar#Thunar_Volume_Manager|Thunar Volume Manager]] is an automount system for users of the [[Thunar]] file manager.<br />
* Pcmanfm-fuse is a lightweight file manager with built-in support for accessing remote shares: https://aur.archlinux.org/packages.php?ID=22992<br />
* [[udiskie]] is a minimalistic automatic disk mounting service using udisks<br />
<br />
== See also ==<br />
<br />
* AutoFS configuration cookbook: http://www.autofs.org/<br />
* An Ubuntu-based walk though of AutoFS with some useful info: http://blogging.dragon.org.uk/index.php/howtos/howto-setup-and-configure-autofs<br />
* FTP and SFTP usage with AutoFS is based on this Gentoo Wiki article: http://en.gentoo-wiki.com/wiki/Mounting_SFTP_and_FTP_shares<br />
* More information on SSH can be found on the [[SSH]] and [[Using_SSH_Keys|Using SSH Keys]] pages of this wiki.</div>Martiushttps://wiki.archlinux.org/index.php?title=Pacman/Package_signing&diff=180073Pacman/Package signing2012-01-24T17:41:18Z<p>Martius: /* Master keys */ Keys in the script are revoked.</p>
<hr />
<div>[[Category:Pacman development (English)]]<br />
{{i18n|Pacman-key}}<br />
[[fr:pacman-key]]<br />
<br />
pacman-key is a new tool available with pacman 4. It allows the user to manage pacman's list of trusted keys in the new package signing implementation. For some background on this issue, see these blog entries [http://allanmcrae.com/2011/08/pacman-package-signing-1-makepkg-and-repo-add/][http://allanmcrae.com/2011/08/pacman-package-signing-2-pacman-key/][http://allanmcrae.com/2011/08/pacman-package-signing-3-pacman/][http://allanmcrae.com/2011/12/pacman-package-signing-4-arch-linux/] and the [https://wiki.archlinux.org/index.php/Package_Signing_Proposal_for_Pacman package signing proposal] wiki page.<br />
<br />
==How it works==<br />
Package signing in pacman uses the "web of trust" model to ensure that packages come from the developers and not from someone impersonating them. Package developers and TUs have individual PGP keys which they use to sign their packages. This signature means they vouch for the contents of the package. You also have a unique PGP key which is generated when you set up pacman-key.<br />
<br />
Keys can also be used to sign ''other'' keys, which means the owner of the signing key vouches for the authenticity of the signed key. In order to trust a package, you need to have a chain of signatures from your own PGP key to the package itself. With the Arch key structure, this can happen in three ways:<br />
* '''Custom packages''': You made the package yourself and signed it with your own key.<br />
* '''Unofficial packages''': A developer made the package and signed it. You used your key to sign that developer's key.<br />
* '''Official packages''': A developer made the package and signed it. The developer's key was signed by the Arch Linux master keys. You used your key to sign the master keys, and you trust them to vouch for developers.<br />
<br />
==Setup==<br />
===Configuring pacman===<br />
First, you need to decide what level of checking you want. This is configured using the {{ic|SigLevel}} option in {{ic|/etc/pacman.conf}}. Several possibilities are mentioned in the comments in that file, and you can read the [http://www.archlinux.org/pacman/pacman.conf.5.html#_package_and_database_signature_checking {{ic|pacman.conf}} man page] for full details.<br />
<br />
{{warning|The {{ic|TrustAll}} option exists for debugging purposes and makes it very easy to trust keys that have not been verified. You should use {{ic|TrustedOnly}} for all official repositories.}}<br />
<br />
As of December 2011, database signing has not been implemented yet, so you will need to add the {{ic|DatabaseOptional}} option if you use {{ic|Required}}, for example:<br />
{{bc|1=SigLevel = Required DatabaseOptional TrustedOnly}}<br />
<br />
===Initializing keyring===<br />
<br />
To set up the pacman keyring use:<br />
# pacman-key --init<br />
<br />
This will set up a new keyring in {{ic|/etc/pacman.d/gnupg}} and generate a unique master key for your system.<br />
<br />
==Managing the keyring==<br />
The keys which are needed to verify package signatures are stored in a "keyring" managed by pacman-key. When a key is needed which is not in the keyring, pacman and pacman-key can retrieve it from a keyserver. The keyserver to use is configured in {{ic|/etc/pacman.d/gnupg/gpg.conf}}, and you can override it by using the {{ic|--keyserver}} option on the command line. (If you are looking for different keyservers, you can find a short list on the [[wikipedia:Key server (cryptographic)|Wikipedia article]].)<br />
<br />
PGP keys are usually too large (2048 bits or more) for humans to work with, so they are usually hashed to create a 40-hex-digit fingerprint. The last eight digits are known as the key ID, and are used as a "name" for the key. The longer fingerprint is used when you want to check by hand that two keys are the same.<br />
<br />
===Master keys===<br />
There are five Arch Linux master keys which are used to sign the keys of developers and TUs. These keys should be in your keyring. You can get the key IDs (the string in "Master Key" column) from the [https://www.archlinux.org/master-keys/ Master Signing Keys] page. To install them, run:<br />
{{bc|# pacman-key -r <keyid> <keyid> <keyid> <keyid> <keyid>}}<br />
<br />
You will need to locally sign these keys and set their trust level to at least "marginal":<br />
{{bc|<br />
# pacman-key --edit-key <keyid> <keyid> <keyid> <keyid> <keyid><br />
}}<br />
Before you sign or trust any key, you should verify its fingerprint. The most secure way to do this is by ''not'' using a computer, for example, buying Allan a beer and asking him for his public key fingerprint in person. It is reasonably secure to check the fingerprint against several different listings, such as the Master Signing Keys page and [http://allanmcrae.com/2011/12/pacman-package-signing-4-arch-linux/ Allan's blog].<br />
{{bc|<br />
gpg> lsign<br />
...<br />
Primary key fingerprint: ...<br />
...<br />
Really sign? (y/N)<br />
}}<br />
If the fingerprint matches, go ahead and sign it. You also need to assign at least a "marginal" trust level to each of the master keys.<br />
{{bc|<br />
Really sign? (y/N) y<br />
gpg> trust<br />
...<br />
Your decision? 3<br />
gpg> q<br />
Save changes? (y/N) y<br />
}}<br />
This process will repeat for each master key.<br />
<br />
===Official developer keys===<br />
The official developer and TU keys are signed by the master keys, so you do not need to use pacman-key to sign them yourself. Whenever pacman encounters a key it does not recognize, it will ask you if you want to download it from a keyserver. Once you have downloaded a developer key, you will not have to download it again, and it can be used to verify any other packages signed by that developer.<br />
<br />
If the developer's and TU's keys were added some time ago, their signatures by the master keys might not be present in the local keyring database.<br />
To have uptodate keys run as root :<br />
<br />
# pacman-key --refresh-keys<br />
<br />
Presently that is not automatically done or checked by pacman. When the package containing all the keys will be released, that will probably not be required anymore, as this package would be updated regularly.<br />
<br />
===Unofficial keys===<br />
If you want to add an unofficial key to your keyring, you will need to do it manually using pacman-key. First, get the ID from the owner of the key. Run:<br />
{{bc|# pacman-key -r <keyid>}}<br />
to download it from a keyserver. Be sure to verify the fingerprint, as you would with a master key, or any other key which you are going to sign. After verifying the fingerprint, you need to locally sign this key:<br />
{{bc|# pacman-key --lsign-key <keyid>}}<br />
You now trust this key to sign packages.<br />
<br />
===Adding keys automatically===<br />
This section provides scripts which can be used to download keys automatically. To avoid trusting a malicious key, these should be used with care.<br />
<br />
====Master keys====<br />
{{warning|Use with caution. This script will automatically trust any key you download, so please verify the fingerprints BEFORE using pacman!}}<br />
<br />
This has to be run as root to add keys.<br />
<br />
for key in <keyid> <keyid> <keyid> <keyid> <keyid>; do<br />
pacman-key --recv-keys $key<br />
pacman-key --lsign-key $key<br />
printf 'trust\n3\nquit\n' | gpg --homedir /etc/pacman.d/gnupg/ \<br />
--no-permission-warning --command-fd 0 --edit-key $key<br />
done<br />
<br />
====Developer and TU keys====<br />
{{warning|This script should ''only'' be used to download keys if you are using {{ic|TrustedOnly}}!}}<br />
<br />
This script uses curl to download the Developer page, extract the PGP key fingerprints and uses {{ic|pacman --recv-keys}} with {{ic|pgp.mit.edu}} as the keyserver, to add them to the pacman key store.<br />
<br />
This has to be run as root to add keys, or add a sudo before the pacman-key command.<br />
<br />
curl <nowiki>https://www.archlinux.org/{developers,trustedusers}/</nowiki> |<br />
awk -F\" '(/pgp.mit.edu/) {sub(/.*search=0x/,"");print $1}' |<br />
xargs pacman-key --recv-keys<br />
<br />
==Troubleshooting==<br />
===Cannot import keys===<br />
<br />
Some ISPs block the port used to import PGP keys. One solution is to use the MIT keyserver, which provides an alternate port. To do this, edit {{ic|/etc/pacman.d/gnupg/gpg.conf}} and change the keyserver line to:<br />
{{bc|keyserver hkp://pgp.mit.edu:11371}}<br />
<br />
==Disabling signature checking==<br />
{{warning|Use with caution. Disabling package signing will allow pacman to install untrusted packages automatically.}}<br />
<br />
If you are not concerned about package signing, you can disable PGP signature checking completely. Edit {{ic|/etc/pacman.conf}} and uncomment the following line under [options]:<br />
SigLevel = Never<br />
This will result in no signature checking, which was the behavior before pacman 4. If you decide to do this, you do not need to set up a keyring with pacman-key. You can change this option later if you decide to enable package verification.<br />
<br />
==Resetting all the keys==<br />
<br />
If you want to remove or reset all the keys installed in your system, you can remove {{ic|/etc/pacman.d/gnupg}} folder as root and rerun {{ic|pacman-key --init}} and following that add the keys as preferred.</div>Martiushttps://wiki.archlinux.org/index.php?title=VMware&diff=146988VMware2011-06-22T08:26:05Z<p>Martius: /* VMware modules and patches */</p>
<hr />
<div>[[Category:Emulators (English)]]<br />
{{i18n|Installing VMware}}<br />
<br />
This article is about installing VMware in Arch, you may also be interested in [[Installing Arch Linux in VMware]].<br />
<br />
==VMware Server Installation==<br />
<br />
Install [http://aur.archlinux.org/packages.php?ID=6182 vmware-server] from the [[AUR]].<br />
<br />
===VMware Server Console===<br />
<br />
Install [http://aur.archlinux.org/packages.php?ID=9604 vmware-server-console] from the [[AUR]].<br />
Alternatively, on Arch64, the [http://aur.archlinux.org/packages.php?ID=31169 bin32] version can also be installed.<br />
<br />
=== Note ===<br />
<br />
On both cases, the vmware image is not included in the [[AUR]] anymore. So you should:<br />
* download and extract the tarball from the AUR<br />
* download the image from [http://www.vmware.com/products/server/ VMWare website]. <br />
* copy VMware-server-2.0.2-203138.i386.tar.gz to the build directory<br />
* finish building<br />
<br />
==VMware Workstation or VMware Player==<br />
<br />
===Installation===<br />
<br />
{{Note| This will '''not''' install with pacman, so the files installed will '''not''' be traceable/removable with pacman.}}<br />
<br />
To install Workstation or Player on a Linux host using a bundle:<br />
<br />
'''1.''' Download {{Filename|VMware-Workstation-<version>.<release>.<architecture>.bundle}} or {{Filename|VMware-Player-<version>-<release>.<architecture>.bundle}} from the VMware site. ({{Codeline|Note:}} you can also try the testing (Beta/RC) versions found in here: http://communities.vmware.com/community/beta/ws but please note that they indeed are beta and so there's no guarantee you will not run into issues).<br />
<br />
'''2.''' In a terminal cd to the directory where you downloaded the file.<br />
<br />
'''3.''' Become root and create a fake System V init style directory for VMware and start the installation (the <code>--console</code> flag uses terminal instead of the GUI and the <code>--custom</code> asks all the unnecessary questions that nobody cares about - but we need it to select the {{Codeline|System service}} runlevels directory):<br />
# mkdir -p /etc/rc.d/vmware.d/{rc{0..6},init}.d<br />
# chmod +x VMware-<edition>-<version>.<release>.<architecture>.bundle<br />
# ./VMware-<edition>-<version>.<release>.<architecture>.bundle --console --custom<br />
<br />
'''4.''' (Read &) accept the EULA to continue.<br />
<br />
'''5.''' Accept the default settings until it prompts for {{Codeline|System service}} runlevels then set to:<br />
/etc/rc.d/vmware.d/<br />
<br />
'''6.''' For {{Codeline|System service scripts}} set to:<br />
/etc/rc.d<br />
<br />
It might happen that you need to set the directory for {{Codeline|System service scripts}} as {{Codeline|/etc/rc.d/vmware.d/init.d}} (the default) or else the installation would fail. If you do, you can create a symlink from {{Codeline|/etc/rc.d/vmware.d/init.d/vmware}} to {{Codeline|/etc/rc.d/vmware}} afterwards or the other way around (note that you can't remove the {{Codeline|VMware System service script}} after you've placed it somewhere because that's where VMware will be looking for it).<br />
<br />
'''7.''' (Optional) Enter the directory path to the Integrated Virtual Debugger for Eclipse if Eclipse is installed.<br />
<br />
'''8.''' Mash enter to install. Note that if nothing happens at this point and you are returned to the prompt, try re-running the installation without the <code>--console</code> option.<br />
<br />
'''9.''' At this point you would want to install the modules. First you need to either change the {{Codeline|lsmod binary path}} in {{Codeline|/etc/rc.d/vmware}} at the lines 88 and 108 from:<br />
/sbin/lsmod<br />
to:<br />
/bin/lsmod<br />
or create a symlink from {{Codeline|/bin/lsmod}} to {{Codeline|/sbin/lsmod}} with:<br />
# ln -s /bin/lsmod /sbin/lsmod<br />
<br />
===VMware modules and patches===<br />
{{Expansion}}<br />
<br />
* For 2.6.39 kernel and VMware player 3.1.4, there is a required<br />
{{Note| like the scripts below, you must extract all of the VMware sources out first and then run this patch. The patch is setup for the source to be in the same local directory of the patch. If you want to run the patch directly against the source in the directory where it already resides, change every instance of "source-original" in the patch file to "/usr/lib/vmware/modules/source" after extracting all five of the tar files in that directory. Patch and then tar them again.}}<br />
$ mkdir /tmp/vmware && cd /tmp/vmware<br />
$ cp /usr/lib/vmware/modules/source/ .<br />
$ wget http://weltall.heliohost.org/wordpress/wp-content/uploads/2011/05/vmware2.6.39fixed.patch<br />
$ for i in ./*.tar; do tar -xf $i; done<br />
$ for i in ./*.tar; do mv $i $i.orginal; done<br />
$ patch --batch --force -p1 < vmware2.6.39fixed.patch<br />
$ tar cf vmblock.tar vmblock-only<br />
$ tar cf vmci.tar vmci-only<br />
$ tar cf vmmon.tar vmmon-only<br />
$ tar cf vmnet.tar vmnet-only<br />
$ tar cf vsock.tar vsock-only<br />
# cp -vf *.tar /usr/lib/vmware/modules/source/<br />
<br />
* For 2.6.38 kernel and VMware player 3.1.4, there is no patch required<br />
<br />
* For 2.6.37 kernel and VMware 7.x.x (tested with 7.1.3), there's a script to patch the VMware sources (run as root):<br />
{{Note| This script also works for 2.6.38 kernels and VMware 7.1.4}}<br />
$ cd /tmp<br />
$ wget http://www.russo79.com/vmware7.1.3-patch-kernel-2.6.37.sh<br />
# chmod +x vmware7.1.3-patch-kernel-2.6.37.sh<br />
# ./vmware7.1.3-patch-kernel-2.6.37.sh<br />
This script was based on the patch taken from http://communities.vmware.com/thread/293321<br />
<br />
* For 2.6.37 kernel and VMware player 3.1.4, there is no patch required<br />
<br />
* For 2.6.36 kernel and VMware 7.x.x, there's a script to patch the vmmon (run as root):<br />
$ cd /tmp<br />
$ wget http://files.archlinux.org.il/vmmon_fix_2.6.36.sh<br />
# chmod +x vmmon_fix_2.6.36.sh<br />
# ./vmmon_fix_2.6.36.sh<br />
<br />
* For 2.6.35 kernel and VMware 7.x.x, there's a script to patch the VMware sources :<br />
$ cd /tmp<br />
$ wget http://www.sputnick-area.net/scripts/vmware7.1.1-patch-kernel-2.6.35.bash<br />
# chmod +x vmware7.1.1-patch-kernel-2.6.35.bash<br />
# ./vmware7.1.1-patch-kernel-2.6.35.bash<br />
<br />
===Installation (concluded)===<br />
<br />
Now you can install the modules. You can do this with either by launching VMware and letting it install the modules from there with the GUI or alternatively you can execute the command:<br />
# vmware-modconfig --console --install-all<br />
<br />
'''10.''' (Optional) Add vmware to the DAEMONS array in /etc/rc.conf so that the service is started automatically on boot.<br />
<br />
'''11.''' Install and run [[HAL]]<br />
#/etc/rc.d/hal start<br />
<br />
'''12.''' Now, open your VMware Workstation ({{Codeline|vmware}} in the console) to configure & use!<br />
<br />
===Uninstallation===<br />
<br />
Check the product name<br />
<br />
# vmware-installer -l<br />
<br />
uninstall product<br />
<br />
# vmware-installer -u <vmware-product><br />
<br />
Manually included parts in /etc/rc.d have to be deleted manually.<br />
Don't forget to remove vmware from the /etc/rc.conf DAEMONS array.<br />
<br />
===Extracting the VMware BIOS===<br />
To extract the VMware BIOS, which can be manipulated and later used with your virtual machines:<br />
$ objcopy /usr/lib/vmware/bin/vmware-vmx -O binary -j bios440 --set-section-flags bios440=a bios440.rom.Z<br />
$ perl -e 'use Compress::Zlib; my $v; read STDIN, $v, '$(stat -c%s "./bios440.rom.Z")'; $v = uncompress($v); print $v;' < bios440.rom.Z > bios440.rom<br />
<br />
Once you've modified the BIOS in whatever way required, move it to the directory where your VM is stored, and add it to the {{Codeline|.vmx}} file:<br />
bios440.filename = "bios440.rom"<br />
<br />
== Troubleshooting ==<br />
<br />
=== Kernel upgrades and VMware modules ===<br />
If when you ran<br />
./VMware-<edition>-<version>.<release>.<architecture>.bundle<br />
you get back to the prompt and VMware don't ask you to makes choices, then you probably have an old install, so you should rename /etc/vmware-installer/ :<br />
# mv /etc/vmware-installer /etc/vmware-installer.old<br />
<br />
<br />
If you get an error like this when launching up a Virtual Machine:<br />
Could not open /dev/vmmon: No such file or directory.<br />
Please make sure that the kernel module `vmmon' is loaded.<br />
It means that at least the one VMware service isn't started up. You can start them all up by running (as root):<br />
# /etc/rc.d/vmware start<br />
<br />
<br />
If, on the other hand VMware complains about kernel headers like this:<br />
Kernel headers for version 2.6.xx-xxxx were not found. If you installed them.......<br />
Install them with the following:<br />
# pacman -S kernel26-headers<br />
<br />
=== error: implicit declaration of function ‘iommu_unmap_range’ ===<br />
If the following error happens while compiling modules<br />
...<br />
/tmp/vmware-root/modules/vmmon-only/linux/iommu.c:403:7: erreur: implicit declaration of function ‘iommu_unmap_range’<br />
make[2]: *** [/tmp/vmware-root/modules/vmmon-only/linux/iommu.o] Erreur 1<br />
make[1]: *** [_module_/tmp/vmware-root/modules/vmmon-only] Erreur 2<br />
make[1]: quittant le répertoire « /usr/src/linux-2.6.35-ARCH »<br />
make: *** [vmmon.ko] Erreur 2<br />
<br />
This error is due to a change in the kernel API, the change is merely just a change of name which removes the suffixed '_range' from the iommu functions.<br />
You can manually patch the sources by removing the _range suffix with a quick sed expression:<br />
cd /tmp<br />
tar xvf /usr/lib/vmware/modules/source/vmmon.tar<br />
sed 's/_range//' -i vmmon-only/linux/iommu.c<br />
tar cvf /usr/lib/vmware/modules/source/vmmon.tar vmmon-only<br />
<br />
Please note that when upgrading the kernel you will have to rebuild the vmware modules with:<br />
$ vmware-modconfig --console --install-all<br />
Otherwise your whole system might crash when trying to power up VMs so keep that in mind.<br />
<br />
=== error: implicit declaration of function ‘kernel_locked’ ===<br />
If you're getting this error it means you're most likely on a 2.6.36 > kernel and require some additional attention. Attention that VMware rarely pays.<br />
<br />
There's a patch available for this and several more compile errors over at [http://communities.vmware.com/thread/293321]<br />
<br />
=== error: ‘struct sock’ has no member named ‘sk_sleep’ ===<br />
This error often occures when compiling the vsock module, the error looks something like:<br />
<br />
make[1]: Entering directory `/usr/src/linux-headers-2.6.35-7-generic-pae'<br />
CC [M] /tmp/vmware-root/modules/vsock-only/linux/af_vsock.o<br />
/tmp/vmware-root/modules/vsock-only/linux/af_vsock.c:312: warning: initialization from incompatible pointer type<br />
/tmp/vmware-root/modules/vsock-only/linux/af_vsock.c:359: warning: initialization from incompatible pointer type<br />
/tmp/vmware-root/modules/vsock-only/linux/af_vsock.c: In function ‘VSockVmciStreamConnect’:<br />
/tmp/vmware-root/modules/vsock-only/linux/af_vsock.c:3224: error: ‘struct sock’ has no member named ‘sk_sleep’<br />
/tmp/vmware-root/modules/vsock-only/linux/af_vsock.c:3247: error: ‘struct sock’ has no member named ‘sk_sleep’<br />
...<br />
<br />
To fix this we do a similar approach as the one mentioned above:<br />
cd /tmp<br />
tar xvf /usr/lib/vmware/modules/source/vsock.tar<br />
sed 's/\([a-z_]*\)->compat_sk_sleep/compat_sk_sleep(\1)/g' -i vsock-only/linux/af_vsock.c<br />
tar cvf /usr/lib/vmware/modules/source/vsock.tar vsock-only<br />
<br />
Then rerun:<br />
$ vmware-modconfig --console --install-all<br />
<br />
And you should be fine.<br />
<br />
=== Printing from the guest OS ===<br />
If you've configured your guest OS to use the printers on your host, and the print jobs aren't going through, there may be a permissions problem with the ThinPrint CUPS filter ('''thnucups'''), which is used by VMware.<br />
<br />
From {{Codeline|/var/log/cups/error_log}}:<br />
E [22/Nov/2010:14:10:11 -0800] Unable to execute /usr/lib/cups/filter/thnucups: insecure file permissions (0104755)<br />
<br />
This should fix that:<br />
<br />
$ sudo chmod u-sw /usr/lib/cups/filter/thnucups<br />
$ sudo /etc/rc.d/cups restart<br />
<br />
=== VMware 7.xx gui won't start ===<br />
<br />
When executing vmware from a terminal, you see the following output but the GUI won't start,<br />
<br />
$ vmware<br />
Logging to /tmp/vmware-jcosta/setup-5527.log<br />
filename: /lib/modules/2.6.38-ck/misc/vmmon.ko<br />
supported: external<br />
license: GPL v2<br />
description: VMware Virtual Machine Monitor.<br />
author: VMware, Inc.<br />
depends:<br />
vermagic: 2.6.38-ck SMP preempt mod_unload<br />
filename: /lib/modules/2.6.38-ck/misc/vmnet.ko<br />
supported: external<br />
license: GPL v2<br />
description: VMware Virtual Networking Driver.<br />
author: VMware, Inc.<br />
depends:<br />
vermagic: 2.6.38-ck SMP preempt mod_unload<br />
filename: /lib/modules/2.6.38-ck/misc/vmblock.ko<br />
supported: external<br />
version: 1.1.2.0<br />
license: GPL v2<br />
description: VMware Blocking File System<br />
author: VMware, Inc.<br />
srcversion: 400149ED038D22A87322D56<br />
depends:<br />
vermagic: 2.6.38-ck SMP preempt mod_unload<br />
parm: root:The directory the file system redirects to. (charp)<br />
filename: /lib/modules/2.6.38-ck/misc/vmci.ko<br />
supported: external<br />
license: GPL v2<br />
description: VMware Virtual Machine Communication Interface (VMCI).<br />
author: VMware, Inc.<br />
depends:<br />
vermagic: 2.6.38-ck SMP preempt mod_unload<br />
filename: /lib/modules/2.6.38-ck/misc/vsock.ko<br />
supported: external<br />
license: GPL v2<br />
version: 1.0.0.0<br />
description: VMware Virtual Socket Family<br />
author: VMware, Inc.<br />
srcversion: CF8ABF14AFA7E44C2CC4C9C<br />
depends: vmci<br />
vermagic: 2.6.38-ck SMP preempt mod_unload<br />
filename: /lib/modules/2.6.38-ck/misc/vmmon.ko<br />
supported: external<br />
license: GPL v2<br />
description: VMware Virtual Machine Monitor.<br />
author: VMware, Inc.<br />
depends:<br />
vermagic: 2.6.38-ck SMP preempt mod_unload<br />
<br />
<br />
This seems to be a problem with glibmm-2.28, downgrade glibmm to 2.24.2.1, and it should work.</div>Martiushttps://wiki.archlinux.org/index.php?title=VMware&diff=146987VMware2011-06-22T08:25:48Z<p>Martius: /* VMware modules and patches */</p>
<hr />
<div>[[Category:Emulators (English)]]<br />
{{i18n|Installing VMware}}<br />
<br />
This article is about installing VMware in Arch, you may also be interested in [[Installing Arch Linux in VMware]].<br />
<br />
==VMware Server Installation==<br />
<br />
Install [http://aur.archlinux.org/packages.php?ID=6182 vmware-server] from the [[AUR]].<br />
<br />
===VMware Server Console===<br />
<br />
Install [http://aur.archlinux.org/packages.php?ID=9604 vmware-server-console] from the [[AUR]].<br />
Alternatively, on Arch64, the [http://aur.archlinux.org/packages.php?ID=31169 bin32] version can also be installed.<br />
<br />
=== Note ===<br />
<br />
On both cases, the vmware image is not included in the [[AUR]] anymore. So you should:<br />
* download and extract the tarball from the AUR<br />
* download the image from [http://www.vmware.com/products/server/ VMWare website]. <br />
* copy VMware-server-2.0.2-203138.i386.tar.gz to the build directory<br />
* finish building<br />
<br />
==VMware Workstation or VMware Player==<br />
<br />
===Installation===<br />
<br />
{{Note| This will '''not''' install with pacman, so the files installed will '''not''' be traceable/removable with pacman.}}<br />
<br />
To install Workstation or Player on a Linux host using a bundle:<br />
<br />
'''1.''' Download {{Filename|VMware-Workstation-<version>.<release>.<architecture>.bundle}} or {{Filename|VMware-Player-<version>-<release>.<architecture>.bundle}} from the VMware site. ({{Codeline|Note:}} you can also try the testing (Beta/RC) versions found in here: http://communities.vmware.com/community/beta/ws but please note that they indeed are beta and so there's no guarantee you will not run into issues).<br />
<br />
'''2.''' In a terminal cd to the directory where you downloaded the file.<br />
<br />
'''3.''' Become root and create a fake System V init style directory for VMware and start the installation (the <code>--console</code> flag uses terminal instead of the GUI and the <code>--custom</code> asks all the unnecessary questions that nobody cares about - but we need it to select the {{Codeline|System service}} runlevels directory):<br />
# mkdir -p /etc/rc.d/vmware.d/{rc{0..6},init}.d<br />
# chmod +x VMware-<edition>-<version>.<release>.<architecture>.bundle<br />
# ./VMware-<edition>-<version>.<release>.<architecture>.bundle --console --custom<br />
<br />
'''4.''' (Read &) accept the EULA to continue.<br />
<br />
'''5.''' Accept the default settings until it prompts for {{Codeline|System service}} runlevels then set to:<br />
/etc/rc.d/vmware.d/<br />
<br />
'''6.''' For {{Codeline|System service scripts}} set to:<br />
/etc/rc.d<br />
<br />
It might happen that you need to set the directory for {{Codeline|System service scripts}} as {{Codeline|/etc/rc.d/vmware.d/init.d}} (the default) or else the installation would fail. If you do, you can create a symlink from {{Codeline|/etc/rc.d/vmware.d/init.d/vmware}} to {{Codeline|/etc/rc.d/vmware}} afterwards or the other way around (note that you can't remove the {{Codeline|VMware System service script}} after you've placed it somewhere because that's where VMware will be looking for it).<br />
<br />
'''7.''' (Optional) Enter the directory path to the Integrated Virtual Debugger for Eclipse if Eclipse is installed.<br />
<br />
'''8.''' Mash enter to install. Note that if nothing happens at this point and you are returned to the prompt, try re-running the installation without the <code>--console</code> option.<br />
<br />
'''9.''' At this point you would want to install the modules. First you need to either change the {{Codeline|lsmod binary path}} in {{Codeline|/etc/rc.d/vmware}} at the lines 88 and 108 from:<br />
/sbin/lsmod<br />
to:<br />
/bin/lsmod<br />
or create a symlink from {{Codeline|/bin/lsmod}} to {{Codeline|/sbin/lsmod}} with:<br />
# ln -s /bin/lsmod /sbin/lsmod<br />
<br />
===VMware modules and patches===<br />
{{Expansion}}<br />
<br />
* For 2.6.39 kernel and VMware player 3.1.4, there is a required<br />
{{Note| like the scripts below, you must extract all of the VMware sources out first and then run this patch. The patch is setup for the source to be in the same local directory of the patch. If you want to run the patch directly against the source in the directory where it already resides, change every instance of "source-original" in the patch file to "/usr/lib/vmware/modules/source" after extracting all five of the tar files in that directory. Patch and then tar them again.}}<br />
$ mkdir /tmp/vmware && cd /tmp/vmware<br />
$ cp /usr/lib/vmware/modules/source/ .<br />
$ wget http://weltall.heliohost.org/wordpress/wp-content/uploads/2011/05/vmware2.6.39fixed.patch<br />
$ for i in ./*.tar; do tar -xf $i; done<br />
$ for i in ./*.tar; do mv $i $i.orginial; done<br />
$ patch --batch --force -p1 < vmware2.6.39fixed.patch<br />
$ tar cf vmblock.tar vmblock-only<br />
$ tar cf vmci.tar vmci-only<br />
$ tar cf vmmon.tar vmmon-only<br />
$ tar cf vmnet.tar vmnet-only<br />
$ tar cf vsock.tar vsock-only<br />
# cp -vf *.tar /usr/lib/vmware/modules/source/<br />
<br />
* For 2.6.38 kernel and VMware player 3.1.4, there is no patch required<br />
<br />
* For 2.6.37 kernel and VMware 7.x.x (tested with 7.1.3), there's a script to patch the VMware sources (run as root):<br />
{{Note| This script also works for 2.6.38 kernels and VMware 7.1.4}}<br />
$ cd /tmp<br />
$ wget http://www.russo79.com/vmware7.1.3-patch-kernel-2.6.37.sh<br />
# chmod +x vmware7.1.3-patch-kernel-2.6.37.sh<br />
# ./vmware7.1.3-patch-kernel-2.6.37.sh<br />
This script was based on the patch taken from http://communities.vmware.com/thread/293321<br />
<br />
* For 2.6.37 kernel and VMware player 3.1.4, there is no patch required<br />
<br />
* For 2.6.36 kernel and VMware 7.x.x, there's a script to patch the vmmon (run as root):<br />
$ cd /tmp<br />
$ wget http://files.archlinux.org.il/vmmon_fix_2.6.36.sh<br />
# chmod +x vmmon_fix_2.6.36.sh<br />
# ./vmmon_fix_2.6.36.sh<br />
<br />
* For 2.6.35 kernel and VMware 7.x.x, there's a script to patch the VMware sources :<br />
$ cd /tmp<br />
$ wget http://www.sputnick-area.net/scripts/vmware7.1.1-patch-kernel-2.6.35.bash<br />
# chmod +x vmware7.1.1-patch-kernel-2.6.35.bash<br />
# ./vmware7.1.1-patch-kernel-2.6.35.bash<br />
<br />
===Installation (concluded)===<br />
<br />
Now you can install the modules. You can do this with either by launching VMware and letting it install the modules from there with the GUI or alternatively you can execute the command:<br />
# vmware-modconfig --console --install-all<br />
<br />
'''10.''' (Optional) Add vmware to the DAEMONS array in /etc/rc.conf so that the service is started automatically on boot.<br />
<br />
'''11.''' Install and run [[HAL]]<br />
#/etc/rc.d/hal start<br />
<br />
'''12.''' Now, open your VMware Workstation ({{Codeline|vmware}} in the console) to configure & use!<br />
<br />
===Uninstallation===<br />
<br />
Check the product name<br />
<br />
# vmware-installer -l<br />
<br />
uninstall product<br />
<br />
# vmware-installer -u <vmware-product><br />
<br />
Manually included parts in /etc/rc.d have to be deleted manually.<br />
Don't forget to remove vmware from the /etc/rc.conf DAEMONS array.<br />
<br />
===Extracting the VMware BIOS===<br />
To extract the VMware BIOS, which can be manipulated and later used with your virtual machines:<br />
$ objcopy /usr/lib/vmware/bin/vmware-vmx -O binary -j bios440 --set-section-flags bios440=a bios440.rom.Z<br />
$ perl -e 'use Compress::Zlib; my $v; read STDIN, $v, '$(stat -c%s "./bios440.rom.Z")'; $v = uncompress($v); print $v;' < bios440.rom.Z > bios440.rom<br />
<br />
Once you've modified the BIOS in whatever way required, move it to the directory where your VM is stored, and add it to the {{Codeline|.vmx}} file:<br />
bios440.filename = "bios440.rom"<br />
<br />
== Troubleshooting ==<br />
<br />
=== Kernel upgrades and VMware modules ===<br />
If when you ran<br />
./VMware-<edition>-<version>.<release>.<architecture>.bundle<br />
you get back to the prompt and VMware don't ask you to makes choices, then you probably have an old install, so you should rename /etc/vmware-installer/ :<br />
# mv /etc/vmware-installer /etc/vmware-installer.old<br />
<br />
<br />
If you get an error like this when launching up a Virtual Machine:<br />
Could not open /dev/vmmon: No such file or directory.<br />
Please make sure that the kernel module `vmmon' is loaded.<br />
It means that at least the one VMware service isn't started up. You can start them all up by running (as root):<br />
# /etc/rc.d/vmware start<br />
<br />
<br />
If, on the other hand VMware complains about kernel headers like this:<br />
Kernel headers for version 2.6.xx-xxxx were not found. If you installed them.......<br />
Install them with the following:<br />
# pacman -S kernel26-headers<br />
<br />
=== error: implicit declaration of function ‘iommu_unmap_range’ ===<br />
If the following error happens while compiling modules<br />
...<br />
/tmp/vmware-root/modules/vmmon-only/linux/iommu.c:403:7: erreur: implicit declaration of function ‘iommu_unmap_range’<br />
make[2]: *** [/tmp/vmware-root/modules/vmmon-only/linux/iommu.o] Erreur 1<br />
make[1]: *** [_module_/tmp/vmware-root/modules/vmmon-only] Erreur 2<br />
make[1]: quittant le répertoire « /usr/src/linux-2.6.35-ARCH »<br />
make: *** [vmmon.ko] Erreur 2<br />
<br />
This error is due to a change in the kernel API, the change is merely just a change of name which removes the suffixed '_range' from the iommu functions.<br />
You can manually patch the sources by removing the _range suffix with a quick sed expression:<br />
cd /tmp<br />
tar xvf /usr/lib/vmware/modules/source/vmmon.tar<br />
sed 's/_range//' -i vmmon-only/linux/iommu.c<br />
tar cvf /usr/lib/vmware/modules/source/vmmon.tar vmmon-only<br />
<br />
Please note that when upgrading the kernel you will have to rebuild the vmware modules with:<br />
$ vmware-modconfig --console --install-all<br />
Otherwise your whole system might crash when trying to power up VMs so keep that in mind.<br />
<br />
=== error: implicit declaration of function ‘kernel_locked’ ===<br />
If you're getting this error it means you're most likely on a 2.6.36 > kernel and require some additional attention. Attention that VMware rarely pays.<br />
<br />
There's a patch available for this and several more compile errors over at [http://communities.vmware.com/thread/293321]<br />
<br />
=== error: ‘struct sock’ has no member named ‘sk_sleep’ ===<br />
This error often occures when compiling the vsock module, the error looks something like:<br />
<br />
make[1]: Entering directory `/usr/src/linux-headers-2.6.35-7-generic-pae'<br />
CC [M] /tmp/vmware-root/modules/vsock-only/linux/af_vsock.o<br />
/tmp/vmware-root/modules/vsock-only/linux/af_vsock.c:312: warning: initialization from incompatible pointer type<br />
/tmp/vmware-root/modules/vsock-only/linux/af_vsock.c:359: warning: initialization from incompatible pointer type<br />
/tmp/vmware-root/modules/vsock-only/linux/af_vsock.c: In function ‘VSockVmciStreamConnect’:<br />
/tmp/vmware-root/modules/vsock-only/linux/af_vsock.c:3224: error: ‘struct sock’ has no member named ‘sk_sleep’<br />
/tmp/vmware-root/modules/vsock-only/linux/af_vsock.c:3247: error: ‘struct sock’ has no member named ‘sk_sleep’<br />
...<br />
<br />
To fix this we do a similar approach as the one mentioned above:<br />
cd /tmp<br />
tar xvf /usr/lib/vmware/modules/source/vsock.tar<br />
sed 's/\([a-z_]*\)->compat_sk_sleep/compat_sk_sleep(\1)/g' -i vsock-only/linux/af_vsock.c<br />
tar cvf /usr/lib/vmware/modules/source/vsock.tar vsock-only<br />
<br />
Then rerun:<br />
$ vmware-modconfig --console --install-all<br />
<br />
And you should be fine.<br />
<br />
=== Printing from the guest OS ===<br />
If you've configured your guest OS to use the printers on your host, and the print jobs aren't going through, there may be a permissions problem with the ThinPrint CUPS filter ('''thnucups'''), which is used by VMware.<br />
<br />
From {{Codeline|/var/log/cups/error_log}}:<br />
E [22/Nov/2010:14:10:11 -0800] Unable to execute /usr/lib/cups/filter/thnucups: insecure file permissions (0104755)<br />
<br />
This should fix that:<br />
<br />
$ sudo chmod u-sw /usr/lib/cups/filter/thnucups<br />
$ sudo /etc/rc.d/cups restart<br />
<br />
=== VMware 7.xx gui won't start ===<br />
<br />
When executing vmware from a terminal, you see the following output but the GUI won't start,<br />
<br />
$ vmware<br />
Logging to /tmp/vmware-jcosta/setup-5527.log<br />
filename: /lib/modules/2.6.38-ck/misc/vmmon.ko<br />
supported: external<br />
license: GPL v2<br />
description: VMware Virtual Machine Monitor.<br />
author: VMware, Inc.<br />
depends:<br />
vermagic: 2.6.38-ck SMP preempt mod_unload<br />
filename: /lib/modules/2.6.38-ck/misc/vmnet.ko<br />
supported: external<br />
license: GPL v2<br />
description: VMware Virtual Networking Driver.<br />
author: VMware, Inc.<br />
depends:<br />
vermagic: 2.6.38-ck SMP preempt mod_unload<br />
filename: /lib/modules/2.6.38-ck/misc/vmblock.ko<br />
supported: external<br />
version: 1.1.2.0<br />
license: GPL v2<br />
description: VMware Blocking File System<br />
author: VMware, Inc.<br />
srcversion: 400149ED038D22A87322D56<br />
depends:<br />
vermagic: 2.6.38-ck SMP preempt mod_unload<br />
parm: root:The directory the file system redirects to. (charp)<br />
filename: /lib/modules/2.6.38-ck/misc/vmci.ko<br />
supported: external<br />
license: GPL v2<br />
description: VMware Virtual Machine Communication Interface (VMCI).<br />
author: VMware, Inc.<br />
depends:<br />
vermagic: 2.6.38-ck SMP preempt mod_unload<br />
filename: /lib/modules/2.6.38-ck/misc/vsock.ko<br />
supported: external<br />
license: GPL v2<br />
version: 1.0.0.0<br />
description: VMware Virtual Socket Family<br />
author: VMware, Inc.<br />
srcversion: CF8ABF14AFA7E44C2CC4C9C<br />
depends: vmci<br />
vermagic: 2.6.38-ck SMP preempt mod_unload<br />
filename: /lib/modules/2.6.38-ck/misc/vmmon.ko<br />
supported: external<br />
license: GPL v2<br />
description: VMware Virtual Machine Monitor.<br />
author: VMware, Inc.<br />
depends:<br />
vermagic: 2.6.38-ck SMP preempt mod_unload<br />
<br />
<br />
This seems to be a problem with glibmm-2.28, downgrade glibmm to 2.24.2.1, and it should work.</div>Martius