Install Lubuntu 18.10 on a 4GB Virtual Machine
Brute force installation from even mini.iso may fail because of not enough disk space during installation (as it needs it for both packages downloading into /var/cache/apt/archives
and their extracting to root filesystem).
But you can get small viable system by proceeding with the following procedure:
-
Install SSH server on the host
sudo apt-get install ssh
-
Create folder on the host for storing deb-archives inside home directory of your user (let's call him
host-user
)mkdir -p ~/Public/debs
Download minimal Network Boot mini.iso
-
Configure VM to use bridged adapter networking
and determine host IP with any method you like (from
ifconfig
or something).
Let's assume it is192.168.13.37
. Boot VM from mini.iso
- Proceed with minimal installation (make whole disk a single partition for rootfs, and do not select huge components on the taskel package selection) and reboot VM on finish
-
Install SSHfs client into guest
sudo apt-get install sshfs
-
Mount
/var/cache/apt/archives
from outside the VM with SSHFS from host to guestsudo sshfs [email protected]:/home/host-user/Public/debs /var/cache/apt/archives -o nonempty
Note: change
host-user
to real username on host and192.168.13.37
to the IP of the host. -
Then install the Lubuntu flavor as usual by APT but without recommended parts (to save disk space)
sudo apt-get install lubuntu-desktop --no-install-recommends
Reboot and enjoy.
As the result you will get 1 Gb free and pretty small but usable system. Install Firefox and other stuff by hand.
Notes:
1. Consider to use LTS version of the Ubuntu instead of 9-month regular version.
2. You can install almost any flavor by this method.
Here is my version of how I approached the problem:
- Create a VM in VirtualBox if you haven't already.
- Configure it to use EFI, that's just how I prefer to do things and it may also be easier copying the contents from the VM to a USB drive if you use only UEFI capable computers.
- Configure port forwarding in the network settings, I forwarded host port 55222 to guest port 22. When you install OpenSSH server after the installation finished and rebooted into your new system you have the benefits of using features like copy and paste through SSH and displaying more content while you are without the GUI.
- Download minimal Network Boot mini.iso.
- Boot and follow the installer instructions. Create a GPT partition table and the following partitions:
- Create a FAT16 EFI (mountpoint
/boot/efi
) partition with 10MB. - Create a EXTt4 root partition with 3990MB. Set EXT4 reserved blocks to 1% instead of 5%. It's generally not recommended, but if you want to make the most of the available space this an option you have.
- Create a FAT16 EFI (mountpoint
- After the installation of the minimal system has been completed and you booted into the system the first time you can do the following:
- Remove swapfile from / and fstab.
- Remove plymouth package and replace
splash
withnosplash
in/etc/default/grub
, runupdate-grub
. Removing plymouth from initramfs (happens in the next step) saves a few more MB. - Change to COMPRESS=xz and BUSYBOX=n
/etc/initramfs-tools/initramfs.conf
and runupdate-initramfs -u
. This will boot a bit slower, but saves about 10MB of initramfs. You can save more (up to 25MB) with MODULES=dep, but at the risk of non-bootable OS on some systems. - Remove manpages package if you think you will never need them and rather look them up on http://manpages.ubuntu.com/.
- If you are sure you can also remove these packages: busybox-static grub-efi-amd64-signed linux-signed-generic shim-signed secureboot-db sbsigntool ubuntu-advantage-tools wamerican wbritish dictionaries-common emacsen-common mokutil shim intel-microcode
- Run
apt autoremove
. - Set
SystemMaxUse=10MB
in/etc/systemd/journald.conf
.
- Install the desktop with
sudo apt-get install lubuntu-desktop --no-install-recommends
as suggested by N0rbert.
My previous approach was to look at the dependencies of lubuntu-desktop package and decide what I don't need. I came up with this list of packages I don't need: genisoimage plymouth-theme-lubuntu-logo plymouth-theme-lubuntu-text software-properties-qt.
So this is the list of packages I installed:
alsa-base alsa-utils anacron arc-theme bc bluedevil breeze-cursor-theme ca-certificates dbus-x11 desktop-file-utils fcitx fcitx-frontend-qt5 fcitx-ui-qimpanel ffmpegthumbnailer fonts-dejavu-core fonts-freefont-ttf foomatic-db-compressed-ppds fwupdate ghostscript-x gvfs-backends gvfs-fuse inputattach kde-style-breeze libfm-modules libmtp-runtime libqt5svg5 libsasl2-modules libu2f-udev lubuntu-artwork lubuntu-default-settings lxqt-about lxqt-admin lxqt-core lxqt-openssh-askpass lxqt-powermanagement lxqt-sudo mobile-broadband-provider-info modemmanager network-manager nm-tray obconf-qt openbox openprinting-ppds oxygen-icon-theme papirus-icon-theme pavucontrol-qt pcmanfm-qt pinentry-qt printer-driver-gutenprint printer-driver-pnm2ppa pulseaudio pulseaudio-module-bluetooth qterminal qttranslations5-l10n rfkill sddm sddm-theme-lubuntu spice-vdagent ubuntu-drivers-common ubuntu-mono ubuntu-release-upgrader-qt unzip usb-creator-kde usb-modeswitch whoopsie wireless-tools wpasupplicant wvdial x11-utils xdg-user-dirs xkb-data xorg xscreensaver xz-utils zip
Adding the --no-install-recommends
will save even more space.
My result (with recommends):
df -h
/dev/nvme0n1p2 3.6G 3.1G 495M 87% /
sudo apt clean
/dev/nvme0n1p2 3.6G 3.0G 593M 84% /
Yes I installed on NVME instead of SATA in VirtualBox, because you can with EFI. :)
I don't know of a good and small browser, installing Firefox or Chrome and attempting to use them as desktop browsers (or use electron apps, leave alone snaps of flatpaks) will create a lot or cache files. You could mount some directories in RAM if the data is not important and you have plenty of RAM, but you are going to hit the limitations of this setup soon I think.