Saturday, 18 June 2016

Snaps! AH AAAAAAHHH! SAVIOR OF THE UNIVERSE!

Linux Applications: 

If you're a competent Linux user then you've almost certainly got your favorite package manager. If you haven't already picked up from previous mentions in my blog, mine is apt-get. I like apt-get for lots of reasons, I find it intuitive and because it's the first package manager I learnt to use, I've been compelled to learn something else, until now.  

Packages:

When we talk about a package manager, it's something that manages packages such as: updating packages; removing them; installing them and more, depending on the manager you choose. A package is just an application. 

Installing packages

When we want to install a package, we use commands to pull the packages down from a repository, which is just a big storage area on the internet for people to download from. It is also the package manager's job to make sure any dependencies are met. Dependencies basically means, any other libraries that are required for the code to run. Generally in Linux, you only have to install dependencies once, for example:

If 2 programs require the same dependency, they can share and it doesn't need to be installed again.   







Linux Distributions:

Installing packages across Linux distros


Installing packages sounds simple enough, but Linux is everywhere. It runs in cars, home automation systems, and it comes in all different flavors called distributions or distros for short. -Read about my top 5 here http://ehandns.blogspot.co.uk/2016/06/linux-lineup.html - 

Ubuntu, Kali, Kubuntu and Arch are a few, to say the least. If you create a package for Linux, then in theory it should support as many Linux distributions as possible. Sadly due to lots of technical reasons this isn't the case and dependencies is often one of them. Let's use an example from the two Linux distributions mentioned. 

Kali: It comes with some great hacking tools on it. I love the tools, but don't like Kali as a distribution, I prefer Ubuntu.

So, I  add the Kali repositories to my Ubuntu installation, go to install some Kali packages and I'm hit by an error. 






My application in Kali required Dependency 1, version 2 but when I install the same application on Ubuntu, I get an error because my Dependency 1 has version 3; which of course it too new. 

The problem occurs too often:

Although this article focuses on dependencies, there are other factors involved which only add extra complication to the problem. When we create applications and cause a dependency mismatch, it usually gets dumped on the maintainers of that Linux distribution to solve it; this is how lots of distributions become under developed and are left out in the cold. 


A possible solution to the problem:

Looking at the simplified example above you can see the problem doesn't lie with the fact that I have/don't have a dependency, but the version. As I mentioned before, Linux applications will happily share dependencies, so if I have that version on my system, I have it there for a reason and it's really hard for me to tell how many other applications need it. Therefore, removing it or changing it isn't really that much of an option. I could always try and install version 2 alongside version 3 but it would take me forever and would probably take me forever. It's almost certainly going to cause me problems down the line, so this is out, really. 

Snaps! 

A realistic solution to the problem

Snaps are a great answer. Snaps were made by Ubuntu, one of the Linux distributions I mentioned above. To explain how they work, we're going to look at the first image in this article again. 


Instead of sharing the dependencies, we can now package them all together in one bundle called a snap (the image on the right). When we install a snap, everything it needs, is included with it. So if I have one snap that requires a different version of a dependency, no more worrying about it, because I know it's included in the snap. 

This might sound familiar. Sometimes, this sort of process is called sandboxing. Everything within the box is isolated from everything outside the box, however snaps takes advantage of making sure that everything we need is in the box and everything we don't need gets left behind!  

The good doesn't stop there...

Security


Everything we need is inside the snap, or inside a box. As a result, this can actually add extra security when using an application for when we want to do something outside of the box. Like so:

















For the application in the snap to connect to the internet, it will communicate something outside of  the box. It makes it easier for us to control this. It makes it easier for us to control anything that comes out of the box, which adds an extra layer of security. In the next few years, we can work on ways to monitor this, while allowing the user to see exactly what goes on in and out of the snap. Remember snaps is new and it will take some time to develop. We've got a long way to go...

Connecting to the internet is just an example. There are so many possibilities of things we would be able to monitor:
  • Peripherals like microphones, and headphones
  • Network activity / Connections
  • Location information 
  • Reading and writing files
  • Other Operating System functions. 
I think it's fair to say that in the Ethical Hacking world, Linux is high up on the list of operating systems preference and in the future this could help a lot in making systems more secure!

Easier updating:

