2014-09-16

Banana Pi trial

Intro


I've been considering ordering Raspberry Pi B+ when it came out. But I found out that more ARM computers exist. I was considering between Beaglebone Black, Cubieboard and Raspberry Pi B+ (a nice comparison here). But all of them had one or more shortcomings. I wanted a machine which has fast processor with maybe more than one core. More RAM (most had 512MB) and also fast Ethernet (most have 100MBit/s max).

This is the ARM that I always wanted

Contents


I ordered my Banana Pi together with SATA cable and case which came relatively fast – 3 weeks from China (Aliexpress). The case is very nice looking and luckily I ordered whole package. If I hadn't Banana Pi would lite my room up. It has 3 or 4 LED lights so it can be really annyoing especially if you use it in a dark room.

This case looks even cooler in real life
I wanted Banana Pi also because it is has connector for external disk which can be quite useful if you have old disk laying around. And it also has infrared sensor directly on the board (hopefully for future XBMC support).

First thing I did when I got it was to try to install Raspian on SD card. It worked without problem booting fast into the operation system. The only let down came later when I ran browser. While the experience is faster than Raspberry Pi, YouTube videos didn't play and with Midori as the default browser I couldn't do much.

Because I'm more inclined to Ubuntu universe I tried Lubuntu image. This one worked OK, and it even played YouTube videos. But the problem was the videos were laggy and skipping picture. So basically I couldn't watch or use it in real life.

I was also considering putting on Android since I heard it can do also video acceleration. But I got stuck with Lubuntu because I wanted to try more things with it. And also on Android I can't do much because I have no touch screen and there are no application which I want to try on (I have Nexus 5 for that).

As for the hardware part I really like, that you can physically turn off the machine. And as far as I found out it doesn't use any electricity when it's powered off. I tried running it of a battery which I bought cheap and found out it can run stable at 5V/1A. So I now have a nice little home made UPS.
This is the battery I'm using

Conclusion


It's a really nice box and I have a few ideas of how to use it. I would recommend it to anyone who's deciding between single-board computers. The community for Banana Pi is growing really fast and I expect it to be better than Raspberry Pi considering the capabilities of Banana Pi.

Now for a few pro/cons.

Pro

  • very low power usage
  • it can run off a battery at 5V/1A without problems
  • IR receiver
  • on/off switch
  • it's small and nice looking

Con

  • it doesn't reach full 1Gbit speed (around 260Mbit/s)
  • can't play YouTube videos out of the box 
  • no support for XBMC/hardware video acceleration yet
  • very bright led lights (if you're not using a case)

Use cases/TODOs/ideas


A few ideas I have of how to use Banana Pi. Some of them were ripped from other people but I can't remember where it all came from. 
  • 3G internet tethering (use it as a modem)
  • BitTorrent server (using Transmission)
  • Cloud solution (using something like ownCloud)
  • Cortana/Siri voice recognition
  • Digital TV streaming
  • Educational PC (LibreOffice/Gimb/Scratch/etc.)
  • FM pirate radio station
  • Git server
  • HTPC (XBMC when available)
  • Kiosk mode PC
  • Mail server
  • Music server for MP3 with web interface (Pi Musicbox, Rampr, RaspyFi)
  • Nagios server
  • NAS (even with 260Mbit it's better than the rest)
  • Penetration testing (something along the line of Kali, Raspberry-Pwn, Pwn-Pi, etc.)
  • Print server
  • Proxy server (squid)
  • SQL server (MySQL)
  • SSH server
  • Syslog server
  • Video encoding (handbrake)
  • Video streaming server
  • VOIP server (Asterisk)
  • VPN server
  • Web cam server
  • Web server (Apache/lighttpd + php5)
  • WiFi/Bluetooth connectivity point
These are just a few I could think of. Hopefully some of the things I'll do and write about them in this blog.

2013-03-02

Mac OS X 10.7.2 on VirtualBox 4.1.14 [with XCode 4.21]

Intro

Since I really like having multiple operating systems on my computer I decided to try out Apple's OS on a virtual computer. Not really an Apple fan, though I wanted to see what all the hype is about. After searching the web I found a few install instructions but none of them were simple or worked straight away. So I decided to write my own tutorial about my trip to Apple land.

Start

Since I will be using this machine for development purposes I will also install XCode on OSX. So let's see what I used to install Mac OS X:
  • VirtualBox 4.1.14
  • iATKOS L2 Mac OS X 10.7.2 for X86
  • 20 GBytes of space
  • 64bit processor
  • (optional) dmg2img
  • (optional) XCode 4.21
My primary machine has i7 2600 with 16GB RAM.

Making VirtualBox machine

Make a new Virtual machine and select Mac OS X as operating system and for version select Mac OS X Server (64bit). Give it at lest 1024MB of Base Memory. But the more the better. I found mine stopped lagging considerably after I jumped from 2048MB to 4096MB.

Startup disk should be at least 20GBytes. First I tried with 10GBytes but when I wanted to install anything OS said there is not enough space. So leave it at default. I recommend you set dynamically allocated size, since the size will grow when the system needs it. And it won't take your disk space (in case you're using small SSD disk).

I selected VDI as file type since I will use it only for VirtualBox. If you have other needs then select the appropriate file type.

Setting VirtualBox machine

I'm posting images because they are easier to understand.

But first you need to make ISO image out of downloaded Mac OS X image file (found at the link below).

This you do with the dmg2iso tool:


dmg2img your_downloaded_file.dmg mac_osx_lion.iso


You can mount DMG image same as ISO but since I didn't do it I can't comment on it.
After you've made the ISO image you can mount it in the Storage section in Virtualbox (as seen below).


  • Basic tab in General



  • Motherboardboard tab in System (don't check the Enable EFI)


  •  Processor tab in System (I recommend you don't use too many processors, your whole computer will get stuck if Mac OS X stops responding)


  •  Acceleration tab in System


  •  Video tab in Display (here you can also turn on Remote Display for your Mac OS X)


  •  Storage (mount CD/DVD drive with Mac OS X ISO/DMG image)


  •  Audio (select Intel HD Audio)


  •  Network (usually I select bridged because I need separate IP address)


  •  Enable USB controller


Mac installation

After setting up everything you can start the machine. It will automatically start from the mounted ISO file. Again I'm posting pictures because it's easier to see the procedure.


  • After running you're going to get this screen. Let it boot and wait for the unitl the welcome screen appears


  •  You're going to notice you can't install, because there is no disk drive available. So with mouse go to the Utilities menu and click Disk utility


  •  Select the disk and go to the Erase tab. Type in the name for your disk and press Erase. Again confirm you want to erase disk (this disk is virtual by the way)


  •  After finishing close the Disk utility and you will be transported back to the install screen. Don't click install just yet. Click the Customize button.


  •  In the customize section select the following choices that are listed below. Some instructions say you can select graphic card. But unfortunately Virtualbox emulates Intel. So it's kind of useless to install Nvidia or ATI drivers. And anyway Mac OSX will complain that no Nvidia/ATI hardware found. So resist the choice to select.

  •  After selecting all the necessary options go back to the install screen and click Install. Finally. After the install finished (depending on your configuration 12-30 min) you will see the screen showed below. You have to manually reset computer by selecting Machine->Reset. Be careful to unload the ISO image before that (otherwise we go to fresh install again). After first restart machine will probably ask again to restart. So do that.

  •  After the second restart we come to the welcome screen. Setup your keyboard, location and optional information (Apple ID, registration). And setup user account.


  •  After setting up everything your Mac OS X system will start. You have made it!


Setting the installed OSX

First thing to do after installing is to disable updates. This you do by clicking the Apple icon in the top left corner and select Software updates and untick the Check for updates option. That's it. Of course you can also update, but be careful not to upgrade to a newer version (in the time of writing 10.7.4) because your system will not boot then (figured it out the hard way). Everything else (iTunes, Java updates,...) is OK to update.

Install XCode (optional) 

Since I'm going to use Mac OS X for development I decided to install XCode. You can download XCode from Apple's development site. You have to register to download but otherwise it's free.

I tried many versions of XCode and the only one that worked was 4.21 version. The rest need a newer system (10.7.4). This became a problem when I tried to use friends iPhone for development. Since he was using 5.1.1 operating system it was too new for the installed XCode so I couldn't do anything. But you can still use this XCode to get to know how to develop in it.

Tips

I found out that Mac OS X shares a little bit different keys than Windows. So in Mac copy/paste work by pressing the Windows key (if you have a Windows keyboard) instead of Ctrl.

Tweaks

  • Disable window animations 

Open up Terminal and type in the following command:

defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool NO


  • Disable mail reply animations

Open up Terminal and type in the following command:

defaults write com.apple.Mail DisableReplyAnimations -bool YES

  • Disable the switching Spaces animation 

Open up Terminal and type in the following command:

defaults write com.apple.dock workspaces-swoosh-animation-off -bool YES && killall Dock

  • Showing / hiding sheets

Open up Terminal and type in the following command:

defaults write -g NSWindowResizeTime -float 0.01


  • Window zoom

Open up Terminal and type in the following command:

defaults write com.apple.finder AnimateWindowZoom -bool false


Better performance

    As I said before if you want a better performance try to apply as much memory to the virtual machine as possible. In the end I disabled audio because I didn't need it. And I think it helped with the overall machine stability (it didn't get stuck so much).

    Troubleshooting

    • Guru Meditation -2301 (VERR_REM_VIRTUAL_CPU_ERROR)

    Found out I didn't set Mac OS X (64bit) system in VirtualBox, so always set it to 64bit.
    • F8 doesn't work / No startup screen

    Didn't follow some tutorials advice and forgot to uncheck Enable EFI (Special OSes only)

    • Mac OS X doesn't boot (stuck at Apple screen)
    One of the hiccups of having Mac OS X on virtual machine. Just try to restart/reset the machine until it comes into the OS X (usually not more than 3 times).


    Useful links