Linux - HOW-TO: Automated efficient XBMC install - Ubuntu 12.10/13.04 mini based

  Thread Rating:
  • 11 Votes - 4.73 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Bram77 Offline
Skilled Python Coder
Posts: 1,369
Joined: Feb 2008
Reputation: 32
Location: Netherlands
Post: #1
The 12.10 version of this script will work on both Ubuntu 12.10 and 13.04!

Because I've done this a few times myself and I've encountered several people asking about it I figured it would be worth the effort to document the required steps. I've cut it into two main steps.

1. Installing Ubuntu minimal (this post)
2. Automated Ubuntu preparation and XBMC installation (post #2 in this thread)


This guide uses a very minimalistic and efficient approach. After a clean installation it takes my relatively old machine only 12 seconds to boot. From pushing the button to the xbmc home screen.
I'm running xbmc on a Asrock ION 330HT with 3GB ram and an SSD drive.

If you're an experienced Linux user you can probably skip to section two because the fisrt step is just a regular Ubuntu minimal installation with only the OpenSSH server as extra module.

You will need to use xbmc for the username of the installation. Otherwise the script won't work!

For this method of installation to work you need to have your HTPC connected to the internet! This needs to be a wired connection for now.


1. Installing Ubuntu minimal

1.1 Download the latest ubuntu 12.10/13.04 minimal installation ISO from

13.04
12.10
1.2 Download and install unetbootin or burn the downloaded ISO to a writable CD

1.2.1 Windows
1.2.2 Ubuntu
  • You can install it straight from the Ubuntu repository:
Code:
sudo apt-get update && sudo apt-get install unetbootin

1.2.3 Creating the bootable USB stick
  • Insert an USB drive into an USB port and delete all it’s content or format it (FAT32)
  • Open unetbootin, select “Diskimage” and select the mini.iso file you’ve downloaded in step 1.1
  • Make sure the correct USB drive is selected and click “OK”
  • When the bootable image is written successfully to the USB drive close unetbootin without rebooting


Now you have a bootable USB drive containing the minimal installation requirements for Ubuntu 12.10 or 13.04. During the installation process the minimal installation will download more required packages. The advantage of using the minimal installation is that no more then absolutely required for you installation will be downloaded and installed. Resulting in a fast and responsive XBMC installation.



1.3 Installation

Every * stands for at least one installation screen in most cases
  • Take the USB drive and insert it into one of your HTPC’s USB slots
  • Make sure your HTPC can and will boot from the USB drive. You can do this from the BIOS of your machine. In most cases no BIOS adjustments are required. Most computers have an option to press a specific key at boot time which will give you a screen where you can select the drive you want to boot from.
  • Unetbootin has added a screen to your bootable USB drive from which you can choose different ways to start the Ubuntu minimal installation. Choose “Install” in this screen.
  • In the next screen choose your preferred installation language. Preferrabely English because that’s the language I’ll be using in this in this howto. You’ll be able to choose your preferred language in XBMC later on.
  • Choose the country you reside in (other -> Europe -> Netherlands in my case)
  • Choose your ‘locale’. This determines some predefined variables. For me the best choice is United States. The best option for you might be the one that’s pre-selected
  • In “Configure the keyboard” select “No” and manually choose the keyboard type you use (English (US) with Euro on 5 in my case)
  • Ubuntu will automatically configure you DHCP (ip address) settings. AFter this has succeeded you know you’ll have a working network connection. If the network has a working internet connection your HTPC will have access to it.
  • Enter the HTPC’s host name (I use “xbmc”). Make sure there are no other computers with the same hostname on your network. If that's the case... choose a different one.
  • Confirm the next two screens with Enter (Ubuntu repositories mirror, default is ok)
  • If you use a proxy server, please enter the proper configuration in the related screen. Otherwise skip this option by pressing Enter
  • Enter xbmc in the Fullname and Username screens! Using xbmc as the username is required! The script won't work if you choose a different one.
  • Choose a password. You’ll need this password several times later on so remeber it or write it down
  • Do not encrypt your home directory unless you really need to (impacts performance a bit in a negative way)
  • Confirm or change your timezone
  • And now for partitioning. To keep it simple I’ll asume you have one HDD in your HTPC and want to use it’s entire capacity. If not... google it Smile. Choose “Guided - use entire disk”
  • Make sure you choose the right disk (not the USB drive)
  • Confirm to write the changes to your HDD with “Yes”
  • Now the installation will start partitioning your HDD and after that copy and download the absolute minimum of required files. This might take a little while.
  • When asked for management upgrade plan select “No automatic updates”, after which the installation process will continue for a while
  • In the “Software selection” screen only select “OpenSSH server” using your arrow keys and the space bar. PRESS ENTER TO GO TO THE NEXT INSTALLATION STEP. I’m choosing not to use Samba since we can access the entire machine remotely using SSH and SFTP with only the OpenSSH server. As minimal as possible is what I want! The installation will continue after you've press enter.
  • Confirm installation of GRUB to the “Master boot record” with “Yes”
  • Confirm that the system clock is set to UTC with “Yes”
  • When finished remove the bootable USB drive and press Enter to reboot the machine.

[Image: widget]

Please add to my reputation if you find my posts usefull (+/- button below posts)
Ubuntu 12.10 minimal XBMC auto-install script :: XBMControl :: Xbmc XBOX Skins :: XBMControl for Android :: Owner of Sudo Systems
(This post was last modified: 2013-04-28 19:19 by Bram77.)
find quote
Bram77 Offline
Skilled Python Coder
Posts: 1,369
Joined: Feb 2008
Reputation: 32
Location: Netherlands
Post: #2
This script will only work properly on Ubuntu Minimal and Ubuntu Server installations! Do not use it on an Ubuntu Desktop installation because it will break stuff!!

The 12.10 version of this script will work on both Ubuntu 12.10 and 13.04!

2. Automated Ubuntu preparation and XBMC installation

The script assumes you chose "en_US.UTF-8" as your locale! It might work if you chose a different one, but I haven't tested that.
Please be patient during the installation process. Some elements will take some time to finish!

Login to your htpc with ssh and execute the following commands...

stable v2.6.0 [nvidia, ati (series >= 5xxx) and intel video drivers support]:
Code:
cd ~
wget https://github.com/Bram77/xbmc-ubuntu-minimal/raw/master/12.10/prepare_install_2_6.sh
bash ./prepare_install_2_6.sh

untested v2.6.1 [nvidia, ati (series >= 5xxx) and intel video drivers support]:
Code:
cd ~
wget https://github.com/Bram77/xbmc-ubuntu-minimal/raw/master/12.10/prepare_install_2_6_1.sh
bash ./prepare_install_2_6_1.sh


CHANGES
* Changed $USER to static variable $XBMC_USER="xbmc"
* Modified video card manufaturer detection to always return uppercase
* Removed 'nomodeset' from grub configuration for INTEL videocards
* Applied USB automount fix and reduce power consumption
* Fixed typo in grub resolution selection causing problems
* Added plymouth boot logo configuration fix
* Switched to new upstart script which is more efficient
* Added XBMC user to some more groups for accessto extra system functionalities


That's it. You should have XBMC up and running after the automatic reboot, with nothing installed that isn't absolutely required! This installation boots super fast (comparable with OpenElec, quite a bit faster then XBMCbuntu). It provides a very smooth XBMC experience because there are almost no extra processes running in the background. No more then required anyway.

Please let me know if you run into problems.

Loads of thanks to everybody who's been helping with debugging, suggesting and testing!

wsnipx has been helping me out with the ATI part of the script. Check out his guide to learn some more about the ATI related configuration

Special thanks to uNiversal for providing support and fixes!

[Image: widget]

Please add to my reputation if you find my posts usefull (+/- button below posts)
Ubuntu 12.10 minimal XBMC auto-install script :: XBMControl :: Xbmc XBOX Skins :: XBMControl for Android :: Owner of Sudo Systems
(This post was last modified: 2013-04-28 19:19 by Bram77.)
find quote
thethirdnut Offline
Donor
Posts: 692
Joined: Jun 2010
Reputation: 23
Location: western Canada
Post: #3
Thanks for posting. I have yet to redo my minimal installs.

Do we for sure even need a window manager installed? I believe last time it was simply an xinit script?

If I helped out pls give me a +

XBMC1:
i3-540, GT430, Ubuntu 12.04 min + Frodo
-> HT: 58" plasma, Denon 3808CI, Paradigm Studio 60, CC-590, ADP-470, Seismic 12
XBMC2: Atom330, GT240, Ubuntu 12.04 min + Frodo
-> Main: 50" plasma, Rotel RX-1052, B&W 683
Server: 20TB FreeBSD + ZFS
find quote
Bram77 Offline
Skilled Python Coder
Posts: 1,369
Joined: Feb 2008
Reputation: 32
Location: Netherlands
Post: #4
lightmd is a requirement for the xbmc-live package. Unfortunately lightmd has a lot of requirements we don't need. I'm looking for a way to reduce the amount of packages installed with lightmd.
If you know an alternative method, please let me know and I'll adjust the installation script and howto to it.

Even though some unnecessary packages are installed, this installation is very responsive. In my experience it's booting quite a bit faster then XBMCbuntu. And running smoother then OpenElec and XBMCbuntu.


edit: Are your referring to this method? -> http://wiki.xbmc.org/index.php?title=HOW..._for_Linux

[Image: widget]

Please add to my reputation if you find my posts usefull (+/- button below posts)
Ubuntu 12.10 minimal XBMC auto-install script :: XBMControl :: Xbmc XBOX Skins :: XBMControl for Android :: Owner of Sudo Systems
(This post was last modified: 2012-09-27 10:25 by Bram77.)
find quote
Bram77 Offline
Skilled Python Coder
Posts: 1,369
Joined: Feb 2008
Reputation: 32
Location: Netherlands
Post: #5
Using the init.d script looks like the way to go. I'm going to try that today! Thanks for pointing this out!

[Image: widget]

Please add to my reputation if you find my posts usefull (+/- button below posts)
Ubuntu 12.10 minimal XBMC auto-install script :: XBMControl :: Xbmc XBOX Skins :: XBMControl for Android :: Owner of Sudo Systems
find quote
Bram77 Offline
Skilled Python Coder
Posts: 1,369
Joined: Feb 2008
Reputation: 32
Location: Netherlands
Post: #6
Excellent tip thethirdnut! I've got it running. Had to figure some stuff out, but I got there Smile.
I've created a new script to automate this process too. The start post has been updated. I've removed the manual method because it makes it look so damn complicated Smile

[Image: widget]

Please add to my reputation if you find my posts usefull (+/- button below posts)
Ubuntu 12.10 minimal XBMC auto-install script :: XBMControl :: Xbmc XBOX Skins :: XBMControl for Android :: Owner of Sudo Systems
(This post was last modified: 2012-09-27 15:34 by Bram77.)
find quote
Bram77 Offline
Skilled Python Coder
Posts: 1,369
Joined: Feb 2008
Reputation: 32
Location: Netherlands
Post: #7
I haven't got audio working on the xinit version. Please wait a bit before using the script

[Image: widget]

Please add to my reputation if you find my posts usefull (+/- button below posts)
Ubuntu 12.10 minimal XBMC auto-install script :: XBMControl :: Xbmc XBOX Skins :: XBMControl for Android :: Owner of Sudo Systems
find quote
Bram77 Offline
Skilled Python Coder
Posts: 1,369
Joined: Feb 2008
Reputation: 32
Location: Netherlands
Post: #8
Ok... audio is working now. I needed to add the xbmc user to the audio group. It took quite a while before I had that figured out.
I've made a lot of improvements to the scripts. I'm unable to test with an Ati videocard. If anyone is willing to provide feedback about an Ati installation? That would be very helpful.

As far as I've been able to test everything should run smooth now. The scripts could be a lot more comprehensive but it's pretty time consuming to test the scripts. So I've kept it as simple as possible.

[Image: widget]

Please add to my reputation if you find my posts usefull (+/- button below posts)
Ubuntu 12.10 minimal XBMC auto-install script :: XBMControl :: Xbmc XBOX Skins :: XBMControl for Android :: Owner of Sudo Systems
find quote
thethirdnut Offline
Donor
Posts: 692
Joined: Jun 2010
Reputation: 23
Location: western Canada
Post: #9
Hi Bram77,

Thanks for putting this together.

Yes - that xinit script was what I was referring to. Glad it helped. Good to see someone else prefers the 'minimal' minimal route as well. ;-)