With a snap including all it's dependencies and their respective versions it means one snap can update, without affecting any other part of the system. When you share dependencies on a Linux system, it's possible that one application will update a dependency that another is unable to support. Putting only what you need in a sandbox, means when you push an update out and you need to update the dependencies, it's only updates the dependency within that snap. Cool, eh?

Easier distribution. 

Previously mentioned, there are so many distributions out there. Proof of that is by how many different distributions have started work to port this to their own operating systems: Arch, Fedora, CentOS and Linux Mint, to mention a few. Using snaps provides me with the knowledge that installing a snap on CentOS is also going to work on Linux Mint. Again, everything I need to run the program, is included in the snap. No fuss. It's similar to downloading an .exe files for one Windows PC, copying it to another Windows PC and running it there but just across Linux distributions instead of Windows PCs. 

There's got to be a downside

All this comes at the cost of bigger files to download. In this day and age of speedy broadband and easy expandable storage, it isn't that much of a problem really; just something to think about. Instead of sharing dependencies on the system, we're downloading them again and and again, every time we download a snap. 

Conclusion: 

For me, I say the downside is well worth the cost for the advantages we get with snaps. It's a new technology and this style of packaging applications has been tried before, but with such keen interest from other Linux distributions, I think it will take off. I know we've got a long way to go before we actually take full advantage of what snaps have to offer. 

Do you think snaps will be successful? Where else would you like to see this kind of technology. Comment below! 

Also, for those of you who don't understand the reference to the title of this post, check out this video. 


Friday, 17 June 2016

Why don't we have 128 bit processors?

Let's start a little bit basic

I'm sure people have heard the terms 32bit or 64bit processors being thrown around. Especially recently in the mobile markets, Apple, Samsung and Snapdragon have hit the markets with their own 64 bit processors. As for your average computer, 64bit computers have been around for quite some time. 

Note: 64bit is sometimes referred to as x64 and in terms of instruction set, sometimes referred to as amd64 (first made by AMD). 

32bit is sometimes referred to as x32 and instruction set x86 (first made by Intel)

In this context, by memory, I'm talking about RAM

Getting data around:

Getting data around from one point to another is usually done by a bus. Like you'd expect a bus gets information (binary) from stop A, to stop B. This is useful for many reasons inside a computer and used for things like peripherals; your mouse, keyboard etc. In this case, will be looking at getting information to the processor. 

The line carries the signals from Stop A to Stop B
 Using the above diagram, we can see there is one line available for information to travel along. This is a very basic representation of a bus. 

We have increased the amount of data we can carry by 4 times now. 
By looking at the picture above, it's easy to understand that we now have 4 lines, 3 extra lines to carry data. In a computer, this is much more complex and today's computer standard have 64 lines to carry data and like the diagram above, they run in parallel. How many lines a bus has to carry data, is known as the bus width. The bus width is key in determining the processors performance. 

The Arithmetic and Logic Unit

Now we know about buses, we can go back to looking at processors. A fundamental part of today's processor design is the Arithmetic and Logic Unit, usually shortened to ALU. The ALU processes maths and logic, basically. Maths is processed in form of binary and logic is processed in forms of gates, built into the processor.  Nearly all operations that go on in a processor, use this unit. 

When we run a program, we store information in memory and the ALU has access to this, to get information like operands. Operands are just pieces are just two bit of information we use, do some a sum. The image below should help, if you're confused. 


The ALU will communicate with the memory by a bus. 

Let's take a blast into the past

32 bit processors

If you're using old hardware or mobile hardware, it's likely that you're using a 32 bit processor. Up until a few years ago, I was quite happy using my Pentium 4 processor. To explain why we don't have 128bit computers, it's easier to understand by looking at the developments we made and in the past and some of the reasons why we did. 

So, why the upgrade from 32 bit to 64 bit? 

Memory Addressing: 

Memory addressing allows computers to refer to an exact bit in the computers memory. 

32bit processors use a bus, with a width of 32. See the connection? A 32bit processor has a bus width of 32. We know the ALU will fetch operands from memory using a bus, so let's see this in a graphical representation. 

This is just a graphical representation in simplified form. This isn't necessarily what happens, but I've put it here to help

Now, we have to do some maths to understand why a bus width of 32 is actually a limitation for the amount of memory addresses we can access. with a 32 width bus. 

Remember computers work on binary with either a value of 1 or 0. Binary works on base/radix 2, which is where the 2 comes and we're seeing many memory addresses we can access using a bus width of 32. The calculation is below:
2^ 32 = 4,294,967,296 

