Reverting VirtualBox Guest Additions 5.0.22 on Ubuntu 16.04

Earlier today I upgraded my installation of Virtualbox on Windows 10 from 5.0.20 to 5.0.22. This also came up with an update to the guest additions which I installed into my Ubuntu 16.04 guest machine.

After a reboot Ubuntu would no longer boot and instead would flicker as it tried to change the screen resolution inside the virtual machine. This is a known problem in VirtualBox (see: https://www.virtualbox.org/ticket/15526).

I’ve managed to revert VirtualBox and the guest additions back to 5.0.20 using the following steps:

  1. On the host OS (in this case Windows 10) reinstall VirtualBox 5.0.20 over 5.0.22 – this was straight forward, I found the old installer in my downloads directory.
  2. Open VirtualBox and start the Ubuntu guest machine, immediately hold down the left shift key. This must be done before the purple splash screen.
  3. At the grub menu that loads select “Advanced Options for Ubuntu” and then select the second menu entry. This entry should contain the word “upstart”.
  4. Once Ubuntu has booted to a console, login.
  5. Switch to the currently installed VirtualBox guest additions install directory
    cd /opt/VBoxGuestAdditions-5.0.22/

    and try and run

    sudo ./uninstall

    I didn’t have much success with this.

  6. Insert the guest additions CD from VirtualBox’s top menu bar.
  7. Mount the CD Rom: 
    sudo mount /dev/cdrom /mnt/cdrom
  8. Switch to the cdrom directory
    cd /cdrom
  9. Reinstall the old version of the guest additons
    sudo ./VBoxLinuxAdditions.run
  10. Reboot Ubuntu and everything “should” be fine.

Completely destroying all data on a Hard Drive

A few days ago while clearing through some old boxes of computer equipment I discovered an old hard drive. This drive had been removed from an old computer that had been disposed of. At the time of disposal I copied all information from the old computer its replacement and kept the old hard drive as a backup in case something went wrong.

Now more than five years later I no longer need the backup and want to dispose of the physical hard drive. But first, I want to ensure that the drive is completely clear of the old data. Connecting the drive to my current computer it can still mount and read the old drive and I can see all the old files on it. It’s good that the backup has lasted this long but to completely wipe the drive of all this old personal data is a little more complex than just selecting all the contents and pressing the delete button or doing a reformat under Windows.

Completely destroying all data on the drive is important. If the drive is not completely wiped (that is every single physical sector on the drive is written over) it is possible that someone using a few pieces of software could bring the old data back from the dead.

To completely nuke the drive I could pay for commercial software or take a hammer to the physical drive. But there is a free way to nuke the drive by using Ubuntu Linux and it’s quite simple to do:

  1. Boot Ubuntu (running from a live CD/USB should work too)
  2. Find the full device path of the drive you want to destroy by running at a terminal:
    sudo gparted

    If you don’t have gparted installed, then install it using

    sudo apt-get install gparted

    Then on the right hand side of the GUI window select from the drop down list of hard drives and check the partitions of each one to confirm the path of the device that you want to nuke is. For instance:

    /dev/sdN
  3. Shred the drive using the following command, replacing the path with the path you found in step 2.
    sudo shred –vzn 1 /dev/sdN

    This command will take a while to run. It will go over the entire drive writing random data into every single physical sector of the drive and then a second time writing zero into every single sector.

Once the command has finished your drive will be completely wiped. It can now be reformatted and reused without any worry about someone being able to resurrect the previously deleted data.

Hacking Ubuntu on a Chromebook

In a few weeks time I’m going to be doing a bit of traveling for work and then a small holiday. As I will be hoping on and off planes and trains, I’m not really keen on taking my primary laptop as it is bulky and not really designed for travel.

After tossing up the pros and cons of tablets, netbooks, and ultrabooks I have bought a Acer C7 Google Chromebook and have managed to get Ubuntu 12.04 running inside a chroot environment. The whole process of getting Ubuntu installed has been much simpler than I was expecting.

For under $300 I now have basically a full lightweight system for travel on which I can watch videos, play music, edit documents, edit photos, and browse the web. While the basic Chrome OS operating system claims all these features, the reality is, it is extremely limited in what it is actually able to do.
Continue reading “Hacking Ubuntu on a Chromebook”

Bumblebee, Optimus, Hybrid Graphics, and Ubuntu

For the last year or so I have been struggling with my laptop overheating under Ubuntu. Upon upgrading to the latest beta of Ubuntu 12.10 I have managed to completely solve the heating problem and as a result increased my battery life by more than an hour.

Two different problems have caused the heating problem. The first, a power-regression bug on i7 processors was resolved in Ubuntu 12.04 with an updated kernel.

The second is caused by the Nvidia Optimus Hybrid Graphics card in my laptop not being properly controlled by Ubuntu. Problems with Hybrid Graphics under linux are well documented and there are quite a few different “solutions” available, however, I have been unable to get any to work until now.

A few months back I installed the Bumblebee project, and despite the packages successfully installing, the hybrid graphics card never worked and battery life remained terrible.

Upon upgrading to the latest Ubuntu beta I noticed a problem in the logs during the install of one of the bumblebee packages: bbswitch-dkms

The package would “successfully” install, however, the terminal output would show that the kernel module was never built.

The problem lies in missing kernel header packages. While the Ubuntu Wiki pages do not detail any requirement for the installation of kernel headers other sites do, however, these other sites only focus on the kernel headers for the currently installed kernel. And, if you update the kernel without new headers, it is possible that the kernel module will no longer work and the overheating problem will return.

This is how I setup my system so that I would always have the latest official Ubuntu kernel and headers with bumblebee working:

1. Install the linux-headers-generic package:
sudo apt-get install linux-headers-generic

2. Setup the Bumblebee PPA:
sudo add-apt-repository ppa:bumblebee/stable

3. Update the package information:
sudo apt-get update

4. Install the bbswitch-dkms package:
sudo apt-get install bbswitch-dkms

Before moving on make sure that the output from the above command shows that the module was successfully installed.

5. Install the rest of Bumblebee:
sudo apt-get install bumblebee bumblebee-nvidia

6. Restart and then test if Bumblebee is working:
a) glxgears
b) optirun glxgears

