Install Ubuntu LTS version into your QNAP NAS

Prepare in QNAP NAS QTS GUI:
1).
install optware by Web UI
ssh login as admin
ipkg install binutils
ipkg install coreutils
ipkg install perl
2).
create user backup, HOME Backup by Web UI
3).
ssh login as admin and setting ENV. variables:
cd /share/Backup
mkdir -p chroot; cd chroot
wget -c http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/debootstrap_1.0.40~precise2_all.deb
ar -x debootstrap_1.0.40~precise2_all.deb
tar xvf data.tar.gz
vi usr/sbin/debootstrap (DEBOOTSTRAP_DIR=/share/Backup/chroot/usr/share/debootstrap)
export DEBOOTSTRAP_DIR=`pwd`/usr/share/debootstrap
export ARCH=i386 (amd64)
export RELEASE=precise (lucid)
export MIRROR=http://tw.archive.ubuntu.com/ubuntu/
export MIRROR=
4).
./usr/sbin/debootstrap –arch $ARCH –foreign $RELEASE ./$RELEASE\_$ARCH $MIRROR
5).
wget -c http://launchpadlibrarian.net/118258808/qemu-user-static_1.0.50-2012.03-0ubuntu2.1_amd64.deb
ar -x qemu-user-static_1.0.50-2012.03-0ubuntu2.1_amd64.deb
tar xvf data.tar.gz
6).
cp ./usr/bin/qemu-x86_64-static ./$RELEASE\_$ARCH/usr/bin
export DEBOOTSTRAP_DIR=””
LC_ALL=C LANGUAGE=C LANG=C chroot $RELEASE\_$ARCH /debootstrap/debootstrap –second-stage
7).
LC_ALL=C LANGUAGE=C LANG=C chroot $RELEASE\_$ARCH dpkg –configure -a
8).
wget –no-check-certificate https://help.ubuntu.com/lts/sample/sources.list

cp $RELEASE\_$ARCH/etc/apt/sources.list $RELEASE\_$ARCH/etc/apt/sources.list.orig
cp sources.list $RELEASE\_$ARCH/etc/apt/sources.list
9).
LC_ALL=C LANGUAGE=C LANG=C chroot $RELEASE\_$ARCH /bin/bash -c “apt-get update; apt-get install vim sudo gnupg -y; apt-get update; locale-gen en_US.UTF-8; echo “Asia/Taipei” > /etc/timezone; dpkg-reconfigure -f noninteractive tzdata”
10).
LC_ALL=C LANGUAGE=C LANG=C chroot $RELEASE\_$ARCH apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 3E5C1192
11).
LC_ALL=C LANGUAGE=C LANG=C chroot $RELEASE\_$ARCH apt-get update

chroot $RELEASE\_$ARCH /bin/bash

HAPPY HACKING …

APPEND – Useful scripts:
1).
====mountall.sh====
cat > mountall.sh << EOF
#!/bin/bash

if [ -z $1 ]; then
CHROOT_PATH=ubuntu
else
CHROOT_PATH=$1
fi

DROOT=`pwd`/$CHROOT_PATH

mount -t proc proc $DROOT/proc
mount –bind /dev $DROOT/dev
mount -t sysfs sysfs $DROOT/sys
mount –bind /dev/pts $DROOT/dev/pts
EOF
=================
2).
====first.sh====
chroot ubutu /bin/bash
apt-get update
apt-get install vim sudo gnupg -y
apt-get updatelocale-gen en_US.UTF-8
echo "Asia/Taipei" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
exit
=============

Advertisements

About xlcwu

Self-employed (One-man Company), Developer/Chief Designer/Consultant, Embedded Linux/NAS/Storage/Platform/Devices, Xcode/Cocos2D/Cocoa/Objective-C, at Joe’s Lab – Newland ESP (TM).
This entry was posted in Linux, NAS, QNAP, Ubuntu and tagged , . Bookmark the permalink.

5 Responses to Install Ubuntu LTS version into your QNAP NAS

  1. kriznik says:

    hi, thanks for your post and i have a question: is it possible to use this kind of instalation for PXE boot from another computer?
    I’m looking for solution that i have several systems installed onto NAS and on thinclients (or from parallels desktop) im connecting to NAS for desired system.

    thanks for answer

    • xlcwu says:

      I have not tried …
      Believed it is OK, QNAP NAS can act as PXE server but you need edit pxelinux.cfg file by manual no GUI (QTS 4.0 F/W).
      QTS is one kind of Linux :p

  2. kriznik says:

    well, i tryed your approach and besides some old files it’s working so far with little updates on some lines. But really dont know how to use this bootstraped ubuntu for booting into it, cos it have no vmlinuz initrd for PXE config… 😦

    • kriznik says:

      so little update, im able to PXE onto LTSP running on QNAP! but im not able to start full GUI desktop, only graphical login screen and then waiting … if i do ctrl+alt+1 then i can login = so system is working, but somehow graphical part not 😦

      • xlcwu says:

        Try to install X Window System to your PXE rootfs environment …

        Packages install by:
        aptitude install xubuntu-desktop (ubuntu-desktop)

        😀

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