Tuesday, 14 March 2017

Installing VirtualBox on Ubuntu 16.10


The most simple way of installing VirtualBox is to use the command:
$ sudo apt-get install virtualbox
However, the version that comes with Ubuntu is fairly old. I decided to connect directly to www.virtualbox.org to get the latest version.
The following commands add virtualbox.org to the list of source repositories used by apt and installs the 5.1 version of VirtualBox.
Add the following line to your /etc/apt/sources.list:
deb http://download.virtualbox.org/virtualbox/debian yakkety contrib
The name yakkety is the name of the Ubuntu 16.10 distribution.
The following commands adds the repository key file so that will be treated as a trusted site. Then the VirtualBox 5.1 is installed. Since I already have dkms the installation should automatically be updated when the kernel is updated.
$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc
$ sudo apt-key add oracle_vbox_2016.asc
$ sudo apt-get update
$ sudo apt-get install virtualbox-5.1

Ready to go.

Saturday, 11 March 2017

Installing ASUS USB-AC56 (chip RTL8812AU) Driver on Linux (Ubuntu)

I have a ASUS USB-AC56 WI-FI Adapter that is based on RTL8812AU chipset.
The Ubuntu kernel did not recognize the adapter automatically, so I downloaded and installed the driver from www.asus.com. However, it did not work. The reason may be that I am using Ubuntu 16.10 (kernel 4.8) and the driver provided by Asus is said to support Linux kernel 2.6 ~ 3.18.

I searched and found a newer driver compiled by Diederik de Haas on GitHub. You find it here.

You need to have git and dkms installed before proceeding.

$ sudo apt-get install git
$ sudo apt-get install dkms
The installation is a 2 step process:

1. Download a copy of the driver from GitHub
2. Install it under /usr/src which is managed by dkms. Then it should automatically be compiled into the kernel whenever it is updated.

You download the source using "git clone" and follow the given instructions when standing in the downloaded directory

$ git clone https://github.com/diederikdehaas/rtl8812AU.git

Dynamic Kernel Module Support (DKMS) is a program/framework that enables generating Linux kernel modules whose sources generally reside outside the kernel source tree. The concept is to have DKMS modules automatically rebuilt when a new kernel is installed.
Install the dkms package like this:

$ sudo -s -H
# DRV_NAME=rtl8812AU
# DRV_VERSION=4.3.14
# mkdir /usr/src/${DRV_NAME}-${DRV_VERSION}
# git archive driver-${DRV_VERSION} | tar -x -C /usr/src/${DRV_NAME}-${DRV_VERSION}
# dkms add -m ${DRV_NAME} -v ${DRV_VERSION}
# dkms build -m ${DRV_NAME} -v ${DRV_VERSION}
# dkms install -m ${DRV_NAME} -v ${DRV_VERSION}
# exit
$

Note that in the following block of commands, the first thing I do is a sudo -s -H as I want to do all the commands as root (superuser).
Reboot the machine and check that the WI-FI adapter works.