Raspberry Pi: Raspbmc+Retropie Dualboot

This slideshow requires JavaScript.


The Raspberry Pi is a great little device with which you can easily use to create a Media Center with (Raspbmc, Openelec or Xbian) or an Retro Console with (Retropie). Unfortunately I couldn’t find a good write up on how to have both of these functions using the same SD card. So I decided to write one.

Necessary Tools:

16gb+ SD Card (I will be using an 8gb SD card for this tutorial but this leaves you with very little space for roms)
USB Keyboard/SSH to run commands(Recommended)
Raspberry Pi

Lets get started:

1.)Download and Extract NOOBS or NOOBS-lite(at the time of writing the latest version is 1.3.9), i will be using NOOBS lite due to the fact that I’m using an 8gb SD card and don’t want to waste space on Operating Systems i’m never going to use. Copy the extracted files to the root of  your SD Card.

NOTE: In the current release the autoboot.txt feature which is what we will use to dual boot is broken, there is a fix that will be included in future releases but if a new version has not been released you will need to manually replace the bootcode.bin in the root of your SD Card with the one here. (Solution comes from https://github.com/raspberrypi/noobs/issues/195)

2.)  Now we’re ready to install our operating systems. When you boot you should see the NOOBS OS install menu. We will want to select Raspbian and Raspbmc. Once selected you can go ahead and install. This process can take a while.Once the OS’s are installed a dialog box will come up and when you hit OK your Raspberry Pi will reboot into a selection screen.  We will first setup Raspbmc side of things.

3.) Upon first boot allow Raspbmc to finish its setup and update then go through the Raspbmc on screen Configuration.

We now need Advanced Launcher so we run

wget http://www.gwenael.org/Repository/repository.angelscry.xbmc-plugins/repository.angelscry.xbmc-plugins-1.2.2.zip

When its done install the repository by going to System>>Add-ons>Install from zip file>>Home Folder then go to Add-ons>>Get Addons>>Angelscry Repository>>Program Add-ons and install Advanced Launcher

With this done we need to create the script that we will launch with Advanced Launcher

sudo nano RetroPie.sh

With the following contents:
RetroPie.sh

#!/bin/sh
sudo sed -i 's/5/7/g' /media/RECOVERY/autoboot.txt
sudo reboot

Make it executable

sudo chmod +x RetroPie.sh

Now we create out autoboot.txt

sudo nano /media/RECOVERY/autoboot.txt

Add the line:

boot_partition=5

Now open Advanced Launcher

Select Default>>Standalone Launcher >>Home folder >> RetroPie.sh

Leave Application Arguments Blank, set the title as you wish, platform doesn’t matter, i chose Linux, i did not provide a thumbnail or fan art (just select OK)

With that done I recommend you add the newly created launcher to your favorites to avoid having to dig for it every time you want to switch.

Now you can go ahead and run this from your favorites on xbmc(Star Icon on default skin near shutdown button) and your raspberry pi should reboot to Raspbian.

Now for the Raspbian(Retropie) Side.

4.)When done booting you will see raspi-config, there are a few settings we want to change here. First you will want to change the Overclock Settings, I chose medium but you can experiment and see what works best for you. Next you want to go to Advanced Settings and change the memory split I’m using a  Raspberry B with 512mb so I make it 256 but again it helps to experiment and find what works best.

(Optional) Enable autoboot to desktop, this makes it much easier to setup Wireless Settings

Finish and Reboot into Raspbian.

(Optional) Configure your Wireless settings

5.) We will now use the Retro-Pie-Setup Script from petrockblog to setup emulation station and our emulators I will be following the instructions at: https://github.com/petrockblog/RetroPie-Setup step by step so head there for the most up-to-date install instructions

In the terminal: Update Raspbian and install git

sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y git dialog

Then use git to download the latest Retropie Script:

cd
git clone --depth=0 git://github.com/petrockblog/RetroPie-Setup.git

Once this is done we will make the script executable and run it:

cd RetroPie-Setup
chmod +x retropie_setup.sh
sudo ./retropie_setup.sh

Now select an installation method(binaries or source based) and wait for it to complete.

Once installation is finished we want EmulationStation to start on boot so go to Setup(only if you have run one of the installations above) and select Auto-Start EmulationStation  and select Option 2 Start Emulation Station at boot.

6.) Now that we have Emulationstation and our Emulators configured we will want to add the option to switch to Raspbmc. To do this I created a separate “system” for EmulationStation called apps by editing the es_systems.cfg file.

sudo nano /etc/emulationstation/es_systems.cfg

I added the following before </systemList>:

<system>
    <fullname>Apps</fullname>
    <name>apps</name>
    <path>~/RetroPie/roms/apps</path>
    <extension>.sh .SH</extension>
    <command>%ROM%</command>
    <platform>pc</platform>
    <theme>apps</theme>
</system>

We then make the apps directory, a directory our script uses to mount our Recovery partition, and add our script:

sudo mkdir ~/RetroPie/roms/apps
sudo mkdir /media/RECOVERY/
cd ~/RetroPie/roms/apps
sudo nano Raspbmc.sh


Raspbmc.sh

#!/bin/sh
sudo mount /dev/mmcblk0p1 /media/RECOVERY/
sudo sed -i 's/7/5/g' /media/RECOVERY/autoboot.txt
sudo reboot

We then make our script executable and allow it to run as root:

sudo chmod +x /home/pi/RetroPie/roms/apps/Raspbmc.sh 
sudo visudo 
add the following to the end of the file:
pi ALL=NOPASSWD: /home/pi/RetroPie/roms/apps/Raspbmc.sh

We are done with the Raspbian/Retropie Side of things after a reboot you should see emulationstation with an apps category with one entry called Raspbmc which when selected will reboot your pi and start Raspbmc. At this point you can add roms/edit the Raspbmc entries metadata and edit the theme of Emulation Station to make it look better. I won’t be going through that or sharing my theme files as i’m not very good at creating graphics and I don’t know what the usage terms for the images I used are(i just did a google image search and grabbed the files). I used the theme files for Ports as my base and edited from there.

In case anyone else wants them these are the other two scripts I have in my roms/apps folder:

StartX.sh

#!/bin/sh
startx

Pair PS3 Controller.sh(this only works after setting up PS3 controller driver using the retropie-setup script)

#!/bin/sh
sudo /opt/retropie/supplementary/sixpair/sixpair

We have finished this process, you are ready to make setup the rest of retropie (great guide is being written by Jessie at RetroPie ver 2.3. The Pictoral Primer.)
and customize xbmc as you see fit! Have Fun!

EDIT: Video as requested.

Special Thanks:

Aloshi for Emulation Station
Petrockblog for a great script which makes this so much easier
Sam Nazarko for Raspbmc
The Rasperry Pi Foundation for an awesome little computer
Any developers I might have missed.

Advertisements

23 thoughts on “Raspberry Pi: Raspbmc+Retropie Dualboot

  1. Hi Gerat tut.

    WOuld it be possible for you to just upload a image of your setup so that we can save all the setup hassle and just flash a working image?

    That would be great!

    Like

  2. Wouldnt it be better to just install Retropie inside Raspbmc and use a script within XBMC to kill xbmc and launch EMulationstation?

    That way you would save the install of Rasbian and the need to reboot if you want to switch between xbmc and Retropie?

    WHat do you think?

    Like

    • I seem to recall people having issues running Retropie within Raspbmc but I could be wrong about that. If there are no issues doing so then yea that would probably work. Personally I like to have both separate as I don’t mind the reboot that much and this way I know for sure that XBMC and Retropie aren’t interfering with each other.

      Like

  3. rromo12: Thanks for awesome tutorial, I have been waiting for this kind of solution!
    I tried this yesterday and found out latest raspbmc build is incompatible with NOOBS. One of the developers actually confirmed this (http://forum.osmc.tv/showthread.php?tid=15756).

    Could you be so kind and make an image of your 8gb sd card and share it? I have also 8gb sd card.

    Thank you very much.

    Like

  4. This doesn’t seem to work. For dir /media/RECOVERY/autoboot.txt there iis no RECOVERY folder. I simply created the autoboot.txt inside the media folder and changed the same for RetroPie.sh I done everything mentioned in this post and when i run i see Advanced Launcher Opening Stream sits for a few and then just disappears not rebooting the system

    Like

  5. My apologies! it does work. User error 😉 I just realized i don’t need to add sudo to any of the configuration. Works like a charm but i did have issues with the recovery folder. The zip might include the dir but i used the add on strait for advanced launcher which didn’t have it anywhere.

    Like

  6. I have been playing with Retropie for a little while and just found out about RaspBMC. I saw that XBMC has a plugin “ROM Collection Browser” to play retro games. Does that work ok? DO you think Retropie & Raspbmc work better than Raspbmc & Rom Collection Browser?

    Like

    • I have never tried to use Rom Collection Browser with RaspBMC but it seems others have: I’m not sure whether they had any luck in the end.

      I personally prefer having two completely separate distributions and like the interfaces of Emulation Station better than ROM Collection Browser’s

      Liked by 1 person

  7. Hello,

    Thank you for the tutorial! I have installed both Raspbmc, raspian and finished the long install of retropie following your guide. I have also been able to install the advanced launcher as well. I am struggling with the following steps:

    With this done we need to create the script that we will launch with Advanced Launcher

    sudo nano RetroPie.sh
    With the following contents:
    RetroPie.sh

    #!/bin/sh
    sudo sed -i ‘s/5/7/g’ /media/RECOVERY/autoboot.txt
    sudo reboot
    Make it executable

    sudo chmod +x RetroPie.sh
    Now we create out autoboot.txt

    sudo nano /media/RECOVERY/autoboot.txt
    Add the line:

    boot_partition=5

    Particularly I do not know how to “create the script”. When I exit out of XBMC and type sudo nano RetroPie.sh I enter into retropie it seems. Thank you!

    Like

  8. Hi,

    Thanks for the tutorial! I just finished setting this up and had to tweak one thing to get it to work. I used NOOBS full version 1.3.10 (it is important to connect the pi to the internet before powering up as the new version of NOOBS requires it to install Raspbmc). I then installed Raspbian and Raspbmc at the same time by selecting them from the NOOBS menu.

    I followed the tutorial but I found that I needed to inverse the sed command in both the RetroPie.sh and Raspbmc.sh scripts: in the tutorial, retropie.sh requires ‘s/5/7/g’ and raspbmc.sh requires ‘s/7/5/g’. This setup meant that when I booted out of retropie, I’d be reloaded into retropie and, similarly, when I booted out of xmbc, I was reloaded into xmbc. I don’t know if the new version of NOOBS changes the partition into which the OSes are installed, but I had to switch it like this:

    Retropie.sh: changed ‘s/5/7/g’ to ‘s/7/5/g’
    Raspbmc.sh: changed ‘s/7/5/g’ to ‘s/5/7/g’

    This now works perfectly.

    Hope this helps someone…it took me forever to figure this out (first time I use Linux too!)

    Liked by 2 people

    • I cannot get this step to work. It does reboot, but it goes to the noobs previous selected os screen with rasbmc being highlighted. Does yours go to the noobs select os screen and just select raspian, or is this step supposed to eliminate the previous selected os screen?

      Like

  9. I followed these instructions today verbatim and had no issues at all. Thank you very much for this. I got a RPi just for these 2 items and this worked perfect. Thank you.

    Like

  10. Hi, I’ve followed this guide but I’m having some trouble. I’ve made the autoboot.txt in the correct location, and the RetroPie.sh script, but when I try to run the latter through Advanced Launcher it just resets back into Raspbmc. Anything I could be doing wrong?

    Liked by 1 person

  11. Doesn`t work on mine rpi 😦 maybe iam doing something wrong but i cant find Home folder from Advanced Launcher and after i reboot raspbmc is gone

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s