I'll have a looksee at your script and get back to you. May be awhile, however, in the middle of a server build, etc...

There seems to be quite a smattering of info out there, but none of it quite complete for newer version of XBMC and Ubuntu minimal. I'll repost as well when I get all my bits sorted.

If I helped out pls give me a +

XBMC1:
i3-540, GT430, Ubuntu 12.04 min + Frodo
-> HT: 58" plasma, Denon 3808CI, Paradigm Studio 60, CC-590, ADP-470, Seismic 12
XBMC2: Atom330, GT240, Ubuntu 12.04 min + Frodo
-> Main: 50" plasma, Rotel RX-1052, B&W 683
Server: 20TB FreeBSD + ZFS
(This post was last modified: 2012-09-27 22:40 by thethirdnut.)
find quote
Bram77 Offline
Skilled Python Coder
Posts: 1,369
Joined: Feb 2008
Reputation: 32
Location: Netherlands
Post: #10
Great Smile

That's exactly what I think the problem is. Requirements and paths change depending on the Ubuntu and XBMC versions. There is quite some information available regarding manual installation of XBMC on a dedicated machine using Ubuntu. But mostly it's about desktop installations running XBMC and especially older versions of XBMC and Ubuntu. I think it would be nice if such information would be part of the XBMC wiki.

I'm looking into integrating the installation script into the mini.iso installation and I want to maintain the script for different XBMC and Ubuntu versions. An advantage in this method is that the user is always using the latest Ubuntu, dependencies and XBMC version when installing. XBMCubuntu needs to release a new iso to offer the latest versions.

[Image: widget]

Please add to my reputation if you find my posts usefull (+/- button below posts)
Ubuntu 12.10 minimal XBMC auto-install script :: XBMControl :: Xbmc XBOX Skins :: XBMControl for Android :: Owner of Sudo Systems
(This post was last modified: 2012-09-27 23:12 by Bram77.)
find quote
Ned Scott Offline
Team-XBMC Wiki Guy
Posts: 19,891
Joined: Jan 2011
Reputation: 247
Location: Arizona, USA
Post: #11
Bram77, nice guide! Mind if we copy this over to the XBMC wiki manual (content added to the wiki is released under CC-SA-BY)?

You can make easy links to the XBMC wiki using double brackets around common XBMC words: [[debug log]] = debug log, [[Video library]] = Video library, [[SMB]] = SMB , [[userdata]] = userdata, etc
(This post was last modified: 2012-09-28 09:06 by Ned Scott.)
find quote
Bram77 Offline
Skilled Python Coder
Posts: 1,369
Joined: Feb 2008
Reputation: 32
Location: Netherlands
Post: #12
That would be great Ned! Maybe the Ati installation script should be tested by someone with an Ati video card before adding it to the wiki, although there isn't much that can go wrong since only two variables vary in the two scripts.

