I would like to customize Ubuntu live CD by installing some additional packages. I have followed the Ubuntu help wiki guide but it doesn't seem to work. Can anyone provide clear instructions?
I'm not keen to use Remastersys; I'd prefer a manual way.
Customization
Packages that I want to install:
- Thunderbird
- Samba
- SSH
Changes that I need:
- Remove Games menu from the Application menu
- Firefox shortcut on Desktop
- Radiance as the default Theme
- Different default Ubuntu Wallpaper
Configuration file changes
- I want the panel to be placed at the bottom
- I want to paste my Samba configuration file instead of default Samba configuration
- I have few Firefox shortcuts and folders I would like to show that in Desktop
- Also it will be nice if you say me how to change the icon sets
Recent Updates
- I have customized Ubuntu 10.10 with Firefox shortcuts and few folders on desktops. Everything went smooth. But the installer gets crashes after choosing the timezone. How do i fix this issue?
- Also setting wallpaper affects the login screen. The wallpaper which I set is displayed on the login screen also. I just want the default one for the login screen.
Creating your own Custom Live CD - the manual way.
1. Preparations
First you download the Live CD ISO. While it is downloading install some software that is needed for rebuilding:
sudo apt-get install squashfs-tools schroot
Squashfs is a compressed read-only filesystem for Linux.
schroot allows users to execute commands or interactive shells in different chroots.
Mount the Live CD:
If you use another ISO or another location for your download please adjust accordingly.
Create a working area and copy contents over to the working area:
If you get an error like this while doing modprobe:
move the modprobe.conf
mv /etc/modprobe.conf /etc/modprobe.conf.OLD
and try again!Network access:
Create a pseudo filesystem:
2. Customizing
You can get a list of all packages with
dpkg-query -W --showformat='${Package}\n' | less
You can remove games with
apt-get remove --purge gnome-games
Update your sources with
sudoedit /etc/apt/sources.list
. Comment out lines you do not want and uncomment the ones you do want, add in PPAs if you want and then you need to update withapt-get update && apt-get dist-upgrade
Adding packages like thunderbird, Samba, Samba system config and SSH is done the same way as you would normally install from command line. So
sudo apt-get install thunderbird samba system-config-samba ssh
will add those.If you've manually downloaded the package from you can install it with
sudo dpkg -i {file_name}.deb
To create an AskUbuntu shortcut on the desktop:
You can add more of these (skip the mkdir part) by editing the URL to something else. Courtesy of dv3500ea
Changing settings inside gconf-editor.
You can change any gconf option if you know what the path is of that option and the value you want it to be (and the type of the value of course).
Changing the wallpaper is done with the path I pointed arrows to:
/desktop/gnome/background/
, it is a string value and it usespicture_filename
as an option. The value it currently holds on my desktop is/discworld2/Downloads/fantasticwall_2.jpg
. The background itself should be copied into/usr/share/backgrounds/
. Make sure to set permissions and owner.Examples:
To change the wallpaper (change the filename in the 1st command to your own image) to this image and to change the theme to Radiance you can use this information to create commands to set this for your live cd:
Courtesy of dv3500ea
Enable remote desktop:
Settings for icons, panels etc are all done by adding a command like this.
Alternatively you can edit
/etc/gconf/gconf.xml.defaults/%gconf-tree.xml
(or when you are down save this file for future usage). All the configuration settings done through gconftool-2 are stored in this file.Change the default timezone used by the live cd
Change locale setting to english (of course change it to what you want)
Configure configuration files.
If you want to have a custom configuration file for a certain package you can do this in several ways.
The difficult (but most logical) way would be to either find the package, change the configuration file and repackage it or to find the source files, figure out where they store their dummy config file and change that and then rebuild the package.
Of course this only works if the default configuration file is included in the source package. Many packages auto-generate their config files in the {packagename}.postinst script so it would make it rather difficult to get this done.
The easiest way would be to create a script and copy your current config to
/etc/skel
so they get added to your desktop (similar to adding firefox shortcuts as explained above) and after installing click the desktop link to set the config file to the place it needs to be. The script could both do the copying and removal of both the script and config file from your desktop after it succesfully installed. This method can be used to update the Samba configuration (put your current config in/etc/skel/
. Put a script in there that has execute permissions and contains a move of said config to/etc/samba/smbd.conf
and all you need to do afterwards is execute the script).This basically always works since it replaces a post-install manual action with a post-install manually activated script. But it also means it is not part of the custom live cd.
3. Cleaning up
This removes all the temporary files; not what we created.
~/livecd/
is readonly so a normalrm
will not remove these files. You need to mount it with write access (or as I did use the new live cd to boot and mount the home andrm
it from there.4. Setting up the ISO
Manifest files.
Regenerate squashfs file.
Update md5 sums.
5. Creating the ISO.
6. Unmount & Clean
7. Comments:
Everything was tested with an Ubuntu 11.04 Live CD. Only thing that went wrong was chrooting: I added dchroot to the files you need to install to do this.
Regarding "should create some firefox shortcuts on desktop", "Should change the default theme to radiance" and "Should change the default ubuntu wallpaper". I edited these in after dv3500ea put it into the comments; I did not test this while creating the 11.04 live cd.
Note: The Ubuntu Builder project has been discontinued.
Creating a custom 12.04 CD with Gnome-Classic using Ubuntu-Builder
(for now, this is specific to Karthik's needs; I will update answer later with more general/Unity-specific stuff)
1. Get Ubuntu Builder and your source ISO
Ubuntu Builder automates many of the preliminary steps that had to be done by hand (mount ISO, extract squashfs, create chroot, etc.) It gives you Synaptic and a "graphical" chroot as well (Unity UI).
Add the PPA to install Ubuntu Builder:
Also download the Ubuntu Desktop ISO you're planning to work with.
2. Ubuntu Builder Basics
Start Ubuntu Builder from the Launcher. I recommend you set all three fields to "Ubuntu" (like the actual LiveCD), because setting custom fields led to Software Center crashing. When you install, you can choose your own username, machine name, etc. as always.
Load your ISO; I loaded the 64-bit with the Local Disk option, although Ubuntu Builder should be able to download the ISO if you want it to.
Console
gives you a CLI chroot, whileDesktop
gives you a graphical one!, i.e. a LiveCD session itself (this one may take a while to load). Note that theSelect DE/WM
does an incomplete job sometimes, so it's better to install via apt-get/Synaptic.3. Updating, adding Gnome Classic and other package management
sources.list
with the button (or via the console) to add your own mirrors, ppas, etc.Let's start with:
gnome-shell
to pull in indicators, etc.), Samba and SSH:4. Customization 1: Files, configs and removing the top-panel
Replace Samba configuration file (from your own system terminal, i.e. outside chroot!)
Put Firefox shortcut on desktop:
Copy custom shortcuts and folders to Desktop (from outside chroot!)
Set
gnome-classic
as the default shell:Remove the top Gnome-Classic panel and move top-items to the bottom-panel:
Move the indicators to the bottom right, just to the left of the Workspace Switcher, by modifying the bolded value for the italicized parameters as below:
Remove the "Show Desktop" button from the bottom left; I prefer the Start Menu to be the first thing there, you can leave it or move it to the bottom right, etc. Delete these lines:
Save and exit.
5. Customization 2: Backgrounds and Themes
Disable the login screen (lightdm) from "copying" the desktop background and other changes:
nano /usr/share/glib-2.0/schemas/com.canonical.unity-greeter.gschema.xml
false
:Change the default wallpaper; here, we'll set it to the included "Tie My Boat" (
/usr/share/backgrounds/Tie_My_Boat_by_Ray_García.jpg
):nano /usr/share/glib-2.0/schemas/10_gsettings-desktop-schemas.gschema.override
, and change the below line to the path for your file:Change the theme to Radiance
Important: Compile the modified schemas!
6. Build, test and install!
Press the
Build
button in Ubuntu Builder to begin building the custom Live-CD ISO. UB automatically handles the cleanup, etc. that previously had to be done manually.The ISO can be found in
/home/ubuntu-builder
; you can test it using the built-in QEMU, or in another virtual machine..23
kernel), with Unity and Gnome 3D still available if the user wishes to, so that's pretty good for a customization! :)The following should result:
After bootup, you get the "Try Ubuntu" or "Install Ubuntu" option:
Clicking "Try" gets us our custom desktop!
And logging out (login with
ubuntu
, blank password) shows that the login wallpaper is kept at the default:Installer does not crash upon Timezone selection:
Select username, etc. for install:
Installed login screen:
Installed desktop:
Creating a live CD from an existing/new installation
EDIT: This method doesn't seem to work anymore. I suggest you try other methods suggested in this QA.
A good way would be making a live CD from a current installation. This can be done using a virtual machine (just don't install any VM tools inside the guest OS)
So, first we need a fresh install(if you can't install it for real, try using a virtual machine) with only things that you need (in your case thunderbird, samba and ssh). Then we tweak the system and record where the tweaks are (e.g. you change your desktop background, the settings are in ~/.gconf or you add firefox shortcuts, they are located in ~/Desktop). This is needed for step 4.
Set up some variables:
Replace ~/temp with a path to a temporary directory in which we will work in. Replace ~/livecd with a path to the CD tree.
Make the folder structure.
sudo mkdir -p ${CD}/{${FS_DIR},boot/grub} ${WORK}/rootfs
Now we will need to install some packages:
Now we will copy the current installation, modify the exclude flags to fit your needs:
If you have a separate boot partition, execute this:
sudo cp -av /boot/* ${WORK}/rootfs/boot
In your case, you want to copy settings and some files from the home directory. First, define what directories we want to copy: CONFIG='.config .gconf Desktop someotherfolder andanotherfolder' And now we copy that:
Now we chroot into the new system and modify it.
The next commands are done in chroot:
Casper contains live scripts. If you want an installer too, run this:
Or if you want KDE:
Update modules.dep and initramfs:
Remove non-system users - do not worry, we have copied the settings and data into the "skeleton" of users. That means all new users will have them.
Clean up:
Exit chroot.
exit
Now, we copy the kernel:
If you have installed the installer, you will need to do this, so that the installer doesn't install things like casper:
Unmount what we have mounted:
Convert to squashfs:
Make filesystem.size:
echo -n $(sudo du -s --block-size=1 ${WORK}/rootfs | tail -1 | awk '{print $1}') | sudo tee ${CD}/casper/filesystem.size
And md5:
find ${CD} -type f -print0 | xargs -0 md5sum | sed "s@${CD}@.@" | grep -v md5sum.txt |sudo tee ${CD}/md5sum.txt
Now grub.cfg:
(replace nano with your fav text editor, it doesn't matter) Paste this and save:
If you want, you can add an additional menu entry, which allows you to jump straight into Ubiquity.
Make the CD/DVD!
sudo grub-mkrescue -o ~/live-cd.iso ${CD}
Test it using a virtual machine!
All credit goes to capink, because the guide is from here.
You can use
uck
or thelive-magic
to customize your Live CD.uck
is available from Ubuntu's official software sources, in all versions of Ubuntu since 10.04 LTS Lucid Lynx. You can installuck
from the Software Center, withapt-get
on the command-line, or by clicking here .Ubuntu Customization Kit
It is a collection of scripts that make it easier to create a custom LiveCD from an existing .iso image. It is very similar to Remastersys, with the difference that it is actively maintained. It has a GUI to help with the customization, but one can also use the command-line to do the same.
If you need more control over exactly what changes are made, it is possible to make the modification manually.
The process consists of unpacking the SquashFS data file containing the live OS's root filesystem, chrooting into the extracted filesystem, making your modifications, exiting the chroot, repacking the SquashFS file, and then regenerating the ISO image.
Complete details are described on the LiveCDCustomization page of the Ubuntu wiki.
In Ubuntu Software Center
Paste the following line in the box and click add source.
Reload the sources and install Remastersys from Software Center.
Once done, install all the media codecs and apps you'd like on your custom ubuntu. Start remastersys from
Pick dist mode, click ok and Wait for the process to finish. Once done, you'll find your custom iso in
Duplicating a Ubuntu System for Distribution
None of the current answers on this page still work. At least not with Ubuntu 20.04 or 20.10. All of the apps have been abandoned. Using an image file to duplicate an OS is simple and will always work.
1) Create Image file from existing operating system:
Boot Live Ubuntu USB and insert Full install, (or Persistent), USB to be copied.
Create an image file of the Full install USB, (or Persistent USB), using Gnome-Disks.
2) Truncate image for distribution, remove unwanted space from end of image file.
Example: Removes NTFS Microsoft basic data partition from end of drive.
Input
Output
Input
3) Compress image for distribution:
For xz compression using 7Zip. Install 7Zip for Windows: https://www.7-zip.org/a/7z1900-x64.msi or for Ubuntu P7Zip Desktop from the Ubuntu store. Once 7Zip has been installed on Windows or Ubuntu, flashing tool should work without first decompressing xz file..
PKZip compression, may also be used but is not as tight.
4) Virtual Machine: Convert
.vdi
file to.img
file that can be flashed to bootable USB.Open VirtualBox
cd to folder that contains ubuntu.vdi and run:
VBoxManage clonemedium --format RAW ubuntu.vdi ubuntu.img
5) Install Image File to target drive
Caution: The target drive will be overwritten.
6) Create Installer Drive for Image File.
Use Etcher, Startup Disk Creator, dd, mkusb, etc to make Live USB.
From another Linux drive, convert new
writable
partition to NTFS partition using:ubuntu@ubuntu:~$ sudo mkfs.ntfs -f -L usbdata /dev/sdx3
Where sdx is the Live drive.
You can use Cubic -- this utility has been tested (by me) and works on Ubuntu 18.04 host with an Ubuntu 18.04 image, which is more than can be said for most of the other tools that don't work or are discontinued.
Here is a guide to use it from the website Linoxide.
The rough steps involve:
Remastersys could be the answer to your needs. You need to go to http://www.remastersys.com/ubuntu.html and follow the instructions. This program makes an iso from your running os including all settings and apps. Than you can burn a CD using this iso. Unfortunately, there was in the past an issue to get it running as a live cd, while installing was no problem (I dont know if this is still a problem).