What you want to do is basically creating an Ubuntu derivative (please correct me if I'm wrong).
As long as you choose to distribute free software, the only problem you may encounter is the Ubuntu branding, which has some trademarks. As of writing, the intellectual property policy contains, among others, the following statements:
- You can modify Ubuntu for personal or internal use
- You can make changes to Ubuntu for your own personal use or for your organisation’s own internal use.
Any redistribution of modified versions of Ubuntu must be approved, certified or provided by Canonical if you are going to associate it with the Trademarks. Otherwise you must remove and replace the Trademarks and will need to recompile the source code to create your own binaries. This does not affect your rights under any open source licence applicable to any of the components of Ubuntu. If you need us to approve, certify or provide modified versions for redistribution you will require a licence agreement from Canonical, for which you may be required to pay. For further information, please contact us (as set out below).
- We do not recommend using modified versions of Ubuntu which are not modified in accordance with this IPRights Policy. Modified versions may be corrupted and users of such modified systems or images may find them to be inconsistent with the updates published by Canonical to its users. If they use the Trademarks, they are in contravention of this IPRights Policy. Canonical cannot guarantee the performance of such modified versions. Canonical’s updates will be consistent with every version of Ubuntu approved, certified or provided by Canonical.
So, in short, if the distribution is for personal or internal use, you have fewer restrictions. If instead you want your distribution to be publicly available for download, you must either get rid of trademarks or ask Canonical for permission.
If you are going to distribute non-free software, then you might encounter other possible legal problems, but they are related to the software's license, not to Ubuntu itself.