Skip to content

Add Ubuntu alongside a pre-installed Windows on an HP laptop (convert primary partition to extended/logical)

Recently I wanted to install Ubuntu next to a pre-installed Windows on a brand-new HP EliteBook.

The notebook came with four primary partitions, with Windows installed on the biggest one:

- sda1 (1 GB, NTFS, label=SYSTEM)
- sda2 (457 GB, NTFS)
- sda3 (16 GB, NTFS, label=HP_RECOVERY)
- sda4 (2 GB, FAT32)

In order to install Ubuntu it's not enough to resize the Windows partition, as you cannot have more than four primary partitions. Removing one of the other partitions is a bad idea according to several reports, as it might render the system unable to start, or prevent BIOS updates. So the idea is to convert the Windows partition to a logical one in addition to resizing it. Fortunately everything you need to do that is already included on the Ubuntu installation image.

1. Use gparted to resize and move the Windows partition. I resized it to 100 GB and added 10 MB free space before it (to leave some space to create the extended partition later on). This will take a while, depending on the performance of your hard drive.

2. Use fixparts to convert sda2 to a logical partition:
# fixparts /dev/sda
Type l then 2, write the changes to the disk with w.

3. Restart the computer without the Ubuntu install media so that Windows fixes itself. This will take even longer than the partition resize, be patient. Restart once more to make sure the Windows install is fine.

4. Proceed with installing Ubuntu, choose the option to "install Ubuntu alongside Windows".
  • Twitter
  • Bookmark Add Ubuntu alongside a pre-installed Windows on an HP laptop (convert primary partition to extended/logical) at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Add Ubuntu alongside a pre-installed Windows on an HP laptop (convert primary partition to extended/logical)
  • Mixx Add Ubuntu alongside a pre-installed Windows on an HP laptop (convert primary partition to extended/logical)
  • Bloglines Add Ubuntu alongside a pre-installed Windows on an HP laptop (convert primary partition to extended/logical)
  • Technorati Add Ubuntu alongside a pre-installed Windows on an HP laptop (convert primary partition to extended/logical)
  • Fark this: Add Ubuntu alongside a pre-installed Windows on an HP laptop (convert primary partition to extended/logical)
  • Bookmark Add Ubuntu alongside a pre-installed Windows on an HP laptop (convert primary partition to extended/logical) at YahooMyWeb
  • Bookmark Add Ubuntu alongside a pre-installed Windows on an HP laptop (convert primary partition to extended/logical) at Furl.net
  • Bookmark Add Ubuntu alongside a pre-installed Windows on an HP laptop (convert primary partition to extended/logical) at reddit.com
  • Bookmark Add Ubuntu alongside a pre-installed Windows on an HP laptop (convert primary partition to extended/logical) at blinklist.com
  • Bookmark Add Ubuntu alongside a pre-installed Windows on an HP laptop (convert primary partition to extended/logical) at Spurl.net
  • Bookmark Add Ubuntu alongside a pre-installed Windows on an HP laptop (convert primary partition to extended/logical) at NewsVine
  • Bookmark Add Ubuntu alongside a pre-installed Windows on an HP laptop (convert primary partition to extended/logical) at Simpy.com
  • Bookmark Add Ubuntu alongside a pre-installed Windows on an HP laptop (convert primary partition to extended/logical) at blogmarks
  • Bookmark Add Ubuntu alongside a pre-installed Windows on an HP laptop (convert primary partition to extended/logical) with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca

Keyboard does not work properly in Virtualbox remote desktop session (fixing rdesktop-vrdp "Failed to open keymap" error)

This has been bugging me for quite some time...

The solution:
$ sudo ln -s /usr/share/virtualbox /opt/VirtualBox

Found here.

  • Twitter
  • Bookmark Keyboard does not work properly in Virtualbox remote desktop session (fixing rdesktop-vrdp "Failed to open keymap" error) at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Keyboard does not work properly in Virtualbox remote desktop session (fixing rdesktop-vrdp "Failed to open keymap" error)
  • Mixx Keyboard does not work properly in Virtualbox remote desktop session (fixing rdesktop-vrdp "Failed to open keymap" error)
  • Bloglines Keyboard does not work properly in Virtualbox remote desktop session (fixing rdesktop-vrdp "Failed to open keymap" error)
  • Technorati Keyboard does not work properly in Virtualbox remote desktop session (fixing rdesktop-vrdp "Failed to open keymap" error)
  • Fark this: Keyboard does not work properly in Virtualbox remote desktop session (fixing rdesktop-vrdp "Failed to open keymap" error)
  • Bookmark Keyboard does not work properly in Virtualbox remote desktop session (fixing rdesktop-vrdp "Failed to open keymap" error) at YahooMyWeb
  • Bookmark Keyboard does not work properly in Virtualbox remote desktop session (fixing rdesktop-vrdp "Failed to open keymap" error) at Furl.net
  • Bookmark Keyboard does not work properly in Virtualbox remote desktop session (fixing rdesktop-vrdp "Failed to open keymap" error) at reddit.com
  • Bookmark Keyboard does not work properly in Virtualbox remote desktop session (fixing rdesktop-vrdp "Failed to open keymap" error) at blinklist.com
  • Bookmark Keyboard does not work properly in Virtualbox remote desktop session (fixing rdesktop-vrdp "Failed to open keymap" error) at Spurl.net
  • Bookmark Keyboard does not work properly in Virtualbox remote desktop session (fixing rdesktop-vrdp "Failed to open keymap" error) at NewsVine
  • Bookmark Keyboard does not work properly in Virtualbox remote desktop session (fixing rdesktop-vrdp "Failed to open keymap" error) at Simpy.com
  • Bookmark Keyboard does not work properly in Virtualbox remote desktop session (fixing rdesktop-vrdp "Failed to open keymap" error) at blogmarks
  • Bookmark Keyboard does not work properly in Virtualbox remote desktop session (fixing rdesktop-vrdp "Failed to open keymap" error) with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca

vim instead of nano (Ubuntu / Debian)

apt-get install vim
update-alternatives --config editor

  • Twitter
  • Bookmark vim instead of nano (Ubuntu / Debian) at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg vim instead of nano (Ubuntu / Debian)
  • Mixx vim instead of nano (Ubuntu / Debian)
  • Bloglines vim instead of nano (Ubuntu / Debian)
  • Technorati vim instead of nano (Ubuntu / Debian)
  • Fark this: vim instead of nano (Ubuntu / Debian)
  • Bookmark vim instead of nano (Ubuntu / Debian) at YahooMyWeb
  • Bookmark vim instead of nano (Ubuntu / Debian) at Furl.net
  • Bookmark vim instead of nano (Ubuntu / Debian) at reddit.com
  • Bookmark vim instead of nano (Ubuntu / Debian) at blinklist.com
  • Bookmark vim instead of nano (Ubuntu / Debian) at Spurl.net
  • Bookmark vim instead of nano (Ubuntu / Debian) at NewsVine
  • Bookmark vim instead of nano (Ubuntu / Debian) at Simpy.com
  • Bookmark vim instead of nano (Ubuntu / Debian) at blogmarks
  • Bookmark vim instead of nano (Ubuntu / Debian) with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca

Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux

This is how I got a Bluetooth low energy (BLE) adapter to work on a Linux laptop running Ubuntu 12.04.

First, as suggested by several websites, I created the file /etc/modprobe.d/trust-btusb.conf with the following contents:
install usb:v0A5Cp21E8d*dc*dsc*dp*ic*isc*ip* /sbin/modprobe btusb; echo 0a5c 21e8 > /sys/bus/usb/drivers/btusb/new_id

After having restarted the computer and inserted the adapter, dmesg told me the following:
Bluetooth: can't load firmware, may not work correctly

To get the proper firmware, I downloaded the Windows 8 driver (18187_02.exe) from http://www.trust.com/18187. The driver files can be extracted from the .exe with "unrar x 18187_02.exe".

Then I looked for the vendor id (0x0a5c) and product id (0x21e8) in the various .inf files, and found this in 18187_02/Win32/bcbtums-win7x86-brcm.inf:
%BRCM20702.DeviceDesc%=RAMUSB21E8,      USB\VID_0A5C&PID_21E8                                   ; 20702A1 dongles

Further down in the inf file there is a RAMUSB21E8 section which contains the following line:
HKR,,%RAMPatchFileName%,0x00000, "BCM20702A1_001.002.014.0187.0188.hex"

The .hex "RAM Patch" file can be found in 18187_02/Win32/. Before it can be used with btusb, it needs to be converted to hcd format. This can be done with hex2hcd. Finally, the hcd file needs to be moved/copied to /lib/firmware/fw-0a5c_21e8.hcd. Here are the steps to get and compile hex2hcd:
$ git clone https://github.com/jessesung/hex2hcd.git
$ cd hex2hcd/
$ make

The resulting executable can be used to convert the .hex firmware file to .hcd, which is then copied to the right destination:
$ ./hex2hcd BCM20702A1_001.002.014.0187.0188.hex BCM20702A1_001.002.014.0187.0188.hcd
$ sudo cp -p BCM20702A1_001.002.014.0187.0188.hcd /lib/firmware/fw-0a5c_21e8.hcd
$ sudo chown root:root /lib/firmware/fw-0a5c_21e8.hcd

The adapter can now be used:
$ sudo hcitool -i hci1 lescan


Update, 2014-09-08:
  • The first step is no longer necessary with Ubuntu 14.04, I directly receive the "may not work" message.
  • I was able to extract the firmware from 18187_05.exe (latest W8 driver) using this command: "7z x 18187_05.exe"
  • The correct .hex file is BCM20702A1_001.002.014.0449.0515.hex
  • Twitter
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux
  • Mixx Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux
  • Bloglines Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux
  • Technorati Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux
  • Fark this: Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux at YahooMyWeb
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux at Furl.net
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux at reddit.com
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux at blinklist.com
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux at Spurl.net
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux at NewsVine
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux at Simpy.com
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux at blogmarks
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca

Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too)

According to the Wikipedia IPv6 article, Privacy extensions are, except for the Windows platform and Mac OS X since 10.7 as well as iOS since version 4.3, not enabled by default.

In theory, one can enable the IPv6 Privacy Extensions on all interfaces at once using sysctl like this:
sudo sysctl net.ipv6.conf.all.use_tempaddr=2

However, this currently doesn't work as expected, so I'm using this one-liner in /etc/rc.local:
for IF in `/bin/ls /proc/sys/net/ipv6/conf/*/use_tempaddr` ; do echo 2 > $IF ; done

This also sets "use_tempaddr" for "default", which means it should also apply to interfaces added to the system afterwards.

A simple check to verify that the new configuration is working: ipv6-test.com will print your MAC address when available...

See also: Linux Kernel Bug 11655

  • Twitter
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too)
  • Mixx Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too)
  • Bloglines Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too)
  • Technorati Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too)
  • Fark this: Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too)
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) at YahooMyWeb
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) at Furl.net
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) at reddit.com
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) at blinklist.com
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) at Spurl.net
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) at NewsVine
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) at Simpy.com
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) at blogmarks
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca