Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Install java,flash,mp3,mp4 to Chromium OS
## Setup java
if [ `uname -m` == 'x86_64' ]; then

Flash, java, mp3 and mp4 and pdf support for Chromium OS builds by hexxeh

This script downloads and installs libraries needed for Chromium, so that you can actually "TEST" multimedia experience.

How to use?

Simply run as root user

curl -L | bash

or if you prefer wget

wget -qO- | bash

Then reboot computer!

You don't know how to become root user?

$ chronos   (user)
$ facepunch (password)
$ sudo su

That's it, enjoy!

No sound?

Login as root

$ mount -o remount, rw /
$ alsaconf

Choose your sound card, then reboot!

Bugs was the hardest thing to do here, it should have a lot of bugs (probably) and might only work for this version.

#based on
if [ `uname -m` == 'x86_64' ]; then
# 64-bit
export CHROME=""
export TALK=""
export JAVA=""
# 32-bit
export CHROME=""
export TALK=""
export JAVA=""
#clean stuff
mount -o remount, rw /
cd /opt/
rm "/opt/"
curl -o "/opt/" ""
mkdir -p /usr/lib/mozilla/plugins/
#Flash, pdf
echo "Downloading Google Chrome"
curl -z "/opt/chrome-bin.deb" -o "/opt/chrome-bin.deb" -L $CHROME
python /opt/ /opt/chrome-bin.deb /opt/chrome.tar.lzma
rm -rf chrome-unstable
mkdir chrome-unstable
tar -xvf /opt/chrome.tar.lzma -C chrome-unstable
cp /opt/chrome-unstable/opt/google/chrome/ /usr/lib/cromo/ -f
cp /opt/chrome-unstable/opt/google/chrome/ /opt/google/chrome/ -f
cp /opt/chrome-unstable/opt/google/chrome/ /usr/lib/mozilla/plugins/ -f
cp /opt/chrome-unstable/opt/google/chrome/ /opt/google/chrome/ -f
cp /opt/chrome-unstable/opt/google/chrome/PepperFlash/ /opt/google/chrome/pepper/ -f
cp /opt/chrome-unstable/opt/google/chrome/PepperFlash/manifest.json /opt/google/chrome/pepper/ -f
curl -L > /opt/google/chrome/pepper/
rm -rf chrome-unstable
rm /opt/chrome.tar.lzma
## Google Talk
echo "Downloading Google Talk plugin"
curl -z "/opt/talk-bin.deb" -o "/opt/talk-bin.deb" -L $TALK
python /opt/ /opt/talk-bin.deb /opt/talk.tar.gz
rm -rf /opt/google/talkplugin
tar -xvf /opt/talk.tar.gz -C /
rm /opt/google/chrome/pepper/
ln -s /opt/google/talkplugin/ /opt/google/chrome/pepper/
rm /opt/google/chrome/pepper/
ln -s /opt/google/talkplugin/ /opt/google/chrome/pepper/
rm /opt/talk.tar.gz
echo "Downloading Oracle Java"
curl -z "/opt/java-bin.tar.gz" -o "/opt/java-bin.tar.gz" -L $JAVA
rm -rf /usr/lib/jvm/java-7-oracle/jre/
mkdir -p /usr/lib/jvm/java-7-oracle/jre/
tar -xvf /opt/java-bin.tar.gz -C /usr/lib/jvm/java-7-oracle/jre/ --strip-components 1
rm /usr/lib/cromo/
if [ `uname -m` == 'x86_64' ]; then
ln -s /usr/lib/jvm/java-7-oracle/jre/lib/amd64/ /usr/lib64/cromo/
ln -s /usr/lib/jvm/java-7-oracle/jre/lib/amd64/ /usr/lib64/mozilla/plugins/
ln -s /usr/lib/jvm/java-7-oracle/jre/lib/amd64/ /usr/lib64/
ln -s /usr/lib/jvm/java-7-oracle/jre/lib/amd64/ /opt/google/chrome/
ln -s /usr/lib/jvm/java-7-oracle/jre/lib/i386/ /usr/lib/cromo/
ln -s /usr/lib/jvm/java-7-oracle/jre/lib/i386/ /usr/lib/mozilla/plugins/
ln -s /usr/lib/jvm/java-7-oracle/jre/lib/i386/ /usr/lib/
ln -s /usr/lib/jvm/java-7-oracle/jre/lib/i386/ /opt/google/chrome/
curl -L > /etc/env.d/99java
restart ui
# -*- coding: utf-8 -*-
# deb2tar - convert a Debian Linux .deb file to a .tar
# First line -- file header: "!<arch>" or similar
# Multiple blocks -- each one, a header line followed by data
# Header line -- <filename> <num1> <num2> <num3> <mode> <len>
# Data -- <len> bytes of data
# We want the block called "data.tar.*"
import shlex
import os
import sys
def copypart(
bufsize=1024 * 1024,
Binary copy
in_file = open(src, 'rb')
out_file = open(dest, 'wb')
pointer = start
chunk = False
amount = bufsize
while pointer < length:
if length - pointer < amount:
amount = length - pointer
chunk =
pointer += len(chunk)
def main(file_open, file_write):
Copy tar data block
print 'Source file:', file_open
print 'Destination file:', file_write
zacetek = 0
konec = 0
file_name = ''
with open(file_open, 'r', 1024 * 1024) as in_file:
for (pointer, line) in enumerate(in_file):
zacetek += len(line)
if 'data.tar' in line:
meta = shlex.split(line[line.find('data.tar'):len(line)])
konec = int(meta[5])
file_name = str(meta[0])
statinfo = os.stat(file_open)
if statinfo.st_size - konec == zacetek:
copypart(file_open, file_write, int(zacetek), int(konec) + int(zacetek))
print '----DEBUG----'
print 'start block', zacetek
print 'end block', konec
print 'end deb', statinfo.st_size
print 'diff', statinfo.st_size - konec
print 'Internal filename is ' + file_name
print 'meta', meta
print 'Failed parsing file! Internal meta mismatch, please report this to author!'
print '----DEBUG----'
if __name__ == '__main__':
main(sys.argv[1], sys.argv[2])
except Exception, e:
print e
print 'Usage:', sys.argv[0], 'debian_file.deb', 'tar_file.tar.lzma or gz'
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Registration file for Pepper Flash player.
PLUGIN_NAME="Shockwave Flash"
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import urllib
import re
import shlex
import subprocess
from urlparse import parse_qs
import httplib
from urlparse import urlparse
import os
import time
debug = False
soup = BeautifulSoup(urllib.urlopen('').read())
## {{{ (r1)
def confirm(prompt=None, resp=False):
"""prompts for yes or no response from the user. Returns True for yes and
False for no.
'resp' should be set to the default value assumed by the caller when
user simply types ENTER.
>>> confirm(prompt='Create Directory?', resp=True)
Create Directory? [y]|n:
>>> confirm(prompt='Create Directory?', resp=False)
Create Directory? [n]|y:
>>> confirm(prompt='Create Directory?', resp=False)
Create Directory? [n]|y: y
if prompt is None:
prompt = 'Confirm'
if resp:
prompt = '%s [%s]|%s: ' % (prompt, 'y', 'n')
prompt = '%s [%s]|%s: ' % (prompt, 'n', 'y')
while True:
ans = raw_input(prompt)
if not ans:
return resp
if ans not in ['y', 'Y', 'n', 'N']:
print 'please enter y or n.'
if ans == 'y' or ans == 'Y':
return True
if ans == 'n' or ans == 'N':
return False
## end of }}}
def get_head(name, req):
url = urlparse(req)
conn = httplib.HTTPConnection(url.netloc)
conn.request('HEAD', url.path + '?' + url.query)
res = conn.getresponse()
return res.getheader(name)
def run(cmd, d=False, shell=False):
# print 'cwd', os.path.dirname(os.path.abspath(__file__))
print cmd
if not debug or d:
proc = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE, stderr=subprocess.PIPE,
(curlstdout, curlstderr) = proc.communicate()
# print '|', curlstdout + curlstderr, '|'
return curlstdout + curlstderr
def find_croot():
disk = run('bash -c "ls /dev/disk/by-label/ -all | grep C-ROOT"', True).split('/')
print 'C-ROOT is :', disk[len(disk) - 1]
if confirm(prompt='Is this correct?', resp=True):
return disk[len(disk) - 1]
return input('Enter correct disk? (sdd5)?')
def unzip(verzija):
run('unzip ' + verzija + '')
def kpartx(verzija):
disk = find_croot()
run('kpartx -a -v ChromeOS-Vanilla-' + verzija + '.img')
run('dd if=/dev/mapper/loop0p3 of=/dev/' + disk)
run('fsck /dev/' + disk + ' -fy')
# run('mount /dev/mapper/loop0p3 /mnt/ -o loop,ro')
# Time.sleep(5)
# run('bash -c "cd /mnt; tar cvf ' + loc + '/chromeos.tar opt/"')
# time.sleep(5)
# run('umount /mnt/')
# time.sleep(5)
run('kpartx -d -v ChromeOS-Vanilla-' + verzija + '.img')
def curl(zip_image, verzija):
run('curl -C - -z ' + verzija + ' -L ' + zip_image + ' -o ' + verzija
+ '')
def get_version(lin):
url = parse_qs(lin['href'])
return str(url['build'][0])
def main():
linki = soup.find_all(href=re.compile('track=vanilla.+type=usb'))
i = 1
for lin in linki:
print '(', i, ')', get_version(lin)
i += 1
# break
verzija = get_version(linki[int(input('Choose version to download?')) - 1])
zip_image = get_head('location', ''
+ verzija + '&type=usb')
size = int(get_head('content-length', zip_image))
size_local = int(os.stat(verzija + '').st_size)
except Exception:
size_local = 0
print 'size', size
print 'size local', size_local
if size != size_local:
curl(zip_image, verzija)
if __name__ == '__main__':
dz0ny commented Jul 8, 2012

@riadle No, no automatic updates.

Malify commented Jul 9, 2012

After becoming root, when i type the command line, I get stuck on a 'bash: cur1: command not found'.

Any suggestions on that?

dz0ny commented Jul 9, 2012

@Malify Its curl(L) not cur1

dz0ny commented Jul 10, 2012

@vik21 Script is robust, unless builds do something radically with system paths it will work. As for Gtalk I haven't tested it, but it seems it's loaded.

dz0ny commented Jul 18, 2012

@jcn115 what version and build are you using. Seems like broken build...


Tried this and MP3 won't work.

dz0ny commented Aug 28, 2012

@MiguelAO1029 audio support has been disabled at compile time, currently there is no way to enable it. Flash works and as many sites use Flash as fallback for MP3,MP4 it will work just fine.


Ok Also I tried talk and still nothing. Someone told me there's an extension I need to get and I don't know what it is.

rikels commented Nov 5, 2012

i tried running this script on the latest Vanilla build (31-10-2012) but sadly enough it didn't work. am i doing something wrong myself (ID-10t error)? or is it something with the paths, or anything change?

rikels commented Nov 5, 2012

seems that isn't working, or the chrome-bin.deb is corrupt. when i execute the command: "python /opt/ /opt/chrome-bin.deb /opt/chrome.tar.lzma" it gives this output:
"source file: /opt/chrome-bin.deb
destination file: /opt/chrome.tar.lzma
start block 33002661
end block 33008770
diff 6109
internal filename is data.tar.lzma
meta ['data.tar.lzma' , '13498855520' , '0' , '0' , '100644' , '33002661' , '`']
failed parsing file! internal meta mismatch, please report this to author!

i tried re-downloading chrome-bin.deb, but that didn't help either.

quiro91 commented Nov 21, 2012

does this script work in last days build? I tryed to use alsaconf but the command wasn't found

rikels commented Nov 26, 2012

for me the script didn't work because it uses python, which doesn't seem to be in Chromium OS. you can try if my script works, with all credits towards Dz0ny.

but Alsaconf should be working since it has nothing to do with this script. alsaconf is a "program" to configure your soundcard. are you running it as super user? (sudo alsaconf). are you running it in the therminal (not the alt+ctrl+t, but alt+ctrl+F2)

rikels commented Dec 17, 2012

on the new builds your script is working again, python is back in the new hexxeh builds. but Alsaconf is removed from it.


I ran the script on this page after installing chromium. The script overwrites chromium with a genuine chrome image and on my samsung n210 everything worked out of the box including google voice/video. The only omission is ctrl alt F2 which probably means that is not running in developer mode.


ive got a problem with this... flash player says something along the lines of "couldnt load plugin" after doing the sudo su curl for the hexxeh builds i tried redoing it plenty of times please help me- Edit scratch that if anyone else has this problem just remove chromium os from ur hdd/sdd reinstall it and restart this script THANKS!


There's an issue with extracting chrome-bin.deb (and hence the Flash plugin).

Source file: /opt/chrome-bin.deb
Destination file: /opt/chrome.tar.lzma
start block 6124
end block 37674757
end deb 37680882
diff 6125
Internal filename is data.tar.lzma
meta ['data.tar.lzma', '1361412583', '0', '0', '100644', '37674757', '`']
Failed parsing file! Internal meta mismatch, please report this to author!


In, the chrome-unstable should really be chrome-stable.


Not working on arnoldthebat 64bit build. Any solutions?


I managed to convert the deb file using this site:

Chopsta commented Jun 20, 2013


perler commented Jul 15, 2013

should this provide a java plugin to chrome? this does't seem to work..

perler commented Jul 28, 2013

and this stoped working at least with chromium 30 dev channel. all sorts of plugins are crashing after the installation, including crosh..

shagr4th commented Aug 7, 2013

I hacked around to fix the deb2tar issue and updated the script to merge all files into a single one, getting plugins from the unstable branch :

flash, pdf and nativeclient are working fine on virtualbox and the latest arnold build...

Next steps would be to test and update the google talk plugin part, if necessary, and find out why the mp3 plugin is not working


Thanks shagr4th! That one is working!


youtube was able to see safely, thanks to you.
Although I am a Japanese, in seeing the animation of the site of TED with a Japanese subtitle, I think that he would like to install 10.3 of flashplayer of a previous version.
I am glad if you develop the patch into which both of old and new flashplayer(s) are put.
since I am creating this text by the automatic translation function -- the case of strange English -- I am sorry!


Getting error. curl failed writing body...

Without bash, able to download everything..however, flash and other stuff not working...

jimaro commented Jan 5, 2014

i get an error on line 1: syntax error near unexpected token "newline"
bash: line 1: ''

curl: (23) failed writing body (0!=7338)

any suggestions?

@ultrajack had purnished. 404 not found...

shoeper commented Apr 4, 2014

fixed broken links and used deb2tar from shagr4th

just run
curl -L | bash > log.txt OR
curl -L | bash > log.txt


I'm using the latest arnoldthebat image.
When using this scripts i get several directory error's.
For example "/opt/google/chrome/pepper/", the pepper directory does not exists on my build.

I noticed when I copied the files manually that the system does not create the pepper directory but that the copied files get's the name pepper. The system becomes unusable after this.

So maybe it's better to try to create all dirs in advance like the mozilla plugin dir.

Same happens with /usr/lib/chromo

Unknown commented May 13, 2014

For x64 Arnoldthebat builds, you can use my script :

Works perfectly on Camd64 from 12 may 2014.


Do i really have to write all that? Or is there a way to copy/paste?


Now that Chrome has dropped support for NPAPI, do you guys know of an alternative to get Java plugins working on Chrome? I was able to install Crouton and have the icedtea plugin installed and running from my chroot's copy of Chrome but not the one running from the Chrome OS. Would appreciate any tips in making that work on the main installation of Chrome also.

giliammc commented Feb 4, 2015

how do i remove it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.