====N100 Mini PC==== {{boards:n100:box.jpg?200}} N100 Mini PCs are very cheap and very capable devices. Here is the procedure used to dual boot debian 12 on a Mini PC and prepare it to run VMs under [[:tools:kvm|KVM]]. ===Hardware=== [[https://www.amazon.co.uk/Windows-3750H-TRIGKEY-S3-Graphics/dp/B09MFKZFYG/|TRIGKEY N100 CPU 16GB RAM 512GB SSD WIFI 6 BT 5.2 WIN 11 PRO]] After discount this device should cost £169 (Jan 2024) or £154 (Aug 2024). External SSD is an ADATA 240 GB for VMs. Any external USB3 drive will do. ===Boot=== {{boards:n100:sysinfo.jpg?200}} Factory default BIOS mode is UEFI and "Secure boot state" is OFF. ===Storage=== {{boards:n100:shrink_volume.jpg?200}} __Disk 0__ Run Windows 11 "Disk Management", select the C partition of "Disk 0" and choose "Shrink Volume". Enter the amount of space to shrink in MB, Eg, 128000. A new empty partition will be created, this is where Linux will be installed. __Disk 1__ Disk 1 is an external USB3 SSD and is not initialised in Windows. This will be dedicated to KVM in Linux. In this instance the external SSD is 240 GB. NB //usb_storage.quirks will probably be required for external USB3 drives in Linux.// ===Debian 12 install=== The recommended way to install Debian is using a USB flash drive. Writing the drive image in Windows can be done using [[https://rufus.ie/en/|RUFUS]]. {{:boards:n100:rufus.jpg?200}} This software was unreliable with one USB flash drive and failed with an ISO extraction error. It worked fine with an SDCARD in a USB adapter. The latest stable Debian image at this time is [[https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.4.0-amd64-netinst.iso|Debian 12.4 AMD64]]. ==Install== Power on and press DELETE to enter the BIOS. To boot from a specific device navigate to the override section and then choose the Mass storage device to install Debian. {{boards:n100:boot.jpg?200}} ==Partition== When installing Debian use the free space created when shrinking the C drive with the single partition option and let Debian work it all out. {{boards:n100:partition.jpg?200}} ==Software== Choose basic software such as SSH and possibly LXQT when using a 4K display since the default console is barely readable at that resolution. ==Boot== Change the NVMe boot priority from Windows boot manager to the Debian boot manager and save the setting to restart. {{:boards:n100:bootpri.jpg?100}} {{boards:n100:debian.jpg?100}} [[boards:n100-dmesg|dmesg]] ===Miscellaneous=== ==Environment== su root export PATH=/bin:/sbin ==Tools== apt install hdparm apt-file net-tools cpu-checker lshw wireless-tools rfkill bridge-utils cgroupfs-mount conntrack iptables apt-file update ==Quirks== Eg. Ensure ADATA device uses USB Mass storage and not UAS. cp /etc/default/grub /etc/default/grub.bak sed -i 's/DEFAULT="quiet"/DEFAULT="quiet usb-storage.quirks=125f:a88a:u"/g' /etc/default/grub update-grub ==Shell== Install tcsh if preferred apt install tcsh ==Locales== Install GB and US locales dpkg-reconfigure locales ==Timezone== Set timezone to Etc/UTC dpkg-reconfigure tzdata ==Editor== Set editor to VIM in preference to pico/nano apt install vim update-alternatives --config editor ==Run level== Disable any window manager at boot. systemctl isolate multi-user.target systemctl set-default multi-user.target ==Services== Disable services not required for the KVM appliance (or servers). As root systemctl disable connman systemctl disable preload.service systemctl disable dundee.service systemctl disable ofono.service systemctl disable plymouth.service systemctl disable wpa_supplicant.service systemctl disable rtkit-daemon systemctl disable bluetooth.service systemctl disable cups.service systemctl disable cups-browsed.service systemctl disable avahi-daemon.service systemctl disable ModemManager.service systemctl mask connman systemctl mask wpa_supplicant.service systemctl mask rtkit-daemon update-rc.d pulseaudio-enable-autospawn disable update-rc.d sddm disable update-rc.d saned disable apt remove --purge gvfs-backends gvfs As user systemctl --user stop pulseaudio.socket systemctl --user stop pulseaudio.service systemctl --user disable pulseaudio.socket systemctl --user disable pulseaudio.service systemctl --user mask pulseaudio.socket systemctl --user mask pulseaudio.service ==Reboot== /sbin/reboot ===File system=== Follow the [[https://wiki.kewl.org/dokuwiki/tools:btrfs|B-TREE filesystem]] guide to setup /dev/sda and mount on /opt This file system will be used for VMs. ===Network=== In this example the host is 192.168.0.130 and VMs or containers will be bridged to the same network. Save /etc/network/interfaces cp interfaces interfaces.dist Replace /etc/network/interfaces auto lo iface lo inet loopback auto enp1s0 iface enp1s0 inet manual auto br0 iface br0 inet static bridge_ports enp1s0 address 192.168.0.130 netmask 255.255.255.0 gateway 192.168.0.1 Reboot to take effect. ifconfig -a br0: flags=4163 mtu 1500 inet 192.168.0.130 netmask 255.255.255.0 broadcast 192.168.0.255 inet6 fe80::4c3a:bff:feab:4fb0 prefixlen 64 scopeid 0x20 ether 4e:3a:0b:ab:4f:b0 txqueuelen 1000 (Ethernet) RX packets 114 bytes 11804 (11.5 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 93 bytes 14326 (13.9 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 enp1s0: flags=4163 mtu 1500 ether 7c:83:34:be:e3:5e txqueuelen 1000 (Ethernet) RX packets 114 bytes 13400 (13.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 93 bytes 14326 (13.9 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000 (Local Loopback) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 Permissions mkdir -p /etc/qemu echo "allow all" > /etc/qemu/bridge.conf chmod u+s /usr/lib/qemu/qemu-bridge-helper Example lease on bridge lease 192.168.0.248 { starts 4 2024/01/18 18:11:39; ends 5 2024/01/19 18:11:39; cltt 4 2024/01/18 18:11:39; binding state active; next binding state free; rewind binding state free; hardware ethernet 52:54:00:e6:ab:09; uid "\001RT\000\346\253\011"; set vendor-class-identifier = "d-i"; }