Now, we need to covert this to GB as that's the common unit for measuring memory

1 GB = 1,073,741,274 bytes
so...
4,294,967,296  /  1,073,741,274  = 4.000002 GB

Conclusion: with a 32 width bus, we can only can address 4GB of Memory

Back in the days of 32bit processors, 4GB was more than capable. Especially when you consider that Windows XP would run on 512MB. By to days standards, we are seeing systems coming out with 16GB of RAM and all the way up to 128GB. The answer to being able to use more memory is 64bit computing. 


The upgrade to 64bit

If you haven't cottoned on to the pattern, 64bit processors use 64 bit buses. Now that we understand the basic principles and the calculation, we can run the same calculations again to see the outcome of how many memory addresses we can reference:

2 ^ 64 = 18446744073709551616

Again, let's convert that to GB for context

1 GB = 1,073,741,274 bytes
so...
18446744073709551616 /  1,073,741,274  = 18446744073.709553 GB

Conclusion: the maximum addresses a 64 width bus can handle is a lot

Lots of today's modern processors wouldn't even be able to support the full amount of RAM that 64bits has to offer and often gets limited. If you're interested in how much your processor can handle, you should look up the specifications of your motherboard and processor online. 


Putting this into context: 

There is no system that even supports that much RAM. Why make a system unnecessarily at so much extra cost, with no benefit for memory addressing. A 128bit processor would be able to handle so much memory that even I can't fully comprehend the maths. We're talking about 
1.8446744e x 10 ^19 GB of memory. 


More processing power? 

When we talk the WORD length of a processor - we talk about how many numbers it can processes at any one time. Let's look at our basic maths equation again. 


When the computer gets an operand, it loads it into something called a register. This is how the processor stores it. On a 64bit processor the WORD length is 64 bits and on a 32bit processor it's 32 bits. Therefore there needs to be registers in the processor with a 64 bit size. 

If we need to use a number that can't fit into a 64bit register, then the processor in laymens terms, will just 'split' it so it will fit in the register. Yes... processing it as a whole bit of data would be faster. 

So, it is faster! 

Yes, the ALU in the processor would process larger numbers faster, but there are very few situations where this would actually be useful. Actually, in my degree, Ethical Hacking and Network Security processing numbers faster would help us do things like brute force attacks faster. However in common computing it doesn't. Like I mentioned at the beginning, the mobile market is only just reaching 64bit. 

It comes at too much of a cost

Upgrading our systems to 128bit would involve a lot of work. We'd need to increase bus widths, have bigger registers and it's hard to justify it when you don't need it. All of this requires redesign, research and development as well as extra silicon. 

Why don't we have 128bit processors

  • There's no need for the extra memory addressing
  • We'd have to increase the bus widths and processor registers, which would be expensive
  • The added processing advantage isn't that big of a deal by today's standard
I hope this answered the question! :) 


Thursday, 16 June 2016

The Linux apps I can't live without

Introduction:

Linux is good for lots of reasons, but one of the main reasons is the amount of apps that are available to install. Lots of them I'm sure the causal PC user wouldn't have any use for, but for me, sometimes they have got me out of sticky situations.

1. htop

I'm sure you all have your own activity viewer to monitor what's really going on, but my personal favorite is htop. It's nice and light and the use of color makes it more visually pleasing (and easier!) to use. It doesn't require any desktop environment to run either; just open up a terminal and type 'htop' 

The use of color makes it easier to look at and the shortcut prompts at the bottom help
want to use htop? use sudo apt-get install htop to get it. 

2. Nano.

When it comes to text editors, it's somewhat of a preference. I like Nano because it's nice a simple. A little part of me feels guilty for opting for an easy text editor, but it just saves time. Like htop, it comes with a list of commands at the bottom, all of which require the cntrl key, so no closing files by accident. Again like htop, it's doesn't require a desktop environment and it's nice and light, if you're using a Raspberry Pi or the like. 

Great for a terminal enviroment

If you're running a fairly  mainstream Linux, you can use sudo apt-get install nano 

3. Idle

It's hard to come across a Linux distribution that doesn't include Python. It's somewhere quite high in the list of languages used around the world. I often find when copying Python files around you loose the formatting and something an other gets mucked up. Idle, made by Python, allows for easy formatting and proper indentation. Unlike some text editors it also will help point out your error in code and save every time you run it, stopping you from losing all your hard work. 

