After having used Xubuntu minimal installations from the netboot (mini.iso) image in multiple previous versions of Ubuntu, I noticed that the netboot installer is no longer actively supported. I would like to know what the "official" way is now to get a Xubuntu 20.04 minimal installation in a virtual machine (since Xubuntu is the only official flavor without a "minimal installation" option in its installer). I am aware of the following options with their respective shortcomings:
-
The Xubuntu Core description on the Xubuntu
Website still
refers to the mini.iso which is not officially supported for >18.04. There is a mini.iso for 20.04 as described in this
post,
albeit not officially supported anymore. It could disappear any
moment or be discontinued completely for future versions >20.04. For
now, this image allows me to install a minimal version of Xubuntu. -
The Xubuntu Core image cannot be
installed as the installer crashes (I tried this multiple times
since the release and with different versions of VirtualBox):
-
Installing the
xubuntu-core
package viaapt
on Ubuntu live server, which is listed as
the recommended replacement for the mini.iso, yields >4 GB of used
disk space and thus seems to differ significantly from the minimal
installation performed by the 20.04 mini.iso as well as the 18.04 mini.iso. -
Ubuntu Core is not an option for me as it requires creating and
linking it to a user account. I have not tried it so far because of
this restriction. I would just like to install Xubuntu in a VM and
use it offline. -
Ubuntu Base is too minimal and requires a very high number of
preparatory steps. I would just like to install Xubuntu.
Given these options, is there anything that I missed which would give me a Xubuntu 20.04 minimal installation in a way that is officially supported and will likely be supported in future versions?
Best Answer
Using Ubuntu Base with Live auto installer (subiquity) to get minimal Ubuntu/Xubuntu system
Below is an autoinstall template file with which you can auto-install Ubuntu Base 20.10 (and newer) and get relatively minimal installation of Xubuntu from it. As a requirement, you need to have rest of PXE installation environment setup already (see below link for step by step guide). PXE environment is composed of: DHCP service, TFTP server, HTTP(S) server, and optional NFS server. When combined, these offer PXE boot ability for devices in your network. Device itself also needs to support boot from network (either legacy BIOS or UEFI).
I did all my testing using PXE boot, Ubuntu 20.04.1 & 20.10, and autoinstall files (see below, for 20.10). To get details about setting up PXE step by step for 20.04 and newer please read my other guide here: https://askubuntu.com/a/1292097/1080682
Notes: commands listed bellow can also be executed in other ways, eg. manually inside Live-CD or any other live boot session, I've also done it with PXE booting to installer (subiquity) and then doing it over SSH inside subiquity live session. Please make sure that booted session/installer is of same major release as Ubuntu Base you plan to install, eg. Live-CD of Ubuntu 20.10 for creating Ubuntu Base 20.10
Autoinstall script is served via PXE as "user-data" file.
user-data
Above script is just pure script for BIOS / legacy boot, and it should work fine as-is, copy/paste.
To add UEFI capabilities, insert the following lines after apt-get clean and before umount & reboot commands.
Lines to be aware of, which may need changes:
useradd
andaddgroup
- change to your own username and password, or leave it forubuntu/ubuntu
/etc/systemd/network/00-*.network
- feel free to change the config file name, and make sure to change interface name (in my caseenp0s10f0
), IP (10.10.2.101/24
) and gateway (10.10.2.99
) to something that you actually expectisc-dhcp-client
) you can use something likeecho [Match]; echo Name=eth0; echo [Network]; echo DHCP=yes
(just check interface name)Once you run the script through automated installer, it will install Ubuntu Base and reboot. After reboot login with user
ubuntu
passwordubuntu
(or your own, if you changed it). Note that I am NOT running installation ofxubuntu-core
, please see comments in script below, as well as comments under the answer.More info with details
To explain the process I'm also pasting the script with all comments, for others that want to get more details, understand the process, and expand on it to change it to your liking.
user-data (with comments)
The script with comments can also be used as-is, copy/paste. As before, please check your user/password, and network (interface name, IP, gateway, etc.) Again, it will NOT install Xubuntu, I have that commented out.
This will boot to bit under 400MB / (root) partition (plus small partition for boot, it's set to 200MB but can be smaller, about 58MB is needed for both BIOS+EFI files). Adding Xubuntu Core requires about 1.8GB (so says apt). After
xubuntu-core
is installed partition usage grows to 2.4GB, and afterapt clean
goes down to 1.9GB, so it is more like 1.5GB of extras on top of Ubuntu Base.Please let me know if you encounter any issues to fix the instructions for everyone.
This was all tested with Ubuntu 20.04.1 (PXE server, Live Install ISO image, and Base image), as well as with 20.10 "client", and should be same or similar for any future release, as long as you change the file names where needed (eg. in curl & tar commands, and where apt installs linux image). Rest should be indentical, until Canonical changes something.
Test environment (both PXE server and services, and test client) were done on Hyper-V VMs.
Note: This was initially for legacy BIOS installs, I have added UEFI support now. Changes are minor for UEFI, syslinux installation was expanded.
Documentation:
Ubuntu Base wiki (outdated)
Ubuntu Base repository
Ubuntu Base Installation Example Guide (heavily outdated, GUI tools)
Edit - 2020-11-22: Modified script for Ubuntu 20.10. If you view revision history, earlier script was for 20.04.1, but I also did some tweaks in meantime, so please compare them to see changes.
Edit - 2020-12-06: Modified script, made it simpler and more straightforward, with better networking, and added EFI bootloader support. I did not write new script for 20.04 but literally only lines with
curl
,tar
andapt-get install
oflinux-image-x.x.x-xx-generic
would need to change, you can check revisions of this answer, and very first version has paths and names for 20.04.1 Ubuntu Base and it's kernel.