I’ve had a keen interest on the Elementary OS Project. Now, you might think from reading my blog, that I’m extremely anti-Apple, so you’re thinking, “Why does he like an OS that LOOKS like Mac OS? Well, firstly it’s Her Ladyship Kana’s fault for introducing me, and secondly, the looks are where the similarities stop dead. It’s an exciting and kinda novel concept: bringing a rigorous focus on user experience  (Apple’s main focus, style over substance) to the Linux desktop, as Elementary only comes with a very bare set of apps, such as Midori (Kana’s mum’s name, such a sweet name for a Japanese woman!) as a web browser, it doesn’t come with an office suite, like Mint, it’s quite lightweight. Recently, they released their second beta of the second version, v0.2, of their operating system, called Luna. It’s been a while since I’ve run Luna (last time my experience was too unstable for a production environment), so I decided to install VirtualBox and virtualize this second beta. My experience was riddled with problems and gotchas until I tweaked it, so I thought I would share my notes with everyone in case any are interested in trying it themselves.

Note one, this is a biggie, DO NOT settle for running this VM at default Virtualbox settings, it WILL run like a dog chasing a stick in treacle. I’ll walk you through optimizing it later.

Installing/Setting-up VirtualBox

Even installing VirtualBox is arduous under Linux, I always prefer Windows as host for virtualization, but seeing as I’m considering a switch to Linux from Windows, I thought I’d test my skills from Kana’s training me. For some reason, VirtualBox under recent versions of Ubuntu is a miserable experience. It seems like I always get this error when I try to set up a new virtual machine:

Kernel driver not installed (rc=-1908)

The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing

‘/etc/init.d/vboxdrv setup’

as root. If it is available in your distribution, you should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.

And when I follow its advice (by running `/etc/init.d/vboxdrv setup`), the program fails. Apparently, Kana told me as she settled next to me after watching me pull my hair out, the key is installing the generic linux headers FIRST, like so: `sudo apt-get install linux-headers-generic`; however, Kana also tweaked it for per-user, try it in case your environment differs from mine:

sudo apt-get install linux-headers-`uname -r`

Download the Elementary Beta 2 ISO

The next step is downloading the ISO, links for torrents and traditional downloads which can be found on this page. I used wget to download the ISO; however, my connection was interrupted and trying to resume it seemed to have corrupted the file (or at least VirtualBox didn’t like it), so if you really want to use a traditional download (that is, over HTTP, like me), make sure you get it in one shot. Otherwise, I recommend using a torrent, but depending on the version, an age of torrent, the number of seeders, hence the speed, may vary. Once you have that, setup a new VM, point its CD drive at the ISO, and then make the following changes:

Under Display, make SURE you check, “2D & 3D Acceleration”, and make double sure you give it enough System and Video RAM, other wise the forementioned dog-chasing-stick-in-treacle symptom will appear, and it’s laggy as hell. Elementary relies heavily on GPU acceleration. IMPORTANT: If you install Elementary and change the settings afterwards, you WILL need TWO restarts to get everything working properly, as Linux configures itself, as far as it’s concerned you’ve swapped out the graphics card for an accelerated one so it’ll need to adjust itself, and the VirtualBox additions files configs.

Putting the final touches on your VM

Now that you have your Luna VM set up and the OS installed, you may find that the default resolutions provided by VirtualBox (I think I had 800×600 and ~1200×700) too small for your monitor (my laptop supports 1920×1200), so you’ll want to change your VirtualBox configuration.

The first step is installing what VirtualBox calls “Guest Additions”, which are essentially a package of utilities that smooth communications between your host OS (in my case, Ubuntu) and your guest (Luna). For example, Guest Additions allows you to configure your VM to support a shared clipboard so you can copy in the guest and paste in the host or vice-versa. It also supports drag-and-drop between host and guest. To do this, click on your VM’s “Devices” menu, and click “Install Guest Additions”. If you have problems with this, it is also well-documented online, so I won’t rehash it here either. I always find that Linux installs VirtualBox additions via its Online Update, Mint and Debian do, so you can do either, whichever works, but the Devices>Install Additions option can sometimes be the most up-to-date drivers.

The following instructions are host-specific. Now that you have your Guest Additions installed, switch back to your host OS (Ubuntu, in my case), open a terminal, and type the following, replacing the ’1920,1200′ with the max resolution of your monitor:

VBoxManage setextradata global GUI/MaxGuestResolution 1920,1200

I had to restart my guest (Luna) VM in order for the changes to take effect correctly, otherwise I got loads of graphics glitches. I forget what exactly I had to do to make it take effect, but I think it is something along the lines of choosing “Auto-Resize Guest Display” under your VM’s “View” menu (I run my VM in fullscreen mode, also available under the View menu). I believe that’s all that is necessary to enable a sane, full-resolution VM. If that still doesn’t do it, you can try resizing your VM’s window a couple times (to try to get VirtualBox to force a resize the guest resolution) or you can try playing with the resolution in the Settings app’s (on the dock) ‘Displays’ view.

Also, the default menu-bar position for a VirtualBox VM’s toolbar (when in full-screen mode) is at the bottom, directly in front of the dock. This is annoying, but configurable. Select the VM’s “Machine” menu’s ‘Settings’ item, and under ‘General’->’Advanced’->’Mini toolbar’, check ‘show at top’.

Also, for performance reasons, you will want to enable 3D hardware acceleration under Machine->Settings->Display, if you didn’t follow my earlier advice to stop it running like a dog in treacle.

Other Issues

From time to time, I’ve experienced weird focus issues in which my host machine (Ubuntu) will intercept some common keyboard events–namely those using the <super> (aka ‘Windows’ key), which is important for both Ubuntu and Luna–which is extremely annoying.

Also, even with hardware acceleration, I’m having problems with inconsistently laggy/slow Gala (the Window manager) transitions, specifically when it comes to switching workspaces using the <super>+<left/right> shortcuts.


Now you’re ready to explore. If you’re experiencing any difficulties related to the above tutorial, leave a comment and I’ll try to elaborate or clarify if necessary. I find Elementary OS, plus LAMPP, a very lightweight webserver combo, hint, hint 😉

Be Sociable, Share!
Leave a Reply