Idle also allows conversation mode in python, which allows you to just text snippets of code
sudo apt-get install idle

4. lm-sensors

If you're worried about the temperature your CPU is running at, this is the answer. lm-sensors has support for lots of sensors, so it's unlikely you're computer won't be supported. To use the application, you just need to let it scan the sensors on first run and then type sudo sensors to view tempreture information. 


sudo apt-get install lm-sensors

5. GCC

For the people who use C++, I admit that there are a lot friendlier development environments but I like this again, for when I'm using a Raspbery Pi and I want something from the terminal and is lightweight. It's got lots of libraries included with it, which makes it a handy tool. 

THIS IS NOT WHAT GCC looks like, but it's just a basic terminal application

6. GIMP

GIMP is a great application for image editing. It's about a 50Mb download, which keeps it nice and light on the hole. It's feature packed and I've never had to use anything else since. It's a great way to touch up photos and you don't particularly need to be a pro to use it. It's useful in a wide variety of situations and comes with lots of nice fonts.


sudo apt-get install gimp

7. DKMS - is this actually an application?

DKMS is one of those tools that you only use when you actually need it. I'm not going to write too much about it, as most of my original understand actually comes from this link here.


It's great if you need to install a driver outside of your kernel - it actually got me out of a mess recently with Intel Audio. If you don't have to ever use it, thank yourself for having easy hardware support ;) 




Wednesday, 15 June 2016

Linux Lineup.

The Dell Latitude E5440:

This laptop being an enterprise machine from Dell, it meant it came with support for Ubuntu 12.04 LTS. This has made it fairly compatible for any Linux Distribution that you want to put on it. Inside, I have upgraded to a 250GB SSD with a 4th Gen Core i5 paired with 8GB of RAM. Not the newest specs, but enough to make a fair comparison. 

1. Kubuntu 16.04


Kubuntu has come a long way since it's predecessor versions. For me, looks is important and the new Plasma is very easy on the eye. Not only that it looks good out of the box, but it really open for customisation - it's easier to download themes and icon sets without any of this extracting them in a folder business. 

On a performance side of things, I've not experienced any lag or stuttering. RAM management is great, as expected with any Linux. Kubuntu is just an all round winner for me; it's snappy, looks sleek and has some really useful tweaking features built in. 


2. Linux Mint - Cinnamon

Not my screenshot. Cinnamon edition is basic and simple, for some people that works. 

Linux Mint is all-round great and with all the flavours it comes in, your bound to find one you like. On their website, you can download it with KDE, Xface and Mate environments. If that hasn't already gotten your attention, my favourite thing here is the amount of widgets that you can put on your status bar. Although that being said, it was touch and go with some as some do crash. As an interface, I didn't find cinnamon making me go 'wow' but it's good if you like simple. Battery life was great and a little bit better when compared to Kubuntu and an extra half an hour could make all the difference. 

3. Ubuntu 14.04 LTS

As you can see by the system specs, this isn't a screen shot I did

Straight out of the box, you can see that Ubuntu a nice design. Although 14.04 isn't actually the current LTS release, for some reason, my laptop refused to update to 16.04. It's a nice experience and you've used Ubuntu before, there isn't a huge change. It's clear to see that the software is full of Amazon Marketing when you use the search feature (as it also searches the item in the text field on Amazon) but I think that's an okay exception when you realise just how good and helpful that search tool is. If you want to tweak the environment, you'll end up needing to download unity-tweak-tool, I can see this prevents people from fiddling about with things they shouldn't. I often think that if my Mum woke out of bed and exclaimed she wanted Linux on her laptop, I'd give her this; it's so nice and easy to use. 

Download link (to the latest LTS): http://www.ubuntu.com/download/desktop

4. Xubuntu

Don't use this distribution if you're scared of mice

If you're looking for the balance of compromising features for a small lightweight OS; this is it. Xubuntu is a stripped down version of Ubuntu above. The system consumption is nice and low and I use it as a daily driver regularly on my Chromebook. Sure, it's pretty basic and it doesn't really come with that much, but that pays off if battery life is you thing. I'd use this on machines that don't really have a lot over power in them and are quite dated. 


5. Apricity OS - Gnome

