Difference between revisions of "Docking Solutions"

From ThinkWiki
Jump to: navigation, search
m (correct model name)
Line 4: Line 4:
 
Docks allow users to connect a variety of external peripherals simply by attaching their ThinkPad to the dock. Lenovo sells three types of docks for current ThinkPads, the [[ThinkPad Port Replicator II]], [[ThinkPad Mini-Dock]], and [[ThinkPad Dock II]]. Additionally, Lenovo's line of ultralight notebooks, the X-series, have a on-the-go dock called the [[UltraBase X4|UltraBase]]. Lenovo's docks are known to be some of the most flexible and useful docks available among all notebook manufacturers.
 
Docks allow users to connect a variety of external peripherals simply by attaching their ThinkPad to the dock. Lenovo sells three types of docks for current ThinkPads, the [[ThinkPad Port Replicator II]], [[ThinkPad Mini-Dock]], and [[ThinkPad Dock II]]. Additionally, Lenovo's line of ultralight notebooks, the X-series, have a on-the-go dock called the [[UltraBase X4|UltraBase]]. Lenovo's docks are known to be some of the most flexible and useful docks available among all notebook manufacturers.
 
|}
 
|}
 +
==Linux support==
 +
With recent distributions, docking and undocking should function out of the box. You can monitor this by running {{cmdroot|udevadm monitor}} and when you dock or press the undock button you should see a flurry of events.
 +
 +
There are some issues though
 +
 +
====No event on undock====
 +
 +
In some cases you may not get any events on undock. This is due to the ACPI dock drivers only registering the first logical Dock port they encounter and in some rare cases there may be more then one, such as on a ThinkPad X40 with ThinkPad X4 Dock. Patches are [https://bugzilla.kernel.org/show_bug.cgi?id=15521 available], and should be merged upstream soon.
 +
 +
====Filesystem corruption====
 +
 +
Pressing the undock button will immediately unplug all dock attached devices. This can easily lead to problems, for instance if you have a USB or Ultrabay storage device attached to the dock and have a filesystem mounted RW, this can easily lead to filesystem corruption.
 +
 +
The solution for now is to always make sure any storage devices attached to the dock are unmounted BEFORE pressing the undock button.
 +
====External display issues====
 +
 +
Docking or undocking will also not change the display configuration, which can lead to issues when your undock and your screensaver decided to put the unlock dialog on the secondary display, effectively requiring you to unlock the screensaver blind, before you can press Fn-F7 to restore your display setup to ThinkPad (LVDS) only. This last issue can be resolved by creating a custom udev rule and script as shown below. This script can also be used to take other actions on dock/undock such as automatically configuring your external display on dock.
 +
 +
create a file {{Path|/etc/udev/rules.d/81-thinkpad-dock.rules}}
 +
KERNEL=="dock.0", ACTION=="change", RUN+="/usr/local/sbin/thinkpad-dock.sh"
 +
 +
Then create the file {{Path|/usr/local/sbin/thinkpad-dock.sh}}
 +
#!/bin/sh
 +
# wait for the dock state to change
 +
sleep 1
 +
DOCKED=$(cat /sys/devices/platform/dock.0/docked)
 +
case "$DOCKED" in
 +
"0")
 +
#undocked event
 +
/usr/bin/xrandr -d :0.0 --output DVI1 --off --output VGA1 --off
 +
;;
 +
"1")
 +
#docked event
 +
/usr/bin/xrandr -d :0.0 --output DVI1 --right-of LVDS1 --auto
 +
;;
 +
esac
 +
exit 0
 +
And set it executable
 +
chmod +x /usr/local/sbin/thinkpad-dock.sh
 +
 +
{{NOTE|The output names shown above are specific to the Intel video drivers. For the ATI Radeon driver they would be VGA-0, DVI-0, LVDS and S-video. But you best check your output names by running xrandr manually, and adjusting the script appropriately for your needs.}}
 +
 +
Part of this is based on information from a thread on the Ubuntu [http://ubuntuforums.org/showthread.php?t=1076486 forums]
  
 
==Available Docking Stations and Port Replicators==
 
==Available Docking Stations and Port Replicators==

Revision as of 09:56, 24 March 2010

Docks allow users to connect a variety of external peripherals simply by attaching their ThinkPad to the dock. Lenovo sells three types of docks for current ThinkPads, the ThinkPad Port Replicator II, ThinkPad Mini-Dock, and ThinkPad Dock II. Additionally, Lenovo's line of ultralight notebooks, the X-series, have a on-the-go dock called the UltraBase. Lenovo's docks are known to be some of the most flexible and useful docks available among all notebook manufacturers.

Linux support

With recent distributions, docking and undocking should function out of the box. You can monitor this by running # udevadm monitor and when you dock or press the undock button you should see a flurry of events.

There are some issues though

No event on undock

In some cases you may not get any events on undock. This is due to the ACPI dock drivers only registering the first logical Dock port they encounter and in some rare cases there may be more then one, such as on a ThinkPad X40 with ThinkPad X4 Dock. Patches are available, and should be merged upstream soon.

Filesystem corruption

Pressing the undock button will immediately unplug all dock attached devices. This can easily lead to problems, for instance if you have a USB or Ultrabay storage device attached to the dock and have a filesystem mounted RW, this can easily lead to filesystem corruption.

The solution for now is to always make sure any storage devices attached to the dock are unmounted BEFORE pressing the undock button.

External display issues

Docking or undocking will also not change the display configuration, which can lead to issues when your undock and your screensaver decided to put the unlock dialog on the secondary display, effectively requiring you to unlock the screensaver blind, before you can press Fn-F7 to restore your display setup to ThinkPad (LVDS) only. This last issue can be resolved by creating a custom udev rule and script as shown below. This script can also be used to take other actions on dock/undock such as automatically configuring your external display on dock.

create a file /etc/udev/rules.d/81-thinkpad-dock.rules

KERNEL=="dock.0", ACTION=="change", RUN+="/usr/local/sbin/thinkpad-dock.sh"

Then create the file /usr/local/sbin/thinkpad-dock.sh

#!/bin/sh
# wait for the dock state to change
sleep 1
DOCKED=$(cat /sys/devices/platform/dock.0/docked)
case "$DOCKED" in
	"0")
	#undocked event
	/usr/bin/xrandr -d :0.0 --output DVI1 --off --output VGA1 --off
	;;
	"1")
	#docked event
	/usr/bin/xrandr -d :0.0 --output DVI1 --right-of LVDS1 --auto
	;;
esac
exit 0

And set it executable

chmod +x /usr/local/sbin/thinkpad-dock.sh
NOTE!
The output names shown above are specific to the Intel video drivers. For the ATI Radeon driver they would be VGA-0, DVI-0, LVDS and S-video. But you best check your output names by running xrandr manually, and adjusting the script appropriately for your needs.

Part of this is based on information from a thread on the Ubuntu forums

Available Docking Stations and Port Replicators

Withdrawn Docking Stations and Port Replicators

Monitor and Notebook Stands

Other

External Sources


FOOTNOTES [Δ]