The second command runs the opengl test using the Optimus graphics card and the output in terminal of the FPS should be much greater than the previous command. Bumblebee should now be successfully installed and you should notice a large decrease in CPU heat and an increase in battery life.

In my opinion during the install of the bbswitch-dkms package a check should be made for the required kernel headers to build the kernel module, if the packages aren’t found a proper error and suggested solution, such as the installation of the headers package should be suggested. A silent fail that keeps the rest of the installation running only provides the end user that false hope that things are working fine.

Recovering from Grub Rescue after upgrading to Ubuntu 11.04

Over the weekend I upgraded one of my computers to the new beta of Ubuntu. Upon restarting the computer I got dumped into grub-rescue with the message missing-xputs. Part of the cause of this was having Adobe CS3 installed in my dual boot with Windows 7.

When you install Adobe products a little DRM program called FlexNet gets installed into your boot sector which is also where grub resides. When grub is upgraded along with Ubuntu it flicks a warning about the FlexNet being in the sector but then continues to install. However, when you restart grub will not run and will be unable to boot your system into either Ubuntu or Windows.

The following instructions is a result of about five hours of googling, reading forums and talking to other linux geeks. The following commands should take about 15 minutes to complete.

This is how I got my system back:

Warning: I cannot gaurantee this instructions will work on your computer. Please read them all before continuing and take extreme care. I am not responsible if these instructions result in corrupt data or the loss of system functionality.

1. Boot to the LiveCD Desktop (Ubuntu 9.10 or later). Please note that the Live CD must be the same as the system you are fixing – either 32-bit or 64-bit.