Taken from the Apricity website
I've got to be honest here, this only just makes the list for reason: it's looks. I haven't come across anything that looks as pretty as this. For me, that comes at too much of a cost for my everyday use as its base is Arch Linux. Again, like Kubuntu, Arch has come a long but it comes with a completely different package software that makes no sense to me. If you're used to your normal 'apt-get install' install command, then using PacMan might be a little tricky. Of course, if I could be bothered to learn how to use it, with the rest of Arch, it would probably make number 1. 

Download link https://apricityos.com/

6. Cloudready


The blue chrome symbols  show the open source version of chrome unlike the usual colours
Cloudready is basically chromium, the developers version of Chrome-OS. I don't find Chrome-OS a useful OS from a Linux perspective. It lacks tons of features and limits you to what's available in the Chrome Web Store. You get a few inbuilt commands like top, ssh and bash shell, but not a lot else. It makes the list as it's so simple to use, being a glorified browser and all, and is good on the battery life front. If you have some really really old hardware, like back when Miley Cyrus was Hannah Montana - this is probably a good choice.

Download Link: http://www.neverware.com/#customerquotes

Got any other suggestions? Comment below: 

Review of the Chromebook C730










Just to clear things up, so people don't get confused; this is a review of the Chromebook C730-C8T7.

Why?

Why a review of a device that is seriously outdated and under-specced by its successors? Well, truth be told this is my first tech review and it made sense to do it about a device that actually changed my opinion, the more and more I used it. Plus, for some crazy reason, it still is being sold on sites like Amazon, Ebay and others...

So...

This device ships with Chrome-OS. For those who don't know what it is, it's the famous Chrome web browser... and that's it. All the extensions and themes work, but that's basically what you've got to play with. They've tried to make it a lightweight OS by building it on top of Linux and well... on this machine it's a bit 'urgh'. We'll come back to the software in a bit, so lets focus on the hardware

Hardware:



Processor:
The processor that ships with this in the Intel Celeron N2840, with a maximum clock rate of 2.16Ghz. While my first impression was to cringe at the thought of using a Celeron, they've come a long way in the last few years and albeit a bit sluggish, it's not an overly unpleasant experience. With a maximum TDP of 7.5W too, this meant Acer skipped putting a fan in and just opted for passive cooling. There are far better processors out there and some manufactures have opted for using higher end processors like Dell's that uses an i3. All at the sacrifice of cost, however. 




Graphics:
I only write this after the processor section as this uses Intel's integrated graphics solution.  On a basic page, you're fine but when you start using pages that run a lot of active graphical content (like Facebook) you'll see lag and stuttering. The only way this could have been rectified is to have used a processor with better integrated graphics. 

Display:
With an 11" screen with a resolution of 1366 x 768 pixels, using it to watch movies is quite nice. I've never been one to particularly fuss about screens. Viewing angles aren't great, but I've been able to sit outside on a sunny day and use it comfortably. Colour production is adequate for it's intended uses too. Sure, it's not full HD but on an 11" screen, I think it's enough. Cheapness is this devices selling point. 

RAM:
For me, this is the device's biggest failing. It uses 2GB of lower power DDR3 RAM. It just isn't enough. A couple of tabs open is enough to crash the machine, while running Chrome-OS. You'll get a horrible experience switching between tabs. Thank goodness I've used Google Sheets (which saves automatically and often) otherwise I would have lost a fair few amount of documents. Even those who have their Chromebooks in developer mode and enable SWAP memory, will still suffer. 

Battery:
With low power RAM, a not very powerful processor and small display, this is where this Chromebook shines. You can easily get 2 days out of this thing and when you start playing with brightness even more! When opening up this model, I immediately noticed that half of it is battery. There again, battery life is usually the main point of buying a Chromebook. For those who are interested it's capacity is 3220mAh.

Connectivity:
It was nice to see an Intel AC wireless card. AC does not stand for air conditioning, it's the latest standard in WiFi, allowing you to get speedy connections. I've not done any benchmarks on the speed, but did not expedience any problems while streaming Netflix or remote sessions. Of course, that also depends on your internet speed. Coupled with the wireless is Bluetooth, in case you need to hook up a wireless keyboard or speaker. I often used my Chromebook for listening to Spotify through a bluetooth speaker, again, with no problems. Being a light portable, I wasn't that surprised to find a lack of ethernet port, not that this is a problem, just something to bear in mind. 

