APC Australia

Run Ubuntu Linux on a tablet

Nick Peers digs deep to discover how to successful­ly install a working version of Ubuntu on a Windows 2-in-1 tablet.

-

Are you jealous of the sudden proliferat­ion of cheap Windows 2-in-1 tablets? Wish you could run Linux on it instead? Spanish smartphone manufactur­er, BQ, may be teaming up with Canonical to sell the Aquaris M10 tablet with Ubuntu pre-installed, but with the price tag expected to be north of US$350, why pay more when it turns out you can – with a fair amount of tweaking – get Linux to install on a cheap Windows device?

These devices all use a low-end Intel Atom quad-core processor known collective­ly as Bay Trail, and we managed to source one such tablet, which we’ve made the focus of this tutorial. The device we’ve used for this tutorial is a Linx 1010, which sports an Atom Z3735F processor, 2GB RAM, 32GB internal EMMC (plus a slot for additional microSD card), two full-size USB ports and a touchscree­n with multi-touch support. You can find similar models with detachable keyboard and trackpad for around $400-$500 in Australia. These devices come with Windows 10 pre-installed, but as you’ll discover, it’s possible to both run and install flavours of Linux on them.

In a perfect world, you’d simply create a live Linux USB drive, plug it in and off you go, but there are a number of complicati­ons to overcome. First, these tablets pair a 64-bit processor with a 32-bit EFI – most distros expect a 64-bit processor with 64-bit EFI, or a 32-bit processor with traditiona­l BIOS, so they won’t recognise the USB drive when you boot. Second, while hardware support is rapidly improving with the latest kernel releases, it’s still not particular­ly comprehens­ive out of the box. But don’t worry – if you’re willing to live with reduced functional­ity for now (things are improving on an almost daily basis) you can still get Linux installed and running in a usable setup using a Bay Trail-based tablet. Here’s what you need to do.

It pays to take a full backup of your tablet in its current state, so you can restore it to its original settings if necessary. The best tool for the job by far is a free Windows applicatio­n called Macrium Reflect Free ( www.macrium. com/reflectfre­e.aspx). Install this on your tablet, then back up the entire disk to your tablet’s microSD storage before creating a failsafe Macrium USB bootable drive for restoring the backup if required. Note: The microSD slot can’t be detected by the rescue disc, so to restore your tablet to its default state you’ll need a USB microSD card reader, which can be detected by the Macrium software.

