Raspberry PI 3, Ubuntu & LXC Howto

To install Ubuntu on Raspberry PI 2 or 3 follow these steps:

  1. Have a micro SD card, of at least 16 GB, handy (Minimum is 8 GB but it may run quickly short of space).
  2. Go to this page of the Ubuntu Pi Flavour Maker website to download the Ubuntu Image you will prefer and install it onto a micro SD card following the instructions on that page.
  3. Connect the Raspi to an HDMI Monitor, an USB Keyboard & Mouse and an Ethernet wired switch (with Internet access).
    Once the micro SD is inserted back into the RasPI board and it is turned on the Ubuntu installation will start and behaves like any other Ubuntu installation.
  4. Update/Upgrade the RasPI with apt:
    sudo -i                       ;# or login as root
    apt-get update
    apt-get dist-upgrade​

    It will take a relatively long time to complete the process but at the end the RasPI will be updated to the latest packages.

  5. Open a console shell, or a remote ssh shell, or a terminal session under the Window Manager of the Ubuntu Distro you have chosen.

Once the installation is completed you can start the tweaking I’m suggesting:

  1. Download & Install webmin & webminstats:
    sudo -i                                  ;# or logged as root
    wget http://downloads.sourceforge.net/project/webadmin/webmin/1.820/webmin_1.820_all.deb
    wget http://downloads.sourceforge.net/project/webminstats/Sysstats/2.14/webmin-sysstats_2.14_all.deb
    dpkg -i webmin_1.820_all.deb             ;# Will complain of dependencies, We will fix it next
                                             ;# It will take quite a while ...
    apt-get -f install                       ;# To fix dependencies​
    dpkg -i webmin-sysstats_2.14_all.deb     ;# Will complain of dependencies, We will fix it next
    apt-get -f install                       ;# To fix dependencies​
    apt-get install libcgi-pm-perl           ;# not in the dependencies tree ...
    reboot                                   ;# Just to settle everything ...
    
    # Once rebooted
    # You can now open the browser on your desktop and connect to https://<your_raspi_ip_address>:10000
    
  2. Install the following packages (Optional):
    apt-get install chrony synaptic​ gparted traceroute lsof
    apt-get install tightvncserver
    • Chrony will substitute NTP and I suggest it, since it is much better than NTP.
    • Synaptic is the best Graphical Package Manager available.
    • With GParted you can extend to 16 GB the root partition.
    • Traceroute, lsof are useful utility programs
    • Tight VNC Server will allow you to access the RasPI headless and still have a Graphical GUI.

    Start a the VNC server on the RasPI with the following command:

    vncserver :1

    After this you can connect from your Desktop PC with a VNC Viewer. Just remember to add “:1” to the IP Address connect string.

  3. Install LXC if you want to try Container Virtualization on the Raspberry PI 3 (3 only, guess why):
    sudo -i                                  ;# or logged as root
    apt-get install lxc lxctl
    apt-get install lxc-templates​
    modprobe configs
    lxc-checkconfig
  4. Create your first Privileged Container:
    sudo -i                                  ;# or logged as root
    lxc-create -t download -n CEUBU1         ;# Interactively choose the DIST, REL, ARCH
    vi /var/lib/lxc/CEUBU1/config            ; Edit the Container configuration file
    # Insert the line "lxc.seccomp = " (The blank is important) after the "lxc.utsname" line and save
    # This line is essential, to allow the container to start.
    lxc-info -n CEUBU1
    lxc-start -n CEUBU1 -d
    lxc-attach -n CEUBU1                     ;# No root password (You can change it later)
    lxc-ls --fancy
    lxc-info -n CEUBU1

    The Container has to be Privileged and its configuration file has to be modified, since the use of unprivileged containers require a kernel recompilation.

  5. Install the LXC Web Panel, the web-based administration tool to manage LinuX Containers (LXC):
    sudo apt-get install python-setuptools
    wget https://lxc-webpanel.github.io/tools/install.sh -O - | sudo bash​

    Once the installation is completed, open up your web browser and go to http://<your_raspi_ip_address>:5000. Default Login & Password: admin/admin.

You can get some more detail by downloading this.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Protected with IP Blacklist CloudIP Blacklist Cloud