[Image: widget]

Please add to my reputation if you find my posts usefull (+/- button below posts)
Ubuntu 12.10 minimal XBMC auto-install script :: XBMControl :: Xbmc XBOX Skins :: XBMControl for Android :: Owner of Sudo Systems
(This post was last modified: 2012-09-28 09:48 by Bram77.)
find quote
atltrickster Offline
Junior Member
Posts: 18
Joined: May 2012
Reputation: 1
Post: #13
(2012-09-28 09:47)Bram77 Wrote:  That would be great Ned! Maybe the Ati installation script should be tested by someone with an Ati video card before adding it to the wiki, although there isn't much that can go wrong since only two variables vary in the two scripts.

Installed and booted flawlessly on my box using an ATI RadeonHD 4800 series card. THANK YOU SO MUCH! :-)
find quote
Bram77 Offline
Skilled Python Coder
Posts: 1,369
Joined: Feb 2008
Reputation: 32
Location: Netherlands
Post: #14
That's great! Thanks for the feedback Smile

[Image: widget]

Please add to my reputation if you find my posts usefull (+/- button below posts)
Ubuntu 12.10 minimal XBMC auto-install script :: XBMControl :: Xbmc XBOX Skins :: XBMControl for Android :: Owner of Sudo Systems
find quote
sectune Offline
Junior Member
Posts: 34
Joined: Mar 2012
Reputation: 0
Post: #15
Thanks for your great script! After evaluation of your code I would like to ask you if it would be possible to add a (selectable? or at least triggered by some -tokens) option to install the open-source ATI/Nvidia drivers instead of proprietary ones, just to hold the head up of the open-source concept high Wink

Good post? Please rate using the [Image: rate.png] button below.
(This post was last modified: 2012-09-28 11:18 by sectune.)
find quote
Post Reply