Skip to content

Releases: AXKuhta/micro_init

v0.6; Ubuntu Base with micro_init for QEMU, VirtualBox or Hyper-V

20 Aug 05:10
Compare
Choose a tag to compare

Below is a set of two VHD images designed to run in QEMU, VirtualBox or Hyper-V.

Device name Image Purpose
/dev/sda DriveBoot.vhd EFI shell, kernel image and startup.nsh script
/dev/sdb DriveSystem.vhd Ubuntu 22.04.3, micro_init

This release features:

  • Micro Init
  • Ubuntu Base 22.04.3
  • Preinstalled packages, including openssh-server
  • XanMod 6.1.46 kernel built with LTO using clang-15
  • EDK2 Shell.efi included for Hyper-V, which lacks a built-in EFI shell

There is no dedicated bootloader. It boots using EFI, so be sure to enable that in the VirtualBox settings. In Hyper-V, UEFI can be enabled when creating a VM.

QEMU Sample Command Line...

qemu-system-x86_64 -enable-kvm -machine q35 -cpu host -smp 2 -m 6G -bios /usr/share/ovmf/OVMF.fd -vga none --device virtio-gpu-gl -display spice-app,gl=on -usb -device usb-tablet -audio driver=pa,model=hda -hda DriveBoot.vhd -hdb DriveSystem.vhd

Kernel config changes...

Starting point: CONFIGS/xanmod/gcc/config_x86-64-v1

CONFIG_LTO_CLANG_FULL=y
CONFIG_HID=y
CONFIG_HID_GENERIC=y
CONFIG_USB_HID=y
CONFIG_SATA_AHCI=y
CONFIG_E1000=y	# PCI variant
CONFIG_E1000E=y	# PCIe variant, found on q35
CONFIG_DRM=y
CONFIG_DRM_VMWGFX=y
CONFIG_DRM_VBOXVIDEO=y
CONFIG_DRM_VIRTIO_GPU=y
CONFIG_WIREGUARD=y
CONFIG_HYPERV=y
CONFIG_HYPERV_UTILS=y
CONFIG_HYPERV_BALLOON=y
CONFIG_SCSI_FC_ATTRS=y
CONFIG_HYPERV_STORAGE=y
CONFIG_HYPERV_NET=y
CONFIG_HYPERV_KEYBOARD=y
CONFIG_HID_HYPERV_MOUSE=y
CONFIG_DRM_HYPERV=y
CONFIG_SOUND=y	# Sound just for the fun of it
CONFIG_SND=y
CONFIG_SND_HDA_INTEL=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_CPU_SRSO=n # This mitigation fails to build with LLVM + 6.1.46; https://github.com/ClangBuiltLinux/linux/issues/1907

Addendum: to successfully build with clang-15, arch/x86/Makefile needs to be edited to remove -fexcess-precision=fast.

List of preinstalled packages...
# A selection of common tools
apt install ncdu dstat htop iotop iftop lsof isc-dhcp-client iproute2 iptables nano sudo ntpdate curl wget git bash-completion

# openssh-server installed without recommends because it pulls systemd
# wireguard-tools installed without recommends because it pulls linux-image
apt install --no-install-recommends openssh-server wireguard-tools

# Delete ssh host keys that were created post openssh-server configuration
# These shall be created anew on the target machine
rm etc/ssh/ssh_host*

Run dhclient to obtain an IP address and run adduser ... to add an user account. Use adduser ... sudo to give sudo privileges. You should be able to connect over ssh. Take a look at the IP using ip a. Add export LANG=C.UTF-8 to ~/.bashrc on any new users to get UTF-8 characters to display.

Desktop environment...

Here's how you install xfce4 and get it to run with graphics and sound:

# Install xfce4 and its apps, e.g. xfce4-terminal
apt install xfce4*

# Allow non-root user to use hardware
adduser ... input
adduser ... video
adduser ... render
adduser ... audio

# Run some specific scripts from /etc/init.d/
/etc/init.d/udev start </dev/null
/etc/init.d/dbus start
/etc/init.d/pulseaudio-enable-autospawn start

# Log in as user via Alt + F2 or `su - ...`
# Let's go!
startx

# [Optional] Download Thorium Browser and take a look at chrome://gpu
# https://github.com/Alex313031/Thorium-Special/

v0.5; Ubuntu Base with micro_init for VirtualBox or Hyper-V

08 Jan 13:19
Compare
Choose a tag to compare

Below is a set of two VHD images designed to run in VirtualBox or Hyper-V.

Device nameImagePurpose
/dev/sdaDriveBoot.vhdEFI shell, kernel image and startup.nsh script
/dev/sdbDriveSystem.vhdUbuntu 22.04, micro_init

This release features:

  • Micro Init
  • Ubuntu Base 22.04
  • Preinstalled packages, including openssh-server

The kernel is XanMod 5.15.84 built with LTO using clang-14. It boots using EFI, so be sure to enable that in the VirtualBox settings. In Hyper-V, UEFI can be enabled when creating a VM.

Hyper-V firmware doesn't seem to have a built-in EFI shell, necessitating the inclusion of EDK2 Shell.efi. Hyper-V firmware also doesn't seem to support UDF filesystem, necessitating a switch to FAT32. The kernel is now compiled with a set of Hyper-V drivers built-in.

Kernel config changes
CONFIG_HID=y
CONFIG_HID_GENERIC=y
CONFIG_SATA_AHCI=y
CONFIG_E1000=y
CONFIG_DRM=y
CONFIG_DRM_VMWGFX=y
CONFIG_DRM_VBOXVIDEO=y
CONFIG_WIREGUARD=y
CONFIG_HYPERV=y
CONFIG_HYPERV_UTILS=y
CONFIG_HYPERV_BALLOON=y
CONFIG_SCSI_FC_ATTRS=y
CONFIG_HYPERV_STORAGE=y
CONFIG_HYPERV_NET=y
CONFIG_HYPERV_KEYBOARD=y
CONFIG_HID_HYPERV_MOUSE=y
CONFIG_DRM_HYPERV=y
CONFIG_VSOCKETS=y
CONFIG_HYPERV_VSOCKETS=y
List of preinstalled packages
# A selection of common tools
apt install ncdu dstat htop iotop iftop lsof isc-dhcp-client iproute2 iptables nano sudo ntpdate curl wget git bash-completion

# openssh-server installed without recommends because it pulls systemd
# wireguard-tools installed without recommends because it pulls linux-image
apt install --no-install-recommends openssh-server wireguard-tools

# Delete ssh host keys that were created post openssh-server configuration
# These shall be created anew on the target machine
rm etc/ssh/ssh_host*

Run dhclient to obtain an IP address and run adduser ... to add an user account. Use adduser ... sudo to give sudo privileges. You should be able to connect over ssh. Take a look at the IP using ip a. Add export LANG=C.UTF-8 to ~/.bashrc on any new users to get UTF-8 characters to display.

See also: notes about running graphics in v0.4 release description.

v0.4; dual-drive setup

25 Apr 15:56
Compare
Choose a tag to compare

Below is a set of two VHD images designed to run in VirtualBox.

Device nameImagePurpose
/dev/sdaDriveBoot.vhdKernel image and startup.nsh script
/dev/sdbDriveSystem.vhdUbuntu 22.04, micro_init

This release features:

  • Micro Init
  • Ubuntu Base 22.04
  • Preinstalled packages, including openssh-server

The kernel is XanMod 5.15.35 built with LTO using clang-14. It boots using EFI, so be sure to enable that in the VirtualBox settings.

Kernel config changes
CONFIG_HID=y
CONFIG_HID_GENERIC=y
CONFIG_USB_HID=y
CONFIG_SATA_AHCI=y
CONFIG_UDF_FS=y
CONFIG_E1000=y
CONFIG_DRM=y
CONFIG_DRM_VMWGFX=y
CONFIG_DRM_VBOXVIDEO=y
CONFIG_WIREGUARD=y
List of preinstalled packages
# A selection of common tools
apt install ncdu dstat htop iotop iftop lsof isc-dhcp-client iproute2 iptables nano sudo ntpdate curl wget git bash-completion

# openssh-server installed without recommends because it pulls systemd
# wireguard-tools installed without recommends because it pulls linux-image
apt install --no-install-recommends openssh-server wireguard-tools

# Delete ssh host keys that were created post openssh-server configuration
# These shall be created anew on the target machine
rm etc/ssh/ssh_host*

Run dhclient to obtain an IP address and run adduser ... to add an user account. Use adduser ... sudo to give sudo privileges. You should be able to connect over ssh. Take a look at the IP using ip a. Add export LANG=C.UTF-8 to ~/.bashrc on any new users to get UTF-8 characters to display.

You can actually run graphics.

Here's how
# Install a DE
sudo apt install xfce4

# Shell 1
# Keyboard and mouse won't work right away
sudo startx

# Shell 2
# The script will give you a warning about please not running it manually, will sleep for 60 seconds unless you patch it out
# But in does run and `xinput list` does get populated with input devices
# Keyboard and mouse will start working
sudo /etc/init.d/udev start

Snapd won't work, but you can still install chromium by embracing third-party forks: https://github.com/Alex313031/Thorium

This surpasses my wildest dreams about running without systemd, to be honest.

v0.3; minimal viable Ubuntu on UDF

04 Jun 05:14
032d749
Compare
Choose a tag to compare

This is a small update featuring XanMod kernel 5.12.9.

All previous instructions apply.

v0.2; minimal viable Ubuntu on UDF

12 May 06:10
032d749
Compare
Choose a tag to compare

Below is a VHD image designed to run in VirtualBox. It features:

  • Micro Init
  • Ubuntu Base 21.04
  • UDF filesystem
  • Prebuilt kernel
  • Boots using EFISTUB
  • See startup.nsh

The kernel is XanMod 5.11 kernel with the following .config changes:

CONFIG_HID_GENERIC=y
CONFIG_USB_HID=y
SATA_AHCI=y
UDF_FS=y
CONFIG_E1000=y

EFI support must be enabled for the virtual machine in order for it to boot. The image must be connected to an AHCI controller. Run this after booting:

apt install ./*.deb

This will install dhclient. You can now connect to the Internet:

dhclient
apt update

Starting up openssh-server:

apt install openssh-server --no-install-recommends
ssh-keygen -A
mkdir /run/sshd
/sbin/sshd # You will get the console back

Warning about UDF filesystem: it looks like you can't have more than ~200 files in a directory on UDF. Some operations, like cloning the Linux Kernel source code, will fail because of the filesystem.

Theoretically you can use whatever filesystem you want if you keep two partitions - one EFI partition with bzImage and startup.nsh and the other ext2/btrfs/whatever with your micro_init and Ubuntu files. There are also various filesystem modules available for EFI: https://efi.akeo.ie/; though you still need an EFI/FAT32/UDF partition to load these modules in the first place.

v0.1

11 May 11:27
4e4ba0e
Compare
Choose a tag to compare
Add the code