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/