3

I will try to keep this question short and concise:

I have recently discovered the use of preseed and kickstart for unattended installation for numerous Linux distros. This seems to be the right way for me since I want to automate the installation process of an OS using packer, but there is a problem: It is a Desktop. Ubuntu Desktop 18.04 to be precise

I have googled this problem and found many examples, many of them with the same solution:

  1. Use Ubuntu server
  2. Install desktop on the server

That is not something I want.

I also found a possible solution - which I have not tried myself - for Ubuntu desktop 16.04, which seemed complicated even though it is well explained.
Ref: Unattended installation Ubuntu Desktop 16.04

I would really appreciate an answer or a solution to my dilemma. Giving a roughly explanation if it is possible or not.

Thanks.

EDIT: When I tried to use Packer for unattended installation it did not work.

user17378
  • 141

2 Answers2

1

I found the solution here Ubuntu 18 packer.

I've used and run the same preseed (desktop.cfg) using the newest dekstop image Ubuntu 18.04.4 along Packer version 1.5.4, and can confirm this works. Even though this example uses Virtualbox, with a little bit of adjusting it works for VMware Workstation too.

user17378
  • 141
0

If I understand correctly, you want to install custom made Ubuntu Desktop images, and not the default installation provided by the downloaded ISO. You actually don't have to use Packer for an unattended installation.

In short: Desktop and server OS use a very different installation method. Seed files are very very limited when installing desktop OS, but you may not even need them. You can just create custom desktop versions of your own with not much effort provided by Ubuntu tools. I think this might help: LiveCDCustomization . Making it truly unattended is also possible (but most of configuration should already be made in the custom image).

A wider explanation: First, we may want to understand why ubuntu server option was even suggested when considering KS and seed files, and why a different method should be used with custom desktop versions.

Ubuntu server uses the debian-installer method for most of the installation, including even most basic parts such as partition creating. It first install all the basic debians (installation components) it needs to run the most basic installer (such as partition manager), and then using them.

Debian-installer actually builds an OS from scratch with parameters of your choice, that need to be manually chosen by the user in tons of menus (that's why administrators love to use seed files).

Ubuntu desktop uses the ubiquity method with squashfs files, a compressed filesystem with many setting and debiand pre-configured for an easy live installation. You may use preseed files, but with a very limited support and range of choices (and a very very limited range of d-i commands are supported). Thus, if we want to use this method, we need to provide with a custom squashfs of a custom image we made.

Pizza
  • 1,428
  • I should've probably added a more detailed question, but the reason why I did mention Packer is because I want to continuously/regularly update the Desktop image with the use of CI/CD pipeline. – user17378 Feb 13 '20 at 11:30
  • What about creating a live DoK of the Desktop OS with persistent storage, and every change you make is saved. You may also install the OS with the changes made, or create an image from the files it contains. This might help: LiveCD/Persistence – Pizza Feb 13 '20 at 11:53
  • I'll take a look at it since I do not have much experience with live "DoK(?)". Though I am more concerned with the concept, since this looks a lot like a manual process and I want to automate much as possible. Does this mean that a Ubuntu machine has be running constantly, while a config.tool updates it and tries to get an image out of it? – user17378 Feb 13 '20 at 12:24
  • It is actually not that hard, and you can run all the tools from an existing Ubuntu endpoint. LiveUsbPendrivePersistent – Pizza Feb 13 '20 at 12:29
  • When using a persistent filesystem, you need it to be running when making changes (it is a live system that is stored on an external storage). Make your changes, install the new image or create an image from it. – Pizza Feb 13 '20 at 12:31
  • I as an user don't want to make these changes nor install new image manually. I myself find all this a bit overwhelming since it's all new to me, but as a final thought: 1. How would an automated process of this looks like? Which tools would've been used? Because right now I don't... see it. 2. Which of the references should I start with? – user17378 Feb 13 '20 at 12:41
  • Sorry for the confusion, let me clear that up: a fully true unattended install (click and go) is something you usually implement with netboot (pxe servers), tho preseeding works with install disks/DoKs (by default they are very thin and contain 2-3 commands in downloaded desktop ISOs.). I would begin with the 1st link I attached (in the answer) to create a custom image with all the parameters you need. If you want to constantly change the settings / programs included, you might want to try the 2nd or the 3rd link I attached. Maybe using 3rd party apps such as Cubic can also make it easier. – Pizza Feb 13 '20 at 13:08
  • I understand you explained it very well, but I don't this to be a manual process that sys.admins need to think about. Yes, I can use Cubic or such to create a CUSTOM Ubuntu Desktop image, but keeping this update-to-date (security etc.) mean that I need to run Cubic again at some point. There can not be manual process. @GrumpyBurger I'm so sorry if my questions/comments contradicts your previous answers. – user17378 Feb 13 '20 at 13:41