Installing kernel headers for Oracle Linux 6 on VirtualBox

The usual reason for Guest Additions failing to install on a Linux guest on Virtual Box is that the kernel headers are missing. How you install these or where they come from varies from distro to distro, although they’re usually available via the package manager on that distro.

I had an Oracle Linux 6 guest installed, Guest Additions (for video drivers, shared folder, clipboard sharing) was all working, and then at some point I started it up again and it was no longer working and wouldn’t re-install either. Seems like I’d picked up an update, and I needed to update the kernel headers too.

This post covers the steps needed. On OE6 before installing the Guest Additions, just run ‘yum install kernel-uek-devel’ and you should be good to go (assuming you’re booting with the ‘unbreakable kernel’ and not the RHEL compatible kernel)

Configuring a static IP on HypriotOS for the Raspberry Pi

How you configure a static IP on the Pi changed between Wheezy and Jessie, and it seems on Hypriot’s prebuilt images for running Docker on the Pi, it’s a slight variation.

Edit /etc/network/interfaces.d/eth0, comment out the DHCP line:

iface eth0 inet dhcp

and add:

iface eth0 inet static
address your-static-ip
gateway your-gateway-ip
#google dns servers
domain_name_servers=8.8.8.8, 8.8.4.4

Done!

Prepending text to a file with sed

Appending content to a file on Linux is pretty easy with >> but there’s no equivalent redirection to prepend content. Luckily, for every file manipulation problem on Linux there’s at least a dozen solutions.

Using sed with -i for inplace replacement of content in a file, you can match ^ for start of line, and then follow with the content you want to replace (in this case, insert).

VNC remote desktop to a Raspberry Pi

I normally ssh into my remote Raspberry Pi’s, but if you don’t have then attached to a monitor and need to get a desktop view of what’s going on, a VNC remote connection works great. Step by step instructions here.