sunnuntai 15. maaliskuuta 2015

Installing Ubuntu 15.04 on Surface Pro 3

UPDATE: see my experiences with release version from http://pedanttinen.blogspot.fi/2015/08/installing-dual-boot-ubuntu-1504-on.html

Here's my experiences on installing Ubuntu 15.04 from daily build. This is not the official release version try out!

By following these instructions, you get Ubuntu 15.04 installed on Surface Pro 3, but at least at the moment everything does not work right. The older instructions based on 14.10 do not help to overcome the issues.

I'm using Surface Pro 3 i5/256GB/8GB version. I wanted to keep pre-installed Windows 8.1 as secondary operating system, because Ubuntu still has many known issues. So, I'm creating a dual boot setup.

Before installingn Linux, you have to make some space for it. I used Windows tools to reduce the partition size. I left 50GB for Windows partition, which means that there's about 20GB of free space before anything else than default software has been installed.

Reducing Windows partition size

  1. Start diskmgmt.msc tool
  2. Try to reduce the size of the Windows partition
  3. In my case, I had to remove Bitlocker from the Windows partition before I was able to reduce the size

Booting from USB stick

  1. Remove secure boot. Shutdown Surface and restart it by first holding down volume up button and then the power button.
  2. Disable secure boot.
  3. Shutdown Surface
  4. Start Surface by holding volume down button and then power button

Install Ubuntu 15.04

  1. To speed up installation process, do not let installer to access internet
  2. During installation, choose manual partitioning
  3. I created the following partitions 
    1. Primary 30GB for root (the / mount point)
    2. Primary (actually not sure whether you can choose between logical and primary for swap) 8GB swap
    3. Primary partition for /home with rest of the space
  4. I installed Linux boot loader on /dev/sda. Many posts in internet say that it would be better to install it on the Windows EFI partition i.e. /dev/sda2, but I got it working this way, so I cannot tell whether it's a good idea or not
  5. After installation is ready, boot Surface and you will end up back in Windows. Ubuntu is nowhere to find
  6. To fix the problem, you have to use boot-repair tool
    1. To run boot-repair, boot Linux from USB stick and run the following commands in shell (these instructions are based on the official guide: https://help.ubuntu.com/community/Boot-Repair)
      1. sudo add-apt-repository ppa:yannubuntu/boot-repair
      2. sudo apt-get update
      3. sudo apt-get install -y boot-repair && boot-repair
      4. Accept default recommended repair
      5. Remember to note down the link boot-repair is giving you
      6. Check the last lines generated by the tool, because they are needed later
    2. Most likely because my Ubuntu 15.04 is from daily build, I wasn't able to execute the boot-repair tool from Ubuntu 15.04 USB stick, so I had to use 14.04 Ubuntu to do this. Since Ubuntu 14.04 does not support Surface type cover keyboard out-of.the-box, you have to use the Ubuntu's default virtual keyboard Onboard, which you can access from the application menu.
  7. After reboot, you still end up in Windows automatically. To make GRUB 2 working, you have to go to Windows CMD as administrator and then execute the command boot-repair tool gave you in the end of its generated output. Most likely it's the one below
    1. bcdedit /set {bootmgr} path \EFI\ubuntu\shimx64.efi
  8. Shutdown the system and boot by pressing volume up + power button. Enable secure boot (if you don't enable it, Surface will keep on booting to Windows)
  9. Now after reboot, GRUB 2 should show you the menus for selecting Windows or Ubuntu dual boot.
  10. At this point, I made Windows my default boot option
    1. Boot to Linux
    2. sudo vi /etc/default/grub
    3. Change line with GRUB_DEFAULT=0 to GRUB_DEFAULT=2 (you can calculate the correct number by checking which line in boot menu has Windows. Indexing starts from 0). Save changes.
    4. sudo update-grub
    5. Next time Windows will be selected automatically, if user does not select anything else in the boot menu
  11. It's worth to notice that if you don't have type cover attached to Surface during boot, you can still use on-screen keyboard to select the right operating system from boot menu. Nice!

What works and what doesn't

Working out-of-the-box
  • Type cover
  • Surface pen as a mouse / pointing device (buttons do not work however)
  • Touch screen (sometimes stops working for a while and has some strange behaviour at times)
  • WLAN
  • Bluetooth
Not working out-of-the-box
  • Cameras
  • Touch pad
  • Ubuntu does not recognize that it's running on laptop with battery. At least the desktop software cannot show the state of the batter
The biggest problems in running Ubuntu 15.04 on Surface at the moment is the lack of touch pad support. It would be nice also to get the touch screen working without random problems. I will keep on using Windows as long as I'm not able to solve the touch pad issue. Otherwise the system seems to run ok.

4 kommenttia:

  1. To the list of what is not working out of the box I guess you could add:
    - power button
    - volume buttons
    - "home button"

    VastaaPoista
  2. Hi:

    The touchpad not working is a common problem. In Ubuntu 14.04 and 14.10 the touchpad would work first when you installed Ubuntu, but in order to have a working keyboard, you had to manually update the kernel to 3.19, in which they add support for the Type Cover for the first time. That would broke the touchpad, though. Add these lines to the X.org configuration file (/usr/share/X11/xorg.conf.d/10-evdev.conf):
    ection "InputClass"
    Identifier "Surface Pro 3 cover"
    MatchIsPointer "on"
    MatchDevicePath "/dev/input/event*"
    Driver "evdev"
    Option "vendor" "045e"
    Option "product" "07dc"
    Option "IgnoreAbsoluteAxes" "True"
    EndSection

    This was David Elner's solution. You may want to read his guide to dual booting Ubuntu 14.10 on the SP3. For example, if you hadn't done so yet, you will want to stabilize the Wi-Fi. It works so much better than with the stock drivers. Here's the link: http://blog.davidelner.com/dual-booting-ubuntu-14-10-on-the-surface-pro-3/

    And for the rest, there is a topic on Reddit (http://www.reddit.com/r/SurfaceLinux/comments/30hg2w/sp3_kernel_40rc4_debs_with_patches_for_camera/) where an user named Claritux shared his modified kernel for the SP3. He got the cameras, battery status, multitouch, suspend and hardware buttons working. It's intended for Ubuntu GNOME 15.04, and it may be a little unstable.

    And why do you mean when you say that "Ubuntu does not recognize that it's running on laptop with battery"? Can you explain a bit more? I'm thinking about upgrading from 14.10 to 15.04.

    VastaaPoista
  3. Sorry, there's a typo in the code: it should be

    Section "InputClass"

    VastaaPoista
    Vastaukset
    1. I'm sorry for not replying earlier. I haven't had time to play around with Ubuntu and Surface lately, but I will give it another go with Windows 10 / Ubuntu 15.04 dual boot setup. I will also make a post about my experiences. Thanks for comments and tips anyway!

      Poista