For my computer class we need Linux. So I recommend to get Virtual Box and Ubuntu. But since there has to be TeX and Emacs installed which is non-trivial for novices, I thought I might set up an appliance to help them.
I realize that it is free software for the most part, but I am not sure how to handle the Ubuntu brand name in this case.
Is it legal to create a Ubuntu VM, install some packages and make the bundle available for download?
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:
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.