2. Open a terminal

3. Determine your normal system partition

sudo fdisk -l

4. Mount your normal system partition:

sudo mount /dev/sdXX /mnt
Example: sudo mount /dev/sda1 /mnt

5. Mount the critical virtual filesystems:

sudo mount -B /dev /mnt/dev
sudo mount -B /dev/pts /mnt/dev/pts
sudo mount -B /proc /mnt/proc
sudo mount -B /sys /mnt/sys

6. Chroot into your normal system device:

sudo chroot /mnt

7. Attempt to install grub

apt-get install grub-pc grub-common

During install a warning should appear about FlexNet being in one of the sectors. In my case it was sector 51, others have reported it in 32 and elsewhere.

8. Purge grub

apt-get purge grub-pc grub-common

9. Remove the flexnet sector

dd if=/dev/zero of=/dev/sda bs=512 count=1 seek=X

Where X is the sector number grub-install warned about, in my case 51.

10. Reinstall grub

apt-get install grub-pc grub-common

11. Exit chroot

CTRL-D

12. Unmount

sudo umount /mnt/dev/pts
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt

13. Reboot

sudo reboot

Further References:
https://help.ubuntu.com/community/Grub2#Reinstalling%20GRUB%202
http://ubuntuforums.org/showthread.php?t=1661254

Ubuntu 10.04 Lucid Lynx First Impressions

Sometime in the next 24 hours Beta 1 of Ubuntu 10.04 Lucid Lynx will be released to the world. This version of Ubuntu is different from the previous few versions for two key reasons the first is that it is a long term support release and as such will be [hopefully] more stable and more complete than other versions over the past year. The second change is in the user interface with a step away from the established brown “human” theme to a new theme that looks very Mac OS like.

For the last two days I have been running the daily build of the AMD64 release candidate for 10.04 Beta 1. So far I am very impressed with it. For the past year I have been running 9.04 as the 9.10 release in October of last year broke support for my laptop’s wireless drivers and would cause frequent lock ups. I am pleased to report that those crashes are a thing of the past in 10.04.

The Good:

  • Fast boot. 9.04 was a massive improvement in boot time over 8.10 and I am surprised to see even more of an improvement in 10.04, from BIOS to logged in would be around 20 seconds.
  • Stable. Sometimes Beta and Test Releases of software are so buggy that they are not even able to be fully tested. So far I have hit a few minor problems but by far I am very impressed.
  • Smooth. The x64 version is very smooth at booting, opening and closing windows, applications, etc. The entire operating system runs quietly and quickly.

The Bad:

  • Crash errors that are almost as cryptic as Windows BSOD and illegal operations. I have had two programs crash and both times the crash errors are just strings of numbers or error codes with no meanings or descriptions. It is very hard to even supply information on a bug report when you have no idea what went wrong, one minute it was working the next it isn’t.

The Ugly:

  • Video Drivers. I am running an ATI Raedon HD Video card and there are no free or propriety video card drivers at the moment. This means that any 2d or 3d video rendering is done through MESA software rendering and is very ugly. I hope this will be sorted out in the final release (and the current bug where if you try to install the old fglrx library aptitude will try to remove ubuntu desktop).
  • Software Install. If you want to install Ubuntu (and community) released software this is a breeze through the Ubuntu Software Manager but the instant you want to install any other piece of software you will need to go through the whole process of getting the source code, resolving dependences, compiling through the terminal sorting out linking errors and a whole lot of other nasty mess.
  • User Experience. Despite the new version of Ubuntu looking very pretty and running very fast it still fails badly in terms of user experience for your average user. Ubuntu is meant to be linux for human beings but I am still finding it linux for those people who want linux to work and have some computing knowledge for how to fix things when they go wrong and also have a linux geek to really fix things when they completely corrupt. Until vendors start releasing fully stable and supported drivers for Linux and there is a software install process for third party applications that works nicely through a simple GUI and not old fashion command windows Ubuntu and Linux in general will continue to only attract nerds, geeks and people who like to break things. I like Ubuntu for its speed and ease of use in a office/development environment. But when I am at home on the weekend I live in Windows. Things just work in Windows – fonts render correctly, most software now plugs and plays correctly, most music and dvds will just play, software is simple to install etc. Now I do not want to start a paid vs free software argument but just because it is free should not mean you need a whole lot of computing knowledge to get your email every morning.