At 11" this device is extremely portable
On the back of the device, there's a full size HDMI for hooking up to an external screen. To the left a USB 3.0 port and the right hand side of the device USB 2.0 with a 3.5mm headphone jack. All pretty standard really. 

Storage: 
The device comes with 16GB  of eMMC storage, if you're using Chrome-OS, because of the size it will periodically clear your Downloads folder, so watch out! Most Chrome-OS devices come with an offer for Google Drive space and the file explorer quickly allows you to drag and drop stuff to the cloud, so for large files either use that or a USB drive. Something I would have liked to see here, is a built in method for connecting to local network drives (like my NAS) but instead I had to use an extension that didn't really work well. 

Software:

Like I said before, the device ships with Chrome-OS. With the default settings, gets an update almost weekly which will often require a restart. No pushy messages making you install it, which is nice though for the purpose of security, you should install updates as soon as they come out. If you've used chrome then there's no learning curve here. 

In the bottom left of the screen, you get a launcher for your Chrome extensions installed. The right gives you you're status icons, similar to Windows. The software is intuitive. It's really designed to be easy and fast and that's all I feel there is to say about usability. 

I really feel like this is what pulls the device back. Of course there aren't any simpler alternatives now, so it's what the industry is using. Even in Developer Mode (the tech-savvy-mode) it would have been nice to see apt-get and some other useful Linux utilities. When I've used the terminal on this machine, it feels like I'm using a useless Linux machine - what's the point of using Linux if I can't customise it and use apps that I want? 

So, I ditched Chrome-OS

This is where I started enjoying my device. I wiped ChromeOS and installed Linux. If you want a guide on doing that, I'll post a link. In return, I got a lot of things:
Noot..noot noot noot (to the Intel tune)
  • I had a device which I could store movies on and not worry about them being deleted. In fact, I could store about 4 movies at any one time. 
  • The ability to have utilities that I wanted like: nano, nmap, the Spotify client
  • Better RAM management - I was able to install Chrome within Linux with multiple tabs and still only be using just over 1GB of RAM
  • More security - I was able to use LVM hardware encryption
  • Just a better overall experience
If you're tech savvy and have this Chromebook, I seriously recommend doing this. I was able to make good use of the hardware and this is where my thinking of Chrome-OS  being a bit 'urgh' comes from. It seems as if Google are missing something. Maybe there will be updates in the future that solve some of these problems, but you don't get that impression when Chromebooks today are coming out with better hardware to accommodate a more power hungry Chrome-OS. 

Summary:

I just wouldn't buy one. I see it as a cheap computer that Acer have tried to make, but for my tastes it is just that bit too cheap. Especially when it's usually the case for ~£50 more you could be getting something with a big improvement on the hardware front. To add to that point, I never bought mine; I was given it to me by my university. If this review has been helpful, feel free to post any comments of ask questions! 


Thursday, 24 March 2016

The final semmester of year 1

Sad face :( 

Who would have thought 21 weeks could go so fast.

Happy face :)

Despite our ever so slightly cramped time frame and manic rush to get a powerpoint together, it seems the group and myself did it. Our presentation had lots of useful goodies, such as hacking techniques, digital forensics and HMAC... no doubt some of this will appear on my blog a little later.

It's been a little cray cray, but I've learnt a lot. I ended going from somebody being scared of linux, to somebody who uses it as a daily driver. Sure, if you're stuck on combersome windows, it's a change but a well worth it one.

I've learnt not to push to the main thread of github repo without checking the code works first... oh and on that note, I also learnt the hard way writing notes helped. I got so into some code (without commenting) it was easier for me to rewrite the whole program that actually work out what the heck I'd written.

Backup. Backup and Backup. So when your BRAND NEW £1300 laptop HDD dies, your things are quickly accessible. FYI - think twice before getting an MSI laptop too.

Never rely on a Mac in an important presentation, it probably won't work. Just... don't rely on a mac (if it works, it probably is only useful for drawing pretty pictures)

Question your lecturers. Unless they give you nasty looks.

Oh. And have fun in the first year.

Monday, 21 March 2016

Installing native linux

Installing linux on an Acer Chromebook C730

Any Linux user can usually recommended it for it's super efficient CPU usage and RAM usage ... and even if you can't, because it's linux, you can usually do some fine tuning.

