Thursday 2 January 2014

Minecraft on the Acer C720 Chromebook

Update 20th July 2015:
Page now updated to work with the 14.04 long term support release (Trusty Tahr) which will last until 2019.

The Acer C720 makes a great little laptop to run Minecraft. As a Chromebook we can't run Java code directly so we are going to install Ubuntu Linux to achieve this.
We have a few choices at this point, how we install it and what version we install but first we need to enable developer mode or we can't install anything.

The bit we are interested in is "To enter Developer mode you first invoke Recovery mode. To invoke Recovery Mode, hold down the ESC and Refresh (F3) keys and poke the Power button. On the Recovery screen, press Ctrl-D (there's no prompt - you have to know to do it). It will ask you to confirm, then reboot into Developer mode. While in Developer mode, your system will show a scary "OS Verification is OFF" boot screen and you need to press Ctrl-D or wait 30 seconds to continue booting."
Note: the instruction to 'poke' just means press normally, as if you were turning on your machine.

Now we are ready to install Ubuntu. We have a choice of using 'Chrubuntu' (a dual boot system where at power on, you choose to boot Ubuntu or Chrome OS) or Crouton (a chroot system that runs Ubuntu at the same time as Chrome OS, similar (ish) to the way Virtualbox allows a guest operating system to run at the same time as the host).
I'm choosing Crouton, simply because my son has had Minecraft freeze when running with Chrubuntu. I've not got to the bottom of why yet, it might be running out of memory, bugs in Minecraft/java or problems with the drivers in use when running native. There's the added disadvantage of no working suspend mode although it's reasonable to expect this to be solved soon.
So, on to Crouton. For details see David Schneider's page at https://github.com/dnschneid/crouton
We have a choice of which desktop version to install, XFCE, LXDE, KDE or Unity. The first two are lightweight (require low memory and processor resources) but in my opinion look a bit dated (without a lot of tweaking) and the C720 is more than capable of running the other two. KDE or Unity? I like KDE's more conventional (ie similar to the windows start button and taskbar interface) approach but I've grown to like Unity and I think it makes a great interface for those new to computers.
To install the latest long term support KDE version (14:04 at the time of writing) do the following.
Download Crouton (get the file from https://github.com/dnschneid/crouton 3rd line down starting with http://goo.gl )
Open a shell by pressing "ctrl+alt+t"
type "shell" then press enter
type "sudo sh -e ~/Downloads/crouton -r trusty -t kde" and press enter
The script will run, downloading and installing, eventually asking you for a default username and password. This process took me around 15 minutes on my 10 Mbit connection.
Make a note of your password. You will need it to install software!

We can now run our chroot with the following command
"sudo startkde" (enter).
You should now see the kde start screen and after a few seconds we have our working Ubuntu ready to play with.
A few tips:
The "Kickoff" button is the blue button in the lower left of the screen where the Start button would be on Windows.
Look in the home directory and it's empty except for the downloads folder. This is actually our Chrome OS downloads folder so this is a handy way of transferring files between operating systems. You might want to manually create the more normal folders such as pictures, videos, documents etc.
We can switch back to Chrome OS by pressing "shift+ctrl+alt+leftarrow".
Switch back to the chroot with "shift+ctrl+alt+rightarrow".
(leftarrow is where the F1 key would be, rightarrow=F2 and refresh=F3) 
Exit Ubuntu by logging off. Press the "kickoff" button, then "leave", then "log out".

If you live outside of the USA, you will probably want to set your locale and keyboard map.
Click "Kickoff", system settings, locale. Click the country tab, select your country and click apply. Click "overview" (top left).
Click input devices, layouts tab, 
Check the "configure layouts box". Click add and then select your desired language and click ok. Select the us layout and click remove.
Click apply. Cllick close.


If you don't have an Minecraft account, switch to Chrome and create one by going to https://minecraft.net/
Go to https://minecraft.net/download and download Minecraft.jar from the section "Minecraft for Linux / Other"

Switch back to Ubuntu where we will move Minecraft to a games/minecraft directory, install java and configure a menu entry.
In KDE, click the kickoff button and type "kons" in the search box and click on 'konsole" to open the terminal application.
Type the following, pressing enter after each line.  Note, Linux commands are case sensitive!
mkdir ~/games
mkdir ~/games/minecraft
mv ~/Downloads/Minecraft.jar ~/games/minecraft
sudo apt-get install openjdk-6-jre
sudo apt-get install kmenuedit

Now log off (press the "kickoff" button, then "leave", then "log out"), wait for the terminal to stop printing text, and log back in again by pressing the "up arrow" and "enter" restarting Ubuntu.

Right click on the kickoff button (two fingered click if using the touchpad) and select "edit applications".
[ If "edit applications" doesn't appear as an option, you will need to install kmenuedit. Open a terminal and type "sudo apt-get install kmenuedit". When this has installed, close the terminal, log out, log back in (restarting ubuntu) and try again) ] 
Click on "Games", click "New Item", type "Minecraft" and click "OK"
In the command field, type "java -jar Minecraft.jar". Note case is important!
Click the "Advanced" tab and type "~/games/minecraft/" in the work path.
Click to select "Run in terminal"
Click "Save" and then close the editor.

Improve the look of your menu item by adding an icon. Search for "minecraft icon", save your favourite (ideally a .png file of around 128x128 pixels) and move it to your ~/games/minecraft folder. Then edit the menu entry and select the icon by clicking on the blank square (menu editor) and browsing to your icon.


Minecraft menu entry
Minecraft menu entry.


You should now be able to run Minecraft from the KDE menu, right click the menu entry to add it to your list of favourites (so it will be listed on the first screen).

Full screen with all the graphical options turned up to full, you should see around 35 frames per second rising to 50 when all the chunks have loaded. You can display the frames per second by pressing the refresh key (press again to remove).
Improve performance by going into the minecraft video settings and lowering the render distance. I find 8 a good choice.


Minecraft up and running nicely
Minecraft up and running nicely.


If this process seems complicated and you are worried you might screw it up. Remember that your Chromebook backs itself up to the cloud so the worst case is you need to restore it from a disk image but your data and settings will be preserved. Details are here. https://support.google.com/chromebook/answer/1080595?hl=en-GB
However as we are running Ubuntu under Chrome OS problems are much less likely than installing a separate operating system.