Adventures in the land of building Google Chrome OS

Okay I have now been working through the process of building Google Chrome OS for a little more than 12 hours. My main desktop computer has been on all night trying to sort out the development build environment so the code can be compiled. It does not help that we went over our data cap a few weeks back and are stuck on 64k internet until mid next week this makes downloading the required files ultra slow.

The build instructions provided by Google so far are quite clear and straightforward to follow. However, they are not very detailed. There are no timings for each step of the process or information about what each step does. So far I have downloaded the full source code (270mb) at uni so I would not have the dial up speed internet problem. However in order to compile the code it is required a strict development be provided. As such the compiling script creates a debootstrap environment virtualizing a minimal Debian OS. While this is a cool feature designed to ensure every build remains consistent it is a pain that this is not explained before the start of the process because the amount of data required to set this up is a lot more than the entire source code for the operating system.

Because the process of building from scratch is so long there has been a build snapshot uploaded onto The Pirate Bay. This is a good idea and I have seen on a few blogs comments that Google should be releasing a nightly build snapshot of the compiled OS. While this takes away the fun of building from scratch it does make testing the OS a lot more accessible. It is something I hope Google implement soon.

Hopefully my next blog on the OS will be a little more positive and lot more further down the building track.

Google Chrome OS goes open source available now

I have something to play with over the weekend.

Around two hours ago Google released the source code to their new operating system.

I am going to download it later today and will set about compiling and organising the installation of it.

For more info: http://googleblog.blogspot.com/2009/11/releasing-chromium-os-open-source.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+blogspot%2FMKuf+%28Official+Google+Blog%29&utm_content=Google+Reader

Thoughts on Google Chrome OS

It was interesting returning to Auckland on Thursday night to find out that in the past few days the world has completely changed. Yes Google has finnaly let the cat out of the bag (but I think it actually escaped months ago) that it was developing an operating system to rival Windows.

Google Chrome OS is not planned to be released until late 2010 however the source will be released later this year (so in some ways you could start using it later this year). The full announcement is here: http://googleblog.blogspot.com/2009/07/introducing-google-chrome-os.html

The points that I am most interested in are:

  • This is not Google’s first OS, in fact it is their third. In house they use Goobuntu (http://en.wikipedia.org/wiki/Goobuntu) which is a modified version of Ubunutu Linux. And at the end of 2008 they released Android an open source operating system for cellphones, and it rocks.
  • Cloud Computing. The operating system is going to be very light weight on the end users system and plug directly into the internet. This is going to be a lot like the Android where it is always on and things are straight away at your finger tips. This works really well for a cellphone but I do wonder how much functionality it is going to have for more high end activities. Sure you may be able to edit a word document etc, but what about being able to do some coding, or playing a game. In those realms I think that a full desktop environment will still be a lot better.
  • It is free. Well being open source and based off linux they really didn’t have much more of a choice. Having said that it really gives Microsoft a kick up the pants with the cost of Windows even at OEM price being really expensive.
  • The number of companies involved: Acer, Adobe, ASUS, Freescale, Hewlett-Packard, Lenovo, Qualcomm, Texas Instruments, and Toshiba. This shows that it has some major industry support and the chances of success are high.

I am excited about what it can deliver, but building a web browser that gets 30 million users in 9 months is one thing. Building a operating system that can deliver a smooth user experience without bugs or issues is a whole lot harder.