Skip to content

Instantly share code, notes, and snippets.

@khilnani
Last active July 22, 2018 07:31
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khilnani/33800c637f898c1781a7 to your computer and use it in GitHub Desktop.
Save khilnani/33800c637f898c1781a7 to your computer and use it in GitHub Desktop.
Install Ubuntu on Chromebook. In Ubuntu, to install Lamp, Mongo DB: wget -O - http://goo.gl/YMhdcP | sudo bash

Install Ubuntu on Chromebook

  • Restart using ESC-Refresh-Power
  • At the prompt, CTRL-D to erase and install ChromeOS in Developer mode
  • Launch terminal - CTRL-ALT-t
  • Download and Install Crouton from (https://github.com/dnschneid/crouton)
    • sudo sh -e ~/Downloads/crouton -t cli-extra
    • sudo sh -e crouton -p "/media/removable/USB Drive/" -r trusty -t cli-extra
    • sudo sh -e crouton -p "/media/removable/USB Drive/" -r trusty -t xfce
  • Open up port 80 if needed - sudo /sbin/iptables -A INPUT -p tcp --dport 80 -j ACCEPT
  • Turn off sleep mode - sudo initctl stop powerd
  • Enter Linux
    • CLI
      • sudo enter-chroot
      • sudo enter-chroot -n trusty
      • sudo enter-chroot -c /usr/local/chroots -n trusty
    • XFE
      • sudo enter-chroot startxfce4
      • sudo enter-chroot -n trusty startxfce4
      • sudo enter-chroot -c /usr/local/chroots -n trusty startxfce4
  • In Ubuntu, run - wget -O - http://goo.gl/YMhdcP | sudo bash

Links

Backup and Restore

  • Backup - sudo edit-chroot -f /path/to/folder -b trusty
  • Restore - sudo edit-chroot -f /path/to/folder -r trusty
  • Install from backup - sudo sh -e crouton -r trusty -t xfce -f /media/removable/SD\ Card/backup/trusty-20130617-1234.tar.gz

Notes

  • You can flip through your running chroot desktops and Chromium OS by hitting Ctrl+Alt+Shift+Back and Ctrl+Alt+Shift+Forward
  • You can start Xfce via the startxfce4 host command: sudo startxfce4
  • apache is at /etc/apache2 and /var/www
  • php is at /etc/php5/apache2/php.ini
  • mysql is at /etc/mysql/my.cnf
  • Start Apache - sudo service apache2 start or sudo /etc/init.d/apache2 start
  • Start httpd - sudo /etc/init.d/mysql start
#!/usr/bin/env sh -x
echo '## Update'
apt-get update
echo '## Install git'
apt-get install git-core
echo '## Install mongo db'
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
apt-get update
apt-get install mongodb-org
mkdir /data
mkdir /data/db
echo '## Install LAMP'
apt-get install tasksel
tasksel install lamp-server
echo '## Download Adminer'
wget http://www.adminer.org/latest-en.php -O /var/www/html/adminer.php
chmod 755 /var/www/html/adminer.php
echo '## /etc/rc.local'
echo '/etc/init.d/apache2 start' > /etc/rc.local
echo '/usr/bin/mongod --smallfiles --fork --config /etc/mongod.conf' >> /etc/rc.local
echo 'export HOME=/etc/mysql' >> /etc/rc.local
echo 'umask 007' >> /etc/rc.local
echo '[ -d /var/run/mysqld ] || install -m 755 -o mysql -g root -d /var/run/mysqld' >> /etc/rc.local
echo '/usr/sbin/mysqld &' >> /etc/rc.local
@tibbeecode
Copy link

This is my first comment, so my apologies if this isn't correct?

Running this failed at apt-get install mongodb-org - a response was requested? I continued along, copying and pasting the rest with sudo. At line 26, access was not allowed to rc.local, so I inserted the lines - only the parts between apostrophes - into the file prior to the exit 0 line. The installation seems to be running fine.

I obviously have no idea what I'm doing - my apologies if this is in bad form. I'll be happy to delete this comment. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment