Asus Chromebox – OpenELEC to LibreELEC Kodi Update

A few years ago I wrote a blog post detailing how to install the OpenELEC Kodi media center on an Asus Chromebox.

Recently though The Movie Database plug-in on my OpenELEC installation has become broken and will no longer retrieve movie metadata, posters and fanart.

After troubleshooting the issue a little and waiting to see if it would be fixed I decided to move on and discovered LibreELEC – a fork of OpenELEC.

Kodi-17-Krypton-b

While I always liked OpenELEC I have to say that LibreELEC has already impressed me more since installing it. In my opinion the GUI and menus are much improved – everything is visually appealing and better organized.

I have encountered two minor issues though:

  • Close to 200 of the movies that were scraped upon adding their sources have the incorrect year of 1969 as their date. This can be fixed manually by refreshing the meta-data but is still a little annoying.
  • I created a 2nd profile for kids content and could not see the add network location option when selecting a content source. The fix for me was to toggle the unlock sources switch to on under the view settings.

Installing LibreELEC was very straightforward. While I believe that you can update an existing OpenELEC installation to LibreELEC I opted to simply install LibreELEC over it. If you are starting from scratch with a new Chromebox please refer to the first half of my original blog post here. Otherwise I would recommend an Intel NUC over the Chromebox because of the ease of installation. A NUC can much more easily be re-purposed should the need arise.

To install LibreELEC visit the download page and grab the USB-SD Creator for your PC, Mac or Linux box.

LibreELEC USB-SD Creator

For a Chromebox installation:

  • Select Generic AMD/Intel/NVIDIA (x86) from the select version drop down menu.
  • Click the Download button.
  • Select your USB drive from the drop down menu and then click the Write button.

This will erase your USB drive and create a bootable LibreELEC installation.

From here simply put your USB drive in your Chromebox and boot from USB. To do this press the Escape key on your keyboard while your Chromebox boots and then select option 2 to boot from USB.

Follow the prompts and LibreELEC will very soon be up and running!

Remove your USB drive once LibreELEC is installed.

 

 

Asus Chromebox – Installing OpenELEC (Standalone Setup – No Chrome-OS)

I wrote this guide in 2014 and now in 2018 I find that the add-ons in OpenELEC for scraping Movies etc no longer work. I now recommend installing LibreELEC instead of OpenELEC. In addition I would now recommend a low end Intel NUC over a Chrombox because of ease of installation. The difference in price between the two is not that great any-more.

There is a lot of great documentation available for installing OpenELEC aka XBMC (now renamed Kodi) on a Chromebox – but I wanted a brief summary of the steps I performed should I need to do it again.

I have been running OpenELEC as my media center of choice for quite a while now on a 7 or 8 year old PC. As that PC just died I needed a replacement – something smaller – and something cheaper! The ChromeBox looked like an ideal choice …

These steps remove ChromeOS and install OpenELEC – so consult the documentation (and do not do this) if you prefer a different configuration! You have been warned! Seriously, read the documentation!

Enormous thanks to Matt DeViller for providing the installation script, documentation and support to the community!

For reference I installed OpenELEC on an Asus ChromeBox M004U.

The first step is to enable Developer Mode:

This will erase all user data!

  • Insert paperclip into the small home next to the SD card slot to press the recovery button
  • Turn on the Chromebox and then remove the paperclip
  • At the recovery screen press Ctrl + D to enter Developer Mode
  • Press the recovery button again to confirm

If pressing Ctrl +D does not get you to Developer Mode then you will need to try a different keyboard.

 After about 5 minutes you will see the developer boot screen.

  • Shutdown Chromebox

The next step is to  Disable Firmware Write Protect:

This is optional but will decrease the developer boot screen time from 30 seconds to less than 1 second (faster boot).

  • Remove the 4 rubber feet from the base of the Chromebox
  • Unscrew the 4 screws (under rubber feet)
  • Remove base
  • Unscrew the write protect screw (pictured below):
  • Re-assemble base, screws and rubber feet

300px-Inside-chrome1

The last step is to use the ChromeBox E-Z script to install OpenELEC:

Make sure ChromeBox is connected to the internet for this step.

  • Turn on ChromeBox and boot to ChromeOS – do not log in to ChromeOS
  • Press Ctrl, Alt + F2 to open a command prompt
  • Log in as chronos (no password required)
  • Download and run the ChromeBox setup script with these commands:
curl -L -O http://goo.gl/3Tfu5W
sudo bash 3Tfu5W

cbox-menu