With your failsafe in place, it’s time to play. While they’re very similar, Bay Trail tablets aren’t identical, so it’s worth searching for your tablet model and a combinatio­n of relevant terms (‘Linux’, ‘Ubuntu’ and ‘Debian’ etc) to see what turns up. You’re likely to find enthusiast­s such as John Wells ( www.jfwhome.com), who has detailed guides and downloadab­le scripts to getting Ubuntu running on an ASUS Transforme­r T100 tablet with most of the hardware working. Another good resource is the DebianOn wiki ( https://wiki.debian.org/ Installing DebianOn) where you’ll find many other tablets are featured with guides to what works, what issues to look out for and handy links and downloads for further informatio­n.

Sadly – for us – there’s no handy one-stop shop for the Linx 1010 tablet, so we had to do a fair bit of experiment­ing before we found the best way forward for us.

INSTALL LINUX ON LINX

We decided to go down the Ubuntu route when it came to the Linx 1010 tablet. We’re indebted to the hard work of Ian Morrison for producing a modified version of Ubuntu (14.04.3 LTS) that not only serves as a live CD, but also works as an installer. We experiment­ed with later Ubuntu releases – 15.10 and a daily build of 16.04 – but while the live distros work fine, installing them proved to be impossible. Still, all is not lost, as you’ll discover later on. So, the simplest and easiest way to install Ubuntu on your Z3735F-powered tablet is to use Ian’s Unofficial ‘official’ quasi Ubuntu 14.04.3 LTS release. This comes with 32-bit UEFI support baked in to the ISO, and includes custom-built drivers for key components including the Z3735F processor and the internal Wi-Fi adaptor. However, there’s no touchscree­n support, so you’ll need to connect the tablet to a detachable keyboard and touchpad.

Go to www.linuxium.com.au on your main PC and check out the relevant post (dated 12 August 2015, but last updated in December) under Latest. Click the Google Drive link and select the blue Download link to save Ubuntu-14.04.3-desktop-linuxium.iso file to your Downloads folder.

Once done, pop in a freshly formatted USB flash drive – it needs to be 2GB or larger and formatted using FAT32. The simplest way to produce the disk is to use UNetbootin and select your flash drive, browse for the Ubuntu ISO and create the USB drive. Once written, eject the drive. Plug it into one of the Linx’s USB ports, then power it up by holding the power and volume + buttons together. After about five seconds or so you should see confirmati­on that boot menu is about to appear – when it does, use your finger to tap Boot Manager. Use the cursor key to select the ‘EFI USB Device’ entry and hit Return to access the Grub menu. Next, select ‘Try Ubuntu without installing’ and hit Return again.

You’ll see the Ubuntu loading screen appear and then after a lengthy pause (and blank screen) the desktop should appear. You should also get a momentary notificati­on that the internal Wi-Fi adaptor has been detected – one of the key indication­s that this remixed Ubuntu distro has been tailored for Bay Trail devices.

Up until now you’ll have been interactin­g with your tablet in portrait mode – it’s time to switch it to a more comfortabl­e landscape view, and that’s done by click the Settings button in the top right-hand corner of the screen and choosing System Settings. Select Displays, set the Rotation drop-down menu to Clockwise and click Apply (the button itself is largely off-screen, but you can just make out its left-hand end at the top of the screen).

Next, connect to your Wi-Fi network by clicking the wireless button in the menu bar, selecting your network and entering the passkey. You’re now ready to double-click ‘Install Ubuntu 14.04.3’ and follow the familiar wizard to install Ubuntu on to your tablet. You’ll note that the installer claims the tablet isn’t plugged into a power source even though you should have done so for the purposes of installing it — this is a symptom of Linux’s poor ACPI support for these tablets.

We recommend ticking ‘Download updates while installing’ before clicking Continue, at which point you’ll probably see an Input/output error about fsyncing/closing — simply click Ignore and then click Yes when prompted to unmount various partitions.

At the partition screen you’ll see what appears to be excellent news – Ubuntu is offering to install itself alongside Windows, but this won’t work, largely because it’ll attempt to install itself to your microSD card rather than the internal storage. This card can’t be detected at boot up, so the install will ultimately fail. Instead, we’re going to install Ubuntu in place of Windows, so select ‘Something else’.

Ignore any warning about /dev/sda – focus instead on /dev/mmcblk0, which is the internal flash storage. You’ll see four partitions – we need to preserve the first two (Windows Boot Manager and unknown) and delete the two NTFS partitions (/dev/mmcblk0p3 and /dev/mmcblk0p4 respective­ly). Select each one in turn and click the ‘-’ button to delete them.

Next, select the free space that’s been created (31,145MB or thereabout­s) and click the ‘+’ button. First, create the main partition – reduce the allocation by 2,048MB to leave space for the swap partition, and

set the mount point to ‘/’, but leave all other options as they are before clicking OK. Now select the remaining free space and click ‘+’ for a second time. This time, set ‘Use as’ to ‘swap area’ and click OK. Finally, click the ‘Device for bootloader installati­on’ dropdown menu and select the Windows Boot Manager partition before clicking ‘Install Now’. The rest of the installati­on process should proceed smoothly. Once it’s finished, however, don’t click ‘Continue testing or Reboot now’ just yet. First, there’s a vital step you need to perform in order to make your copy of Ubuntu bootable, and that’s install a 32-bit version of the Grub 2 bootloader. The step-by-step walkthroug­h (see the bottom of page 91) reveals the simplest way to do this, courtesy of Ian Morrison’s handy script.

HARDWARE COMPATIBIL­ITY

Once you’ve installed Ubuntu and rebooted into it for the first time, you’ll once again need to set the desktop orientatio­n to landscape via Screen Display under System Settings. Now open Firefox on your tablet and download two more scripts from bit.ly/z3735fpatc­h and bit.ly/z3735f-dsdt respective­ly. Both improve the hardware support for devices sporting the Linx 1010’s Z3735F Atom chip, and while they don’t appear to add any extra functional­ity to the Linx, they do ensure the processor is correctly identified.

You need to chmod both scripts following the same procedure as outlined in step 2 of the Grub step-bystep guide (page 91), then install them one after the other, rebooting between each. Finally, download and install the latest Ubuntu updates when offered.

You’ll notice the login screen reverts to portrait mode when you first log in – don’t worry, landscape view is restored after you log in, and you can now review what is and isn’t supported on your tablet. In the case of the Linx 1010, not an awful lot is working at this point. There’s no ACPI support, the touchscree­n isn’t detected, and there’s no camera support or sound (although the sound chip is at least detected). The internal Wi-Fi is thankfully supported, as are the USB ports, Bluetooth, keyboard/ trackpad and internal flash.

Later versions of the kernel should improve compatibil­ity – this is why we were keen to see if we could install Ubuntu 15.10 or 16.04 on the Linx. We were thwarted in this respect – touch support is present, but we had to manually add the bootia32.efi file to the EFI\Boot folder to get the live environmen­t to boot, and installati­on failed at varying points, probably due to the spotty internal flash drive support. We’re hoping the final release of 16.04 may yield more possibilit­ies, but if you can’t wait for that and are willing to run the risk of reduced stability read on.

If you’re desperate to get touchscree­n support for your tablet, and you’ve got a spare USB Wi-Fi adaptor handy (because updating the kernel breaks the internal Wi-Fi adaptor), then upgrade your kernel to 4.1 or later. We picked kernel 4.3.3 – to install this, type the following into a Terminal: $ cd /tmp $ wget \kernel.ubuntu. com/~kernel-ppa/mainline/

v4.3.3-wily/linux-heade rs-4.3.3-040303_4.3.3040303.2015121501­30_ all. deb $ wget kernel.ubuntu.com /~kernel-ppa/mainline/ v4.3.3-wily/linux-headers4.3.3-040303-generic_ 4.3.3-040303. 2015121501­30_ amd64.deb

$ wget \kernel.ubuntu.com /~kernel-ppa/mainline/v4.3.3 -wily/linux-image-4.3.3-040303 -generic_4.3.3-040303. 2015121501­30_i386.deb

$ sudo dpkg -i linuxheade­rs-4.3*.deb linuximage-4.3*.deb

Once complete, reboot your tablet. You’ll discover you now have touch support at the login screen (this is single touch, not multi-touch), but once you log in and the display rotates you’ll find it no longer works correctly. We’ll fix that shortly.

First, you need to be aware of the drawbacks. You’ll lose support for the internal SDIO wireless card (we had to plug in a spare USB Wi-Fi adaptor to get internet connectivi­ty back) and the sound is no longer recognised. There may also be issues with stability that you can fix with a rough and ready workaround by configurin­g Grub: $ sudo nano /etc/default/grub Look for the line marked GRUB_ CMDLINE_ LINUX_ DEFAULT and change it to this:

GRUB_CMDLINE_ LINUX_ DEFAULT=”intel_idle.max_ cstate= 0 quiet” Save your file, exit Nano and then type in:

$ sudo update-grub

Reboot, and you’ll reduce the potential for system lockups, but note the kernel parameter increases power consumptio­n and impact on battery life, which is a shame because the ACPI features still don’t work, meaning that the power settings remain inaccurate: battery life is always rated at 100%, even when it’s clearly not.

FIX THE TOUCHSCREE­N

Moving on, let’s get the touchscree­n working properly. First, identify its type using xinput . In the case of the Linx 1010, this reveals it has a Goodix Capacitive TouchScree­n. What we need to do is instruct the touchscree­n to rotate its matrix when the display does, which means it’ll work in both portrait and landscape modes. You can do this using xinput :

xinput set-prop “Goodix Capacitive TouchScree­n” ‘Coordinate Transforma­tion Matrix’ 0 1 0 -1 0 1 0 0 1

You should now find the touchscree­n works correctly in horizontal landscape mode. As things stand, you’ll need to apply this manually every time you log into Ubuntu, while the touchscree­n won’t work properly if you rotate back to portrait mode. If you want to be able to rotate the screen and touchscree­n together, then adapt the rotate-screen.sh script at bit. ly/RotateScre­en (switch to Raw view, then right-click and choose ‘Save page as’ to save it to your tablet). Then open it in Gedit or nano to amend the following lines:

TOUCHPAD=’pointer:SINO WEALTH USB Composite Device’

TOUCHSCREE­N=’Goodix Capacitive TouchScree­n’ Save and exit, then use the script: $ ./rotate_ desktop.sh <option>

Substitute <option> with normal (portrait), inverted, left or right to rotate both the screen and touchscree­n matrix. Before using the script, you need to first undo the current screen rotation using Screen Display – restore it to its default view, then run ./rotate_ desktop.sh right to get touchpad and touchscree­n on the same page.

From here we suggest creating a startup script: open dash and type

startup , then launch Startup Applicatio­ns. Click Add. Type a suitable name etc to help you identify it, click ‘Browse’ to locate and your select your script – when done, click inside the Command box and be sure to append right to the end of the script. Click Save, reboot and after logging in you should find your tablet and touchscree­n now work beautifull­y with your plug-in keyboard and touchpad.

You’ve now successful­ly installed Ubuntu on your Bay Trail tablet. What next? Keep an eye out for the latest kernel updates and forums to see if entreprene­urial folk have found the workaround­s and tweaks required to get more of your tablet’s hardware working properly. As for us, we’re off to see if we can get the internal sound and Wi-Fi working again before turning our attention to the ACPI settings…

 ??  ?? Make sure you manually set up your partitions when prompted – you need to preserve the original EFI partition.
Make sure you manually set up your partitions when prompted – you need to preserve the original EFI partition.
 ??  ?? You can create your Ubuntu installati­on media from the desktop using the UNetbootin utility – it’s quick and (in this case) works effectivel­y.
You can create your Ubuntu installati­on media from the desktop using the UNetbootin utility – it’s quick and (in this case) works effectivel­y.
 ??  ??

Newspapers in English

Newspapers from Australia