Those of you who have installed linux natively, good job, but lots of us are stuck with using crouton. There's nothing wrong with that, but this usually involves a laggy chromeOS experience and your crouton Linux install can eat into your RAM. When you've got a chroot running with a GUI, you're only left with about 1GB of RAM to play with on either side.

This is where running native linux comes into play. Don't for a minute think you're making a sacrifice in doing this, you've still got access to chrome so all those chromeapps and themes you used are still available. Plus all the other goodies that come with linux!

I'm sure if you haven't got a C730, your steps aren't doing to vary that much, but I'm not responsible for anything.... even if you're trying it on a C730.

Prerequisites:

  • Access to a Windows PC 
  • Developer Mode enabled
  • A USB thumb drive (4GB or more is recommended) 
  • Your write protection screw removed (google for a guide)
  • Common Sense
  • A little bit of luck
Getting started:
If you're running a C730 and you've tried to running linux, you've probably guessed the reason for crouton is because the BIOS that ships with these laptops doesn't support booting off a USB. We need to remove the write protection screw and flash a new BIOS to do this. 

PREPARE TO LOSE YOUR CHROMEBOOK DATA

Flashing the new BIOS: 

We are basically going to follow this guide here

  1. Hit Cntrl+Alt+T to get to a developer shell
  2. Type 'shell' to get to a shell
  3. AGAIN, I AM NOT RESPONSIBLE IF THIS DOESN'T WORK
  4. Use this code:
cd; rm -f flash_chromebook_rom.sh; curl -O https://johnlewis.ie/flash_chromebook_rom.sh; sudo -E bash flash_chromebook_rom.sh

(I found it easier to seperate each command, depending on your configuration, some may not be necessary)


Using the code above will give varying outputs, depending on your model. For my C730, I hit option 2. You basically want the option that mentions about modifying. This script tends to be fairly self descriptive on how to use when you first run it. 

You should see the message mentioning if this has worked, you should successfully be able to restart. It's a lie, so now is the time to get everything you need off your chromebook. Make sure you can access this guide on your secondary computer accessing windows as your chromebook is going to be out of action for a bit. 

DO NOT PANIC! 

You will probably certainly find your chromebook no longer boots into ChromeOS. However, when you turn it on, you should now get into SeaBIOS. You were warned you'd lose everything. 

Creating a bootable linux USB:

Switch to your Windows PC :) 

Next we need to create a linux usb. Now, I highly recommend Rufus or anything that will use a DD imaging process, which copies sector by sector. If not, you may get an error saying a live file system can't be found. I went for Rufus; it's free and easy. You can grab it here. 

It should take no installing and should just run. It may ask to check for updates, select as you wish. When you get into the program, you should see the little image of a disk (right hand side, half way down the window). Hit it. 

You may want to do some Googling about what distro you like best. I know arch works, but right now I'm using GalliumOS for several reasons:
  • Nice graphical install 
  • Based on Xubuntu
  • Uses XFCE. 
  • Based for ChromeOS hardware and included patches that other distrubutions might not. 
  • Grab a link here
UPDATE: Gallium is the only OS I've tried that has full support for key mapping and touchpad for the c730. Gallium also comes with a pre-configured powertop to get the most juice from your chromebook. 

Select your downloaded ISO in explorer window and hit okay. Rufus will do the rest of the options for you. When you click start, Rufus will mention something about grub, just click okay. When it asks you about the mode you want to write in, select DD. You'll find this is the one below the recommended option.


Installing linux:

This bit is a little tricky. I found my chromebook to be very temperamental. I suffered keyboard freezes or no response, not seeing my USB drive or skipping to boot to the first HDD. 

If you experience this problems, it a bit hit and miss, but it's an art. Here are some things that worked for me:
  • Booting with the USB in and then doing a cold shutdown
  • Doing a cold shutdown
  • Putting my USB stick in quickly after boot
  • Going full crazy and hitting every key on the keyboard
  • Crying (it helps) 
Depending on the distro you selected, your install process will be different. Gallium is very nice and smooth. When you come to the time where you select what disk to install on, it should be easy enough to work out which disk it is by size. Select 'Use the whole disk option' which will overwrite the existing chrome installation. 

Problems:
If you have problems, Google is probably your first port of call. I'm not expert and these are the steps that worked for me through experimenting. It's easy to ruin your chromebook or brick it, so bear that in mind and don't rush the process or you're playing with fire. If you can't find anything or need any of the steps clarified, feel free to comment below.