Press 5 to proceed with Standalone Setup – this will update the coreboot Firmware (which means that you cannot easily run  ChromeOS).

This Firmware is only valid for Haswell based Asus / HP / Acer / Dell ChromeBoxes!

  • When prompted insert a USB Jump Drive to back up the stock firmware

Remove the stock firmware backup and insert another USB Jump Drive.

Press 6 to create the OpenELEC install media on the 2nd Jump Drive.

  • Reboot
  • Press the Escape key [ESC]at the boot menu and then select the Jump Drive from the list to install OpenELEC

Pressing Escape more than once will skip the boot menu forcing the ChromeBox to attempt to boot from the hard disk (instead of the Jump Drive).

  • Select Run Installer
  • Choose Quick Install
  • Select Yes and OK as needed in the installation wizard

When installation is complete:

  • Remove Jump Drive
  • Reboot

OpenELEC recommended settings are as follows:

This assumes you are using the default (Confluence) skin:

  • System –> OpenELEC –> System: Automatic Updates:Auto
  • System –> OpenELEC –> Services: Enable Bluetooth:Selected (if using Bluetooth)
  • System –> Settings –> System: Settings Level:Expert
  • System –> Settings –> System–>Video Output: Vertical blank sync:Enabled during video playback
  • System –> Settings –> System–>Power Saving: Shutdown function:Suspend (sets IR power toggle to suspend)
  • System –> Settings –> Videos–>Acceleration: Use VC-1 VAAPI:Selected
  • System –> Settings –> Videos–>Acceleration: Use SW Filter for VAAPI:Selected

In conclusion I have to say that I am quite impressed with how well my Chromebox has handled the job so far – it is a great replacement media center box!

Sources:

http://kodi.wiki/view/Chromebox#Perform_a_Factory_Reset

http://forum.kodi.tv/showthread.php?tid=194362

Ubuntu – Change Hostname Permanently Using the Command Line

ubuntu-logo

On Ubuntu the hostname is stored in both the /etc/hosts and /etc/hostname files. There are several ways that we can change the hostname in these files.

1. Manually Edit the hostname

We can manually edit these files using a basic text editor like nano:

sudo nano /etc/hosts
sudo nano /etc/hostname

In /etc/hostname simply overwrite the existing hostname with a new one. In /etc/hosts you will find the hostname on the line beginning 127.0.0.1 – overwrite only the hostname with the new one, and then reboot.

Editing /etc/hosts using nano
Editing /etc/hosts using nano
sudo reboot

2. Use sed to change the hostname

Another way to achieve the same goal is to use the sed command to replace the existing hostname with a new one.

For example, my Ubuntu Server has the default hostname of ‘ubuntu’.

Use the hostname command to check what your hostname is.

With sed we can look for our hostname (in /etc/hosts and /etc/hostname) and then replace it with the desired new-hostname:

sudo sed -i 's/ubuntu/new-hostname/g' /etc/hosts
sudo sed -i 's/ubuntu/new-hostname/g' /etc/hostname

Reboot:

sudo reboot

3. Write a Bash Script

It’s always handy to have a script to do things – so here is a quick bash script that I put together that uses sed to change the hostname and then reboot:

#!/bin/bash
#Assign existing hostname to $hostn
hostn=$(cat /etc/hostname)

#Display existing hostname
echo "Existing hostname is $hostn"

#Ask for new hostname $newhost
echo "Enter new hostname: "
read newhost

#change hostname in /etc/hosts & /etc/hostname
sudo sed -i "s/$hostn/$newhost/g" /etc/hosts
sudo sed -i "s/$hostn/$newhost/g" /etc/hostname

#display new hostname
echo "Your new hostname is $newhost"

#Press a key to reboot
read -s -n 1 -p "Press any key to reboot"
sudo reboot

Ubuntu Server – Unattended Installation (Custom CD)

ubuntu-server-logo

I’ve lost count of the number of times that I have installed Ubuntu Server on my VMware vSphere box – so I finally looked in to performing an unattended install.

I could have setup DHCP and TFTP servers and done PXE boot from images over the network – but I wanted to work on something quicker than that (and I don’t have that much spare RAM on my vSphere box as it is).

So I settled on re-mastering an Ubuntu Server .iso image. The result is an unattended install, except for the initial boot screen (where I need to select a minimal virtual machine installation anyway).

The following steps were performed on Ubuntu Desktop.

Download Ubuntu Server – I am using the 32 bit version of Ubuntu 12.04.

Open a Terminal and create a directory to mount the Ubuntu Server iso to.

sudo mkdir -p /mnt/iso

