Xubuntu with a *pure* Debian Base (Part 5)

If you have followed the previous 4 parts to this tutorial then well done! You should have a nice Xubuntu themed, XFCE installation on a Debian Testing (Jessie) base. Having gone to all this effort, you might want to now:


  • Backup your system in case something goes wrong 
  • share your system with friends/family
  • make additional installations on different hardware.


I am going to provide some instructions on doing all of these things using some simple tools provided by the Refracta distribution that are licensed for use through the GPL.

10. Prepare your system


Set up the Skeleton directory

The Skeleton directory is found at /etc/skel and contains the files and directories that are copied into a new user's home directory when that new user account is created. It is the equivalent of the Windows default user account. This is where you need to place any config files that determine the configuration of a user's session including:

  • Desktop icons
  • Desktop environment configuration eg panel, desktop, window theme
  • Application menu layout
  • Bash and terminal settings
  • Application specific customization
In our Xubuntu themed example, we want to make sure each new user account will look identical to the one that we have worked so hard to set up. Here's how:

  1. Log in as root
  2. Open Thunar and browse to your home folder
  3. Enable hidden files in Thunar from the view menu
  4. Copy these directories into the existing /etc/skel directory :
    1. Desktop, Documents, Downloads, Music, Pictures, Public, Templates, Video
    2. Make sure the above directories are empty
    3. Now create these hidden directories:
      1. /etc/skel/.config
      2. /etc/skel/.local
      3. /etc/skel/.local/share
    4. And finally copy these directories into the hidden ones you've just created above:
      1. ~/.config/menus
      2. ~/.config/xfce4
      3. ~/.config/xfce4-session
      4. ~/.local/share/applications
      5. ~/.local/share/mime
These directories contain the config files relating to the configurations you have made to XFCE to theme it like Xubuntu without containing any personal data.


Test the Skeleton and create a live session user account

  1. To test the Skeleton directory is correctly set up, simply create a new user account. As you will be creating a live ISO image of your installation later, you might as well make this the live user account, so use a simple username like "user" or "live" with an identical password.
  2. Still logged in as root, open a terminal and type adduser followed by the username you want to create eg:
    adduser user
    Adding user `user' ...
    Adding new group `user' (1002) ...
    Adding new user `user' (1001) with group `user' ...
    Creating home directory `/home/user' ...
    Copying files from `/etc/skel' ...
    Enter new UNIX password:
    Retype new UNIX password:
    passwd: password updated successfully
    Changing the user information for test
    Enter the new value, or press ENTER for the default
    Full Name []: Live Session User
    Room Number []:
    Work Phone []:
    Home Phone []:
    Other []:
    Is the information correct? [Y/n] y
  3. Make sure your root password is now straightforward as well eg change it to root
    passwd root
    Changing password for root
    (current) UNIX password:
    Enter new UNIX password:
    Retype new UNIX password:
    passwd: password updated successfully
  4. Log out and log in with your new user account and check that your theme has 'held'. In particular check the Whisker menu, check the file manager displays the home directory correctly. Check the icon and Window themes etc...
  5. You might also want to copy the skel files into the root account so that the root desktop has the same appearance. Some distros prefer to keep the root account theme different - it's up to you.

Download imaging tools from Refracta

  1. Before you attempt to install the imaging tools, you will need to install some dependencies. If you want to try the latest testing branch of the tools, then you will need to enable the sid repository and install the following packages first:
    liblzo2-2
    isolinux
    squashfs-tools
    Syslinux
    Syslinux-common
    Syslinux-utils
  2. Install Yad for the GUI element of these tools to work:
    https://github.com/RichJack/Xubuntu/raw/master/yad_0.26.1-1~webupd8~trusty1_i386.deb
  3. Then download the tools from here:
    http://distro.ibiblio.org/refracta/files/Testing/
    refractainstaller-base_9.1.0_all.deb
    refractainstaller-gui_9.1.0_all.deb
    refractasnapshot-base_9.1.2_all.deb
    refractasnapshot-gui_9.1.2_all.deb
    refracta2usb-0.9.6.deb (optional)
  4. Install the tools using gdebi or dpkg.
  5. Change the splash image at /usr/lib/refractasnapshot to the Xubutu wallpaper (Copy this 640x480 png image):
Clean your system
  1. Log back out and back in as root. Delete your original user account (after backing up any information you think you need). In a terminal:
    userdel <yourusername>
  2. Delete all files/directories that you don't want in the live system:
    1. Deleted user's home directories
    2. Remove old log files:
      rm /var/log/*.gz
      rm /var/log/*.old
      rm /var/log/*/*.gz
    3. Purge un-needed packages with apt-get autoremove
    4. Check in Synaptic under, Status/Residual Config and remove any packages there that you know you won't need.
    5. Install bleachbit and run it under the user and then root account.
  3. Remove any packages that you don't think a conventional user would need eg: bleachbit, gdebi...
  4. If you have created this in VirtualBox, you may now wish to remove the VirtualBox guest additions as they are not licensed under the GPL.
  5. If you are thinking of distributing your ISO internationally, then you might want to consider removing non-free software, drivers or codecs that are not freely distributable eg libdvdcss2, Adobe Flash Player... 
  6. Remember, real hardware might require real drivers eg Wifi, video drivers. If these aren't installed on your system before you take the snapshot, they won't be available on the live image.
  7. You will probably want to have Gparted installed so that the live system has a graphical way of partitioning disks before installation.

11. Create a Live CD ISO 


This bit is simple. All you need is about twice the hard disk space available as you have used space (in this instance 5GB of free space would be enough):

  1. Log in as root.
  2. Select Refracta Snapshot from the Applications Menu. 
  3. Accept the defaults and let it run.
  4. The ISO will be created at /home/Snapshots and will have a filename based on the date/time (you can easily change this).
  5. I took a test snapshot of my Xubuntu/Debian installation and it was roughly 650MB in size, so just fits nicely on a CD and took about 30 minutes to generate.
  6. If you created it in VirtualBox, use shared folders to transfer it back to the host system, otherwise you can burn it straight to CD from your system or transfer it out using USB.
  7. You can then test the Snapshot in VirtualBox or on real hardware. You'll lose the boot splash as the live CD uses Syslinux to boot rather than Plymouth, but everything else should be as you configured it.
  8. The Live CD can be installed using the Refracta Installer or transferred to a USB using the Refracta2USB application or UNetbootin on Linux or Windows.







No comments:

Post a Comment