Installing Vine Linux on MacBook Air (Middle 2011)

要約:
日常的に Vine マシンとして使っている MacBook Early 2008 の後釜として、MacBook Air Middle 2011 を購入。現時点で Vine が MBA 上でどの程度動くか動かないか、とりあえず現状を確認しました。で、安定するまで当分は OS X 上の VirtualBox に Vine 環境を移そうか、と考えています。




Bought a MacBook Air (Middle 2011) - 11inch, US Keyboard, 4GB Memory, 128GB SSD and Core i7 - to replace my MacBook (Early 2008) that has served me very hard as a Vine Linux development environment as a daily basis for a few years.


[MacBook Air Mid 2011 11-inch]

To be honest, I always have used my whity MacBook with Vine - Mac OS X is always there on the harddrive in a separated partition, but I seldom booted it up on my MacBook - maybe once or twice a year? Another OSX machine at home, an old PowerMac G4 MDD, is still there and serving me as a daily basis as well, to store my huge digital music contents (almost all in lossless format) on iTunes (still hundreds of CDs left to get ripped though), and as a scanning machine (connected to the old SCSI A3 flatbed scanner).

The first thing I did on my new toy was to play around the new OS for a while that amazed me a bit. This was the first time for me to play with the multi-touch trackpad and gestures. I felt Gestures and "Mission Control" are really great for portable computers with small screens like this MBA 11inch.

And the next thing I gonna do was, of course, to figure out how well this brand new machine is supported on Linux - I know there are so much to get done on the Linux kernel, the X thing, and some userland utilities, to run Linux on the MBA 2011 flawlessly, but I just thought it was worth checking out and playing around.


[MacBook Air Mid 2011 11-inch vs MacBook Early 2008]







Create Lion Recovery On Your USB Flash Drive

So you are going to try installing Vine Linux on your MacBook Air (Middle 2011) which doesn't come with any recovery media. Of course, if you have a wireless connection to the Internet, you will be able to restore OS X Lion through the net, without any install media. This is called “Internet Recovery”, built into newer Macs starting with Mac Mini (Middle 2011) and MacBook Air (Middle 2011).


[OS X Lion Internet Revoery]

But you should be fully prepared - “Providing is preventing” - you would be happier to have the physical recovery medium, an USB flash drive, that contains OS X Lion Recovery, before facing some accidental issues.

All you need is an USB flash drive and Lion Recovery Disk Assistant. Create the USB flash drive recovery media before installing Linux for safety.

In case you already build up your own environment on OS X Lion, you would better back up your whole system with Time Machine - this will simplify the process of restoring your entire OS X environment onto the specific partition of your harddrive.




Boot up the Linux Installer, partition the drive, then install

Now you are nearly ready. Prepare another USB flash drive and make the USB install medium. If you already have Linux machines, connect the flash drive to the machine, identify the device name (such as /dev/sdb) very carefully, then just do this:

$ sudo dd if=Vine60-x86_64-DVD.iso of=/dev/sdb
(or alternatively)
$ sudo sh -c 'cat Vine60-x86_64-DVD.iso > /dev/sdb'

Similarly you can create the USB install medium on Windows machines, using DDforWindows or Image Writer for Windows.


CAUTION, PLEASE NOTE: Unfortunately a nasty bug is found on Vine Linux 6.0 x86_64 edition, that will cause some issues, when trying to install onto the harddrives with GPT partition table. The bug is already fixed (among the Vine developers) and will be released as a part of future releases of Vine Linux. 32bit edition does not suffer from this issue. You would install the 32bit edition instead, or wait for the minor fix version of the x86_64 edition.


Shut down your MacBook Air, plug the USB flash drive, hold the option key while pressing the power button, then you will see the boot selector named “Startup Manager” that is built in Intel Macs. Select the USB flash drive and press return, and the initial screen of Vine Linux Installer would appear.


[Intel Mac Startup Manager]

Be sure to select NOFB MODE before proceeding - otherwise your MBA will black out and will “hard freeze”. The KMS (Kernel-based Mode Setting), Intel Framebuffer driver and Xorg driver on Vine Linux 6.0 (even on breeding-edge Linux kernel and Xorg as of today) is NOT compatible with the 2011 MBA hardware yet.


[Vine Linux 6.0 Installer Options]

Then the Vine Installer starts. As my MBA is brand new and I already have Recovery USB flash drive, so I don't hesitate to erase all the partition on the MBA SSD. If you already have your own OSX Lion environment, you would back up your whole OSX system with Time Machine as noted far above.

The only thing you should keep in mind is, place the Linux partitions first, then the OS X partition. This is a limitation of the GRUB bootloader (unless you use newer GRUB2 bootloader), as it only sees the MBR partition tables which can hold up to four partitions. OS X on Intel Macs, on the other hand, relies on the GPT (GUID Partition Table) that can hold more partitions. As long as you use the GRUB bootloader, Linux partitions (especially the / partition or /boot partition which holds Linux kernels and initrds) must be either of first four partition.

My case - I know MBA 2011 is not fully supported on Linux yet (and hopefully several months needed to get fully supported), so I decided the Vine Linux directly on MBA 2011 was just for testing purpose. 10GB for /, 2GB for swap, the rest (approximately 107GB) kept free to reinstall OS X later.

Did a few settings (selecting languages, keyboards, timezone and a few more) in the Vine Installer, then finally the installation process starts. As the MBA comes with a SSD harddrive, package installation itself is faster than you could imagine - just a few minutes - not long enough to grind coffee beans and drip brew. You would try instant coffee when installing Linux on machines with SSD.


Okay, you finished installing Vine Linux. But you need a few more to do. Otherwise the Linux system you just installed won't boot.




Reinstall OS X (or Restore your OS X system from Time Machine)

Next, you need to reinstall OS X. Boot from the Restore USB flash drive, open Disk Utility, and create the HFS+ partition while keeping the Linux partitions intact. Then proceed restoring OS X. Alternatively you may restore your OS X system from the Time Machine backup onto the HFS+ partition you just created.


[Lion Recovery: Mac OS X Utilities]



Install rEFIt

You are just one step away from the completion. Boot up the OS X you just reinstalled/resotred, grab rEFIt, then install.

Then open the Terminal, and type the following command.

$ cd /efi/refit
$ sudo ./enable.sh

Okay, now you are almost done. Reboot your MBA. If you did everything correctly, you will see the rEFIt boot selector.


[rEFIt OS Selector]

But don't rush - you have one more thing left to do - syncronize GPT and MBR tables. On the rEFIt screen, use arrow key to select “Partitioning Tool” (gptsync) then press return. Press Y to syncronize the GPT/MBR partition tables. Then shut down your MBA once for safety.

Then you'll be able to boot into the Vine Linux, finally.




Current Status: Vine Linux 6.0 / VineSeed on MBA 2011

Unfortunately, as I already noted far above, there are still so many things to get done on the Linux kernel, the X thing, and some userland utilities, to run Linux on the MBA 2011 flawlessly. You will see many restrictions on Linux (not only Vine but also many other distros) on MBA 2011, at least AS OF AUG. 16, 2011.

Vine Linux 6.0 doesn't fully support MBA 2011, while VineSeed (development version of Vine Linux) gradually supports MBA 2011 features - see the updates below.


(1) (Vine Linux 6) You'll need to add nomodeset to the grub.conf. Otherwise your MBA will hard-freeze during bootup.
UPDATE: (SEP. 6, 2011): most recent VineSeed (kernel-3.0.4-1vl7) doesn't hard-freeze w/o nomodeset. However, you need Apple Mini DisplayPort (ThunderBolt) / DVI (or HDMI) Adapter to get the screen. Without nomodeset, the screen will only appears on the external display (built-in LCD will get blank).
UPDATE: (SEP. 16, 2011): most recent VineSeed (kernel-3.0.4-2vl7) finally supports 1366x768 resolution on the built-in LCD. Now no need to add nomodeset to the grub.conf.


(2) (Vine Linux 6) X still can't do 1366x768. 1024x768 at most, strangely stretched wide.
UPDATE: (SEP. 6, 2011): with recent kernel and without nomodeset described above, you get normal 1024x768 on the external display. Intel HD Graphics can do 3D accelaration (w/ xorg-x11-drv-intel-2.16.0-2vl7) and compatible with GNOME Shell.
UPDATE: (SEP. 16, 2011): with recent kernel (3.0.4-2vl7) and without nomodeset described above, you finally get 1366x768 on the built-in LCD display, featuring 3D acceleration with GNOME Shell.


(3) Wireless network works out of the box - with kernel-module-compat-wireless package installed (on Vine6), or with kernel-3.0.1 (VineSeed).


(4) Sound output is initially muted, so you need the following tasks:

  • Execute alsamixer.
  • Press the F6 key, and unmute the “Surround” or the likes. Press ESC to exit.
  • Execute sudo alsactl store to save the setting.
[alsamixer on MBA2011]

(5) FaceTime Camera is properly recognized by Linux kernel with uvcvideo.


(6) Special keys, such as LCD backlight control (F1/F2), keyboard backlight control (F5/F6), sound mute/volume control (F10/F11/F12) does not work at all. The pommed will treat them like a charm on old MacBooks and MacBook Pros (or even some PowerBooks and iBooks), but unfortunately the pommed is not compatible with the new MacBook Air (Mid 2011) yet.


(7) As this is a Mac, there is no middle-click and right-click - you'll need to enable mouse button emulation to handle this. There are two ways to accomplish the mouse button emulation - one is sysctl way and and the other is Xmodmap way. Please search over the Internet as there are plenty of pages on this.


(8) UPDATE: (SEP. 16, 2011): at least with most recent kernel (3.0.4-2vl7) on VineSeed, suspend/resume works flawlessly on my MBA Mid2011 11-inch.




Installing Vine on VirtualBox Instead

So the status of Vine Linux 6.0 on MBA 2011 for desktop purpose is still far from flawless (although there's a notable progress going on with the development version, VineSeed, as described above). But I have my old MacBook 2008 that runs VineSeed rock solid, and I have spent my daily computer life on this. I bought my MBA to replace my old MacBook.

That's why I decided to create rather small Linux partitions (10GB for /) on the SSD, keeping the OS X partition approximately 90% of its original size. I mean, sometimes (or very frequently) I may want to try if Linux (as of today) runs good on MBA, but too early to spend every minute on this.

So what did I do?

We have another (and very easy) way to install Linux on Intel Macs - VirtualBox (not VertualBox, but VirtualBox - to whom it may concern). I mean, I install Vine Linux on a VirtualBox running on OS X Lion. I know there is yet another way - a similar solution - VMWare Fusion, a famous commercial product. But this time I go with VirtualBox as I've been already familiar with running VirtualBox on Vine Linux - testing Vine installer, using other Linux distributions for certain purposes, et al.

The installation itself is really a piece of cake. And you'll get the Linux running on a virtual machine like a charm. You don't have to worry about hardware compatibility issues. You can quickly let your Mac sleep by closing the lid, while Linux is on a virtual machine - no matter what that Linux is compatible with sleep or not. You can run Linux on full-screen mode (although VirtualBox is not OS X Lion's ‘Full-Screen’ App yet) with 1366x768 resolution very quick and fast. You can instantly switch from OS X (host OS) and Vine Linux (guest OS) by swiping the trackpad with your three fingers - give another huge round of applause to Mission Control!


[Vine Linux VM on Missiion Control]

This is “insanely great”, actually. Two Vine Linux developers (daisuke & munepi) bought MBA 2011 as well, and they do this way. They didn't ever tried to install Vine directly onto their MBAs like I did this time.

But in the meantime I will keep looking for some hacks and upstream fixes that will make Vine Linux running directly on newer Intel Macs flawlessly like it already does on my old whity MacBook. This is why I still keep small 10GB Linux partition on my MBA 2011's SSD.


Okay, so I need to move my current Vine environment on my MacBook to the VirtualBox on OS X Lion - hope it will not take long - and I gotta say to myself, installing Linux on MacBook Air is just the means of restoring my daily environment, not an end in itself (except when I am debugging and developing Vine Linux itself).





Pages

Powered by Movable Type 4.23-en

About this Entry

This page contains a single entry by Shaolin published on August 16, 2011 3:36 PM.

kernel panic on shutdown w/ vboxdrv was the previous entry in this blog.

Apple Products I Ever Bought is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.