The -p switch is very useful as it allows you to create a directory structure which does not already exist (as opposed to creating a single directory).

Change directory to Downloads:

cd Downloads

I renamed my download UbuntuServer.iso.

Mount UbuntuServer.iso to /mnt/iso:

sudo mount -o loop UbuntuServer.iso /mnt/iso

Create a directory and copy the mounted Ubuntu Server files:

sudo mkdir -p /opt/serveriso
sudo cp -rT /mnt/iso /opt/serveriso

The -r switch copies directories recursively and -T specifies no (singular) target directory.

Now we have a copy of our Ubuntu .iso to work on in /opt/serveriso – but we need to make these files writable:

sudo chmod -R 777 /opt/serveriso/

With this preparation done we can start customizing things.

If we look at the isolinux/langlist file we see all the supported languages listed that Ubuntu supports (in an abbreviated format):

am
ar
ast
be
bg ...

I am only interested in an English install so I am going to overwrite the contents of isolinux/langlist with the single abbreviation for English, which is “en”.

cd /opt/serveriso
echo en >isolinux/langlist

This stops the language selection menu from appearing during installation.

The next step of the process is to create a kickstart file – this will provide the server install with the answers to the various questions asked during installation, such as timezone, username, password, partition structure and so on.

Install Kickstart Configurator:

sudo apt-get install system-config-kickstart

Click the Dash button and type kickstart and then click on the kickstart application.

kickstart

Obviously you should customize your settings as you see fit – I have provided mine for reference.

Basic Configuration
Basic Configuration: Set Timezone
Installation Method
Installation Method: Choose the CD-ROM installation method

Boot Loader Options

Partition Options: Add an ext4 partition to the root file system that fills all unused space on the disk
Partition Options: Add an ext4 partition to the root file system that fills all unused space on the disk
Partition Options: Add a swap file system that uses the recommended swap size
Partition Options: Add a swap file system that uses the recommended swap size
Network Configuration: Add network device eth0 and set to DHCP
Network Configuration: Add network device eth0 and set to DHCP
User Configuration: Provide username and password
User Configuration: Provide username and password

Click File, Save File and save the kickstart file ks.cfg to /opt/serveriso.

While using the Kickstart Configurator you may have noticed that the Package Selection screen did not work. Fortunately we can manually edit the ks.cfg file so that the packages that we want are installed during Ubuntu Server installation.

At the end of ks.cfg add %packages and then list the packages that you want installed. I chose to install nano, openssh-server and open-vm-tools:

%packages
nano
openssh-server
open-vm-tools --no-install-recommends

–no-install-recommends installs open-vm-tools in headless mode.

Now we need to configure the CD boot command line to use the kickstart ks.cfg file.

Browse to and open /opt/serveriso/isolinux/txt.cfg.

We need to edit the append line of the default install section at the top of the file.

default install

At the end of the append line add ks=cdrom:/ks.cfg. You can remove quiet — and vga=788.

My append line is as follows:

append  file=/cdrom/preseed/ubuntuserver.seed initrd=/install/initrd.gz ks=cdrom:/ks.cfg

The final step is to create a new Ubuntu Server .iso using this command:

sudo mkisofs -D -r -V "ATTENDLESS_UBUNTU" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o /opt/autoinstall.iso /opt/serveriso

The finished .iso is /opt/autoinstall.iso.

Test your .iso in a virtual machine to make sure that everything works as it should.

The minimal interaction that I need to set my Ubuntu Server install going is documented below:

1. Press the Enter key to confirm the English language selection
Press the Enter key to confirm the English language selection
Press F4, select Install a minimal virtual machine, and then press Enter
Press F4, select Install a minimal virtual machine, and then press Enter
Press Enter to install Ubuntu Server
Press Enter to install Ubuntu Server

From here installation continues without any further input being required.

Sources: http://askubuntu.com/questions/122505/how-do-i-create-completely-unattended-install-for-ubuntu

Windows 8 WordPress Metro App Test

The WordPress Metro App is a good looking tool for posting to WordPress. It has a nice clean minimalist design which is unfortunately only matched by the lack of features.

The app only allows for basic text features such as bold, italic and strike – basic lists – and then text alignment. Add hyperlinks and the ability to add locally stored images and that is it.

I was hoping for more – such as the ability to add images that are stored on wordpress.com, add tags and categories and so on. I cannot switch to HTML view or even save a draft.

There are so many features that I use that are missing that this will probably be the last time that I ever use the WordPress Metro App – which is a shame. I hope that there is some further development for this app as otherwise it is quite nice to use.